
                           S r SSKJr  SSKJr  SSKJr  SSK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rSzS jrS rS rS rS rS rS rS rS rS rS rS rS rS rS r S r!S r"S r#S  r$S{S! jr%S" r&S|S# jr' S}S$ jr(S% r)S|S& jr*S' r+S|S( jr,S) r-S|S* jr.S|S+ jr/S|S, jr0S- r1S. r2 S|S/ jr3S|S0 jr4S1 r5S2 r6S|S3 jr7S|S4 jr8S5 r9S6 r:S7 r;S|S8 jr<S|S9 jr= S}S: jr> S}S; jr?S< r@S= rAS> rBS? rCS|S@ jrDS|SA jrES}SB jrFS}SC jrGS}SD jrH S}SE jrIS}SF jrJS|SG jrKS|SH jrLS}SI jrMS}SJ jrNS}SK jrOSL rPSM rQS|SN jrRS|SO jrSS|SP jrTS|SQ jrUS|SR jrVS|SS jrWS|ST jrXS|SU jrYS|SV jrZS|SW jr[S|SX jr\S|SY jr]S|SZ jr^S[ r_S\ r`S] raS^ rbS|S_ jrcS|S` jrdSa reS~Sb jrfS}Sc jrgS|Sd jrhSe riSSf jrjS|Sg jrkSh rlSi rmSj rnS|Sk jroS|Sl jrpS|Sm jrqSn rrS|So jrsS|Sp jrtS|Sq jruS|Sr jrvS|Ss jrwS|St jrxS|Su jryS|Sv jrzSw r{Sx r|Sy r}g)zFlags for Eventarc commands.    )absolute_import)division)unicode_literalsN)arg_parsers)base)concepts)deps)concept_parsers)presentation_specs)
