
                            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 ddlmZ  ej$                  ej&                  j(                         G d dej*                               Zy)z%Disable a root certificate authority.    )absolute_import)division)unicode_literals)base)request_utils)flags)
operations)resource_args)log)
console_ioc                   &    e Zd ZdZed        Zd Zy)Disablea  Disable a root certificate authority.

    Disables a root certificate authority. The root certificate authority
    will not be allowed to issue certificates once disabled. It may still revoke
    certificates and/or generate CRLs. The CA certfificate will still be
    included in the FetchCaCertificates response for the parent CA Pool.

    ## EXAMPLES

    To disable a root CA:

        $ {command} prod-root --pool=prod-root-pool --location=us-west1
  c                 Z    t        j                  | d       t        j                  |        y )Nz
to disable)r
   %AddCertAuthorityPositionalResourceArgr   AddIgnoreDependentResourcesFlag)parsers    &lib/surface/privateca/roots/disable.pyArgszDisable.Args/   s     77M	))&1    c           
         t        j                  d      }t        j                  d      }|j                  j                  j                         }|j                  rVdj                  |j                               }t        j                  |d      s t        j                  j                  d       y |j                  j                  |j!                  |j                                     }t#        j$                  |j&                  j(                  j*                  |d       |j                  j-                  |j/                  |j                         |j1                  |j                  t3        j4                         	      
            }t7        j8                  |dd       t        j                  j                  dj                  |j                                      y )Nv1)api_versionaC  You are about to disable Certificate Authority [{}] without checking if the CA's CA Pool is being used by another resource. If you proceed and this is the last enabled CA in the CA Pool, there may be unintended and unrecoverable effects on any dependent resource(s) since the CA Pool would not be able to issue certificatesT)messagedefaultzAborted by user.)name)version)ignoreDependentResources	requestId)r   "disableCertificateAuthorityRequestzDisabling Root CAzDisabled Root CA [{}].)privateca_baseGetClientInstanceGetMessagesModuleCONCEPTScertificate_authorityParseignore_dependent_resourcesformatRelativeNamer   PromptContinuer   statusPrint1projects_locations_caPools_certificateAuthoritiesGetAPrivatecaProjectsLocationsCaPoolsCertificateAuthoritiesGetRequestr
   CheckExpectedCATypeCertificateAuthorityTypeValueValuesEnumSELF_SIGNEDr   EPrivatecaProjectsLocationsCaPoolsCertificateAuthoritiesDisableRequest"DisableCertificateAuthorityRequestr   GenerateRequestIdr	   Await)selfargsclientmessagesca_refprompt_message
current_ca	operations           r   RunzDisable.Run4   s   --$?F//DAH]]00668F&&< 	v""$%  &&~tL

+,IIMM	J	J$$& 
K 
()J
 %%%%99EE
 HHPP	N	N$$&/7//)-)H)H'99; 0 = 
O 
>?I Y 3FJJ-44V5H5H5JKLr   N)__name__
__module____qualname____doc__staticmethodr   r?    r   r   r   r      s!     2 2(Mr   r   N)rC   
__future__r   r   r    googlecloudsdk.api_lib.privatecar   r    r   googlecloudsdk.calliope$googlecloudsdk.command_lib.privatecar   r	   r
   googlecloudsdk.corer   googlecloudsdk.core.consoler   ReleaseTracksReleaseTrackGASilentCommandr   rE   r   r   <module>rP      sh    , &  ' C : ( 6 ; > # 2 D%%(()<Md   <M *<Mr   