
    V                     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)z2Command to update the specified Google API source.    )absolute_import)division)unicode_literals)google_api_sources)base)flags)labels_util)logz{description}a           To update the Google API source `my-google-api-source` in location `us-central1` with destination message bus `my-message-bus`, run:

          $ {command} my-google-api-source --location=us-central1 --destination-message-bus=my-message-bus

        To update the Google API source `my-google-api-source` in location `us-central1` with `INFO` level logging, run:

          $ {command} my-google-api-source --location=us-central1 --logging-config=INFO

        To update the Google API source `my-google-api-source` in location `us-central1` with a Cloud KMS CryptoKey, run:

          $ {command} my-google-api-source --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 API source.c                    [         R                  " U5        [         R                  " US5        [         R                  " USS9  [         R                  " USS9  [
        R                  " U5        [        R                  R                  U5        g )Nz,The logging config of the Google API source.T)
with_clear)
r   $AddUpdateGoogleApiSourceResourceArgsAddLoggingConfigArgAddWideScopeSubscriptionArgAddCryptoKeyArgr	   AddUpdateLabelsFlagsr   
ASYNC_FLAGAddToParser)clsparsers     1lib/surface/eventarc/google_api_sources/update.pyArgsUpdate.Args5   sf    	..v6	> 
%%f>	&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'                  S5      UR(                  UR*                  UR'                  S5      UR'                  S5      UR,                  S9nUR/                  UUR1                  UUR                  R2                  R	                  5       UR4                  UR6                  UR9                  5       UR'                  S5      (       a  UR:                  OSUR<                  S	9U5      nUR>                  (       a  U$ URA                  US
U5      $ )zRun the update command.z;Updating Google API source {} for project {} in location {}destination_message_buslogging_config
crypto_keyorganization_subscriptionproject_subscriptions)destinationr!   r"   clear_crypto_keylabelsr#   r$   clear_project_subscriptionsN)google_api_source_refdestination_refr!   crypto_key_namer'   r#   r$   Updating)!r   GoogleApiSourceClientV1CONCEPTSgoogle_api_sourceParser
   debugformatgoogleApiSourcesId
projectsIdlocationsIdGetr	   DiffFromUpdateArgsApplyLabelsValueClassr'   BuildUpdateMaskIsSpecifiedr&   needs_updater(   PatchBuildGoogleApiSourcer    r!   r"   	GetOrNoner#   r$   async_WaitFor)selfargsclientr)   original_google_api_sourcelabels_update_resultupdate_mask	operations           r   Run
Update.Run@   s   779F MM;;AACIIE	!44!,,!--

 "(,A!B&++::4@FF!#=#D#D (($$%>?''(89##L1..#00"&"2"23N"O"../FG$($D$D ) 	K ##"7 MMAAGGI.. OO'113 ;<< '+&D&D"&"<"< 	$ 
	
 	I  {{>>)Z1FGGr    N)__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpclassmethodr   rJ   __static_attributes__rL   r   r   r   r   .   s$     . -( (0Hr   r   N)rQ   
__future__r   r   r   googlecloudsdk.api_lib.eventarcr   googlecloudsdk.callioper   #googlecloudsdk.command_lib.eventarcr   $googlecloudsdk.command_lib.util.argsr	   googlecloudsdk.corer
   rR   ReleaseTracksReleaseTrackBETAGADefaultUniverseOnlyUpdateCommandr   rL   r   r   <module>rb      s    9 &  ' > ( 5 < # #& D%%**D,=,=,@,@A@HT @H  B@Hr   