propertiesv1c                 Z   [         R                  " [        R                  " S5      5      /nSnU(       a  US-  nUS-  nU (       aR  UR	                  [         R
                  " [        R                  R                  R                  R                  S5      5        [        R                  " SX#S9$ )z4Builds an AttributeConfig for the location resource.zeventarc/locationz:The location for the Eventarc {resource}, which should be zeither ``global'' or zRone of the supported regions. Alternatively, set the [eventarc/location] property.z@use '-' location to aggregate results for all Eventarc locationslocation)namefallthroughs	help_text)r	   PropertyFallthroughr   
FromStringappendFallthroughgooglecloudsdkcommand_libeventarcflagsSetLocationr    ResourceParameterAttributeConfig)allow_aggregationallow_globalfallthroughs_listr   s       0lib/googlecloudsdk/command_lib/eventarc/flags.pyLocationAttributeConfigr!   !   s     z445HIJ K)((I)
 &&//55AAN	
 
	2	2$5
     c                      g)N- r%   r"   r    r   r   ;   s    	r"   c                  *    [         R                  " SS9$ )z3Builds an AttributeConfig for the trigger resource.triggerr   r   r   r%   r"   r    TriggerAttributeConfigr*   ?       		2	2		BBr"   c                  *    [         R                  " SS9$ )z3Builds an AttributeConfig for the channel resource.channelr(   r)   r%   r"   r    ChannelAttributeConfigr.   D   r+   r"   c                  *    [         R                  " SS9$ )z>Builds an AttributeConfig for the channel connection resource.zchannel-connectionr(   r)   r%   r"   r     ChannelConnectionAttributeConfigr0   I   s    		2	28L	MMr"   c                  *    [         R                  " SS9$ )z4Builds an AttributeConfig for the provider resource.providerr(   r)   r%   r"   r    ProviderAttributeConfigr3   N       		2	2
	CCr"   c                  *    [         R                  " SS9$ )z;Builds an AttributeConfig for the transport topic resource.ztransport-topicr(   r)   r%   r"   r    TransportTopicAttributeConfigr6   S   s    		2	28I	JJr"   c                  *    [         R                  " SS9$ )z7Builds an AttributeConfig for the message bus resource.zmessage-busr(   r)   r%   r"   r    MessageBusAttributeConfigr8   X   s    		2	2	FFr"   c                  *    [         R                  " SS9$ )z=Builds an AttributeConfig for the Google API source resource.zgoogle-api-sourcer(   r)   r%   r"   r    GoogleApiSourceAttributeConfigr:   ]   s    		2	28K	LLr"   c                  *    [         R                  " SS9$ )z6Builds an AttributeConfig for the enrollment resource.
enrollmentr(   r)   r%   r"   r    EnrollmentAttributeConfigr=   b   s    		2	2	EEr"   c                  *    [         R                  " SS9$ )z4Builds an AttributeConfig for the pipeline resource.pipeliner(   r)   r%   r"   r    PipelineAttributeConfigr@   g   r4   r"   c                  *    [         R                  " SS9$ )z8Builds an AttributeConfig for the Kafka source resource.zkafka-sourcer(   r)   r%   r"   r    KafkaSourceAttributeConfigrB   l   s    		2	2	GGr"   c                  n    [         R                  " SS[        5       [        5       [         R                  S9$ )z+Builds a ResourceSpec for trigger resource.z$eventarc.projects.locations.triggersr'   )resource_name
triggersIdlocationsId
projectsId)r   ResourceSpecr*   r!    DEFAULT_PROJECT_ATTRIBUTE_CONFIGr%   r"   r    TriggerResourceSpecrJ   q   0    			,'))+::
 r"   c                  n    [         R                  " SS[        5       [        5       [         R                  S9$ )z+Builds a ResourceSpec for channel resource.z$eventarc.projects.locations.channelsr-   )rD   
channelsIdrF   rG   )r   rH   r.   r!   rI   r%   r"   r    ChannelResourceSpecrN   |   rK   r"   c                  n    [         R                  " SS[        5       [        5       [         R                  S9$ )z6Builds a ResourceSpec for channel connection resource.z.eventarc.projects.locations.channelConnectionszchannel connection)rD   channelConnectionsIdrF   rG   )r   rH   r0   r!   rI   r%   r"   r    ChannelConnectionResourceSpecrQ      s0    			6(;=)+::
 r"   c                  n    [         R                  " SS[        5       [        5       [         R                  S9$ )z)Builds a ResourceSpec for event provider.z%eventarc.projects.locations.providersr2   )rD   providersIdrF   rG   )r   rH   r3   r!   rI   r%   r"   r    ProviderResourceSpecrT      s0    			-)+)+::
 r"   c            	      l    [         R                  " SS[        5       [        SS9[         R                  S9$ )z&Builds a ResourceSpec for message bus.z(eventarc.projects.locations.messageBuseszmessage busFr   )rD   messageBusesIdrF   rG   )r   rH   r8   r!   rI   r%   r"   r    MessageBusResourceSpecrX      s2    			0!.0)u=::
 r"   c            	      l    [         R                  " SS[        5       [        SS9[         R                  S9$ )z,Builds a ResourceSpec for Google API source.z,eventarc.projects.locations.googleApiSourceszGoogle API sourceFrV   )rD   googleApiSourcesIdrF   rG   )r   rH   r:   r!   rI   r%   r"   r    GoogleApiSourceResourceSpecr[      s2    			4'79)u=::
 r"   c            	      l    [         R                  " SS[        5       [        SS9[         R                  S9$ )z%Builds a ResourceSpec for enrollment.z'eventarc.projects.locations.enrollmentsr<   FrV   )rD   enrollmentsIdrF   rG   )r   rH   r=   r!   rI   r%   r"   r    EnrollmentResourceSpecr^      s2    			/ -/)u=::
 r"   c           	      l    [         R                  " SU [        5       [        SS9[         R                  S9$ )&Builds a ResourceSpec for destination.z%eventarc.projects.locations.pipelinesFrV   )rD   pipelinesIdrF   rG   )r   rH   r@   r!   rI   rD   s    r    PipelineResourceSpecrc      s2    			-!)+)u=::
 r"   c            	      l    [         R                  " SS[        5       [        SS9[         R                  S9$ )r`   z(eventarc.projects.locations.kafkaSourceszkafka sourceFrV   )rD   kafkaSourcesIdrF   rG   )r   rH   rB   r!   rI   r%   r"   r    KafkaSourceResourceSpecrf      s2    			0"/1)u=::
 r"   c                     [         R                  " SS[        5       [         R                  S9n[        R
                  R                  SUSUS9nUR                  U 5        g)zAAdds a resource argument for a customer-provided transport topic.zpubsub.projects.topicszPub/Sub topic)rD   topicsIdrG   z--transport-topica*  The Cloud Pub/Sub topic to use for the trigger's transport intermediary. This feature is currently only available for triggers of event type ``google.cloud.pubsub.topic.v1.messagePublished''. The topic must be in the same project as the trigger. If not specified, a transport topic will be created.requiredN)r   rH   r6   rI   r
   ConceptParserForResourceAddToParser)parserrj   resource_specconcept_parsers       r    AddTransportTopicResourceArgrq      sd    ''#,.::	- #00<<=
  = 	. V$r"   c                     [         R                  " SS[        US9[         R                  S9n[        R
                  R                  SXAUS9nUR                  U 5        g)z2Adds a resource argument for an Eventarc location.zeventarc.projects.locationsr   )r   )rD   rF   rG   z
--locationri   N)r   rH   r!   rI   r
   rk   rl   rm   )rn   group_help_textrj   r   ro   rp   s         r    AddLocationResourceArgrt      s`     ''#)<MN::	- #00<<MX = . V$r"   c                     [         R                  " SS[         R                  S9n[        R                  R                  SUSSS9nUR                  U 5        g)	z'Adds a resource argument for a project.zeventarc.projectsproject)rD   rG   z	--projectz:Project ID of the Google Cloud project for the {resource}.Tri   N)r   rH   rI   r
   rk   rl   rm   )rn   ro   rp   s      r    AddProjectResourceArgrw      sZ    ''::-
 #00<<B	 = . V$r"   c                 p    [         R                  R                  S[        5       XS9R	                  U 5        g)z1Adds a resource argument for an Eventarc trigger.r'   ri   N)r
   rk   rl   rJ   rm   rn   rs   rj   s      r    AddTriggerResourceArgrz   	  0    ++$& , Kr"   c           
      "   U[         R                  R                  :X  af  [        R                  " [
        R                  " S[        5       SSS9[
        R                  " S[        5       SSS0S	9/S
S/0S9R                  U 5        g[        U SSS9  g)z;Adds trigger and channel arguments to for trigger creation.r'   zThe trigger to create.Tri   z	--channelzoThe channel to use in the trigger. The channel is needed only if trigger is created for a third-party provider.r    flag_name_overridesz--channel.locationztrigger.locationcommand_level_fallthroughsN)r   ReleaseTrackGAr
   rk   r   ResourcePresentationSpecrJ   rN   rm   rz   )rn   release_tracks     r    AddCreateTrigerResourceArgsr     s    d''***!!77#%(	 77#%E%/$4	
" %9;M:N#O%& k&&":TJr"   c                 p    [         R                  R                  S[        5       XS9R	                  U 5        g)z1Adds a resource argument for an Eventarc channel.r-   ri   N)r
   rk   rl   rN   rm   ry   s      r    AddChannelResourceArgr   +  r{   r"   c                 r    [         R                  R                  S[        5       USS9R	                  U 5        g)z<Adds a resource argument for an Eventarc channel connection.channel_connectionTri   N)r
   rk   rl   rQ   rm   )rn   rs   s     r    AddChannelConnectionResourceArgr   2  s6    ++#%	 , 
 Kr"   c                 p    [         R                  R                  S[        5       XS9R	                  U 5        g)z2Adds a resource argument for an Eventarc provider.r2   ri   N)r
   rk   rl   rT   rm   ry   s      r    AddProviderResourceArgr   <  s0    ++&(/ , Kr"   c                 r    [         R                  R                  S[        5       UUS9R	                  U 5        g)z4Adds a resource argument for an Eventarc MessageBus.message_busri   N)r
   rk   rl   rX   rm   ry   s      r    AddMessageBusResourceArgr   C  s6    ++	 , 
 Kr"   c                 r    [         R                  R                  S[        5       UUS9R	                  U 5        g)z9Adds a resource argument for an Eventarc GoogleApiSource.google_api_sourceri   N)r
   rk   rl   r[   rm   ry   s      r    AddGoogleApiSourceResourceArgr   M  s6    ++!#	 , 
 Kr"   c                     [        U SSS9  g)zAAdds resource arguments for creating an Eventarc GoogleApiSource.z The Google API source to create.Tgoogle_api_source_help_textdestination_requiredN_AddGoogleApiSourceResourceArgsrn   s    r    $AddCreateGoogleApiSourceResourceArgsr   W  s    !"Dr"   c                     [        U SSS9  g)zAAdds resource arguments for updating an Eventarc GoogleApiSource.z The Google API source to update.Fr   Nr   r   s    r    $AddUpdateGoogleApiSourceResourceArgsr   `  s    !"D r"   c                     [         R                  " [        R                  " S[	        5       USS9[        R                  " S[        5       SUSSS.S	9/S
S/0S9R                  U 5        g )Nr   Tri   z--destination-message-busz5The destination message bus of the Google API source.r}   z!--destination-message-bus-projectr   rv   rj   r   z"--destination-message-bus.locationzgoogle_api_source.locationr   )r
   rk   r   r   r[   rX   rm   )rn   r   r   s      r    r   r   i  sz     

5
5!)+)	 
5
5)$&E+ @#	& /1M0N"', Kr"   c                 r    [         R                  R                  S[        5       UUS9R	                  U 5        g)4Adds a resource argument for an Eventarc Enrollment.r<   ri   N)r
   rk   rl   r^   rm   ry   s      r    AddEnrollmentResourceArgr     s6    ++	 , 
 Kr"   c                 4   U R                  SS9n[        R                  " [        R                  " S[        5       SSS9[        R                  " S[        5       SSSSS	.S
9[        R                  " S[        SS9SUSS0S9/S/S/S.S9R                  U 5        g)r   Tri   r<   zThe enrollment to create.--message-busz1The message bus to which the enrollment attaches.r}   --message-bus-projectr   r   --destination-pipelinezdestination pipelinerb   +The destination pipeline of the enrollment.r   groupr   enrollment.location)--message-bus.location--destination-pipeline.locationr   N)	add_mutually_exclusive_groupr
   rk   r   r   r^   rX   rc   rm   rn   destination_groups     r    AddCreateEnrollmentResourceArgsr     s    9949H

5
5$&)	 
5
5$&A 4#	 
5
5&"1GH;%#-r"2#8 &;$;.C-D"9 @ Kr"   c                     U R                  5       n[        R                  " [        R                  " S[        5       SSS9[        R                  " S[        5       SUSS0S	9/S
S/0S9R                  U 5        g)z<Adds resource arguments for updating an Eventarc Enrollment.r<   zThe enrollment to update.Tri   r   r   r   r}   r   r   r   r   N)r   r
   rk   r   r   r^   rc   rm   r   s     r    AddUpdateEnrollmentResourceArgsr     s    99;

5
5$&)	 
5
5&"$;%#-r"2$ ,.C-D"%* Kr"   c                 r    [         R                  R                  S[        5       UUS9R	                  U 5        g)z2Adds a resource argument for an Eventarc pipeline.r?   ri   N)r
   rk   rl   rc   rm   ry   s      r    AddPipelineResourceArgr     s6    ++	 , 
 Kr"   c                 r    [         R                  R                  S[        5       UUS9R	                  U 5        g)z6Adds a resource argument for an Eventarc Kafka source.kafka_sourceri   N)r
   rk   rl   rf   rm   ry   s      r    AddKafkaSourceResourceArgr     s6    ++	 , 
 Kr"   c                 &    U R                  SSSS9  g)z/Adds an argument for an Eventarc provider name.z--nameFzA provider name (e.g. `storage.googleapis.com`) List results will be filtered on this provider. Only exact match of the provider name is supported.rj   helpNadd_argumentr   s    r    AddProviderNameArgr     s     	  r"   c                 h   [         R                  " [        R                  " S[	        5       SSS9[        R                  " S[        5       SSSSS	S
.S9/SS/0S9R                  U 5        U R                  SS9nUR                  5       n[        U5        UR                  SSS9  UR                  SSS9  g)z9Adds arguments for publishing to an Eventarc message bus.r   zMessage bus to publish to.Tri   z--destination-enrollmentz<The only Enrollment that the message should be delivered to.Fr}   z --destination-enrollment-projectr   rj   hiddenr   z!--destination-enrollment.locationzmessage_bus.locationr   z--json-messagez-A JSON message to publish to the message bus.r   z--avro-messagez.An Avro message to publish to the message bus.N)r
   rk   r   r   rX   r^   rm   r   	add_groupAddEventPublishingArgsr   )rn   payload_groupprotobuf_payload_groups      r    AddMessageBusPublishingArgsr     s    

5
5$&*	 
5
5($&L ?#
, .0F/G"-2 K55t5D-(224/0:   ;  r"   c                     U R                  SSSS9  U R                  SSSS9  U R                  SSSS9  U R                  S	SS
S9  U R                  S[        R                  [        R                  " 5       SSS9  g)zBAdds arguments for publishing a Cloud Event to Eventarc resources.z
--event-idTz)An event id. The id of a published event.r   z--event-typez3An event type. The event type of a published event.z--event-sourcez7An event source. The event source of a published event.z--event-dataz3An event data. The event data of a published event.z--event-attributesATTRIBUTE=VALUEzmEvent attributes. The event attributes of a published event.This flag can be repeated to add more attributes.)actiontypemetavarr   N)r   r   UpdateActionArgDictr   s    r    r   r     s    6   	@   	D   	@   	%% >  	r"   c                 &    U R                  SUSS9  g)z3Adds an argument for the trigger's service account.z--service-accountz:The IAM service account email associated with the trigger.r   Nr   rn   rj   s     r    AddServiceAccountArgr   @  s    G  r"   c           	          U[         R                  R                  :X  a  SnSnOSnSnU R                  U[        R
                  [        R                  " 5       UUSS9  g)z1Adds an argument for the trigger's event filters.z--event-filtersa@  The trigger's list of filters that apply to CloudEvents attributes. This flag can be repeated to add more filters to the list. Only events that match all these filters will be sent to the destination. The filters must include the ``type'' attribute, as well as any other attributes that are expected for the chosen type.z--matching-criteriaa  The criteria by which events are filtered for the trigger, specified as a comma-separated list of CloudEvents attribute names and values. This flag can also be repeated to add more criteria to the list. Only events that match with this criteria will be sent to the destination. The criteria must include the ``type'' attribute, as well as any other attributes that are expected for the chosen type.r   )r   r   rj   r   r   Nr   r   r   r   r   r   r   )rn   r   rj   flagr   s        r    AddEventFiltersArgr   I  sm    d''***D	<  !D	B  	
%%   r"   c           
          U[         R                  R                  :X  a7  U R                  S[        R
                  [        R                  " 5       UUSSS9  gg)zHAdds an argument for the trigger's event filters in path pattern format.z--event-filters-path-patternaJ  The trigger's list of filters in path pattern format that apply to CloudEvent attributes. This flag can be repeated to add more filters to the list. Only events that match all these filters will be sent to the destination. Currently, path pattern format is only available for the resourceName attribute for Cloud Audit Log events.zATTRIBUTE=PATH_PATTERN)r   r   r   rj   r   r   Nr   rn   r   rj   r   s       r    AddEventFiltersPathPatternArgr   h  sX     d''***
&''  " )   +r"   c                 f    U[         R                  R                  :X  a  U R                  SUUSS9  gg)z;Adds an argument for the trigger's event data content type.z--event-data-content-typea  Depending on the event provider, you can specify the encoding of the event data payload that will be delivered to your destination, to either be encoded in ``application/json'' or ``application/protobuf''. The default encoding is ``application/json''. Note that for custom sources or third-party providers, or for direct events from Cloud Pub/Sub, this formatting option is not supported.)r   rj   r   N)r   r   r   r   r   s       r    AddEventDataContentTypeArgr     s>     d''***
#   +r"   c                 n    U[         R                  R                  :X  a  U R                  $ U R                  $ )z*Gets the event filters from the arguments.)r   r   r   event_filtersmatching_criteriaargsr   s     r    GetEventFiltersArgr     s.    d''***!!!r"   c                 X    U[         R                  R                  :X  a  U R                  $ g)z<Gets the event filters with path pattern from the arguments.N)r   r   r   event_filters_path_patternr   s     r    GetEventFiltersPathPatternArgr     s%    d''******	r"   c                 X    U[         R                  R                  :X  a  U R                  $ g)z4Gets the event data content type from the arguments.N)r   r   r   event_data_content_typer   s     r    GetEventDataContentTypeArgr     s%    d''***'''	r"   c                     U[         R                  R                  :X  a$  U R                  R                  R                  5       $ g)z$Gets the channel from the arguments.N)r   r   r   CONCEPTSr-   Parser   s     r    GetChannelArgr     s2    d''***==  &&((	r"   c                     U R                  USS9n[        X15        U[        R                  R                  :X  a,  [        U5        [        U5        [        USS9  [        U5        gg)zFAdds arguments related to trigger's destination for create operations.zDFlags for specifying the destination to which events should be sent.r   Tr   N)	r   !_AddCreateCloudRunDestinationArgsr   r   r   _AddCreateGKEDestinationArgs!_AddCreateWorkflowDestinationArgs!_AddCreateFunctionDestinationArgs%_AddCreateHTTPEndpointDestinationArgsrn   r   rj   
dest_groups       r    AddCreateDestinationArgsr     sb    22
P 3 * $J>d''*** ,%j1%j>)*5	 +r"   c                     U R                  USS9nUR                  SS9n[        U5        U[        R                  R
                  :X  a  [        U5        [        U5        [        U5        g)zgAdds arguments related to trigger's Cloud Run fully-managed resource destination for create operations.zDFlags for specifying a Cloud Run fully-managed resource destination.r   Tri   N)	r   r   AddDestinationRunServiceArgr   r   r   AddDestinationRunJobArgAddDestinationRunPathArgAddDestinationRunRegionArg)rn   r   rj   	run_groupresource_groups        r    r   r     sh    
P  ) 9949H.n- d''***N+9%Y'r"   c                     U R                  UUSS9n[        USS9  [        U5        [        U5        [	        USS9  [        U5        g)zRAdds arguments related to trigger's GKE service destination for create operations.z/Flags for specifying a GKE service destination.rj   r   r   Tri   N)r   _AddDestinationGKEClusterArg_AddDestinationGKELocationArg_AddDestinationGKENamespaceArg_AddDestinationGKEServiceArg_AddDestinationGKEPathArg)rn   rj   r   	gke_groups       r    r   r     sN    <  )
 y48	* +y48I&r"   c                 P    U R                  UUSS9n[        USS9  [        U5        g)zPAdds arguments related to trigger's Workflows destination for create operations.z3Flags for specifying a Cloud Workflows destination.r   Tri   Nr   _AddDestinationWorkflowArg"_AddDestinationWorkflowLocationArgrn   rj   r   workflow_groups       r    r   r     s4    ##@ $ .
 ^d;$^4r"   c                 P    U R                  UUSS9n[        USS9  [        U5        g)zTAdds arguments related to trigger's HTTP Endpoint destination for create operations.z1Flags for specifying a HTTP Endpoint destination.r   Tri   N)r   !_AddDestinationHTTPEndpointUriArg&_AddCreateNetworkConfigDestinationArgs)rn   rj   r   http_endpoint_groups       r    r   r     s7    ((> ) 
 $$7$G()<=r"   c                 :    U R                  UUSS9n[        USS9  g)zUAdds arguments related to trigger's Network Config destination for create operations.z:Flags for specifying a Network Config for the destination.r   Tri   N)r   _AddNetworkAttachmentArg)rn   rj   r   network_config_groups       r    r  r    s0      ))G * 
 /$?r"   c                 P    U R                  UUSS9n[        USS9  [        U5        g)zNAdds arguments related to trigger's Function destination for create operation.z,Flags for specifying a Function destination.r   Tri   Nr   _AddDestinationFunctionArg"_AddDestinationFunctionLocationArgrn   rj   r   function_groups       r    r   r     s4    ##9 $ .
 ^d;$^4r"   c                     U R                  USS9n[        X15        U[        R                  R                  :X  a!  [        U5        [        U5        [        USS9  gg)zFAdds arguments related to trigger's destination for update operations.zBFlags for updating the destination to which events should be sent.r   Tr   N)r   !_AddUpdateCloudRunDestinationArgsr   r   r   _AddUpdateGKEDestinationArgs!_AddUpdateWorkflowDestinationArgs!_AddUpdateFunctionDestinationArgsr   s       r    AddUpdateDestinationArgsr    sZ    22O 3 * $J>d''*** ,%j1%j> +r"   c                    U R                  USS9nUR                  5       n[        U5        U[        R                  R
                  :X  a  [        U5        [        U5        UR                  5       n[        U5        [        U5        g)zgAdds arguments related to trigger's Cloud Run fully-managed resource destination for update operations.zBFlags for updating a Cloud Run fully-managed resource destination.r   N)
r   r   r   r   r   r   r   r   r   AddClearDestinationRunPathArg)rn   r   rj   r   r   destination_run_path_groups         r    r  r    s|    O  ) 99;.n- d''***N+Y'(EEG56 :;r"   c                     U R                  UUSS9n[        U5        [        U5        UR                  5       n[	        U5        [        U5        g)zRAdds arguments related to trigger's GKE service destination for update operations.z-Flags for updating a GKE service destination.r   N)r   r   r  r   r  _AddClearDestinationGKEPathArg)rn   rj   r   r  destination_gke_path_groups        r    r  r  .  sS    :  )
 !+y)(EEG67 !;<r"   c                 R    U R                  UUSS9n[        U5        [        U5        g)zOAdds arguments related to trigger's Workflow destination for update operations.z1Flags for updating a Cloud Workflows destination.r   Nr  r  s       r    r  r  <  s2    ##> $ .
 ^,$^4r"   c                 R    U R                  UUSS9n[        U5        [        U5        g)zOAdds arguments related to trigger's Function destination for update operations.z*Flags for updating a Function destination.r   Nr  r  s       r    r  r  G  s2    ##7 $ .
 ^,$^4r"   c                 $    U R                  SSS9  g)zAAdds an argument for the trigger's destination Cloud Run service.z--destination-run-servicezName of the Cloud Run fully-managed service that receives the events for the trigger. The service must be in the same project as the trigger.r   Nr   r   s    r    r   r   R  s    !  r"   c                 &    U R                  SSSS9  g)z=Adds an argument for the trigger's destination Cloud Run job.z--destination-run-jobTzName of the Cloud Run fully-managed job that receives the events for the trigger. The job must be in the same project as the trigger.)r   r   Nr   r   s    r    r   r   ^  s     	  r"   c                 &    U R                  SUSS9  g)zMAdds an argument for the trigger's destination path on the Cloud Run service.z--destination-run-pathzRelative path on the destination Cloud Run service to which the events for the trigger should be sent. Examples: ``/route'', ``route'', ``route/subroute''.r   Nr   r   s     r    r   r   k       +	  r"   c                 &    U R                  SUSS9  g)zJAdds an argument for the trigger's destination Cloud Run service's region.z--destination-run-regionzRegion in which the destination Cloud Run service can be found. If not specified, it is assumed that the service is in the same region as the trigger.r   Nr   r   s     r    r   r   x  s      	  r"   c                 &    U R                  SUSS9  g)zEAdds an argument for the trigger's destination GKE service's cluster.z--destination-gke-clusterzName of the GKE cluster that the destination GKE service is running in.  The cluster must be in the same project as the trigger.r   Nr   r   s     r    r   r     s!    !Q	  r"   c                 &    U R                  SUSS9  g)zFAdds an argument for the trigger's destination GKE service's location.z--destination-gke-locationzLocation of the GKE cluster that the destination GKE service is running in. If not specified, it is assumed that the cluster is a regional cluster and is in the same region as the trigger.r   Nr   r   s     r    r   r     s!    "H	  r"   c                 &    U R                  SUSS9  g)zGAdds an argument for the trigger's destination GKE service's namespace.z--destination-gke-namespaceznNamespace that the destination GKE service is running in. If not specified, the ``default'' namespace is used.r   Nr   r   s     r    r   r     s     #>	  r"   c                 &    U R                  SUSS9  g)BAdds an argument for the trigger's destination GKE service's name.z--destination-gke-servicezMName of the destination GKE service that receives the events for the trigger.r   Nr   r   s     r    r  r    s     !	  r"   c                 &    U R                  SUSS9  g)r.  z--destination-gke-pathzRelative path on the destination GKE service to which the events for the trigger should be sent. Examples: ``/route'', ``route'', ``route/subroute''.r   Nr   r   s     r    r  r    r(  r"   c                 &    U R                  SUSS9  g)z8Adds an argument for the trigger's destination Workflow.z--destination-workflowzuID of the workflow that receives the events for the trigger. The workflow must be in the same project as the trigger.r   Nr   r   s     r    r  r    !    E	  r"   c                 &    U R                  SUSS9  g)zAAdds an argument for the trigger's destination Workflow location.z--destination-workflow-locationzLocation that the destination workflow is running in. If not specified, it is assumed that the workflow is in the same location as the trigger.r   Nr   r   s     r    r  r         '%	  r"   c                 &    U R                  SUSS9  g)z8Adds an argument for the trigger's destination Function.z--destination-functionzuID of the Function that receives the events for the trigger. The Function must be in the same project as the trigger.r   Nr   r   s     r    r  r    r1  r"   c                 &    U R                  SUSS9  g)zAAdds an argument for the trigger's destination Function location.z--destination-function-locationzLocation that the destination Function is running in. If not specified, it is assumed that the Function is in the same location as the trigger.r   Nr   r   s     r    r  r    r3  r"   c                 &    U R                  SUSS9  g)zAAdds an argument for the trigger's HTTP endpoint destination URI.z--destination-http-endpoint-uriz8URI that the destination HTTP Endpoint is connecting to.r   Nr   r   s     r    r  r    s    'E  r"   c                 &    U R                  SUSS9  g)z?Adds an argument for the trigger's destination service account.--network-attachmentz]The network attachment associated with the trigger that allows access to the destination VPC.r   Nr   r   s     r    r  r    s     ,	  r"   c                 &    U R                  SSSS9  g )Nz--clear-service-account
