
                            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"                  ej$                  j&                         G d dej(                                      Zy)z+Update a subordinate certificate authority.    )absolute_import)division)unicode_literals)base)request_utils)
operations)resource_args)update_utils)labels_utilc                   &    e Zd ZdZed        Zd Zy)Updatea  Update an existing subordinate certificate authority.

  ## EXAMPLES
    To update labels on a subordinate CA:

      $ {command} server-tls-1 \
        --pool=my-pool \
        --location=us-west1 \
        --update-labels=foo=bar

    To update the CA certificate chain for a subordinate CA:

      $ {command} server-tls-1 \
        --pool=my-pool \
        --location=us-west1 \
        --pem-chain=pem_chain.txt
  c                     t        j                  | d       t        j                  ddd      j	                  |        t        j                  |        y )Nz	to updatez--pem-chainFzA file containing a list of PEM-encoded certificates that represent the issuing chain of this CA. Please note that the certificate corresponding to this specific CA should be excluded.)requiredhelp)r	   %AddCertAuthorityPositionalResourceArgr   ArgumentAddToParserr   AddUpdateLabelsFlags)parsers    ,lib/surface/privateca/subordinates/update.pyArgszUpdate.Args3   sC    77LMM		 k&$$V,    c           	         t        j                  d      }t        j                  d      }|j                  j                  j                         }|j                         }|j                  j                  |j                  |            }t        j                  |j                  j                  j                  |d       t        j                   ||j"                        \  }}|j                  j%                  |j'                  ||dj)                  |      t+        j,                                     }	t/        j0                  |	dd      S )Nv1)api_version)name)version,)r   certificateAuthority
updateMask	requestIdzUpdating Subordinate CA.)privateca_baseGetClientInstanceGetMessagesModuleCONCEPTScertificate_authorityParseRelativeName1projects_locations_caPools_certificateAuthoritiesGetAPrivatecaProjectsLocationsCaPoolsCertificateAuthoritiesGetRequestr	   CheckExpectedCATypeCertificateAuthorityTypeValueValuesEnumSUBORDINATEr
   UpdateCAFromArgslabelsPatchCPrivatecaProjectsLocationsCaPoolsCertificateAuthoritiesPatchRequestjoinr   GenerateRequestIdr   Await)
selfargsclientmessagesca_refca_name
current_caca_to_updateupdate_mask	operations
             r   Runz
Update.RunB   s)   --$?F//DAH]]00668F!!#GIIMMRR 	S 	
J %%%%99EE !- = =j!L+
 HHNNTT!-xx,#557	 	U 	
I -4 r   N)__name__
__module____qualname____doc__staticmethodr   rA    r   r   r   r      s     $ - -#r   r   N)rE   
__future__r   r   r    googlecloudsdk.api_lib.privatecar   r"   r   googlecloudsdk.calliope$googlecloudsdk.command_lib.privatecar   r	   r
   $googlecloudsdk.command_lib.util.argsr   DefaultUniverseOnlyReleaseTracksReleaseTrackGAUpdateCommandr   rG   r   r   <module>rR      ss    2 &  ' C : ( ; > = < D%%(()ET E * Er   