You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Make a json-encodable message replicating the GCP Pub/Sub v1 format
59
+
60
+
For more details see: https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage
61
+
62
+
:param Union[dict, list] data: JSON-serialisable data to form the body of the message
63
+
:param Union[dict, None] attributes: Dict of attributes to attach to the message. Contents must be flat, containing only string keys with string values.
64
+
:param Union[str, None] message_id: An optional id for the message.
65
+
:param Union[str, None] ordering_key: A string used to order messages.
66
+
:param Union[datetime, None] publish_time: If sending a message to PubSub, this will be set by the server on receipt so generally should be left as `None`. However, for the purposes of mocking messages for testing, supply a python datetime specifying the publish time of the message, which will be converted to a string timestamp with nanosecond accuracy.
67
+
:return dict: A dict containing a fully composed PubSub message
0 commit comments