store_truez:Clear the IAM service account associated with the trigger.r   r   r   r   s    r    AddClearServiceAccountArgr<  
  s    G  r"   c                 &    U R                  SSSS9  g)zGAdds an argument for clearing the trigger's Cloud Run destination path.z--clear-destination-run-pathr:  zpClear the relative path on the destination Cloud Run service to which the events for the trigger should be sent.r;  Nr   r   s    r    r  r    s     $=	  r"   c                 &    U R                  SSSS9  g)zAAdds an argument for clearing the trigger's GKE destination path.z--clear-destination-gke-pathr:  zjClear the relative path on the destination GKE service to which the events for the trigger should be sent.r;  Nr   r   s    r    r!  r!    s     $7	  r"   c                 $    U R                  SUS9  g)z.Adds a positional argument for the event type.r   r   Nr   rn   r   s     r    AddTypePositionalArgrA  *  s    f9-r"   c                 &    U R                  SUSS9  g)z$Adds an argument for the event type.z--typezThe event type.r   Nr   r   s     r    
AddTypeArgrC  /  s    h8IJr"   c                 &    U R                  SUSS9  g)zHAdds an argument for the value of the serviceName CloudEvents attribute.z--service-namez3The value of the serviceName CloudEvents attribute.r   Nr   r   s     r    AddServiceNameArgrE  4  s    @  r"   c           
          [         R                  " [        R                  " S[	        5       SSS9[        R                  " S[        5       SSS0S	9/S
S/0S9R                  U 5        g )Nr-   zChannel to create.Tri   z
--providerz Provider to use for the channel.r   r}   r~   z--provider.locationzchannel.locationr   )r
   rk   r   r   rN   rT   rm   r   s    r    AddCreateChannelArgrG  =  sp    

