
    o                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ	 ddlm
Z
 ddlmZ ddlmZ dd	lmZ dd
lmZ  ej$                  ej&                  j(                         G d dej*                               Zy),List certificate templates within a project.    )absolute_import)division)unicode_literals)
list_pager)base)resource_utils)common_args)response_utils)
propertiesc                   0    e Zd ZdZdddZed        Zd Zy)Listr   zList certificate templates.z      To list all certificate templates in a project across all locations, run:

        $ {command}

      To list all certificate templates in a project and location 'us-central1',
      run:

        $ {command} --location=us-central1)DESCRIPTIONEXAMPLESc                 d   t        j                  ddd      j                  |        t         j                  j	                  | d       t         j
                  j	                  | d       | j                  j                  d       | j                  j                  t        j                  d             y )	Nz
--locationzThe location you want to list the certificate templates for. Set this to "-" to list certificate templates across all locations.-)helpdefaultd   namez
      table(
        name.scope("certificateTemplates"):label=NAME,
        name.scope("locations").segment(0):label=LOCATION,
        description
      )z1privateca.projects.locations.certificateTemplates)r   ArgumentAddToParserPAGE_SIZE_FLAG
SetDefaultSORT_BY_FLAGdisplay_info	AddFormat
AddUriFuncr	   MakeGetUriFunc)parsers    'lib/surface/privateca/templates/list.pyArgsz	List.Args2   s    MM 
 ![(""63/  0
!! #  ""%%?	AB    c           	         t        j                  d      }t        j                  d      }dj                  t        j
                  j                  j                  j                         |j                        }|j                  |t        j                  |j                        |j                        }t        j                   |j"                  |d|j$                  d|j&                  t(        j*                        S )zRuns the command.v1)api_versionzprojects/{}/locations/{})parentorderByfiltercertificateTemplatespageSize)fieldlimitbatch_size_attribute
batch_sizeget_field_func)privateca_baseGetClientInstanceGetMessagesModuleformatr   VALUEScoreproject	GetOrFaillocation9PrivatecaProjectsLocationsCertificateTemplatesListRequestr
   ParseSortByArgsort_byr)   r   YieldFromList'projects_locations_certificateTemplatesr-   	page_sizer   GetFieldAndLogUnreachable)selfargsclientmessagesr'   requests         r!   RunzList.RunG   s    --$?F//DAH'..&&002DMMCFPP**4<<8{{ Q G ##66$jj'>>%??A Ar#   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr"   rF    r#   r!   r   r      s2    4 (.	- B B(Ar#   r   N)rJ   
__future__r   r   r   apitools.base.pyr    googlecloudsdk.api_lib.privatecar   r1   r	   googlecloudsdk.api_lib.utilr
   googlecloudsdk.calliope$googlecloudsdk.command_lib.privatecar   googlecloudsdk.corer   ReleaseTracksReleaseTrackGAListCommandr   rM   r#   r!   <module>rY      se    3 &  ' ' C ; 3 ( ? * D%%(()9A4 9A *9Ar#   