Skip to content

Commit

Permalink
[CHANGE ME] Re-generated pubsub to pick up changes in the API or clie…
Browse files Browse the repository at this point in the history
…nt library generator. (googleapis#9078)
  • Loading branch information
yoshi-automation authored and plamut committed Aug 22, 2019
1 parent 27e8de7 commit 69476c7
Show file tree
Hide file tree
Showing 4 changed files with 262 additions and 67 deletions.
21 changes: 19 additions & 2 deletions pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ def create_subscription(
labels=None,
enable_message_ordering=None,
expiration_policy=None,
dead_letter_policy=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
Expand Down Expand Up @@ -340,6 +341,20 @@ def create_subscription(
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.pubsub_v1.types.ExpirationPolicy`
dead_letter_policy (Union[dict, ~google.cloud.pubsub_v1.types.DeadLetterPolicy]): A policy that specifies the conditions for dead lettering messages in
this subscription. If dead\_letter\_policy is not set, dead lettering is
disabled.
The Cloud Pub/Sub service account associated with this subscriptions's
parent project (i.e.,
service-{project\_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must
have permission to Acknowledge() messages on this subscription.
EXPERIMENTAL: This feature is part of a closed alpha release. This API
might be changed in backward-incompatible ways and is not recommended
for production use. It is not subject to any SLA or deprecation policy.
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.pubsub_v1.types.DeadLetterPolicy`
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will
be retried using a default configuration.
Expand Down Expand Up @@ -380,6 +395,7 @@ def create_subscription(
labels=labels,
enable_message_ordering=enable_message_ordering,
expiration_policy=expiration_policy,
dead_letter_policy=dead_letter_policy,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -932,8 +948,9 @@ def pull(
Args:
subscription (str): The subscription from which messages should be pulled. Format is
``projects/{project}/subscriptions/{sub}``.
max_messages (int): The maximum number of messages returned for this request. The Pub/Sub
system may return fewer than the number specified.
max_messages (int): The maximum number of messages to return for this request. Must be a
positive integer. The Pub/Sub system may return fewer than the number
specified.
return_immediately (bool): If this field set to true, the system will respond immediately even if
it there are no messages available to return in the ``Pull`` response.
Otherwise, the system may wait (for a bounded amount of time) until at
Expand Down
51 changes: 49 additions & 2 deletions pubsub/google/cloud/pubsub_v1/proto/pubsub.proto
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,52 @@ message Subscription {
// *default policy* with `ttl` of 31 days will be used. The minimum allowed
// value for `expiration_policy.ttl` is 1 day.
ExpirationPolicy expiration_policy = 11;

// A policy that specifies the conditions for dead lettering messages in
// this subscription. If dead_letter_policy is not set, dead lettering
// is disabled.
//
// The Cloud Pub/Sub service account associated with this subscriptions's
// parent project (i.e.,
// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
// permission to Acknowledge() messages on this subscription.
// <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
// API might be changed in backward-incompatible ways and is not recommended
// for production use. It is not subject to any SLA or deprecation policy.
DeadLetterPolicy dead_letter_policy = 13;
}

// Dead lettering is done on a best effort basis. The same message might be
// dead lettered multiple times.
//
// If validation on any of the fields fails at subscription creation/updation,
// the create/update subscription request will fail.
message DeadLetterPolicy {
// The name of the topic to which dead letter messages should be published.
// Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service
// account associated with the enclosing subscription's parent project (i.e.,
// service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
// permission to Publish() to this topic.
//
// The operation will fail if the topic does not exist.
// Users should ensure that there is a subscription attached to this topic
// since messages published to a topic with no subscriptions are lost.
string dead_letter_topic = 1;

// The maximum number of delivery attempts for any message. The value must be
// between 5 and 100.
//
// The number of delivery attempts is defined as 1 + (the sum of number of
// NACKs and number of times the acknowledgement deadline has been exceeded
// for the message).
//
// A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that
// client libraries may automatically extend ack_deadlines.
//
// This field will be honored on a best effort basis.
//
// If this parameter is 0, a default value of 5 is used.
int32 max_delivery_attempts = 2;
}

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

// The maximum number of messages returned for this request. The Pub/Sub
// system may return fewer than the number specified.
// The maximum number of messages to return for this request. Must be a
// positive integer. The Pub/Sub system may return fewer than the number
// specified.
int32 max_messages = 3;
}

Expand Down
Loading

0 comments on commit 69476c7

Please sign in to comment.