5
5!#"	 
5
5"$0#-r"2	  #8:L9M!N#$ Kr"   c                 p    U nU(       a  U R                  US9n[        XAU5        UR                  SUUSS9  g)2Adds an argument for the crypto key used for CMEK.r   z--crypto-keyzFully qualified name of the crypto key to use for customer-managed encryption. If this is unspecified, Google-managed keys will be used for encryption.r   N)r   AddClearCryptoNameArgr   )rn   rj   r   
with_clearpolicy_groups        r    AddCryptoKeyArgrM  S  sH    ,66f6EL,&9.  	r"   c           	      ,    U R                  SUUSSSS9  g)rI  z--clear-crypto-keyFr:  zqRemove the previously configured crypto key. The channel will continue to be encrypted using Google-managed keys.)rj   r   defaultr   r   Nr   )rn   rj   r   s      r    rJ  rJ  e  s*    A  
r"   c                 &    U R                  SUSS9  g)z.Adds an argument for the cel match expression.z--cel-matchz,The cel match expression for the enrollment.r   Nr   r   s     r    AddCelMatchArgrQ  t  s    9  r"   c                 ,    U R                  S/ SQSUS9  g)z8Adds an argument for the logging config of the resource.z--logging-config)	NONEDEBUGINFONOTICEWARNINGERRORCRITICALALERT	EMERGENCYF)choicesrj   r   Nr   r@  s     r    AddLoggingConfigArgr]  }  s%    
   r"   c                     U R                  SS9nUR                  S[        R                  " S[        S9SSSS9  UR                  S	[        R
                  SS
S9  U(       a  UR                  SSSSS9  gg)zAAdds an argument for the wide scope subscription of the resource.Fri   z--project-subscriptions   
min_lengthelement_typeGAS_PROJECT_SUBSCRIPTIONz+The project subscriptions for the resource.)r   r   rj   r   z--organization-subscriptionz/The organization subscription for the resource.)r   rj   r   z--clear-project-subscriptionsr:  z1Clear the project subscriptions for the resource.N)r   r   r   ArgListstrStoreTrueFalseAction)rn   rK  r   s      r    AddWideScopeSubscriptionArgrg    s    

