
    i                     p   S r SSKJr  SSKJr  SSKJr  SSKrSSKJr  SSKJ	r	  SSK
Jr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr   " S S\5      r " S S\5      rS rS rS rS rS r S r!S r"S r#S r$S r%S r&S'S  jr' " S! S"5      r( " S# S$\)5      r* " S% S&\)5      r+g)(z@Classes that generate and parse arguments for apitools messages.    )absolute_import)division)unicode_literalsN)messages)base)util)	arg_utils)update)yaml_arg_schema)yaml_command_schema)yaml_command_schema_util)labels_util)	resources)resource_propertyc                       \ rS rSrSrSrg)Error%   z(Base class for this module's exceptions. N__name__
__module____qualname____firstlineno____doc____static_attributes__r       ;lib/googlecloudsdk/command_lib/util/apis/arg_marshalling.pyr   r   %   s    0r   r   c                       \ rS rSrSrSrg)ConflictingResourcesError)   zFError for whenever api method / primary resource cannot be determined.r   Nr   r   r   r   r   r   )   s    Nr   r   c                 B    [         R                  " X5      R                  $ N)r	   GetFieldFromMessagetype)message	api_fields     r   _GetLabelsClassr'   -   s    		&	&w	:	?	??r   c                 t    [        X5      n[        R                  " X5      n[        R                  " XU5        g r"   )r'   r   ParseCreateArgsr	   SetFieldInMessage)r%   argsr&   
labels_clslabels_fields        r   _ParseLabelsIntoCreateMessager.   1   s,    w2*,,T>,g,?r   c                 t    X;  d	  X   (       d  SX'   g SX   R                  S5      ;   a  g X   S-   S-   U U'   g )Nlabels,)split)static_fieldupdate_mask_paths     r   _AddLabelsToUpdateMaskr5   7   sQ    *

