
                         6   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ dd	lmZ d
ddZ ej                   ej"                  j$                  ej"                  j&                        ej(                   G d dej*                                      Zy)z)Command to update the specified pipeline.    )absolute_import)division)unicode_literals)	pipelines)base)flags)labels_util)logz{description}a^           To update the pipeline `my-pipeline` with its destination targeting HTTP endpoint URI 'https://example-endpoint.com' and network attachment 'my-network-attachment', run:

          $ {command} my-pipeline --location=us-central1 --destinations=http_endpoint_uri='https://example-endpoint.com',network_attachment=my-network-attachment
        )DESCRIPTIONEXAMPLESc                   *    e Zd ZdZeZed        Zd Zy)UpdatezUpdate an Eventarc pipeline.c                    t        j                  |dd       t        j                  |d       t        j                  |       t        j                  |       t        j
                  |d       t        j                  |       t        j                  |dd       t        j                  |       t        j                  j                  |       y )NzThe pipeline to update.T)group_help_textrequiredF)r   z#The logging config of the pipeline.)
with_clearhidden)r   AddPipelineResourceArgAddPipelineDestinationsArgAddInputPayloadFormatArgsAddMediationsArgAddLoggingConfigArgAddRetryPolicyArgsAddCryptoKeyArgr	   AddUpdateLabelsFlagsr   
ASYNC_FLAGAddToParser)clsparsers     (lib/surface/eventarc/pipelines/update.pyArgszUpdate.Args,   s    	   9D 
$$Ve<	##F+	6"	f&KL	V$	&T%@$$V,OO'    c                    t        j                         }|j                  j                  j	                         }t        j                  dj                  |j                  |j                  |j                               |j                  |      }t        j                  j                  |      j                  |j!                         |j"                        }|j%                  |j'                  d      |j'                  d      |j'                  d      |j'                  d      |j'                  d      |j'                  d      |j'                  d      |j'                  d	      |j'                  d
      |j'                  d      |j(                  |j*                        }|j-                  ||j/                  ||j0                  |j2                  |j4                  |j6                  |j8                  |j:                  |j<                  |j>                  |j@                  |jB                  |jE                               |      }|jF                  r|S |jI                  |d|      S )zRun the update command.z2Updating pipeline {} for project {} in location {}destinationsinput_payload_format_json+input_payload_format_avro_schema_definition/input_payload_format_protobuf_schema_definition
mediationslogging_configmax_retry_attemptsmin_retry_delaymax_retry_delay
crypto_key)r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   clear_crypto_keylabels)pipeline_refr$   r%   r&   r'   r(   r)   r*   r+   r,   crypto_key_namer/   Updating)%r   PipelineClientV1CONCEPTSpipelineParser
   debugformatpipelinesId
projectsIdlocationsIdGetr	   DiffFromUpdateArgsApplyLabelsValueClassr/   BuildUpdateMaskIsSpecifiedr.   needs_updatePatchBuildPipeliner$   r%   r&   r'   r(   r)   r*   r+   r,   r-   	GetOrNoneasync_WaitFor)selfargsclientr0   original_pipelinelabels_update_resultupdate_mask	operations           r    Runz
Update.Run;   s   '')F==))//1LII<CC$$##$$	
 

<0&++::4@FF!#4#;#; ((%%n5"&"2"23N"O484D4D95
 9=8H8H=9
 ##L1''(89++,@A(():;(():;##L1..#00! ) K& %**&*&D&D8<8h8h<@<p<p..#66 00 00 OO'113 	 	
 	!I& {{>>)Z>>r"   N)	__name__
__module____qualname____doc___DETAILED_HELPdetailed_helpclassmethodr!   rP    r"   r    r   r   %   s#     % -( (:?r"   r   N)rT   
__future__r   r   r   googlecloudsdk.api_lib.eventarcr   googlecloudsdk.callioper   #googlecloudsdk.command_lib.eventarcr   $googlecloudsdk.command_lib.util.argsr	   googlecloudsdk.corer
   rU   ReleaseTracksReleaseTrackBETAGADefaultUniverseOnlyUpdateCommandr   rX   r"   r    <module>re      s    0 &  ' 5 ( 5 < # # D%%**D,=,=,@,@AN?T N?  BN?r"   