-
-u
-
=%!#>(8   #--<	   	'@	   r"   c                 ,   SnU R                  S[        R                  " [        R                  " [        [        [        [        [        [        [        [        [        [        [        [        S[        [        S.SSS9SSS	9[        R
                  UUS
S9  g)z>Adds an argument for the pipeline's HTTP endpoint destination.a/  
The pipeline's destinations. This flag can be repeated to add more destinations
to the list. Currently, only one destination is supported per pipeline. A
destination is specified in a dict format. For more
information, see
[Create an enrollment to receive events](https://cloud.google.com/eventarc/advanced/docs/receive-events/create-enrollment).

Note: Exactly one of the `http_endpoint_uri`,
`workflow`, `message_bus`, or `pubsub_topic` keys must be set.

Valid keys are:

*http_endpoint_uri*::: The URI of the HTTP endpoint. The value must be a RFC2396
URI string. Only HTTPS protocol is supported. The host can be either a static IP
addressable from the VPC specified by the network config, or an internal DNS
hostname of the service resolvable via Cloud DNS. For example:

    $ gcloud eventarc pipelines create example-pipeline --destinations=http_endpoint_uri='https://example.com'

*http_endpoint_message_binding_template*::: The CEL expression used to construct
a new HTTP request to be sent to the final destination. It can be optionally
specified alongside with `http_endpoint_uri`. It represents a configuration used
to bind a message to the final HTTP request that will be sent to the destination.
If a binding is not specified, by default the message is treated as a CloudEvent
and is mapped to the HTTP request according to the CloudEvent HTTP Protocol
Binding Binary Content Mode. The pipeline converts the data field of the message
to the format provided in `output_payload_format` and maps it to the body field
of the result. It also sets the corresponding Content-Type header to the
`output_payload_format` type. If the `output_payload_format` is unspecified,
then the pipeline will treat the data field of the message as opaque binary data
and attach it to the request body as bytes. In this case, the Content-Type
header will be set to the value of the datacontenttype attribute set on the
incoming CloudEvent message if present, or the `application/octet-stream` MIME
type otherwise. The pipeline expects that the content of the message will adhere
to the standard CloudEvent format. If not then the outgoing message request may
fail with a persistent error.

Note: When `http_endpoint_uri` is not set,
`http_endpoint_message_binding_template` can't be set.

The result of the CEL expression must be a map of key-value pairs such that:

1. If a map named `headers` exists on the result of the expression, then its
key-value pairs are directly mapped to the HTTP request headers. The headers
values are constructed from the corresponding value type's canonical
representation. If the `headers` field does not exist, then the resulting HTTP
request will not contain headers.

2. If a field named `body` exists on the result of the expression, then its
value is directly mapped to the body of the request. If the value of the `body`
field is of type bytes or string, then it is used as the HTTP request body
as-is withouth any conversion. If the `body` field is of any other type, then
it is converted to a JSON string. If the `body` field does not exist, then the
resulting HTTP request will not contain a body.

3. Any other fields in the resulting expression will be ignored.

The CEL expression may access the incoming CloudEvent message in its definition,
as follows:

1. The `data` field of the incoming CloudEvent message can be accessed using
the `message.data` value.

2. Each attribute of the incoming CloudEvent message can be accessed using the
`message.<key>` value, where <key> is the name of the attribute.

Headers added to the request by previous filters in the chain can be accessed in
the CEL expression using the `headers` variable. The `headers` variable defines
a map of key-value pairs corresponding to the HTTP headers added by previous
mediation steps and not the headers present on the original incoming request.
For example, the following CEL expression can be used to construct a
headers-only HTTP request by adding an additional header to the headers added by
previous mediations in the pipeline:

  ```
  {"headers": headers.merge({"new-header-key": "new-header-value"})}
  ```

Additionally, the following CEL extension functions can be used in this CEL
expression:

* `toBase64Url`: map.toBase64Url() -> string
  - Converts a CelValue to a base64url encoded string.

* `toJsonString`: map.toJsonString() -> string
  - Converts a CelValue to a JSON string.

* `merge`: map1.merge(map2) -> map3
  - Merges the passed CEL map with the existing CEL map the function is
    applied to. If the same key exists in both maps, or if the key's value is
    type map, then both maps are merged; Otherwise, the value from the passed
    map is used.

* `toMap`: list(map).toMap() -> map
  - Converts a CEL list of CEL maps to a single CEL map.

* `toDestinationPayloadFormat`: message.data.toDestinationPayloadFormat() -> string or bytes
  - Converts the message data to the destination payload format specified in
    `output_payload_format`. This function is meant to be applied to the
    message.data field. If the destination payload format is not set, the
    function will return the message data unchanged.

* `toCloudEventJsonWithPayloadFormat`: message.toCloudEventJsonWithPayloadFormat() -> map
  - Converts a message to the corresponding structure of JSON format for
    CloudEvents. This function applies toDestinationPayloadFormat() to the
    message data. It also sets the corresponding datacontenttype of the
    CloudEvent, as indicated by the `output_payload_format` field. If
    `output_payload_format` is not set, it will use the existing
    datacontenttype on the CloudEvent if present; Otherwise, it leaves the
    datacontenttype unset. This function expects that the content of the
    message will adhere to the standard CloudEvent format. If it doesn't then
    this function will fail. The result is a CEL map that corresponds to the
    JSON representation of the CloudEvent. To convert that data to a JSON
    string it can be chained with the toJsonString() function.

For example:

      $ gcloud eventarc pipelines create example-pipeline --destinations=http_endpoint_uri='https://example.com',http_endpoint_message_binding_template='{"headers": headers.merge({"new-header-key": "new-header-value"}),"body": "new-body"}'

*workflow*::: The destination Workflow ID. For example:

    $ gcloud eventarc pipelines create example-pipeline --destinations=workflow=my-workflow

*message_bus*::: The destination Message Bus ID. For example:

    $ gcloud eventarc pipelines create example-pipeline --destinations=message_bus=my-message-bus

*pubsub_topic*::: The destination Pub/Sub topic ID. For example:

    $ gcloud eventarc pipelines create example-pipeline --destinations=pubsub_topic=my-topic

*project*::: The project ID of the destination resource. If `project` is not set,
then the project ID of the pipeline is used. For example:

    $ gcloud eventarc pipelines create example-pipeline --destinations=project=example-project,workflow=my-workflow

Note: When `http_endpoint_uri` is set, `project` can't be set.

*location*::: The location of the destination resource. If `location` is not set,
then the location of the pipeline is used. For example:

    $ gcloud eventarc pipelines create example-pipeline --destinations=location=us-east1,workflow=my-workflow

Note: When `http_endpoint_uri` is set, `location` can't be set.

*network_attachment*::: The ID of the network attachment that allows access to
the consumer VPC. For example:

    $ gcloud eventarc pipelines create example-pipeline --destinations=network_attachment=my-network-attachment,http_endpoint_uri='https://example.com'

Note: `network_attachment` can only be set when `http_endpoint_uri` is set as well.

*google_oidc_authentication_service_account*::: The service account email used
to generate the OIDC token. The token can be used to invoke Cloud Run and Cloud
Run functions destinations or HTTP endpoints that support Google OIDC. Note that
the principal who calls this API must have `iam.serviceAccounts.actAs`
permission on the service account. For more information, see
[Service accounts overview](https://cloud.google.com/iam/docs/understanding-service-accounts).
For example:

    $ gcloud eventarc pipelines create example-pipeline --destinations=http_endpoint_uri='https://example.com',google_oidc_authentication_service_account=example-service-account@example-project.gserviceaccount.iam.com

*google_oidc_authentication_audience*::: The audience claim which identifies the
recipient that the JWT is intended for. If unspecified, the destination URI will
be used. For example:

    $ gcloud eventarc pipelines create example-pipeline --destinations=http_endpoint_uri='https://example.com',google_oidc_authentication_service_account=example-service-account@example-project.gserviceaccount.iam.com,google_oidc_authentication_audience='https://example.com'

Note: `google_oidc_authentication_audience` can only be set if
`google_oidc_authentication_service_account` is set.

*oauth_token_authentication_service_account*::: The service account email used
to generate the OAuth token. OAuth authorization should generally only be used
when calling Google APIs hosted on *.googleapis.com. Note that the principal who
calls this API must have iam.serviceAccounts.actAs permission in the service
account. For more information, see
[Service accounts overview](https://cloud.google.com/iam/docs/understanding-service-accounts).
For example:

    $ gcloud eventarc pipelines create example-pipeline --destinations=http_endpoint_uri='https://example.com',oauth_token_authentication_service_account=example-service-account@example-project.gserviceaccount.iam.com

*oauth_token_authentication_scope*::: The scope used to generate the OAuth token.
  If unspecified, "https://www.googleapis.com/auth/cloud-platform" will be used.
  For example:

    $ gcloud eventarc pipelines create example-pipeline --destinations=http_endpoint_uri='https://example.com',oauth_token_authentication_service_account=example-service-account@example-project.gserviceaccount.iam.com,oauth_token_authentication_scope=https://www.googleapis.com/auth/cloud-platform

Note: At most one of `google_oidc_authentication_service_account` or
`oauth_token_authentication_service_account` can be set; and
`oauth_token_authentication_scope` can only be set if
`oauth_token_authentication_service_account` is set.

*output_payload_format_json*::: Indicates that the output payload format is JSON.
For example:

    $ gcloud eventarc pipelines create example-pipeline --destinations=http_endpoint_uri='https://example.com',output_payload_format_json= --input-payload-format-json=

Note: JSON schemas are not supported. Any value specified by this key is ignored.

*output_payload_format_avro_schema_definition*::: The schema definition of the
Avro output payload format. For example:

    $ gcloud eventarc pipelines create example-pipeline --destinations=http_endpoint_uri='https://example.com',output_payload_format_avro_schema_definition='{"type": "record", "name": "my_record", "fields": [{"name": "field1", "type": "string"}]}' --input-payload-format-avro-schema-definition='{"type": "record", "name": "my_record", "fields": [{"name": "field1", "type": "string"}]}'

*output_payload_format_protobuf_schema_definition*::: The schema definition of
the Protobuf output payload format. For example:

    $ gcloud eventarc pipelines create example-pipeline --destinations=http_endpoint_uri='https://example.com',output_payload_format_protobuf_schema_definition='syntax = "proto3"; message Location { string home_address = 1; }' --input-payload-format-protobuf-schema-definition='syntax = "proto3"; message Location { string home_address = 1; }'

Note: If none of the `input_payload_format_json`,
`input_payload_format_avro_schema_definition`, or
`input_payload_format_protobuf_schema_definition` is set, then the message data
is treated as an opaque binary and no output format can be set on the pipeline
through the `output_payload_format_json`,
`output_payload_format_avro_schema_definition`, or
`output_payload_format_protobuf_schema_definition` field. Any mediations on the
pipeline that involve access to the data field will fail as persistent errors.
  z--destinationsN)http_endpoint_uri&http_endpoint_message_binding_templateworkflowr   pubsub_topicrv   r   network_attachment*google_oidc_authentication_service_account#google_oidc_authentication_audience*oauth_token_authentication_service_account oauth_token_authentication_scopeoutput_payload_format_json,output_payload_format_avro_schema_definition0output_payload_format_protobuf_schema_definitionT)specallow_key_onlyincludes_jsonr_  #)rb  ra  custom_delim_chara5  [http_endpoint_uri=URI],[http_endpoint_message_binding_template=HTTP_ENDPOINT_MESSAGE_BINDING_TEMPLATE],[workflow=WORKFLOW],[message_bus=MESSAGE_BUS],[pubsub_topic=PUBSUB_TOPIC],[project=PROJECT],[location=LOCATION],[network_attachment=NETWORK_ATTACHMENT],[google_oidc_authentication_service_account=GOOGLE_OIDC_AUTHENTICATION_SERVICE_ACCOUNT],[google_oidc_authentication_audience=GOOGLE_OIDC_AUTHENTICATION_AUDIENCE],[oauth_token_authentication_service_account=OAUTH_TOKEN_AUTHENTICATION_SERVICE_ACCOUNT],[oauth_token_authentication_scope=OAUTH_TOKEN_AUTHENTICATION_SCOPE],[output_payload_format_json=OUTPUT_PAYLOAD_FORMAT_JSON],[output_payload_format_avro_schema_definition=OUTPUT_PAYLOAD_FORMAT_AVRO_SCHEMA_DEFINITION],[output_payload_format_protobuf_schema_definition=OUTPUT_PAYLOAD_FORMAT_PROTOBUF_SCHEMA_DEFINITION])r   r   rj   r   r   )r   r   rd  r   re  r   rn   rj   r   s      r    AddPipelineDestinationsArgr{    s    Y)t 	"**'*<?!!$"% !(+@C9<@C6904BEFI" " '* /2 %% F=  r"   c           
          SnU R                  S[        R                  " [        R                  " S[        0SS9SS9USS	9  g
)z/Adds an argument for the pipeline's mediations.a  
The different ways to modify the pipeline.
Currently, only one mediation is supported per pipeline.

A mediation is specified in a dict format. Currently, the only valid choice is `transformation_template`.

This is the template to apply to transform messages.

For complex transformations, shell parameter processing may fail to parse the CEL expressions.
Please see `gcloud topic flags-file` for how to use  https://cloud.google.com/sdk/gcloud/reference/topic/flags-file feature of gcloud to pass in CEL expressions.

Examples:

  $ gcloud eventarc pipelines create example-pipeline --mediations=transformation_template='message.removeFields(["data.credit_card_number","data.ssn"])'
  z--mediationstransformation_templateT)ru  rw  rx  )rb  ry  z/transformation_template=TRANSFORMATION_TEMPLATE)r   r   r   N)r   r   rd  r   re  r@  s     r    AddMediationsArgr~    sY    ) 	"**+S !	   ?  r"   c                     U R                  5       nUR                  SSS9  UR                  SSS9  UR                  SSS9  g)	z7Adds arguments for the pipeline's input payload format.z--input-payload-format-jsonzThe pipeline's input payload format is JSON. If this is set, then any messages not matching this format will be treated as persistent errors.r   z---input-payload-format-avro-schema-definitionzThe pipeline's input payload Avro schema definition. If this is set, then any messages not matching this format will be treated as persistent errors.z1--input-payload-format-protobuf-schema-definitionzThe pipeline's input payload Protobuf schema definition. If this is set, then any messages not matching this format will be treated as persistent errors.N)r   r   )rn   input_payload_format_groups     r    AddInputPayloadFormatArgsr    sf    %BBD))# *  ))5  *  ))9  * r"   c                     U R                  SS9nUR                  S[        SS9  UR                  SSS9  UR                  SS	S9  g
)z/Adds arguments for the pipeline's retry policy.a  
The retry policy configuration for the pipeline.
The pipeline exponentially backs off if the destination is non-responsive or returns a retryable error code.
The backoff starts with a 1 second delay and doubles the delay after each failed attempt. The delay is capped at 60 seconds.
If the max-retry-delay and min-retry-delay are set to the same value, then the duration between retries is constant.
r   z--max-retry-attemptszIThe maximum number of retry attempts. If not set, the default value is 5.)r   r   z--min-retry-delayzGThe minimum retry delay in seconds. If not set, the default value is 1.z--max-retry-delayzHThe maximum retry delay in seconds. If not set, the default value is 60.N)r   r   int)rn   retry_policy_groups     r    AddRetryPolicyArgsr    su    '' .'  !!	 "  !! "  !! " r"   c           	      \    SnU R                  SS[        R                  " S[        S9UUS9  g)z>Adds an argument for the Kafka Source's bootstrap server URIs.a>  
The Kafka bootstrap server URIs, in the format <hostname>:<port>
This flag can be repeated to add more URIs to the list, or comma-separated.
At least one URI must be specified.

