
                         X   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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0r\R:                  " \R<                  R>                  5       " S S\R@                  5      5       r!g)z#List certificates within a project.    )absolute_import)division)unicode_literals)
list_pager)base)resource_utils)common_args)deps)filter_rewrite)resource_args)response_utils)
text_utils)concept_parsers)presentation_specs)log)resource_projection_specEXAMPLESa          To list all Certificates issued by a given Certificate Authority, run:

          $ {command} --issuer=my-ca --location=us-west1

        To list all Certificates issued by all Certificate Authorities in a
        location, run:

          $ {command} --location=us-west1

        You can omit the `--location` flag in both of the above examples if
        you've already set the ``privateca/location'' property. For example:

          $ {top_command} config set privateca/location us-west1
        +
          # The following is equivalent to the first example above.
          $ {command} --issuer=my-ca
        +
          # The following is equivalent to the second example above.
          $ {command}
        c                   .    \ rS rSrSr\S 5       rS rSrg)List?   a  List certificates within a project.

List certificates within a project. Note that listing certificates accross
locations is not supported.

## EXAMPLES
To list all Certificates issued by a given CA pool, run:

  $ {command} --issuer-pool=my-pool --location=us-west1

To list all Certificates issued by all CA pools in a location, run:

  $ {command} --location=us-west1

To list all Certificates issued directly under a CA, run:

  $ {command} --issuer-pool=my-pool --location=us-west1 \
      --filter="issuer_certificate_authority='projects/1234567890/locations/us-west1/caPools/my-pool/certificateAuthorities/my-ca'"

You can omit the `--location` flag in both of the above examples if you've
already set the ``privateca/location'' property. For example:

  $ {top_command} config set privateca/location us-west1
+
  # The following is equivalent to the first example above.
  $ {command} --issuer-pool=my-pool
+
  # The following is equivalent to the second example above.
  $ {command}
c                    [         R                  " [        R                  " S[        R
                  " S[        R                  " S SSSS9/S9SS	S
9/5      R                  U 5        [        R                  R                  U S5        U R                  R                  S5        U R                  R                  [        R                   [        R"                  S.5        U R                  R%                  [&        R(                  " S5      5        g )Nz--issuer-poolCA_POOLc                      g)N- r       *lib/surface/privateca/certificates/list.py<lambda>List.Args.<locals>.<lambda>i   s    r   z.defaults to all CA pools in the given locationF)functionhintactiveplural)pool_id_fallthroughszrThe issuing CA pool. If this is omitted, Certificates issued by all CA pools in the given location will be listed.T)requiredd   a  
        table(
          name.basename(),
          name.scope().segment(-3):label=CA_POOL,
          name.scope().segment(-5):label=LOCATION,
          revocation_details.yesno(yes="REVOKED", no="ACTIVE"):label=REVOCATION_STATUS,
          certificate_description.subject_description.not_before_time():label=NOT_BEFORE,
          certificate_description.subject_description.not_after_time():label=NOT_AFTER)
        )not_before_timenot_after_timez1privateca.projects.locations.caPools.certificates)r   ConceptParserr   ResourcePresentationSpecr   CreateCaPoolResourceSpecr
   FallthroughAddToParserr   PAGE_SIZE_FLAG
SetDefaultdisplay_info	AddFormatAddTransformsr   TransformNotBeforeTimeTransformNotAfterTime
AddUriFuncr   MakeGetUriFunc)parsers    r   Args	List.Args`   s    !!3322$$!,/$$&&	' 	#   {6""63/
!! #  %%%<<$::'  ""%%?	ABr   c           
         [         R                  " SS9n[         R                  " SS9nUR                  5       n[        R
                  " UR                  UR                  S9n[        R                  " 5       R                  UR                  US9u  pg[        R                  " SUR                  Xg5        Xal        UR                  R                  R!                  5       nUR#                  UR%                  5       [&        R(                  " UR*                  5      US9n	[,        R.                  " UR0                  U	SUR2                  SUR4                  [6        R8                  S	9$ )
Nv1)api_version)symbolsaliases)defaultsz6original_filter=%r, client_filter=%r, server_filter=%r)parentorderByfiltercertificatespageSize)fieldlimitbatch_size_attribute
batch_sizeget_field_func)privateca_baseGetClientInstanceGetMessagesModuleGetDisplayInfor   ProjectionSpec
transformsr>   r   BackendFilterRewriteRewriterB   r   infoCONCEPTSissuer_poolParse8PrivatecaProjectsLocationsCaPoolsCertificatesListRequestRelativeNamer	   ParseSortByArgsort_byr   YieldFromList'projects_locations_caPools_certificatesrF   	page_sizer   GetFieldAndLogUnreachable)
selfargsclientmessagesr0   r?   client_filterserver_filterr@   requests
             r   RunList.Run   s/   --$?F//DAH&&(L'66''1E1EGH#1#F#F $gh  ( !M HHE[[-8  K]]&&,,.FOO""$**4<<8 P G
 ##66jj'>>%??A Ar   r   N)	__name__
__module____qualname____firstlineno____doc__staticmethodr8   re   __static_attributes__r   r   r   r   r   ?   s$    > #B #BJAr   r   N)"rk   
__future__r   r   r   apitools.base.pyr    googlecloudsdk.api_lib.privatecar   rJ   r   googlecloudsdk.api_lib.utilr	   googlecloudsdk.calliope googlecloudsdk.calliope.conceptsr
   $googlecloudsdk.command_lib.privatecar   r   r   r   (googlecloudsdk.command_lib.util.conceptsr   r   googlecloudsdk.corer   googlecloudsdk.core.resourcer   _DETAILED_HELPReleaseTracksReleaseTrackGAListCommandr   r   r   r   <module>r}      s    * &  ' ' C ; 3 ( 1 ? > ? ; D G # A 	4 D%%(()aA4 aA *aAr   