From ee2ea7341268fd5428d98208b8af2fc96efe8d03 Mon Sep 17 00:00:00 2001 From: Anna Cocuzzo <63511057+acocuzzo@users.noreply.github.com> Date: Tue, 4 Apr 2023 16:45:33 -0400 Subject: [PATCH] docs: Fix formatting of request arg in docstring (#894) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: Update gapic-generator-python to v1.8.5 PiperOrigin-RevId: 511892190 Source-Link: https://github.com/googleapis/googleapis/commit/a45d9c09c1287ffdf938f4e8083e791046c0b23b Source-Link: https://github.com/googleapis/googleapis-gen/commit/1907294b1d8365ea24f8c5f2e059a64124c4ed3b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTkwNzI5NGIxZDgzNjVlYTI0ZjhjNWYyZTA1OWE2NDEyNGM0ZWQzYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * remove rest.py * chore: Update gapic-generator-python to v1.9.0 PiperOrigin-RevId: 517425588 Source-Link: https://github.com/googleapis/googleapis/commit/33c93eb8b4d3aaf88e44a1be197811052be62282 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d5f59789d19fc43270ff2124967d4ec8992b8e8f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDVmNTk3ODlkMTlmYzQzMjcwZmYyMTI0OTY3ZDRlYzg5OTJiOGU4ZiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: Fix formatting of request arg in docstring chore: Update gapic-generator-python to v1.9.1 PiperOrigin-RevId: 518604533 Source-Link: https://github.com/googleapis/googleapis/commit/8a085aeddfa010af5bcef090827aac5255383d7e Source-Link: https://github.com/googleapis/googleapis-gen/commit/b2ab4b0a0ae2907e812c209198a74e0898afcb04 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjJhYjRiMGEwYWUyOTA3ZTgxMmMyMDkxOThhNzRlMDg5OGFmY2IwNCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../services/publisher/async_client.py | 11 +++---- google/pubsub_v1/services/publisher/client.py | 11 +++---- .../services/schema_service/async_client.py | 21 ++++-------- .../services/schema_service/client.py | 21 ++++-------- .../services/subscriber/async_client.py | 33 ++++++++----------- .../pubsub_v1/services/subscriber/client.py | 33 ++++++++----------- google/pubsub_v1/types/pubsub.py | 2 ++ google/pubsub_v1/types/schema.py | 2 ++ .../snippet_metadata_google.pubsub.v1.json | 2 +- 9 files changed, 55 insertions(+), 81 deletions(-) diff --git a/google/pubsub_v1/services/publisher/async_client.py b/google/pubsub_v1/services/publisher/async_client.py index e749892f5..92a10c38e 100644 --- a/google/pubsub_v1/services/publisher/async_client.py +++ b/google/pubsub_v1/services/publisher/async_client.py @@ -740,7 +740,7 @@ async def sample_list_topics(): Args: request (Optional[Union[google.pubsub_v1.types.ListTopicsRequest, dict]]): - The request object. Request for the `ListTopics` method. + The request object. Request for the ``ListTopics`` method. project (:class:`str`): Required. The name of the project in which to list topics. Format is ``projects/{project-id}``. @@ -866,8 +866,7 @@ async def sample_list_topic_subscriptions(): Args: request (Optional[Union[google.pubsub_v1.types.ListTopicSubscriptionsRequest, dict]]): - The request object. Request for the - `ListTopicSubscriptions` method. + The request object. Request for the ``ListTopicSubscriptions`` method. topic (:class:`str`): Required. The name of the topic that subscriptions are attached to. Format is @@ -998,8 +997,7 @@ async def sample_list_topic_snapshots(): Args: request (Optional[Union[google.pubsub_v1.types.ListTopicSnapshotsRequest, dict]]): - The request object. Request for the `ListTopicSnapshots` - method. + The request object. Request for the ``ListTopicSnapshots`` method. topic (:class:`str`): Required. The name of the topic that snapshots are attached to. Format is @@ -1126,8 +1124,7 @@ async def sample_delete_topic(): Args: request (Optional[Union[google.pubsub_v1.types.DeleteTopicRequest, dict]]): - The request object. Request for the `DeleteTopic` - method. + The request object. Request for the ``DeleteTopic`` method. topic (:class:`str`): Required. Name of the topic to delete. Format is ``projects/{project}/topics/{topic}``. diff --git a/google/pubsub_v1/services/publisher/client.py b/google/pubsub_v1/services/publisher/client.py index a9684144f..32549cff7 100644 --- a/google/pubsub_v1/services/publisher/client.py +++ b/google/pubsub_v1/services/publisher/client.py @@ -976,7 +976,7 @@ def sample_list_topics(): Args: request (Union[google.pubsub_v1.types.ListTopicsRequest, dict]): - The request object. Request for the `ListTopics` method. + The request object. Request for the ``ListTopics`` method. project (str): Required. The name of the project in which to list topics. Format is ``projects/{project-id}``. @@ -1091,8 +1091,7 @@ def sample_list_topic_subscriptions(): Args: request (Union[google.pubsub_v1.types.ListTopicSubscriptionsRequest, dict]): - The request object. Request for the - `ListTopicSubscriptions` method. + The request object. Request for the ``ListTopicSubscriptions`` method. topic (str): Required. The name of the topic that subscriptions are attached to. Format is @@ -1212,8 +1211,7 @@ def sample_list_topic_snapshots(): Args: request (Union[google.pubsub_v1.types.ListTopicSnapshotsRequest, dict]): - The request object. Request for the `ListTopicSnapshots` - method. + The request object. Request for the ``ListTopicSnapshots`` method. topic (str): Required. The name of the topic that snapshots are attached to. Format is @@ -1329,8 +1327,7 @@ def sample_delete_topic(): Args: request (Union[google.pubsub_v1.types.DeleteTopicRequest, dict]): - The request object. Request for the `DeleteTopic` - method. + The request object. Request for the ``DeleteTopic`` method. topic (str): Required. Name of the topic to delete. Format is ``projects/{project}/topics/{topic}``. diff --git a/google/pubsub_v1/services/schema_service/async_client.py b/google/pubsub_v1/services/schema_service/async_client.py index 68b896e48..cfb566e84 100644 --- a/google/pubsub_v1/services/schema_service/async_client.py +++ b/google/pubsub_v1/services/schema_service/async_client.py @@ -486,8 +486,7 @@ async def sample_list_schemas(): Args: request (Optional[Union[google.pubsub_v1.types.ListSchemasRequest, dict]]): - The request object. Request for the `ListSchemas` - method. + The request object. Request for the ``ListSchemas`` method. parent (:class:`str`): Required. The name of the project in which to list schemas. Format is ``projects/{project-id}``. @@ -600,8 +599,7 @@ async def sample_list_schema_revisions(): Args: request (Optional[Union[google.pubsub_v1.types.ListSchemaRevisionsRequest, dict]]): - The request object. Request for the - `ListSchemaRevisions` method. + The request object. Request for the ``ListSchemaRevisions`` method. name (:class:`str`): Required. The name of the schema to list revisions for. @@ -829,8 +827,7 @@ async def sample_rollback_schema(): Args: request (Optional[Union[google.pubsub_v1.types.RollbackSchemaRequest, dict]]): - The request object. Request for the `RollbackSchema` - method. + The request object. Request for the ``RollbackSchema`` method. name (:class:`str`): Required. The schema being rolled back with revision id. @@ -941,8 +938,7 @@ async def sample_delete_schema_revision(): Args: request (Optional[Union[google.pubsub_v1.types.DeleteSchemaRevisionRequest, dict]]): - The request object. Request for the - `DeleteSchemaRevision` method. + The request object. Request for the ``DeleteSchemaRevision`` method. name (:class:`str`): Required. The name of the schema revision to be deleted, with a revision ID explicitly included. @@ -1050,8 +1046,7 @@ async def sample_delete_schema(): Args: request (Optional[Union[google.pubsub_v1.types.DeleteSchemaRequest, dict]]): - The request object. Request for the `DeleteSchema` - method. + The request object. Request for the ``DeleteSchema`` method. name (:class:`str`): Required. Name of the schema to delete. Format is ``projects/{project}/schemas/{schema}``. @@ -1148,8 +1143,7 @@ async def sample_validate_schema(): Args: request (Optional[Union[google.pubsub_v1.types.ValidateSchemaRequest, dict]]): - The request object. Request for the `ValidateSchema` - method. + The request object. Request for the ``ValidateSchema`` method. parent (:class:`str`): Required. The name of the project in which to validate schemas. Format is ``projects/{project-id}``. @@ -1259,8 +1253,7 @@ async def sample_validate_message(): Args: request (Optional[Union[google.pubsub_v1.types.ValidateMessageRequest, dict]]): - The request object. Request for the `ValidateMessage` - method. + The request object. Request for the ``ValidateMessage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/pubsub_v1/services/schema_service/client.py b/google/pubsub_v1/services/schema_service/client.py index d217c49f0..2944caed9 100644 --- a/google/pubsub_v1/services/schema_service/client.py +++ b/google/pubsub_v1/services/schema_service/client.py @@ -718,8 +718,7 @@ def sample_list_schemas(): Args: request (Union[google.pubsub_v1.types.ListSchemasRequest, dict]): - The request object. Request for the `ListSchemas` - method. + The request object. Request for the ``ListSchemas`` method. parent (str): Required. The name of the project in which to list schemas. Format is ``projects/{project-id}``. @@ -832,8 +831,7 @@ def sample_list_schema_revisions(): Args: request (Union[google.pubsub_v1.types.ListSchemaRevisionsRequest, dict]): - The request object. Request for the - `ListSchemaRevisions` method. + The request object. Request for the ``ListSchemaRevisions`` method. name (str): Required. The name of the schema to list revisions for. @@ -1061,8 +1059,7 @@ def sample_rollback_schema(): Args: request (Union[google.pubsub_v1.types.RollbackSchemaRequest, dict]): - The request object. Request for the `RollbackSchema` - method. + The request object. Request for the ``RollbackSchema`` method. name (str): Required. The schema being rolled back with revision id. @@ -1173,8 +1170,7 @@ def sample_delete_schema_revision(): Args: request (Union[google.pubsub_v1.types.DeleteSchemaRevisionRequest, dict]): - The request object. Request for the - `DeleteSchemaRevision` method. + The request object. Request for the ``DeleteSchemaRevision`` method. name (str): Required. The name of the schema revision to be deleted, with a revision ID explicitly included. @@ -1282,8 +1278,7 @@ def sample_delete_schema(): Args: request (Union[google.pubsub_v1.types.DeleteSchemaRequest, dict]): - The request object. Request for the `DeleteSchema` - method. + The request object. Request for the ``DeleteSchema`` method. name (str): Required. Name of the schema to delete. Format is ``projects/{project}/schemas/{schema}``. @@ -1380,8 +1375,7 @@ def sample_validate_schema(): Args: request (Union[google.pubsub_v1.types.ValidateSchemaRequest, dict]): - The request object. Request for the `ValidateSchema` - method. + The request object. Request for the ``ValidateSchema`` method. parent (str): Required. The name of the project in which to validate schemas. Format is ``projects/{project-id}``. @@ -1491,8 +1485,7 @@ def sample_validate_message(): Args: request (Union[google.pubsub_v1.types.ValidateMessageRequest, dict]): - The request object. Request for the `ValidateMessage` - method. + The request object. Request for the ``ValidateMessage`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/pubsub_v1/services/subscriber/async_client.py b/google/pubsub_v1/services/subscriber/async_client.py index dbe4fd0e7..694b166d9 100644 --- a/google/pubsub_v1/services/subscriber/async_client.py +++ b/google/pubsub_v1/services/subscriber/async_client.py @@ -279,10 +279,10 @@ async def sample_create_subscription(): Args: request (Optional[Union[google.pubsub_v1.types.Subscription, dict]]): - The request object. A subscription resource. If none of - `push_config` or `bigquery_config` is set, then the - subscriber will pull and ack messages using API methods. - At most one of these fields may be set. + The request object. A subscription resource. If none of ``push_config`` or + ``bigquery_config`` is set, then the subscriber will + pull and ack messages using API methods. At most one of + these fields may be set. name (:class:`str`): Required. The name of the subscription. It must have the format @@ -706,8 +706,7 @@ async def sample_list_subscriptions(): Args: request (Optional[Union[google.pubsub_v1.types.ListSubscriptionsRequest, dict]]): - The request object. Request for the `ListSubscriptions` - method. + The request object. Request for the ``ListSubscriptions`` method. project (:class:`str`): Required. The name of the project in which to list subscriptions. Format is ``projects/{project-id}``. @@ -1194,7 +1193,7 @@ async def sample_pull(): Args: request (Optional[Union[google.pubsub_v1.types.PullRequest, dict]]): - The request object. Request for the `Pull` method. + The request object. Request for the ``Pull`` method. subscription (:class:`str`): Required. The subscription from which messages should be pulled. Format is @@ -1360,11 +1359,10 @@ def request_generator(): Args: requests (AsyncIterator[`google.pubsub_v1.types.StreamingPullRequest`]): - The request object AsyncIterator. Request for the `StreamingPull` - streaming RPC method. This request is used to establish - the initial stream as well as to stream acknowledgements - and ack deadline modifications from the client to the - server. + The request object AsyncIterator. Request for the ``StreamingPull`` streaming RPC method. + This request is used to establish the initial stream as + well as to stream acknowledgements and ack deadline + modifications from the client to the server. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1697,8 +1695,7 @@ async def sample_list_snapshots(): Args: request (Optional[Union[google.pubsub_v1.types.ListSnapshotsRequest, dict]]): - The request object. Request for the `ListSnapshots` - method. + The request object. Request for the ``ListSnapshots`` method. project (:class:`str`): Required. The name of the project in which to list snapshots. Format is ``projects/{project-id}``. @@ -1841,8 +1838,7 @@ async def sample_create_snapshot(): Args: request (Optional[Union[google.pubsub_v1.types.CreateSnapshotRequest, dict]]): - The request object. Request for the `CreateSnapshot` - method. + The request object. Request for the ``CreateSnapshot`` method. name (:class:`str`): Required. User-provided name for this snapshot. If the name is not provided in the request, the server will @@ -2116,8 +2112,7 @@ async def sample_delete_snapshot(): Args: request (Optional[Union[google.pubsub_v1.types.DeleteSnapshotRequest, dict]]): - The request object. Request for the `DeleteSnapshot` - method. + The request object. Request for the ``DeleteSnapshot`` method. snapshot (:class:`str`): Required. The name of the snapshot to delete. Format is ``projects/{project}/snapshots/{snap}``. @@ -2225,7 +2220,7 @@ async def sample_seek(): Args: request (Optional[Union[google.pubsub_v1.types.SeekRequest, dict]]): - The request object. Request for the `Seek` method. + The request object. Request for the ``Seek`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/pubsub_v1/services/subscriber/client.py b/google/pubsub_v1/services/subscriber/client.py index 816275ef7..a3237d122 100644 --- a/google/pubsub_v1/services/subscriber/client.py +++ b/google/pubsub_v1/services/subscriber/client.py @@ -558,10 +558,10 @@ def sample_create_subscription(): Args: request (Union[google.pubsub_v1.types.Subscription, dict]): - The request object. A subscription resource. If none of - `push_config` or `bigquery_config` is set, then the - subscriber will pull and ack messages using API methods. - At most one of these fields may be set. + The request object. A subscription resource. If none of ``push_config`` or + ``bigquery_config`` is set, then the subscriber will + pull and ack messages using API methods. At most one of + these fields may be set. name (str): Required. The name of the subscription. It must have the format @@ -954,8 +954,7 @@ def sample_list_subscriptions(): Args: request (Union[google.pubsub_v1.types.ListSubscriptionsRequest, dict]): - The request object. Request for the `ListSubscriptions` - method. + The request object. Request for the ``ListSubscriptions`` method. project (str): Required. The name of the project in which to list subscriptions. Format is ``projects/{project-id}``. @@ -1404,7 +1403,7 @@ def sample_pull(): Args: request (Union[google.pubsub_v1.types.PullRequest, dict]): - The request object. Request for the `Pull` method. + The request object. Request for the ``Pull`` method. subscription (str): Required. The subscription from which messages should be pulled. Format is @@ -1558,11 +1557,10 @@ def request_generator(): Args: requests (Iterator[google.pubsub_v1.types.StreamingPullRequest]): - The request object iterator. Request for the `StreamingPull` - streaming RPC method. This request is used to establish - the initial stream as well as to stream acknowledgements - and ack deadline modifications from the client to the - server. + The request object iterator. Request for the ``StreamingPull`` streaming RPC method. + This request is used to establish the initial stream as + well as to stream acknowledgements and ack deadline + modifications from the client to the server. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1863,8 +1861,7 @@ def sample_list_snapshots(): Args: request (Union[google.pubsub_v1.types.ListSnapshotsRequest, dict]): - The request object. Request for the `ListSnapshots` - method. + The request object. Request for the ``ListSnapshots`` method. project (str): Required. The name of the project in which to list snapshots. Format is ``projects/{project-id}``. @@ -1996,8 +1993,7 @@ def sample_create_snapshot(): Args: request (Union[google.pubsub_v1.types.CreateSnapshotRequest, dict]): - The request object. Request for the `CreateSnapshot` - method. + The request object. Request for the ``CreateSnapshot`` method. name (str): Required. User-provided name for this snapshot. If the name is not provided in the request, the server will @@ -2253,8 +2249,7 @@ def sample_delete_snapshot(): Args: request (Union[google.pubsub_v1.types.DeleteSnapshotRequest, dict]): - The request object. Request for the `DeleteSnapshot` - method. + The request object. Request for the ``DeleteSnapshot`` method. snapshot (str): Required. The name of the snapshot to delete. Format is ``projects/{project}/snapshots/{snap}``. @@ -2353,7 +2348,7 @@ def sample_seek(): Args: request (Union[google.pubsub_v1.types.SeekRequest, dict]): - The request object. Request for the `Seek` method. + The request object. Request for the ``Seek`` method. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. diff --git a/google/pubsub_v1/types/pubsub.py b/google/pubsub_v1/types/pubsub.py index 3e2f225ad..cee8cee4c 100644 --- a/google/pubsub_v1/types/pubsub.py +++ b/google/pubsub_v1/types/pubsub.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence import proto # type: ignore diff --git a/google/pubsub_v1/types/schema.py b/google/pubsub_v1/types/schema.py index 27a6efbbd..7b432906b 100644 --- a/google/pubsub_v1/types/schema.py +++ b/google/pubsub_v1/types/schema.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from __future__ import annotations + from typing import MutableMapping, MutableSequence import proto # type: ignore diff --git a/samples/generated_samples/snippet_metadata_google.pubsub.v1.json b/samples/generated_samples/snippet_metadata_google.pubsub.v1.json index 256ef8a94..d66015ac4 100644 --- a/samples/generated_samples/snippet_metadata_google.pubsub.v1.json +++ b/samples/generated_samples/snippet_metadata_google.pubsub.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-pubsub", - "version": "2.15.2" + "version": "0.1.0" }, "snippets": [ {