Examples:

  $ gcloud eventarc kafka-sources create example-kafka-source --bootstrap-servers='broker-1.private:9092,broker-2.private:9092'
z--bootstrap-serversBOOTSTRAP_SERVERr_  r`  r   r   rj   r   Nr   r   rd  re  rz  s      r    !AddKafkaSourceBootstrapServersArgr  	  s:    ) 	 !#>  r"   c           	      \    SnU R                  SS[        R                  " S[        S9UUS9  g)z.Adds an argument for the Kafka Source's topic.z
  The Kafka topic(s) to subscribe to. At least one topic must be specified.
  Examples:

  $ gcloud eventarc kafka-sources create example-kafka-source --topics='topic1,topic2'
  z--topicsKAFKA_TOPICr_  r`  r  Nr  rz  s      r    AddKafkaSourceTopicArgr    s:    ) 	!#>  r"   c                 4    SnU R                  S[        UUS9  g)z:Adds an argument for the Kafka Source's Consumer Group ID.a=  
  The Kafka consumer group ID. If not specified, a random UUID will be generated.
  This consumer group ID is used by the Kafka cluster to record the current read
  offsets of any topics subscribed.
  Examples:

  $ gcloud eventarc kafka-sources create example-kafka-source --consumer-group-id='my-consumer-group'
  z--consumer-group-idr   rj   r   Nr   re  rz  s      r     AddKafkaSourceConsumerGroupIDArgr  .  s*    ) 		  r"   c                     Sn[         R                  " [        R                  " S[	        5       SSS9[        R                  " S[        5       USSSS	.S
9/SS/0S9R                  U 5        g)z<Adds a resource argument for the Kafka Source's Message Bus.z
  The message bus to which the Kafka source will send events.
  Examples:

  $ gcloud eventarc kafka-sources create example-kafka-source --message-bus=my-message-bus
  r   zThe Kafka source to create.Tri   r   r}   r   r   r   r   zkafka_source.locationr   N)r
   rk   r   r   rf   rX   rm   r@  s     r     AddCreateKafkaSourceResourceArgsr  @  s    ) 

