From 10df8767bfa4e3d080460eb03c57ae99c340a6e6 Mon Sep 17 00:00:00 2001 From: Gentris Leci Date: Mon, 6 Nov 2023 09:21:27 +0100 Subject: [PATCH] docs: use `raises` instead of `returns` --- google/pubsub_v1/services/subscriber/async_client.py | 8 ++++---- google/pubsub_v1/services/subscriber/client.py | 8 ++++---- google/pubsub_v1/services/subscriber/transports/grpc.py | 8 ++++---- .../services/subscriber/transports/grpc_asyncio.py | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/google/pubsub_v1/services/subscriber/async_client.py b/google/pubsub_v1/services/subscriber/async_client.py index 17b8bc1d2..bb3697a26 100644 --- a/google/pubsub_v1/services/subscriber/async_client.py +++ b/google/pubsub_v1/services/subscriber/async_client.py @@ -239,8 +239,8 @@ async def create_subscription( r"""Creates a subscription to a given topic. See the [resource name rules] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - If the subscription already exists, returns ``ALREADY_EXISTS``. - If the corresponding topic doesn't exist, returns ``NOT_FOUND``. + If the subscription already exists, raises ``ALREADY_EXISTS``. + If the corresponding topic doesn't exist, raises ``NOT_FOUND``. If the name is not provided in the request, the server will assign a random name for this subscription on the same project @@ -1795,8 +1795,8 @@ async def create_snapshot( operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. - If the snapshot already exists, returns ``ALREADY_EXISTS``. If - the requested subscription doesn't exist, returns ``NOT_FOUND``. + If the snapshot already exists, raises ``ALREADY_EXISTS``. If + the requested subscription doesn't exist, raises ``NOT_FOUND``. If the backlog in the subscription is too old -- and the resulting snapshot would expire in less than 1 hour -- then ``FAILED_PRECONDITION`` is returned. See also the diff --git a/google/pubsub_v1/services/subscriber/client.py b/google/pubsub_v1/services/subscriber/client.py index f74e895a3..38aad35a9 100644 --- a/google/pubsub_v1/services/subscriber/client.py +++ b/google/pubsub_v1/services/subscriber/client.py @@ -520,8 +520,8 @@ def create_subscription( r"""Creates a subscription to a given topic. See the [resource name rules] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - If the subscription already exists, returns ``ALREADY_EXISTS``. - If the corresponding topic doesn't exist, returns ``NOT_FOUND``. + If the subscription already exists, raises ``ALREADY_EXISTS``. + If the corresponding topic doesn't exist, raises ``NOT_FOUND``. If the name is not provided in the request, the server will assign a random name for this subscription on the same project @@ -1952,8 +1952,8 @@ def create_snapshot( operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. - If the snapshot already exists, returns ``ALREADY_EXISTS``. If - the requested subscription doesn't exist, returns ``NOT_FOUND``. + If the snapshot already exists, raises ``ALREADY_EXISTS``. If + the requested subscription doesn't exist, raises ``NOT_FOUND``. If the backlog in the subscription is too old -- and the resulting snapshot would expire in less than 1 hour -- then ``FAILED_PRECONDITION`` is returned. See also the diff --git a/google/pubsub_v1/services/subscriber/transports/grpc.py b/google/pubsub_v1/services/subscriber/transports/grpc.py index 0b1fcd3aa..a1bb89199 100644 --- a/google/pubsub_v1/services/subscriber/transports/grpc.py +++ b/google/pubsub_v1/services/subscriber/transports/grpc.py @@ -246,8 +246,8 @@ def create_subscription( Creates a subscription to a given topic. See the [resource name rules] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - If the subscription already exists, returns ``ALREADY_EXISTS``. - If the corresponding topic doesn't exist, returns ``NOT_FOUND``. + If the subscription already exists, raises ``ALREADY_EXISTS``. + If the corresponding topic doesn't exist, raises ``NOT_FOUND``. If the name is not provided in the request, the server will assign a random name for this subscription on the same project @@ -608,8 +608,8 @@ def create_snapshot( operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. - If the snapshot already exists, returns ``ALREADY_EXISTS``. If - the requested subscription doesn't exist, returns ``NOT_FOUND``. + If the snapshot already exists, raises ``ALREADY_EXISTS``. If + the requested subscription doesn't exist, raises ``NOT_FOUND``. If the backlog in the subscription is too old -- and the resulting snapshot would expire in less than 1 hour -- then ``FAILED_PRECONDITION`` is returned. See also the diff --git a/google/pubsub_v1/services/subscriber/transports/grpc_asyncio.py b/google/pubsub_v1/services/subscriber/transports/grpc_asyncio.py index d32730c1e..37f660c7d 100644 --- a/google/pubsub_v1/services/subscriber/transports/grpc_asyncio.py +++ b/google/pubsub_v1/services/subscriber/transports/grpc_asyncio.py @@ -249,8 +249,8 @@ def create_subscription( Creates a subscription to a given topic. See the [resource name rules] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). - If the subscription already exists, returns ``ALREADY_EXISTS``. - If the corresponding topic doesn't exist, returns ``NOT_FOUND``. + If the subscription already exists, raises ``ALREADY_EXISTS``. + If the corresponding topic doesn't exist, raises ``NOT_FOUND``. If the name is not provided in the request, the server will assign a random name for this subscription on the same project @@ -621,8 +621,8 @@ def create_snapshot( operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. - If the snapshot already exists, returns ``ALREADY_EXISTS``. If - the requested subscription doesn't exist, returns ``NOT_FOUND``. + If the snapshot already exists, raises ``ALREADY_EXISTS``. If + the requested subscription doesn't exist, raises ``NOT_FOUND``. If the backlog in the subscription is too old -- and the resulting snapshot would expire in less than 1 hour -- then ``FAILED_PRECONDITION`` is returned. See also the