
    
                        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Update a CA pool.    )absolute_import)division)unicode_literals)base)request_utils)flags)
operations)resource_args)update_utils)labels_utilc                   &    e Zd ZdZed        Zd Zy)Updatea.  Update an existing  CA Pool.

  ## EXAMPLES
    To update labels on a CA pool:

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

    To disable publishing CRLs on a CA pool:

      $ {command} my-pool \
        --location=us-west1 \
        --no-publish-crl
  c                     t        j                  | d       t        j                  | d       t        j                  |        t        j                  |        y )Nz	to updateT)use_update_help_text)r
   AddCaPoolPositionalResourceArgr   AddPublishingOptionsFlagsAddCaPoolIssuancePolicyFlagr   AddUpdateLabelsFlags)parsers    %lib/surface/privateca/pools/update.pyArgszUpdate.Args1   sA    00	##FF	%%f-$$V,    c           	      @   t        j                  d      }t        j                  d      }|j                  j                  j                         }|j                  j                  |j                  |j                                     }t        j                  ||j                        \  }}|j                  j                  |j                  |j                         |dj                  |      t!        j"                                     }t%        j&                  |dd      S )Nv1)name,)r   caPool
updateMask	requestIdzUpdating CA pool.)api_version)privateca_baseGetClientInstanceGetMessagesModuleCONCEPTSca_poolParseprojects_locations_caPoolsGet+PrivatecaProjectsLocationsCaPoolsGetRequestRelativeNamer   UpdateCaPoolFromArgslabelsPatch-PrivatecaProjectsLocationsCaPoolsPatchRequestjoinr   GenerateRequestIdr	   Await)	selfargsclientmessagesca_pool_refcurrent_ca_poolpool_to_updateupdate_mask	operations	            r   Runz
Update.Run9   s    --d3F//5H--''--/K77;;<<))+ 	= 	-.O #/"C"Co$$#&NK 1177>>))+!xx,#557	 	? 	9:I I':MMr   N)__name__
__module____qualname____doc__staticmethodr   r;    r   r   r   r      s!      - -Nr   r   N)r?   
__future__r   r   r    googlecloudsdk.api_lib.privatecar   r!   r   googlecloudsdk.calliope$googlecloudsdk.command_lib.privatecar   r	   r
   r   $googlecloudsdk.command_lib.util.argsr   ReleaseTracksReleaseTrackGAUpdateCommandr   rA   r   r   <module>rK      sh     &  ' C : ( 6 ; > = < D%%(()-NT -N *-Nr   