
                         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 enrollment.    )absolute_import)division)unicode_literals)enrollments)base)flags)labels_util)logz{description}a&           To update the enrollment `my-enrollment` with a new CEL expression `message.type == 'google.cloud.pubsub.topic.v1.messagePublished'`, run:

          $ {command} my-enrollment --location=us-central1 --cel-match="message.type == 'google.cloud.pubsub.topic.v1.messagePublished'"
        )DESCRIPTIONEXAMPLESc                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)Update%   zUpdate an Eventarc enrollment.c                     [         R                  " U5        [         R                  " USS9  [        R                  " U5        [
        R                  R                  U5        g )NF)required)r   AddUpdateEnrollmentResourceArgsAddCelMatchArgr	   AddUpdateLabelsFlagsr   
ASYNC_FLAGAddToParser)clsparsers     *lib/surface/eventarc/enrollments/update.pyArgsUpdate.Args,   s@    	))&1	%0$$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9nUR+                  UUR-                  UUR.                  SUR                  R0                  R	                  5       UR3                  5       S9U5      nUR4                  (       a  U$ UR7                  USU5      $ )zRun the update command.z4Updating enrollment {} for project {} in location {}	cel_matchdestination_pipeline)r   destinationlabelsN)enrollment_refr   message_bus_refdestination_refr!   Updating)r   EnrollmentClientV1CONCEPTS
enrollmentParser
   debugformatenrollmentsId
projectsIdlocationsIdGetr	   DiffFromUpdateArgsApplyLabelsValueClassr!   BuildUpdateMaskIsSpecifiedneeds_updatePatchBuildEnrollmentr   r   	GetOrNoneasync_WaitFor)selfargsclientr"   original_enrollmentlabels_update_resultupdate_mask	operations           r   Run
Update.Run4   s^   ++-F]]--335NII>EE((%%&&	
 !**^4&++::4@FF!#6#=#= (("";/$$%;<#00 ) K )nn  MM>>DDF'113 	 	
 	
I {{>>)Z@@r    N)__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpclassmethodr   rC   __static_attributes__rE   r   r   r   r   %   s$     ' -( (&Ar   r   N)rJ   
__future__r   r   r   googlecloudsdk.api_lib.eventarcr   googlecloudsdk.callioper   #googlecloudsdk.command_lib.eventarcr   $googlecloudsdk.command_lib.util.argsr	   googlecloudsdk.corer
   rK   ReleaseTracksReleaseTrackBETAGADefaultUniverseOnlyUpdateCommandr   rE   r   r   <module>r[      s    2 &  ' 7 ( 5 < # # D%%**D,=,=,@,@A3AT 3A  B3Ar   