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

          $ {command} my-message-bus --location=us-central1

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

          $ {command} my-message-bus --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 message bus.c                     [         R                  " USSS9  [         R                  " US5        [         R                  " USS9  [        R
                  " U5        [        R                  R                  U5        g )NzMessage bus to update.T)requiredz&The logging config of the message bus.)
with_clear)	r   AddMessageBusResourceArgAddLoggingConfigArgAddCryptoKeyArgr	   AddUpdateLabelsFlagsr   
ASYNC_FLAGAddToParser)clsparsers     ,lib/surface/eventarc/message_buses/update.pyArgsUpdate.Args1   s[    	""(4 
f&NO	&T2$$V,OO'    c           
         [         R                  " 5       nUR                  R                  R	                  5       n[
        R                  " SR                  UR                  UR                  UR                  5      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'                  S5      UR(                  UR*                  S9nUR-                  UUR/                  UUR0                  UR2                  UR5                  5       S9U5      nUR6                  (       a  U$ UR9                  USU5      $ )zRun the update command.z5Updating message bus {} for project {} in location {}logging_config
crypto_key)r    r!   clear_crypto_keylabels)message_bus_refr    crypto_key_namer#   Updating)r   MessageBusClientV1CONCEPTSmessage_busParser
   debugformatmessageBusesId
projectsIdlocationsIdGetr	   DiffFromUpdateArgsApplyLabelsValueClassr#   BuildUpdateMaskIsSpecifiedr"   needs_updatePatchBuildMessageBusr    r!   	GetOrNoneasync_WaitFor)selfargsclientr$   original_message_buslabels_update_resultupdate_mask	operations           r   Run
Update.Run;   sW   --/Fmm//557OII?FF**&&''	
 "::o6&++::4@FF!#7#>#> ((''(89##L1..#00	 ) K +.. OO'113	 	 	
 		I {{>>)ZAAr    N)__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpclassmethodr   rD   __static_attributes__rF   r   r   r   r   *   s$     ( -( (&B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BETAGADefaultUniverseOnlyUpdateCommandr   rF   r   r   <module>r\      s    3 &  ' 9 ( 5 < # #	 D%%**D,=,=,@,@A5BT 5B  B5Br   