
    E                         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
S.r\R                  " \R                  R                   5      \R"                   " S S\R$                  5      5       5       rg)z/Command to update the specified google channel.    )absolute_import)division)unicode_literals)google_channels)base)flags)labels_utilz{description}ag           To update the Google channel in location `us-central1`, run:

          $ {command} --location=us-central1

        To configure the Google channel in location `us-central1` with a Cloud KMS CryptoKey, run:

          $ {command} --location=us-central1 --crypto-key=projects/PROJECT_ID/locations/KMS_LOCATION/keyRings/KEYRING/cryptoKeys/KEY

        )DESCRIPTIONEXAMPLESc                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)Update+   z"Update an Eventarc Google channel.c                     [         R                  " USSS9  [         R                  " USS9  [        R                  " U5        g )Nz#The location of the Google Channel.T)required)
with_clear)r   AddLocationResourceArgAddCryptoKeyArgr	   AddUpdateLabelsFlags)clsparsers     .lib/surface/eventarc/google_channels/update.pyArgsUpdate.Args2   s7    	  5F	&T2$$V,    c           	      ^   [         R                  " 5       nUR                  R                  R	                  5       R                  5       nU S3nUR                  U5      n[        R                  R                  U5      R                  UR                  5       UR                  5      nUR                  UR                  S5      UR                  UR                   S9nSnUR                  S5      (       a  UR"                  nUR%                  UUR'                  UUUR)                  5       S9U5      n	U	$ )zRun the update command.z/googleChannelConfig
crypto_key)r   clear_crypto_keylabels )r   )r   GoogleChannelConfigClientV1CONCEPTSlocationParseRelativeNameGetr	   DiffFromUpdateArgsApplyLabelsValueClassr   BuildUpdateMaskIsSpecifiedr   needs_updater   r   BuildGoogleChannelConfig	GetOrNone)
selfargsclientlocation_nameconfig_nameoriginal_google_channellabels_update_resultupdate_maskcrypto_key_nameresponses
             r   Run
Update.Run9   s   88:FMM**002??AM"O#78K$jj5&++::4@FF!#:#A#A ((##L1..#00 ) K O%%o}}'''113 	( 	

 	H Or    N)__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpclassmethodr   r9   __static_attributes__r;   r   r   r   r   +   s#     + -- -r   r   N)r@   
__future__r   r   r   googlecloudsdk.api_lib.eventarcr   googlecloudsdk.callioper   #googlecloudsdk.command_lib.eventarcr   $googlecloudsdk.command_lib.util.argsr	   rA   ReleaseTracksReleaseTrackGADefaultUniverseOnlyUpdateCommandr   r;   r   r   <module>rO      sv    6 &  ' ; ( 5 < 				" D%%(()*T *  **r   