
                             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)zUpdate an existing certificate.    )absolute_import)division)unicode_literals)base)request_utils)
exceptions)resource_args)labels_utilc                   8    \ rS rSrSrSr\S 5       rS rS r	Sr
g)	Update   zUpdate an existing certificate.

## EXAMPLES

 To update labels on a certificate:

    $ {command} frontend-server-tls \
      --issuer-pool=my-pool --issuer-location=us-west1 \
      --update-labels=in_use=true
z8There are no changes to the certificate [{certificate}].c                 ^    [         R                  " U S5        [        R                  " U 5        g )Nz	to update)r	   AddCertPositionalResourceArgr
   AddUpdateLabelsFlags)parsers    ,lib/surface/privateca/certificates/update.pyArgsUpdate.Args-   s     ..v{C$$V,    c           	         [         R                  " U5      nUR                  UR                  R                  UR
                  5      nUR                  (       d8  [        R                  " SU R                  R                  UR                  S95      eUR
                  Ul        UR                  R                  UR                  UR                  US[        R                   " 5       S95      $ )Nlabels)certificate)namer   
updateMask	requestId)r
   GetAndValidateOpsFromArgsApplyCertificateLabelsValuer   needs_updater   InvalidArgumentExceptionNO_CHANGES_MESSAGEformatr   'projects_locations_caPools_certificatesPatch9PrivatecaProjectsLocationsCaPoolsCertificatesPatchRequestr   GenerateRequestId)selfclientmessagesoriginal_certargslabels_difflabels_updates          r   
_RunUpdateUpdate._RunUpdate2   s    77=K%%h&:&:&F&F&3&:&:<M %%//


!
!
(
(]5G5G
(
HJ J )//M99??AA##%#557	 	B 	9: :r   c                 *   [         R                  " SS9n[         R                  " SS9nUR                  R                  R                  5       nUR                  R                  UR                  UR                  5       S95      nU R                  X#XQ5      $ )Nv1)api_version)r   )privateca_baseGetClientInstanceGetMessagesModuleCONCEPTSr   Parser$   Get7PrivatecaProjectsLocationsCaPoolsCertificatesGetRequestRelativeNamer/   )r(   r,   r)   r*   certificate_refr   s         r   Run
Update.RunG   s    --$?F//DAHmm//557O@@DD	@	@ --/ 
A 
12K ??6[??r    N)__name__
__module____qualname____firstlineno____doc__r"   staticmethodr   r/   r=   __static_attributes__r?   r   r   r   r      s1    	 A  - -:*@r   r   N)rD   
__future__r   r   r    googlecloudsdk.api_lib.privatecar   r4   r   googlecloudsdk.callioper   $googlecloudsdk.command_lib.privatecar	   $googlecloudsdk.command_lib.util.argsr
   ReleaseTracksReleaseTrackGAUpdateCommandr   r?   r   r   <module>rP      s`    & &  ' C : ( . > < D%%(()5@T 5@ *5@r   