
    f                         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  \R                   " \R"                  R$                  5       " S
 S\R&                  5      5       rg)z7List the root certificate authorities within a project.    )
list_pager)base)resource_utils)common_args)
exceptions)response_utils)
text_utils)
propertiesc                   .    \ rS rSrSr\S 5       rS rSrg)List   a  List root certificate authorities.

List the root certificate authorities within a project.

## EXAMPLES

To list all root certificate authorities in a projects:

$ {command}

To list all root certificate authorities within a project and location
'us-central1':

$ {command} --location=us-central1

To list all root certificate authorities within a CA Pool in location
'us-central1':

$ {command} --pool=my-pool --location=us-central1
c                    [         R                  " SSS9R                  U 5        [         R                  " SSS9R                  U 5        [         R                  R	                  U S5        [         R
                  R                  U 5        U R                  R                  S5        U R                  R                  [        R                  [        R                  S.5        U R                  R                  [        R                  " S	5      5        g )
N
--locationzaLocation of the certificate authorities. If ommitted, root CAs across all regions will be listed.)helpz--poolzuID of the CA Pool where the certificate authorities reside. If ommitted, root CAs across all CA pools will be listed.d   a  
        table(
          name.basename(),
          name.scope().segment(-5):label=LOCATION,
          name.scope().segment(-3):label=POOL,
          state,
          state.regex("ENABLED","YES","NO"):label=INCLUDED_IN_POOL_ISSUANCE,
          ca_certificate_descriptions[0].subject_description.not_before_time():label=NOT_BEFORE,
          ca_certificate_descriptions[0].subject_description.not_after_time():label=NOT_AFTER)
        )not_before_timenot_after_timez;privateca.projects.locations.caPools.certificateAuthorities)r   ArgumentAddToParserPAGE_SIZE_FLAG
SetDefaultFILTER_FLAGRemoveFromParserdisplay_info	AddFormatAddTransformsr	   TransformNotBeforeTimeTransformNotAfterTime
AddUriFuncr   MakeGetUriFunc)parsers    #lib/surface/privateca/roots/list.pyArgs	List.Args5   s    MMp k&MM E k&""63/%%f-
!! 	# 	 %%%<<$::'  ""%%I	KL    c           
         [         R                  " SS9n[         R                  " SS9nUR                  S5      (       a  UR                  OSnUR                  S5      (       a  UR
                  OSnUS:X  a  US:w  a  [        R                  " SS5      eSR                  [        R                  R                  R                  R                  5       XE5      nUR                  US	[        R                   " UR"                  5      S
9n[$        R&                  " UR(                  USUR*                  SUR,                  [.        R0                  S9$ )Nv1)api_versionlocation-poolr   zKIf a pool id is specified, you must also specify the location of that pool.z#projects/{}/locations/{}/caPools/{}ztype:SELF_SIGNED)parentfilterorderBycertificateAuthoritiespageSize)fieldlimitbatch_size_attribute
batch_sizeget_field_func)privateca_baseGetClientInstanceGetMessagesModuleIsSpecifiedr)   r+   r   InvalidArgumentExceptionformatr
   VALUEScoreproject	GetOrFailBPrivatecaProjectsLocationsCaPoolsCertificateAuthoritiesListRequestr   ParseSortByArgsort_byr   YieldFromList1projects_locations_caPools_certificateAuthoritiesr2   	page_sizer   GetFieldAndLogUnreachable)selfargsclientmessagesr)   
ca_pool_idparent_resourcerequests           r"   RunList.RunT   s"   --$?F//DAH $ 0 0 < <t}}#H"..v66CJ3:,//

W 
 <BB&&002HJO YY!**4<<8 Z :G
 ##@@&jj'>>%??A Ar%    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr#   rN   __static_attributes__rP   r%   r"   r   r      s#    * L L<Ar%   r   N)rU   apitools.base.pyr    googlecloudsdk.api_lib.privatecar   r6   r   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper   $googlecloudsdk.command_lib.privatecar   r	   googlecloudsdk.corer
   ReleaseTracksReleaseTrackGAListCommandr   rP   r%   r"   <module>rb      se    > ( C ; 3 ( . ? ; * D%%(()QA4 QA *QAr%   