5
5%'+	 
5
5$& 4#	* #%<$="+0 Kr"   c                 :    SnU R                  S[        SS/UUS9  g)z7Adds an argument for the Kafka Source's initial offset.z
  The initial offset for the Kafka Source. If not specified, the default value is 'newest'.
  Examples:
  $ gcloud eventarc kafka-sources create example-kafka-source --initial-offset=oldest
  z--initial-offsetnewestoldestr   r\  rj   r   Nr  rz  s      r    AddKafkaSourceInitialOffsetArgr  c  s2    )
 	"  r"   c                     U R                  USS9nUR                  SSS9n[        USS9  [        USS9  [	        USS9  UR                  SSSS	9n[        USS9  [        USS9  g
)z=Adds an argument group for the Kafka Source's authentication.zLFlags for specifying the authentication method to use with the Kafka broker.r   Fz?Flags for specifying SASL authentication with the Kafka broker.)mutexr   Tri   zEFlags for specifying mutual TLS authentication with the Kafka broker.)r   r  r   N)r   r   _AddKafkaSourceSASLMechanismArg_AddKafkaSourceSASLUsernameArg_AddKafkaSourceSASLPasswordArg&_AddKafkaSourceTLSClientCertificateArg_AddKafkaSourceTLSClientKeyArg)rn   rj   
auth_group
sasl_group	tls_groups        r    AddKafkaSourceAuthGroupr  s  s    22 3 * ##L $ * "*t< d; d;""	 # ) )TB T:r"   c                 :    SnU R                  S[        / SQUUS9  g)z7Adds an argument for the Kafka Source's SASL mechanism.a  
  The SASL mechanism to use for authentication with the Kafka broker.
  This flag cannot be set if --tls-client-certificate is set (using mutual TLS for authentication).
  Examples:
  $ gcloud eventarc kafka-sources create example-kafka-source --sasl-mechanism=plain
  z--sasl-mechanism)PLAINzSCRAM-SHA-256zSCRAM-SHA-512r  Nr  rz  s      r    r  r    s-    ) 	9  r"   c                 4    SnU R                  S[        UUS9  g)z6Adds an argument for the Kafka Source's SASL username.a  
  The SASL username to use for authentication with the Kafka broker.
  This flag is required if --sasl-mechanism is set.
  Examples:
  $ gcloud eventarc kafka-sources create example-kafka-source --sasl-username='projects/123/secrets/my-username/versions/1'
  z--sasl-usernamer  Nr  rz  s      r    r  r    *    ) 		  r"   c                 4    SnU R                  S[        UUS9  g)z6Adds an argument for the Kafka Source's SASL password.a  
  The SASL password to use for authentication with the Kafka broker.
  This flag is required if --sasl-mechanism is set.
  Examples:
  $ gcloud eventarc kafka-sources create example-kafka-source --sasl-password='projects/123/secrets/my-secret/versions/1'
  z--sasl-passwordr  Nr  rz  s      r    r  r    r  r"   c                 4    SnU R                  S[        UUS9  g)zFAdds an argument for the Kafka Source's mutual TLS Client Certificate.a$  
  The mutual TLS Client Certificate to use for authentication with the Kafka broker.
  This option cannot be set if --sasl-mechanism is set.
  Examples:
  $ gcloud eventarc kafka-sources create example-kafka-source --tls-client-certificate='projects/123/secrets/my-certificate/versions/1'
  z--tls-client-certificater  Nr  rz  s      r    r  r    s*    ) 	 	  r"   c                 4    SnU R                  S[        UUS9  g)z>Adds an argument for the Kafka Source's mutual TLS Client Key.a  
  The mutual TLS Client Key to use for authentication with the Kafka broker.
  This option is required if --tls-client-certificate is set.
  Examples:
  $ gcloud eventarc kafka-sources create example-kafka-source --tls-client-key='projects/123/secrets/my-key/versions/1'
  z--tls-client-keyr  Nr  rz  s      r    r  r    s*    ) 		  r"   c                 &    U R                  SUSS9  g)zDAdds an argument for the Kafka sources's ingress network attachment.r8  z^The network attachment associated with the Kafka source that allows access to the ingress VPC.r   Nr   r   s     r    "AddKafkaSourceNetworkAttachmentArgr    s     (	  r"   c                 N    U R                  SU[        R                  " 5       SS9  g)z%Adds arguments for resources' labels.z--labelsz	KEY=VALUE)r   r   r   N)r   r   r   r@  s     r    AddLabelsArgr    s*     	  r"   c                     [         R                  " [        R                  " S[	        5       SSS9[        R                  " S[        5       SSSSS	S
