Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
chore: use gapic-generator-python 0.53.4 (#530)
- [ ] Regenerate this pull request now.

docs: list oneofs in docstring
fix(deps): require google-api-core >= 1.28.0
fix(deps): drop packaging dependency

committer: busunkim96@
PiperOrigin-RevId: 406468269

Source-Link: googleapis/googleapis@83d81b0

Source-Link: googleapis/googleapis-gen@2ff001f
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZmMDAxZmJhY2I5ZTc3ZTcxZDczNGRlNWY5NTVjMDVmZGFlODUyNiJ9
  • Loading branch information
gcf-owl-bot[bot] committed Nov 1, 2021
1 parent df3f829 commit 290b9c5
Show file tree
Hide file tree
Showing 19 changed files with 208 additions and 516 deletions.
64 changes: 33 additions & 31 deletions google/pubsub_v1/services/publisher/async_client.py
Expand Up @@ -19,14 +19,16 @@
from typing import Dict, Sequence, Tuple, Type, Union
import pkg_resources

import google.api_core.client_options as ClientOptions # type: ignore
from google.api_core.client_options import ClientOptions # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.api_core import timeout as timeouts # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.iam.v1 import iam_policy_pb2 # type: ignore
from google.iam.v1 import policy_pb2 # type: ignore
from google.protobuf import duration_pb2 # type: ignore
Expand Down Expand Up @@ -168,10 +170,10 @@ def __init__(

async def create_topic(
self,
request: pubsub.Topic = None,
request: Union[pubsub.Topic, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pubsub.Topic:
Expand All @@ -180,7 +182,7 @@ async def create_topic(
(https://cloud.google.com/pubsub/docs/admin#resource_names).
Args:
request (:class:`google.pubsub_v1.types.Topic`):
request (Union[google.pubsub_v1.types.Topic, dict]):
The request object. A topic resource.
name (:class:`str`):
Required. The name of the topic. It must have the format
Expand Down Expand Up @@ -254,17 +256,17 @@ async def create_topic(

async def update_topic(
self,
request: pubsub.UpdateTopicRequest = None,
request: Union[pubsub.UpdateTopicRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pubsub.Topic:
r"""Updates an existing topic. Note that certain
properties of a topic are not modifiable.
Args:
request (:class:`google.pubsub_v1.types.UpdateTopicRequest`):
request (Union[google.pubsub_v1.types.UpdateTopicRequest, dict]):
The request object. Request for the UpdateTopic method.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
Expand Down Expand Up @@ -313,19 +315,19 @@ async def update_topic(

async def publish(
self,
request: pubsub.PublishRequest = None,
request: Union[pubsub.PublishRequest, dict] = None,
*,
topic: str = None,
messages: Sequence[pubsub.PubsubMessage] = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pubsub.PublishResponse:
r"""Adds one or more messages to the topic. Returns ``NOT_FOUND`` if
the topic does not exist.
Args:
request (:class:`google.pubsub_v1.types.PublishRequest`):
request (Union[google.pubsub_v1.types.PublishRequest, dict]):
The request object. Request for the Publish method.
topic (:class:`str`):
Required. The messages in the request will be published
Expand Down Expand Up @@ -407,17 +409,17 @@ async def publish(

async def get_topic(
self,
request: pubsub.GetTopicRequest = None,
request: Union[pubsub.GetTopicRequest, dict] = None,
*,
topic: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pubsub.Topic:
r"""Gets the configuration of a topic.
Args:
request (:class:`google.pubsub_v1.types.GetTopicRequest`):
request (Union[google.pubsub_v1.types.GetTopicRequest, dict]):
The request object. Request for the GetTopic method.
topic (:class:`str`):
Required. The name of the topic to get. Format is
Expand Down Expand Up @@ -487,17 +489,17 @@ async def get_topic(

async def list_topics(
self,
request: pubsub.ListTopicsRequest = None,
request: Union[pubsub.ListTopicsRequest, dict] = None,
*,
project: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListTopicsAsyncPager:
r"""Lists matching topics.
Args:
request (:class:`google.pubsub_v1.types.ListTopicsRequest`):
request (Union[google.pubsub_v1.types.ListTopicsRequest, dict]):
The request object. Request for the `ListTopics` method.
project (:class:`str`):
Required. The name of the project in which to list
Expand Down Expand Up @@ -577,18 +579,18 @@ async def list_topics(

async def list_topic_subscriptions(
self,
request: pubsub.ListTopicSubscriptionsRequest = None,
request: Union[pubsub.ListTopicSubscriptionsRequest, dict] = None,
*,
topic: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListTopicSubscriptionsAsyncPager:
r"""Lists the names of the attached subscriptions on this
topic.
Args:
request (:class:`google.pubsub_v1.types.ListTopicSubscriptionsRequest`):
request (Union[google.pubsub_v1.types.ListTopicSubscriptionsRequest, dict]):
The request object. Request for the
`ListTopicSubscriptions` method.
topic (:class:`str`):
Expand Down Expand Up @@ -670,10 +672,10 @@ async def list_topic_subscriptions(

async def list_topic_snapshots(
self,
request: pubsub.ListTopicSnapshotsRequest = None,
request: Union[pubsub.ListTopicSnapshotsRequest, dict] = None,
*,
topic: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListTopicSnapshotsAsyncPager:
Expand All @@ -685,7 +687,7 @@ async def list_topic_snapshots(
in an existing subscription to the state captured by a snapshot.
Args:
request (:class:`google.pubsub_v1.types.ListTopicSnapshotsRequest`):
request (Union[google.pubsub_v1.types.ListTopicSnapshotsRequest, dict]):
The request object. Request for the `ListTopicSnapshots`
method.
topic (:class:`str`):
Expand Down Expand Up @@ -767,10 +769,10 @@ async def list_topic_snapshots(

async def delete_topic(
self,
request: pubsub.DeleteTopicRequest = None,
request: Union[pubsub.DeleteTopicRequest, dict] = None,
*,
topic: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
Expand All @@ -782,7 +784,7 @@ async def delete_topic(
field is set to ``_deleted-topic_``.
Args:
request (:class:`google.pubsub_v1.types.DeleteTopicRequest`):
request (Union[google.pubsub_v1.types.DeleteTopicRequest, dict]):
The request object. Request for the `DeleteTopic`
method.
topic (:class:`str`):
Expand Down Expand Up @@ -846,9 +848,9 @@ async def delete_topic(

async def detach_subscription(
self,
request: pubsub.DetachSubscriptionRequest = None,
request: Union[pubsub.DetachSubscriptionRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pubsub.DetachSubscriptionResponse:
Expand All @@ -859,7 +861,7 @@ async def detach_subscription(
will stop.
Args:
request (:class:`google.pubsub_v1.types.DetachSubscriptionRequest`):
request (Union[google.pubsub_v1.types.DetachSubscriptionRequest, dict]):
The request object. Request for the DetachSubscription
method.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
Expand Down Expand Up @@ -913,7 +915,7 @@ async def set_iam_policy(
self,
request: iam_policy_pb2.SetIamPolicyRequest = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> policy_pb2.Policy:
Expand Down Expand Up @@ -1022,7 +1024,7 @@ async def get_iam_policy(
self,
request: iam_policy_pb2.GetIamPolicyRequest = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> policy_pb2.Policy:
Expand Down Expand Up @@ -1132,7 +1134,7 @@ async def test_iam_permissions(
self,
request: iam_policy_pb2.TestIamPermissionsRequest = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> iam_policy_pb2.TestIamPermissionsResponse:
Expand Down
26 changes: 14 additions & 12 deletions google/pubsub_v1/services/publisher/client.py
Expand Up @@ -32,6 +32,8 @@
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.iam.v1 import iam_policy_pb2 # type: ignore
from google.iam.v1 import policy_pb2 # type: ignore
from google.protobuf import duration_pb2 # type: ignore
Expand Down Expand Up @@ -407,7 +409,7 @@ def create_topic(
request: Union[pubsub.Topic, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pubsub.Topic:
Expand Down Expand Up @@ -484,7 +486,7 @@ def update_topic(
self,
request: Union[pubsub.UpdateTopicRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pubsub.Topic:
Expand Down Expand Up @@ -538,7 +540,7 @@ def publish(
*,
topic: str = None,
messages: Sequence[pubsub.PubsubMessage] = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pubsub.PublishResponse:
Expand Down Expand Up @@ -617,7 +619,7 @@ def get_topic(
request: Union[pubsub.GetTopicRequest, dict] = None,
*,
topic: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pubsub.Topic:
Expand Down Expand Up @@ -687,7 +689,7 @@ def list_topics(
request: Union[pubsub.ListTopicsRequest, dict] = None,
*,
project: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListTopicsPager:
Expand Down Expand Up @@ -767,7 +769,7 @@ def list_topic_subscriptions(
request: Union[pubsub.ListTopicSubscriptionsRequest, dict] = None,
*,
topic: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListTopicSubscriptionsPager:
Expand Down Expand Up @@ -850,7 +852,7 @@ def list_topic_snapshots(
request: Union[pubsub.ListTopicSnapshotsRequest, dict] = None,
*,
topic: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListTopicSnapshotsPager:
Expand Down Expand Up @@ -937,7 +939,7 @@ def delete_topic(
request: Union[pubsub.DeleteTopicRequest, dict] = None,
*,
topic: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
Expand Down Expand Up @@ -1007,7 +1009,7 @@ def detach_subscription(
self,
request: Union[pubsub.DetachSubscriptionRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pubsub.DetachSubscriptionResponse:
Expand Down Expand Up @@ -1078,7 +1080,7 @@ def set_iam_policy(
self,
request: iam_policy_pb2.SetIamPolicyRequest = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> policy_pb2.Policy:
Expand Down Expand Up @@ -1191,7 +1193,7 @@ def get_iam_policy(
self,
request: iam_policy_pb2.GetIamPolicyRequest = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> policy_pb2.Policy:
Expand Down Expand Up @@ -1305,7 +1307,7 @@ def test_iam_permissions(
self,
request: iam_policy_pb2.TestIamPermissionsRequest = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: TimeoutType = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> iam_policy_pb2.TestIamPermissionsResponse:
Expand Down

0 comments on commit 290b9c5

Please sign in to comment.