Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions google/pubsub_v1/types/pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,11 @@ class ExpirationPolicy(proto.Message):
class PushConfig(proto.Message):
r"""Configuration for a push delivery endpoint.

This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.

.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

Attributes:
Expand Down Expand Up @@ -998,6 +1003,18 @@ class PushConfig(proto.Message):
every pushed message.

This field is a member of `oneof`_ ``authentication_method``.
pubsub_wrapper (google.pubsub_v1.types.PushConfig.PubsubWrapper):
When set, the payload to the push endpoint is
in the form of the JSON representation of a
PubsubMessage
(https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).

This field is a member of `oneof`_ ``wrapper``.
no_wrapper (google.pubsub_v1.types.PushConfig.NoWrapper):
When set, the payload to the push endpoint is
not wrapped.

This field is a member of `oneof`_ ``wrapper``.
"""

class OidcToken(proto.Message):
Expand Down Expand Up @@ -1033,6 +1050,29 @@ class OidcToken(proto.Message):
number=2,
)

class PubsubWrapper(proto.Message):
r"""The payload to the push endpoint is in the form of the JSON
representation of a PubsubMessage
(https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage).

"""

class NoWrapper(proto.Message):
r"""Sets the ``data`` field as the HTTP body for delivery.

Attributes:
write_metadata (bool):
When true, writes the Pub/Sub message metadata to
``x-goog-pubsub-<KEY>:<VAL>`` headers of the HTTP request.
Writes the Pub/Sub message attributes to ``<KEY>:<VAL>``
headers of the HTTP request.
"""

write_metadata: bool = proto.Field(
proto.BOOL,
number=1,
)

push_endpoint: str = proto.Field(
proto.STRING,
number=1,
Expand All @@ -1048,6 +1088,18 @@ class OidcToken(proto.Message):
oneof="authentication_method",
message=OidcToken,
)
pubsub_wrapper: PubsubWrapper = proto.Field(
proto.MESSAGE,
number=4,
oneof="wrapper",
message=PubsubWrapper,
)
no_wrapper: NoWrapper = proto.Field(
proto.MESSAGE,
number=5,
oneof="wrapper",
message=NoWrapper,
)


class BigQueryConfig(proto.Message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-pubsub",
"version": "2.17.1"
"version": "0.1.0"
},
"snippets": [
{
Expand Down