Skip to content

Commit

Permalink
feat: add push config wrapper fields (#925)
Browse files Browse the repository at this point in the history
* feat: add push config wrapper fields

PiperOrigin-RevId: 534994946

Source-Link: googleapis/googleapis@64ecfeb

Source-Link: googleapis/googleapis-gen@03534b3
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDM1MzRiM2RkNGM5MjZmNzA2NzI5ZDk3OWQ4OTM0NThkYjdlMTc0ZCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed May 25, 2023
1 parent 0854a7d commit 8e803cf
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
52 changes: 52 additions & 0 deletions google/pubsub_v1/types/pubsub.py
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
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-pubsub",
"version": "2.17.1"
"version": "0.1.0"
},
"snippets": [
{
Expand Down

0 comments on commit 8e803cf

Please sign in to comment.