
    
                        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$                  5       " S S\	R&                  5      5       5       rg)zCommand to publish channels.    )absolute_import)division)unicode_literals)channel_connections)common_publishing)base)flags)logz{description}aD           To publish an event to your channel connection `my-channel-connection`
        with event id `1234`
        with event type `event-provider.event.v1.eventType`
        with event source `//event-provider/projects/project-id/resource-id`
        with event data `{ "key": "value" }`
        and  event attributes of `attribute1=value`, run:

          $ {command} my-channel-connection --event-id=1234 --event-type=event-provider.event.v1.eventType --event-source="//event-provider/event/source" --event-data='{"key": "value"}' --event-attributes=attribute1=value
        )DESCRIPTIONEXAMPLESc                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)Publish,   z*Publish to an Eventarc channel connection.c                 ^    [         R                  " US5        [         R                  " U5        g )Nz!Channel connection to publish to.)r	   AddChannelConnectionResourceArgAddEventPublishingArgs)clsparsers     3lib/surface/eventarc/channel_connections/publish.pyArgsPublish.Args2   s$    	))&*MO	  (    c           
         [         R                  " 5       nUR                  R                  R	                  5       nUR                  5       n[        R                  " SR                  UR                  U5      5        UR                  U[        R                  " UR                  UR                  UR                  UR                  UR                   5      5        [        R"                  R%                  S5      $ )zRun the Publish command.z6Publishing event with id: {} to channel connection: {}zEvent published successfully)r   ChannelConnectionClientV1CONCEPTSchannel_connectionParseNamer
   debugformatevent_idr   r   CreateCloudEvent
event_typeevent_source
event_dataevent_attributesoutPrint)selfargsclientchannel_connection_refnames        r   RunPublish.Run8   s     !::<F!]]==CCE!&&(DIIFMMt  NN**4==$//+/+<+<doo+/+@+@	BC 77==788r    N)__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpclassmethodr   r.   __static_attributes__r0   r   r   r   r   ,   s#     3 -) )
9r   r   N)r5   
__future__r   r   r   googlecloudsdk.api_lib.eventarcr   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.eventarcr	   googlecloudsdk.corer
   r6   HiddenReleaseTracksReleaseTrackGACommandr   r0   r   r   <module>rD      su    # &  ' ? = ( 5 # 				" D%%(()9dll 9 * 9r   