(%-L"
/55c::
 '83>I r   c                     UR                  S5      nU H  n [        X5      n M     U $ ! [         a    [        SR                  U5      5      ef = f)N.z0The message does not have field specified in {}.)r2   getattrAttributeErrorformat)r%   r&   path
field_names       r   _RetrieveFieldValueFromMessager=   D   sa    		$jP,g  
.  P
<
C
CI
NP PPs	   )%Ac                     [         R                  R                  U5      nUR                  5       (       d  g[	        X5      n[        X5      nUR                  XT5      nUR                  (       a!  [        R                  " XUR                  5        g)zHFind diff between existing labels and args, set labels into the message.FT)r   DiffFromUpdateArgsMayHaveUpdatesr=   r'   Applyneeds_updater	   r*   r0   )r%   r+   r&   diffexisting_labels	label_clsupdate_results          r   _ParseLabelsIntoUpdateMessagerH   O   sn    				(	(	.$					27F/g1)**Y8-M4H4HI	r   c                 ,   [        U [        R                  5      (       a  U /$ [        U [        R                  5      (       a  / $ [        U [        R                  5      (       a  U R
                  n / nU  H  nUR                  [        U5      5        M     U$ )zRetrieves all resource args from the arg_info tree.

Args:
  params: an ArgGroup or list of args to parse through.

Returns:
  YAMLConceptArgument (resource arg) list.
)
isinstancer   YAMLConceptArgumentArgumentArgumentGroup	argumentsextend_GetResources)paramsresultparams      r   rP   rP   ]   s{     ;;<<8O0011I5566F&e
MM-&'  
-r   c                    U (       d  gU  Vs/ s H  nUR                  U5      (       d  M  UPM     nnU(       dG  U(       a  UR                  nUR                  nOSnSn[        R                  " SR                  XES95      e[        U5      S:  aO  U Vs/ s H  o"R                  PM     nn[        R                  " SR                  SR                  U5      5      5      eUS   $ s  snf s  snf )zRetrieves the primary resource arg.

Args:
  resource_params: list of YAMLConceptParser
  resource_collection: registry.APICollection, resource collection
    associated with method

Returns:
  YAMLConceptArgument (resource arg) or None.
Na  No resource args were found that correspond with [{name} {version}]. Add resource arguments that corresponds with request.method collection [{name} {version}]. HINT: Can set resource arg is_primary_resource to True in yaml schema to receive more assistance with validation.)nameversion   zOnly one resource arg can be listed as primary. Remove one of the primary resource args [{}] or set is_primary_resource to False in yaml schema., r   )	IsPrimaryResource	full_nameapi_versionr   InvalidSchemaErrorr:   lenrU   join)resource_paramsresource_collectionargprimary_resourcesrZ   r[   primary_resource_namess          r   _GetPrimaryResourcerd   t   s     
 %5$c			2	3 
_  5 
%//i'33kik

!
!	 "6 " 12 2 		a2CD2C3hh2CD

!
!	vdii(>?@B B
 
1	75* Es   C$C$C)c                     U nU(       d  [        US5      =n(       a  [        USS9/$ / nU H2  n[        X%R                  5      nUR                  [        Xe5      5        M4     U$ )a  Gets list of primary resource args and methods associated with them.

Args:
  resource_args: list[YAMLConceptArg], list of potential primary resource
    args
  methods: list[registry.APIMethod], The method to generate arguments for.

Returns:
  list[YAMLMethod] (resource arg) or None.
Nprimary_resourcemethod)rd   MethodResourceArgresource_argument_collectionappend)resource_argsmethodsr+   primaryyaml_methodsrh   resource_args          r   _GetMethodResourceArgsrq      sl     
$	!4T4!@@g@wtDEE,f&113L),?@  
r   c                 Z    U  Vs/ s H  n[         R                  " U5      PM     sn$ s  snf r"   )resource_utilNormalizeFormat)
attributesattrs     r   _NormalizeNamesrw      s%    :D	E*$-
'
'
-*	EE	Es    (c                     U HQ  nX :w  d  M
  UR                   U R                   :X  d  M&  [        UR                  5      [        U R                  5      :H  s  $    g)a2  Verify if there is a duplicated resource argument with the same attributes.

Args:
  resource: yaml_arg_schema.Argument, resource to be verified.
  resource_params: [yaml_arg_schema.Argument], list to check duplicate.

Returns:
  True if there is a duplicate resource arg in the list with same attributes.
T)rU   rw   attribute_names)resourcer_   res_args      r   %_DoesDupResourceArgHaveSameAttributesr|      sP     !gw||x}}< W445X5567 8	 ! 
r   c                    [        5       n[        R                  " [        5      nU  H  nUR                  nXA;   a;  XA;   a5  [        X05      (       d%  [        R                  " SR                  U5      5      eOUR                  U5        UR                  R                  5        H'  nXSR                  ;  d  M  X%   R                  U5        M)     M     UR                  5        VVs0 s H  u  pV[        U5      S:  d  M  XV_M     snn$ s  snnf )zRetrieves shared attributes between resource args.

Args:
  resource_params: [yaml_arg_schema.Argument], yaml argument tree

Returns:
  Map of attribute names to list of resources that contain that attribute.
zxMore than one resource argument has the name [{}] with different attributes. Remove the duplicate resource declarations.rW   )setcollectionsdefaultdictlistpresentation_namer|   r   r\   r:   addattribute_to_flag_mapvaluesignored_flagsrk   itemsr]   )r_   resource_namesflagsra   arg_name	flag_namerl   s          r   _GetSharedFlagsr      s     5.

!
!$
'%c $$H!
 
$7MM%%FFLfG
 	
 " ..557		++	+) 8- : ',kkm
&3
")	]	a	 i&3
  
s   #D<Dc                 r    U R                   R                  nU(       a  UR                  S5      u  n  nU$ UnU$ )Nr7   )rj   rZ   
rpartition)rh   	is_parentcollection_namer`   _s        r   _GetCollectionNamer      sD    77AA/ / : :3 ?A 
 *	r   c                   $    \ rS rSrSrS rS rSrg)ri   i  z4Method and the resource argument associated with it.c                     Xl         X l        g r"   rf   )selfrg   rh   s      r   __init__MethodResourceArg.__init__
  s    ,Kr   c                 \    U R                   (       a  U R                   R                  U5      $ g r"   )rg   ParseResourceArgr   	namespaces     r   ParseMethodResourceArg.Parse  s%    ""33I>>r   )rh   rg   N)r   r   r   r   r   r   r   r   r   r   r   ri   ri     s    <r   ri   c                   N    \ rS rSrSrS rS rS r    SS jrS r	S	 r
S
 rSrg)DeclarativeArgumentGeneratori  a)  An argument generator that operates off a declarative configuration.

When using this generator, you must provide attributes for the arguments that
should be generated. All resource arguments must be provided and arguments
will only be generated for API fields for which attributes were provided.
c                 D    Xl         [        U R                   5      U l        g)zCreates a new Argument Generator.

Args:
  arg_info: [yaml_arg_schema.Argument], Information about
    request fields and how to map them into arguments.
N)arg_inforP   rl   )r   r   s     r   r   %DeclarativeArgumentGenerator.__init__  s     M&t}}5Dr   c                 "  ^
 [        U R                  5      n[        U5      nU R                   Vs/ s H  nUR	                  X5      PM     nn[        U R                  U5      n[        S U 5       5      m
UR                  5        H  u  px[        [        U5      5      n	U	R                  U
4S jS9  UR                  [        R                  " USR                  SR                  U	5      [        R                  " U5      S9S95        M     U$ s  snf )zGenerates all the CLI arguments required to call this method.

Args:
  methods: list[APIMethod], list of methods to generate arguments for.

Returns:
  {str, calliope.base.Action}, A map of field name to the argument.
c              3   t   #    U  H.  nUR                   =(       a    UR                   R                  v   M0     g 7fr"   )rg   rU   ).0ra   s     r   	<genexpr><DeclarativeArgumentGenerator.GenerateArgs.<locals>.<genexpr>7  s1      *(C 	:!5!5!:!::(s   68c                    > U T;   a  S$ U $ )N r   )rU   primary_namess    r   <lambda>;DeclarativeArgumentGenerator.GenerateArgs.<locals>.<lambda>>  s    !62@D@r   )keyzFor resources [{}], provides fallback value for resource {attr} attribute. When the resource's full URI path is not provided, {attr} will fallback to this flag value.rX   )rv   help)r   rl   r   r   Generaterq   r~   r   sortrk   r   rL   r:   r^   rs   StripPrefix)r   rm   shared_flag_resource_dictshared_resource_flag_listra   r+   primary_resource_argsr   rl   r   r   s             @r   GenerateArgs)DeclarativeArgumentGenerator.GenerateArgs'  s    !00B0B C $%> ? }}&$ LL<$ 	 & 343E3EwO *(* *M %>$C$C$E 	C./n@  B kk$--
DDJF99^,%11)< EK E>	? @ %F K+&s   Dc                    / n[        U R                  U5      nU(       d
  [        SSS9$ [        U5      S:X  a  UR	                  5       $ U H  nUR
                  nUR                  nU(       a  U(       d  [        R                  " S5      e[        XgR                  S9nUR                  U5      n	U	=(       a    U	R                  5       R                  n
X:X  d  M  UR                  U5        M     [        U5      S:  ad  / nU H<  nUR                  U5      =n(       d  M  UR                  UR                  5       5        M>     SR!                  U5      n[#        SU S35      e[        U5      S:X  a  UR	                  5       $ [        SSS9$ )	a  Gets primary resource based on user input and returns single method.

This determines which api method to use to make api request. If there
is only one potential request method, return the one request method.

Args:
  methods: list[APIMethod], The method to generate arguments for.
  namespace: The argparse namespace.

Returns:
  MethodResourceArg, gets the primary resource arg and method the
    user specified in the namespace.

Raises:
  ConflictingResourcesError: occurs when user specifies too many primary
    resources.
Nrf   rW   zIf more than one request collection is specified, a resource argument that corresponds with the collection, must be specified in YAML command.)r   rX   z5User specified multiple primary resource arguments: [z*]. Unable to determine api request method.)rq   rl   ri   r]   poprh   rg   r   r\   r   is_parent_resourcer   GetCollectionInforZ   rk   RelativeNamer^   r   )r   rm   r   specified_methodsrb   method_inforh   rg   method_collectionspecified_resourceprimary_collectionurisparsedr+   s                 r   GetPrimaryResource/DeclarativeArgumentGenerator.GetPrimaryResourceJ  s   & .t/A/A7K TBB		1	$""$$(!!f$55
 +%%)
 	
 -
??A ',,Y7
 ;

.
.
0
:
:  
	0  -/ )2 !d*+ &&y1161
++f))+
, + YYt_d%A$ H4 45 5 """$$TBBr   Nc                    UR                  5       " 5       nU(       a  [        R                  " XvU5      nOUnU(       a  U[        R                  R
                  :X  a  [        XUR                  5        O\U[        R                  R                  :X  a>  [        XUR                  5      n	U	(       a!  [        R                  " U5      n
[        X:5        [        R                  " XS9  U R                   H  nUR                  X(U5        M     U$ )a  Generates the request object for the method call from the parsed args.

Args:
  namespace: The argparse namespace.
  method: APIMethod, api method used to make request message.
  static_fields: {str, value}, A mapping of API field name to value to
    insert into the message. This is a convenient way to insert extra data
    while the request is being constructed for fields that don't have
    corresponding arguments.
  labels: The labels section of the command spec.
  command_type: Type of the command, i.e. CREATE, UPDATE.
  existing_message: the apitools message returned from server, which is used
    to construct the to-be-modified message when the command follows
    get-modify-update pattern.

Returns:
  The apitools message to be send to the method.
)static_fields)GetRequestTyper	   ParseExistingMessageIntoMessager   CommandTypeCREATEr.   r&   UPDATErH   r
   GetMaskFieldPathr5   ParseStaticFieldsIntoMessager   r   )r   r   rh   r   r0   command_typeexisting_messagenew_messager%   need_updater4   ra   s               r   CreateRequest*DeclarativeArgumentGenerator.CreateRequest  s    2 '')+K 99
1g g 	,88??	?%g&:J:JK.::AAA3G4:4D4DF#44V<

 
A **7P }}	ii+  Nr   c                    U(       a  U/O/ nU R                  XB5      R                  U5      n[        R                  R                  UUR                  R
                  UR                  R                  UR                  5       S9$ )a  Gets a resource reference for a resource returned by a list call.

It parses the namespace to find a reference to the parent collection and
then creates a reference to the child resource with the given id_value.

Args:
  id_value: str, The id of the child resource that was returned.
  namespace: The argparse namespace.
  method: APIMethod, method used to make the api request

Returns:
  resources.Resource, The parsed resource reference.
)
collectionr[   rQ   )r   r   r   REGISTRYr   rZ   r[   AsDict)r   id_valuer   rh   rm   
parent_refs         r   GetResponseResourceRef3DeclarativeArgumentGenerator.GetResponseResourceRef  su     !vhbG((<BB9MJ##$$..%%11  "	 $ $ $r   c                     [        USS5      $ z.Gets the value of the limit flag (if present).limitNr8   r   s     r   Limit"DeclarativeArgumentGenerator.Limit  s    9gt,,r   c                     [        USS5      $ z2Gets the value of the page size flag (if present).	page_sizeNr   r   s     r   PageSize%DeclarativeArgumentGenerator.PageSize  s    9k400r   )r   rl   )NNNN)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r     s=    6!FCCP #'!%%)5n$,-1r   r   c                   n    \ rS rSrSrSr1 SkrSS jrS rS r	S r
S	 rS
 rS rS rS rS rSS jrSrg)AutoArgumentGeneratori  a3  An argument generator to generate arguments for all fields in a message.

When using this generator, you don't provide any manual configuration for
arguments, it is all done automatically based on the request messages.

There are two modes for this generator. In 'raw' mode, no modifications are
done at all to the generated fields. In normal mode, certain list fields are
not generated and instead our global list flags are used (and orchestrate
the proper API fields automatically). In both cases, we generate additional
resource arguments for path parameters.
rz   >   filterorderBy	pageTokenc                    Xl         X l        U R                   R                  U R                   R                  :g  U l        [        5       U l        U(       d  U R                   R                  5       (       aa  U =R                  [        R                  -  sl        U R                   R                  5       nU(       a  U R                  R                  U5        gggg)a  Creates a new Argument Generator.

Args:
  method: APIMethod, The method to generate arguments for.
  raw: bool, True to do no special processing of arguments for list
    commands. If False, typical List command flags will be added in and the
    equivalent API fields will be ignored.
N)rh   rawdetailed_paramsrQ   	is_atomicr~   ignored_fieldsHasTokenizedRequestr   IGNORABLE_LIST_FIELDSBatchPageSizeFieldr   )r   rh   r   batch_page_size_fields       r   r   AutoArgumentGenerator.__init__  s     KH[[00DKK4F4FFDN%D4;;2244
2HHH"kk<<>	 56 
 53r   c                    ^^ [        5       m/ mUU4S jnU" U R                  5       5        U" U R                  SU R                  R	                  5       5      5        U" U R                  5       5        T$ )zGenerates all the CLI arguments required to call this method.

Returns:
  {str, calliope.base.Action}, A map of field name to the argument.
c                    > U  H:  n UR                   nUT;   a  M  TR                  U5        TR                  U5        M<     g! [         a     N"f = f)zUpdate args.N)rU   r   
IndexErrorrk   )rN   ra   rU   r+   seens      r   _UpdateArgs7AutoArgumentGenerator.GenerateArgs.<locals>._UpdateArgs  sR    #	$
 T\
((4.C   	
	s   A
AAr   )r~   _GenerateResourceArg_GenerateArgumentsrh   r   _GenerateListMethodFlags)r   r   r+   r   s     @@r   r   "AutoArgumentGenerator.GenerateArgs  sa     5DD  ))+,''DKK,F,F,HIJ--/0Kr   c                 H   U R                   R                  5       nU R                  USU5      nU R                  U5      nU(       aQ  UR	                  5       nUR                  U R                   R                   Vs0 s H  nU[        XFU5      _M     sn5        U" S0 UD6$ s  snf )zGenerates the request object for the method call from the parsed args.

Args:
  namespace: The argparse namespace.

Returns:
  The apitools message to be send to the method.
r   r   )rh   r   _ParseArguments_ParseResourceArgr   r
   rQ   r8   )r   r   request_typefieldsrefrelative_namefs          r   r   #AutoArgumentGenerator.CreateRequest'  s     ;;--/L!!)R>F 
 
 
+C
&&(mmm"kk0020 6602 3!&!!2s   9Bc                 @    U R                   (       d  [        USS5      $ gr   r   r8   r   s     r   r   AutoArgumentGenerator.Limit<  s    88Y..r   c                 @    U R                   (       d  [        USS5      $ gr   r  r   s     r   r   AutoArgumentGenerator.PageSizeC  s    88YT22r   c                    / nU R                   (       d  U R                  R                  5       (       a  UR                  [        R
                  5        UR                  [        R                  5        U R                  R                  5       (       a|  U R                  R                  5       (       a]  UR                  [        R                  5        U R                  R                  5       (       a  UR                  [        R                  5        U$ )z~Generates all the CLI flags for a List command.

Returns:
  {str, calliope.base.Action}, A map of field name to the argument.
)r   rh   IsListrk   r   FILTER_FLAGSORT_BY_FLAGr   ListItemField
LIMIT_FLAGr   PAGE_SIZE_FLAG)r   r   s     r   r   .AutoArgumentGenerator._GenerateListMethodFlagsJ  s     E88**,,ll4##$ll4$$%		(	(	*	*t{{/H/H/J/JT__%;;))++
,,t**
+Lr   c                 .   / n[         R                  " U5      nUR                  5        GHg  nUR                  UR                  S5      nU R                  UR                  U5      nU(       d  ME  X-   nUR                  [        R                  R                  :X  az  U R                  US-   UR                  5      nU(       aR  U(       a  US-   U-   OSn	[        R                  " U	S9n
UR                  U
5        U H  nU
R                  U5        M     M  M  [         R"                  " XwU5      n[         R$                  " X\SSS9nUR&                  R                  S	5      (       d  S
R)                  U5      UR&                  S	'   UR                  U5        GMj     U$ )aR  Gets the arguments to add to the parser that appear in the method body.

Args:
  prefix: str, A string to prepend to the name of the flag. This is used
    for flags representing fields of a submessage.
  message: The apitools message to generate the flags for.

Returns:
  {str, calliope.base.Argument}, A map of field name to argument.
Nr7   z: r   r   FMESSAGE)	fix_boolscategoryr   z"API doc needs help for field [{}].)r	   FieldHelpDocs
all_fieldsgetrU   _GetArgNamevariantr   Variantr  r   r$   r   rM   rk   AddArgumentr   rL   GenerateFlagkwargsr:   )r   prefixr%   r+   field_helpsfield
field_helprU   sub_args	help_textgroupra   ru   s                r   r   (AutoArgumentGenerator._GenerateArguments\  sM    D))'2K##%??5::t4jejj*5d]d	(**22	2**4#:uzzB4>td{Z/B)$$)4%
++e
cc" 	  %--d*E
$$U%.79zz~~f%%CJJ4P#**V
C) &* Kr   c           
      <   / nU R                   R                  (       a   U R                   R                  R                  OSnU(       d  U$ [        R                  " U R                   R                  5       5      nSU R                   R                  -   n[        R                  " [        R                  SSS9nUR                  U5        U HQ  n[        R                  " SU-   [        R                  " U5      SUR                  Xd5      S9nUR                  U5        MS     U$ )	zGets the flags to add to the parser that appear in the method path.

Returns:
  {str, calliope.base.Argument}, A map of field name to argument.
NzFor substitution into: ?z+The GRI for the resource being operated on.)nargsr   z--RESOURCE)metavarr  r   )rh   request_collectionr   r	   r  r   detailed_pathr   rL   r   FLAT_RESOURCE_ARG_NAMErk   r   ConvertToAngrySnakeCaser  )r   r+   field_namesr%  default_helpra   r&  s          r   r   *AutoArgumentGenerator._GenerateResourceArg  s     Dkk44 ;;11AA:> k))$++*D*D*FGK,t{{/H/HHL --44:<C 	KKMM
,#;;EBu3	5c
 kk#  Kr   c                    0 nUR                  5        H  nU R                  UR                  5      nU(       d  M'  X&-   nUR                  [        R
                  R                  :X  a^  U R                  XS-   UR                  5      nU(       a6  UR                  " S0 UD6nUR                  (       d  UOU/XER                  '   M  M  [        R                  " X5      nUc  M  [        R                  " XX5      XER                  '   M     U$ )ad  Recursively generates data for the request message and any sub-messages.

Args:
  namespace: The argparse namespace containing the all the parsed arguments.
  prefix: str, The flag prefix for the sub-message being generated.
  message: The apitools class for the message.

Returns:
  A dict of message field data that can be passed to an apitools Message.
r7   r   )r  r  rU   r  r   r   r  r  r$   repeatedr	   GetFromNamespaceConvertValue)	r   r   r$  r%   r#  r&  r   
sub_kwargsvalues	            r   r  %AutoArgumentGenerator._ParseArguments  s     F##%!!%**-h"h	(**22	2)))^UZZP
***z*%,1NNu&
  **9?(55eC&
! &" Mr   c                    U R                   R                  (       a   U R                   R                  R                  OSnU(       d  g[        U[        R
                  5      n[        USS5      n0 n0 nU HN  n[        X5      nU(       a  XU'   M  [        R                  R                  US 5      " 5       n	U	(       d  MJ  XU'   MP     U(       d   U(       d  [        U5      [        U5      :  a  gUR                  U5        [        R                  R                  X0R                   R                  R                  UU R                   R                  R                  US9$ )zGets the resource ref for the resource specified as the positional arg.

Args:
  namespace: The argparse namespace.

Returns:
  The parsed resource ref or None if no resource arg was generated for this
  method.
Nenforce_collectionTc                      g r"   r   r   r   r   r   9AutoArgumentGenerator._ParseResourceArg.<locals>.<lambda>  s    $r   )r   r@  r[   rQ   )rh   r1  r   r8   r   r3  r	   DEFAULT_PARAMSr  r]   r
   r   r   r   rZ   r[   )
r   r   r5  rr@  rQ   defaultsr  r=  defaults
             r   r  'AutoArgumentGenerator._ParseResourceArg  s    kk44 ;;11AA:> 	0GGHA ,@$GFHi#e	q	**..q,?A71+  VHK0@ @ OOF##	kk44>>-KK22>>	 $  r   Nc                     U(       a  [         R                  " U5      (       a  gXR                  ;   a  gXR                  R                  :X  a%  UR                  5       R                  S5      (       a  gU$ )a  Gets the name of the argument to generate for the field.

Args:
  field_name: str, The name of the field.
  field_help: str, The help for the field in the API docs.

Returns:
  str, The name of the argument to generate, or None if this field is output
  only or should be ignored.
Nrequest)r	   IsOutputFieldr   rh   request_fieldlowerendswith)r   r<   r'  s      r   r  !AutoArgumentGenerator._GetArgName  s\     i--j99(((kk///##I..r   )r   r   rh   r   Fr"   )r   r   r   r   r   r3  r   r   r   r   r   r   r   r   r   r  r  r  r   r   r   r   r   r     sN    
 &<7(>"*$"H>>&Pr   r   rO  ),r   
__future__r   r   r   r   apitools.base.protorpcliter   googlecloudsdk.callioper    googlecloudsdk.calliope.conceptsr   rs   $googlecloudsdk.command_lib.util.apisr	   r
   r   r   r   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   googlecloudsdk.core.resourcer   	Exceptionr   r   r'   r.   r5   r=   rH   rP   rd   rq   rw   r|   r   r   ri   objectr   r   r   r   r   <module>rZ     s     G &  '  / ( B : 7 @ D Q < ) :1I 1O O@@
J.+\0F&*Z M16 M1`SF Sr   