Skip to content

Commit f58d5a8

Browse files
yoshi-automationemar-kar
authored andcommitted
[CHANGE ME] Re-generated pubsub to pick up changes in the API or client library generator. (googleapis#9078)
1 parent 1f2948f commit f58d5a8

4 files changed

Lines changed: 262 additions & 67 deletions

File tree

pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ def create_subscription(
246246
labels=None,
247247
enable_message_ordering=None,
248248
expiration_policy=None,
249+
dead_letter_policy=None,
249250
retry=google.api_core.gapic_v1.method.DEFAULT,
250251
timeout=google.api_core.gapic_v1.method.DEFAULT,
251252
metadata=None,
@@ -340,6 +341,20 @@ def create_subscription(
340341
341342
If a dict is provided, it must be of the same form as the protobuf
342343
message :class:`~google.cloud.pubsub_v1.types.ExpirationPolicy`
344+
dead_letter_policy (Union[dict, ~google.cloud.pubsub_v1.types.DeadLetterPolicy]): A policy that specifies the conditions for dead lettering messages in
345+
this subscription. If dead\_letter\_policy is not set, dead lettering is
346+
disabled.
347+
348+
The Cloud Pub/Sub service account associated with this subscriptions's
349+
parent project (i.e.,
350+
service-{project\_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must
351+
have permission to Acknowledge() messages on this subscription.
352+
EXPERIMENTAL: This feature is part of a closed alpha release. This API
353+
might be changed in backward-incompatible ways and is not recommended
354+
for production use. It is not subject to any SLA or deprecation policy.
355+
356+
If a dict is provided, it must be of the same form as the protobuf
357+
message :class:`~google.cloud.pubsub_v1.types.DeadLetterPolicy`
343358
retry (Optional[google.api_core.retry.Retry]): A retry object used
344359
to retry requests. If ``None`` is specified, requests will
345360
be retried using a default configuration.
@@ -380,6 +395,7 @@ def create_subscription(
380395
labels=labels,
381396
enable_message_ordering=enable_message_ordering,
382397
expiration_policy=expiration_policy,
398+
dead_letter_policy=dead_letter_policy,
383399
)
384400
if metadata is None:
385401
metadata = []
@@ -932,8 +948,9 @@ def pull(
932948
Args:
933949
subscription (str): The subscription from which messages should be pulled. Format is
934950
``projects/{project}/subscriptions/{sub}``.
935-
max_messages (int): The maximum number of messages returned for this request. The Pub/Sub
936-
system may return fewer than the number specified.
951+
max_messages (int): The maximum number of messages to return for this request. Must be a
952+
positive integer. The Pub/Sub system may return fewer than the number
953+
specified.
937954
return_immediately (bool): If this field set to true, the system will respond immediately even if
938955
it there are no messages available to return in the ``Pull`` response.
939956
Otherwise, the system may wait (for a bounded amount of time) until at

pubsub/google/cloud/pubsub_v1/proto/pubsub.proto

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,52 @@ message Subscription {
609609
// *default policy* with `ttl` of 31 days will be used. The minimum allowed
610610
// value for `expiration_policy.ttl` is 1 day.
611611
ExpirationPolicy expiration_policy = 11;
612+
613+
// A policy that specifies the conditions for dead lettering messages in
614+
// this subscription. If dead_letter_policy is not set, dead lettering
615+
// is disabled.
616+
//
617+
// The Cloud Pub/Sub service account associated with this subscriptions's
618+
// parent project (i.e.,
619+
// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
620+
// permission to Acknowledge() messages on this subscription.
621+
// <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
622+
// API might be changed in backward-incompatible ways and is not recommended
623+
// for production use. It is not subject to any SLA or deprecation policy.
624+
DeadLetterPolicy dead_letter_policy = 13;
625+
}
626+
627+
// Dead lettering is done on a best effort basis. The same message might be
628+
// dead lettered multiple times.
629+
//
630+
// If validation on any of the fields fails at subscription creation/updation,
631+
// the create/update subscription request will fail.
632+
message DeadLetterPolicy {
633+
// The name of the topic to which dead letter messages should be published.
634+
// Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
635+
// account associated with the enclosing subscription's parent project (i.e.,
636+
// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
637+
// permission to Publish() to this topic.
638+
//
639+
// The operation will fail if the topic does not exist.
640+
// Users should ensure that there is a subscription attached to this topic
641+
// since messages published to a topic with no subscriptions are lost.
642+
string dead_letter_topic = 1;
643+
644+
// The maximum number of delivery attempts for any message. The value must be
645+
// between 5 and 100.
646+
//
647+
// The number of delivery attempts is defined as 1 + (the sum of number of
648+
// NACKs and number of times the acknowledgement deadline has been exceeded
649+
// for the message).
650+
//
651+
// A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
652+
// client libraries may automatically extend ack_deadlines.
653+
//
654+
// This field will be honored on a best effort basis.
655+
//
656+
// If this parameter is 0, a default value of 5 is used.
657+
int32 max_delivery_attempts = 2;
612658
}
613659

614660
// A policy that specifies the conditions for resource expiration (i.e.,
@@ -770,8 +816,9 @@ message PullRequest {
770816
// least one message is available, rather than returning no messages.
771817
bool return_immediately = 2;
772818

773-
// The maximum number of messages returned for this request. The Pub/Sub
774-
// system may return fewer than the number specified.
819+
// The maximum number of messages to return for this request. Must be a
820+
// positive integer. The Pub/Sub system may return fewer than the number
821+
// specified.
775822
int32 max_messages = 3;
776823
}
777824

0 commit comments

Comments
 (0)