
                         `    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r
S	rS
 rS rg)z&Utilities for Eventarc Publishing API.    )absolute_import)division)unicode_literalsN)extra_types)timeseventarcpublishingv1c                     [         R                  " [        R                  " U5      5      nUR                   Vs/ s H'  nU R                  UR                  UR                  S9PM)     nnU " US9$ s  snf )zFormat events value list entry into CloudEvent.

Args:
  events_value_list_entry: A EventsValueListEntry object.
  cloud_event: A CloudEvent representation to be passed as the request body.

Returns:
  The CloudEvents v1.0 events to publish.
)keyvalue)additionalProperties)r   JsonProtoDecoderjsondumps
propertiesAdditionalPropertyr   r   )events_value_list_entrycloud_event
proto_jsonobjadditional_propertiess        8lib/googlecloudsdk/api_lib/eventarc/common_publishing.pyTransformEventsForPublishingr      sp     ++DJJ{,CD* &&&# 00SWWCII0N&  
 
!6K	LLs   .A/c           
          SU USUS[         R                  " [         R                  " 5       5      0SS0S.US.nUb#  UR                  5        H  u  pgSU0US   U'   M     U$ )	a  Transform args to a valid cloud event.

Args:
  event_id: The id of a published event.
  event_type: The event type of a published event.
  event_source: The event source of a published event.
  event_data: The event data of a published event.
  event_attributes: The event attributes of a published event. It can be
    repeated to add more attributes.

Returns:
  valid CloudEvent.

z0type.googleapis.com/io.cloudevents.v1.CloudEventz1.0ceTimestampceStringzapplication/json)timedatacontenttype)z@typeidsourcespecVersiontype
attributestextDatar#   )r   FormatDateTimeNowitems)event_id
event_typeevent_source
event_dataevent_attributesr   r   r   s           r   CreateCloudEventr-   4   s    " B &&uyy{3
 , +( !&,,.
(2E':k,$ / 
    )__doc__
__future__r   r   r   r   apitools.base.pyr   googlecloudsdk.core.utilr   API_NAMEAPI_VERSION_1r   r-    r.   r   <module>r6      s3    - &  '  ( *  M*(r.   