
    2                        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S.r\R                   " \R"                  R$                  5      \R&                   " S S\R(                  5      5       5       rg)z(Command to update the specified channel.    )absolute_import)division)unicode_literals)channels)base)flags)labels_util)logz{description}a           To update the channel `my-channel` in location `us-central1`, run:

          $ {command} my-channel --location=us-central1

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

          $ {command} my-channel --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 channel.c                     [         R                  " USSS9  [         R                  " USS9  [        R                  " U5        [
        R                  R                  U5        g )NzChannel to update.T)required)
with_clear)r   AddChannelResourceArgAddCryptoKeyArgr	   AddUpdateLabelsFlagsr   
ASYNC_FLAGAddToParser)clsparsers     'lib/surface/eventarc/channels/update.pyArgsUpdate.Args3   sE    	(<tL	&T2$$V,OO'    c           
         [         R                  " 5       nUR                  R                  R	                  5       nUR                  5       R                  5       R                  5       nUR                  5       R                  5       n[        R                  " SR                  UR                  5       XE5      5        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SXR1                  5       5      U5      n
UR2                  (       a  U
$ UR5                  U
SU5      $ )zRun the update command.z1Updating channel {} for project {} in location {}
crypto_key)r   clear_crypto_keylabels NUpdating)r   ChannelClientV1CONCEPTSchannelParseParentNamer
   debugformatGetr	   DiffFromUpdateArgsApplyLabelsValueClsr!   BuildUpdateMaskIsSpecifiedr    needs_updater   PatchBuildChannel	GetOrNoneasync_WaitFor)selfargsclientchannel_refproject_namelocation_nameoriginal_channellabels_update_resultupdate_maskcrypto_key_name	operations              r   Run
Update.Run:   s}   %%'F--''--/K%%'..0557L&&(--/MIIAHHL9 : zz+.&++::4@FF!1!8!8 ((##L1..#00 ) K O%%o0N0N0P	
 	I {{>>)Z==r    N)__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpclassmethodr   rD   __static_attributes__rF   r   r   r   r   ,   s#     $ -( (#>r   r   N)rK   
__future__r   r   r   googlecloudsdk.api_lib.eventarcr   googlecloudsdk.callioper   #googlecloudsdk.command_lib.eventarcr   $googlecloudsdk.command_lib.util.argsr	   googlecloudsdk.corer
   rL   ReleaseTracksReleaseTrackGADefaultUniverseOnlyUpdateCommandr   rF   r   r   <module>r[      sy    / &  ' 4 ( 5 < # 				" D%%(()/>T />  */>r   