
                             S 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
\R                  5      rg)zHA command that generates and/or updates single resource config commands.    )absolute_import)division)unicode_literals)arg_parsers)base)generate_config_command)resource_name_translatorc                   .    \ rS rSrSr\S 5       rS rSrg)GenerateCommand   zBGenerate declarative config commands with surface specs and tests.c                     U R                  SSSSS9  U R                  SSSS	9  U R                  S
S[        R                  " 5       SS9  U R                  SS[        R                  " 5       SS9  g )Nz--output-root	DIRECTORYTzMRoot of the directory within which to generate config config export commands.)metavarrequiredhelpz--enable-overwrites
store_truezUWhen enabled, allows overwriting of existing commands, surface specs, and test files.)actionr   z--collections
COLLECTIONz6List of apitools collections to generate commands for.)r   typer   z--release-tracksTRACKzEList of release tracks to generate commands for. E.g. `ALPHA,BETA,GA`)add_argumentr   ArgList)parsers    ,lib/surface/meta/generate_config_commands.pyArgsGenerateCommand.Args   s    
(	  * '  )
   "F	  I
   "T	      c                    [         R                  " 5       n[        US5      =(       d    S/n[        US5      nU H  nSnUR                  nSU;   a-  UR                  (       a  U(       a  UR
                  U;   a  SnOSnU(       d  MM  [        R                  " UR
                  UR                  UUUR                  5        M     g )Nrelease_tracksALPHAcollectionsFenable_single_resource_autogenT)
r	   ResourceNameTranslatorgetattrresource_datar"   collection_namer   WriteConfigYamloutput_rootenable_overwrites)selfargs
translatorr   specified_collections
collectionrender_filesr%   s           r   RunGenerateCommand.Run7   s    )@@BJT#34A	N#D-8 
l ..m
*m
;

6
6 ''+@@L,	//
0J0J040@0@0=0>040F0F		H !r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r0   __static_attributes__r2   r   r   r   r      s    J 0Hr   r   N)r7   
__future__r   r   r   googlecloudsdk.callioper   r   googlecloudsdk.command_lib.metar   8googlecloudsdk.command_lib.util.resource_map.declarativer	   Commandr   r2   r   r   <module>r?      s2    O &  ' / ( C ]0Hdll 0Hr   