Skip to content

Commit

Permalink
feat: add support for exactly once delivery (#578)
Browse files Browse the repository at this point in the history
* feat: add exactly once delivery flag

PiperOrigin-RevId: 426415626

Source-Link: googleapis/googleapis@1f707ab

Source-Link: googleapis/googleapis-gen@2baebc5
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmJhZWJjNTc5ZWQ0MmM0ZDE3ODgzYTE0ZWNhNjQ0MTFmNjlkY2M4NyJ9

* 🦉 Updates from OwlBot

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>
Co-authored-by: Anthonios Partheniou <[email protected]>
  • Loading branch information
3 people authored Feb 5, 2022
1 parent d6614e2 commit 95a86fa
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions google/pubsub_v1/types/pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -1123,24 +1123,76 @@ class StreamingPullResponse(proto.Message):
received_messages (Sequence[google.pubsub_v1.types.ReceivedMessage]):
Received Pub/Sub messages. This will not be
empty.
acknowlege_confirmation (google.pubsub_v1.types.StreamingPullResponse.AcknowledgeConfirmation):
This field will only be set if
``enable_exactly_once_delivery`` is set to ``true``.
modify_ack_deadline_confirmation (google.pubsub_v1.types.StreamingPullResponse.ModifyAckDeadlineConfirmation):
This field will only be set if
``enable_exactly_once_delivery`` is set to ``true``.
subscription_properties (google.pubsub_v1.types.StreamingPullResponse.SubscriptionProperties):
Properties associated with this subscription.
"""

class AcknowledgeConfirmation(proto.Message):
r"""Acknowledgement IDs sent in one or more previous requests to
acknowledge a previously received message.
Attributes:
ack_ids (Sequence[str]):
Successfully processed acknowledgement IDs.
invalid_ack_ids (Sequence[str]):
List of acknowledgement IDs that were
malformed or whose acknowledgement deadline has
expired.
unordered_ack_ids (Sequence[str]):
List of acknowledgement IDs that were out of
order.
"""

ack_ids = proto.RepeatedField(proto.STRING, number=1,)
invalid_ack_ids = proto.RepeatedField(proto.STRING, number=2,)
unordered_ack_ids = proto.RepeatedField(proto.STRING, number=3,)

class ModifyAckDeadlineConfirmation(proto.Message):
r"""Acknowledgement IDs sent in one or more previous requests to
modify the deadline for a specific message.
Attributes:
ack_ids (Sequence[str]):
Successfully processed acknowledgement IDs.
invalid_ack_ids (Sequence[str]):
List of acknowledgement IDs that were
malformed or whose acknowledgement deadline has
expired.
"""

ack_ids = proto.RepeatedField(proto.STRING, number=1,)
invalid_ack_ids = proto.RepeatedField(proto.STRING, number=2,)

class SubscriptionProperties(proto.Message):
r"""Subscription properties sent as part of the response.
Attributes:
exactly_once_delivery_enabled (bool):
True iff exactly once delivery is enabled for
this subscription.
message_ordering_enabled (bool):
True iff message ordering is enabled for this
subscription.
"""

exactly_once_delivery_enabled = proto.Field(proto.BOOL, number=1,)
message_ordering_enabled = proto.Field(proto.BOOL, number=2,)

received_messages = proto.RepeatedField(
proto.MESSAGE, number=1, message="ReceivedMessage",
)
acknowlege_confirmation = proto.Field(
proto.MESSAGE, number=2, message=AcknowledgeConfirmation,
)
modify_ack_deadline_confirmation = proto.Field(
proto.MESSAGE, number=3, message=ModifyAckDeadlineConfirmation,
)
subscription_properties = proto.Field(
proto.MESSAGE, number=4, message=SubscriptionProperties,
)
Expand Down

0 comments on commit 95a86fa

Please sign in to comment.