.S9/SS/0S9R                  U 5        g)z:Adds resource arguments for creating an Eventarc Pipeline.r?   zThe pipeline to create.Tri   --error-message-busz&The error message bus of the pipeline.F--error-message-bus-location--error-message-bus-projectr   r   --error-message-bus.locationpipeline.locationr   N)r
   rk   r   r   rc   rX   rm   r   s    r    AddCreatePipelineResourceArgsr    s{    

5
5"$'	 
5
5#$&6<:#
( )+>*?"). Kr"   c                    U R                  SSS9n[        R                  " [        R                  " S[        5       SSS9[        R                  " S[        5       SSSUS	S
S.S9/SS/0S9R                  U 5        UR                  SSSSSS9  g)z:Adds resource arguments for updating an Eventarc Pipeline.FT)rj   r   r?   zThe pipeline to update.ri   r  z0The error message bus of the pipeline to update.r  r  r   )rj   r   r   r   r  r  r   z--clear-error-message-busr:  z,Clear the error message bus of the pipeline.)r   r   rj   r   N)	r   r
   rk   r   r   rc   rX   rm   r   )rn   error_message_bus_groups     r    AddUpdatePipelineResourceArgsr    s    "??T @  

5
5"$'	 
5
5#$&@+<:#* )+>*?"+0 K&&!9 ' r"   )FT)r?   )F)FF)FFT)T)~__doc__
__future__r   r   r   r   googlecloudsdk.callioper   r    googlecloudsdk.calliope.conceptsr   r	   (googlecloudsdk.command_lib.util.conceptsr
   r   googlecloudsdk.corer   _IAM_API_VERSIONr!   r   r*   r.   r0   r3   r6   r8   r:   r=   r@   rB   rJ   rN   rQ   rT   rX   r[   r^   rc   rf   rq   rt   rw   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r  r  r  r  r  r   r   r   r   r   r   r   r  r  r  r  r  r  r  r  r<  r  r!  rA  rC  rE  rG  rM  rJ  rQ  r]  rg  r{  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r%   r"   r    <module>r     s   # &  '  / ( 5 1 D G * 4C
C
N
D
K
G
M
F
D
H
%, @E% % K6 ?D8#L6
&R#L@ 380 38,"6 ($'5> $)	@5
?<$=55	


	
		
	
	
			.
K
,$(8{|B:@("$ F ;8"    	8$r"   