Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-generate library using pubsub/synth.py #6223

Merged
merged 1 commit into from
Oct 17, 2018
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
9 changes: 4 additions & 5 deletions pubsub/google/cloud/pubsub_v1/gapic/publisher_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def create_topic(self,
underscores (``_``), periods (``.``), tildes (``~``), plus (``+``) or percent
signs (``%``). It must be between 3 and 255 characters in length, and it
must not start with ``\"goog\"``.
labels (dict[str -> str]): User labels.
labels (dict[str -> str]): See <a href=\"/pubsub/docs/labels\"> Creating and managing labels</a>.
message_storage_policy (Union[dict, ~google.cloud.pubsub_v1.types.MessageStoragePolicy]): Policy constraining how messages published to the topic may be stored. It
is determined when the topic is created based on the policy configured at
the project level. It must not be set by the caller in the request to
Expand Down Expand Up @@ -340,8 +340,7 @@ def publish(self,
metadata=None):
"""
Adds one or more messages to the topic. Returns ``NOT_FOUND`` if the topic
does not exist. The message payload must not be empty; it must contain
either a non-empty data field, or at least one attribute.
does not exist.

Example:
>>> from google.cloud import pubsub_v1
Expand Down Expand Up @@ -481,8 +480,8 @@ def list_topics(self,
... pass

Args:
project (str): The name of the cloud project that topics belong to.
Format is ``projects/{project}``.
project (str): The name of the project in which to list topics.
Format is ``projects/{project-id}``.
page_size (int): The maximum number of resources contained in the
underlying API response. If page streaming is performed per-
resource, this parameter does not affect the return value. If page
Expand Down
37 changes: 24 additions & 13 deletions pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ def create_subscription(self,
retain_acked_messages=None,
message_retention_duration=None,
labels=None,
expiration_policy=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
Expand Down Expand Up @@ -296,7 +297,18 @@ def create_subscription(self,
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.Duration`
labels (dict[str -> str]): User labels.
labels (dict[str -> str]): See <a href=\"/pubsub/docs/labels\"> Creating and managing labels</a>.
expiration_policy (Union[dict, ~google.cloud.pubsub_v1.types.ExpirationPolicy]): A policy that specifies the conditions for this subscription's expiration.
A subscription is considered active as long as any connected subscriber is
successfully consuming messages from the subscription or is issuing
operations on the subscription. If ``expiration_policy`` is not set, a
*default policy* with ``ttl`` of 31 days will be used. The minimum allowed
value for ``expiration_policy.ttl`` is 1 day.
<b>BETA:</b> This feature is part of a beta 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.ExpirationPolicy`
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
Expand Down Expand Up @@ -336,6 +348,7 @@ def create_subscription(self,
retain_acked_messages=retain_acked_messages,
message_retention_duration=message_retention_duration,
labels=labels,
expiration_policy=expiration_policy,
)
return self._inner_api_calls['create_subscription'](
request, retry=retry, timeout=timeout, metadata=metadata)
Expand Down Expand Up @@ -496,8 +509,8 @@ def list_subscriptions(self,
... pass

Args:
project (str): The name of the cloud project that subscriptions belong to.
Format is ``projects/{project}``.
project (str): The name of the project in which to list subscriptions.
Format is ``projects/{project-id}``.
page_size (int): The maximum number of resources contained in the
underlying API response. If page streaming is performed per-
resource, this parameter does not affect the return value. If page
Expand Down Expand Up @@ -762,8 +775,7 @@ def pull(self,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None):
"""
Pulls messages from the server. Returns an empty list if there are no
messages available in the backlog. The server may return ``UNAVAILABLE`` if
Pulls messages from the server. The server may return ``UNAVAILABLE`` if
there are too many concurrent pull requests pending for the given
subscription.

Expand All @@ -787,9 +799,7 @@ def pull(self,
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
least one message is available, rather than returning no messages. The
client may cancel the request if it does not wish to wait any longer for
the response.
least one message is available, rather than returning no messages.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
Expand Down Expand Up @@ -1001,8 +1011,8 @@ def list_snapshots(self,
... pass

Args:
project (str): The name of the cloud project that snapshots belong to.
Format is ``projects/{project}``.
project (str): The name of the project in which to list snapshots.
Format is ``projects/{project-id}``.
page_size (int): The maximum number of resources contained in the
underlying API response. If page streaming is performed per-
resource, this parameter does not affect the return value. If page
Expand Down Expand Up @@ -1070,7 +1080,7 @@ def create_snapshot(self,
Creates a snapshot from the requested subscription.<br><br>
<b>ALPHA:</b> This feature is part of an 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.
use. It is not subject to any SLA or deprecation policy.<br><br>
If the snapshot already exists, returns ``ALREADY_EXISTS``.
If the requested subscription doesn't exist, returns ``NOT_FOUND``.
If the backlog in the subscription is too old -- and the resulting snapshot
Expand All @@ -1097,7 +1107,8 @@ def create_snapshot(self,
name (str): Optional user-provided name for this snapshot.
If the name is not provided in the request, the server will assign a random
name for this snapshot on the same project as the subscription.
Note that for REST API requests, you must specify a name.
Note that for REST API requests, you must specify a name. See the
<a href=\"/pubsub/docs/admin#resource_names\">resource name rules</a>.
Format is ``projects/{project}/snapshots/{snap}``.
subscription (str): The subscription whose backlog the snapshot retains.
Specifically, the created snapshot is guaranteed to retain: \
Expand All @@ -1109,7 +1120,7 @@ def create_snapshot(self,
successful completion of the CreateSnapshot request. \

Format is ``projects/{project}/subscriptions/{sub}``.
labels (dict[str -> str]): User labels.
labels (dict[str -> str]): See <a href=\"/pubsub/docs/labels\"> Creating and managing labels</a>.
retry (Optional[google.api_core.retry.Retry]): A retry object used
to retry requests. If ``None`` is specified, requests will not
be retried.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"retry_codes": {
"idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"pull": [
"CANCELLED", "DEADLINE_EXCEEDED", "INTERNAL",
"RESOURCE_EXHAUSTED", "UNAVAILABLE"
"DEADLINE_EXCEEDED", "INTERNAL", "RESOURCE_EXHAUSTED",
"UNAVAILABLE"
],
"http_get": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"non_idempotent": []
Expand Down Expand Up @@ -72,7 +72,7 @@
},
"Acknowledge": {
"timeout_millis": 60000,
"retry_codes_name": "non_idempotent",
"retry_codes_name": "idempotent",
"retry_params_name": "messaging"
},
"Pull": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ def publish(self):
"""Return the gRPC stub for {$apiMethod.name}.

Adds one or more messages to the topic. Returns ``NOT_FOUND`` if the topic
does not exist. The message payload must not be empty; it must contain
either a non-empty data field, or at least one attribute.
does not exist.

Returns:
Callable: A callable which accepts the appropriate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,7 @@ def acknowledge(self):
def pull(self):
"""Return the gRPC stub for {$apiMethod.name}.

Pulls messages from the server. Returns an empty list if there are no
messages available in the backlog. The server may return ``UNAVAILABLE`` if
Pulls messages from the server. The server may return ``UNAVAILABLE`` if
there are too many concurrent pull requests pending for the given
subscription.

Expand Down Expand Up @@ -288,7 +287,7 @@ def create_snapshot(self):
Creates a snapshot from the requested subscription.<br><br>
<b>ALPHA:</b> This feature is part of an 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.
use. It is not subject to any SLA or deprecation policy.<br><br>
If the snapshot already exists, returns ``ALREADY_EXISTS``.
If the requested subscription doesn't exist, returns ``NOT_FOUND``.
If the backlog in the subscription is too old -- and the resulting snapshot
Expand Down
Loading