
    '
                         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
r
SS	KJr   " S
 S\R                  5      rg)zHA command that generates resource URIs given collection and api version.    )absolute_import)division)unicode_literals)arg_parsers)base)	resourcesN)rangec                   .    \ rS rSrSr\S 5       rS rSrg)Parse   zsCloud SDK resource test URI generator.

*{command}* is an handy way to generate test URIs for the resource parser.
c                     U R                  SSSSS9  U R                  SSSS	9  U R                  S
S[        R                  " SS9SS9  g )Nz--collectionNAMETz6The resource collection name of the resource to parse.)metavarrequiredhelpz--api-versionVERSIONzUThe resource collection API version. The collection default is used if not specified.)r   r   z--count   )lower_boundz-The number of test resource URIs to generate.)defaulttyper   )add_argumentr   
BoundedInt)parsers    &lib/surface/meta/resources/generate.pyArgs
Parse.Args#   sn    
E	  G
 *  ,
 ##2<	  >    c                    [         R                  R                  UR                  UR                  S9n0 nUR                  S5      nU(       d  / $ U H  nSUR                  5       -   S-   X5'   M     / n[        SUR                  S-   5       Hp  n0 n[        R                  " U5       H  u  pXUR                  U5      XE'   M     [         R                  " SUSUS5      R                  5       n	UR                  U	5        Mr     U$ )z(Returns the list of generated resources.)api_version zmy-z-{}r   N)r   REGISTRYGetCollectionInfo
collectionr   	GetParamslowerr	   countsix	iteritemsformatResourceSelfLinkappend)
selfargscollection_info	templatesparamsparamurisitemplateuris
             r   Run	Parse.Run5   s    ((::T%5%5 ; 7OI&&r*F i.6i D1djj1n%f ]]95/% * 6
VT33;8: 

kk# & Kr    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r7   __static_attributes__r9   r   r   r   r      s     
 > >"r   r   )r>   
__future__r   r   r   googlecloudsdk.callioper   r   googlecloudsdk.corer   r'   	six.movesr	   Commandr   r9   r   r   <module>rF      s3     O &  ' / ( ) 
 -DLL -r   