From e2f7b9864109ce9ce08d2e4740bc71888805f467 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 9 Oct 2021 16:16:29 +0000 Subject: [PATCH] chore: use gapic-generator-python 0.52.0 (#251) - [x] Regenerate this pull request now. fix: improper types in pagers generation fix: add 'dict' annotation type to 'request' PiperOrigin-RevId: 399773015 Source-Link: https://github.com/googleapis/googleapis/commit/410c184536a22fadaf00aec3cab04102e34d2322 Source-Link: https://github.com/googleapis/googleapis-gen/commit/290e883545e3ac9ff2bd00cd0dacb28f1b8ca945 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjkwZTg4MzU0NWUzYWM5ZmYyYmQwMGNkMGRhY2IyOGYxYjhjYTk0NSJ9 --- .../services/admin_service/client.py | 78 +++++++++---------- .../services/admin_service/pagers.py | 2 +- .../services/admin_service/transports/base.py | 2 +- .../services/admin_service/transports/grpc.py | 6 +- .../admin_service/transports/grpc_asyncio.py | 6 +- .../services/cursor_service/client.py | 20 ++--- .../services/cursor_service/pagers.py | 12 +-- .../cursor_service/transports/base.py | 2 +- .../cursor_service/transports/grpc.py | 6 +- .../cursor_service/transports/grpc_asyncio.py | 6 +- .../partition_assignment_service/client.py | 12 +-- .../transports/base.py | 2 +- .../transports/grpc.py | 6 +- .../transports/grpc_asyncio.py | 6 +- .../services/publisher_service/client.py | 12 +-- .../publisher_service/transports/base.py | 2 +- .../publisher_service/transports/grpc.py | 6 +- .../transports/grpc_asyncio.py | 6 +- .../services/subscriber_service/client.py | 12 +-- .../subscriber_service/transports/base.py | 2 +- .../subscriber_service/transports/grpc.py | 6 +- .../transports/grpc_asyncio.py | 6 +- .../services/topic_stats_service/client.py | 14 ++-- .../topic_stats_service/transports/base.py | 2 +- .../topic_stats_service/transports/grpc.py | 6 +- .../transports/grpc_asyncio.py | 6 +- noxfile.py | 4 +- owlbot.py | 1 + 28 files changed, 107 insertions(+), 144 deletions(-) diff --git a/google/cloud/pubsublite_v1/services/admin_service/client.py b/google/cloud/pubsublite_v1/services/admin_service/client.py index 1048e8e9..9a8f2364 100644 --- a/google/cloud/pubsublite_v1/services/admin_service/client.py +++ b/google/cloud/pubsublite_v1/services/admin_service/client.py @@ -17,7 +17,7 @@ from distutils import util import os import re -from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore @@ -389,7 +389,7 @@ def __init__( def create_topic( self, - request: admin.CreateTopicRequest = None, + request: Union[admin.CreateTopicRequest, dict] = None, *, parent: str = None, topic: common.Topic = None, @@ -401,7 +401,7 @@ def create_topic( r"""Creates a new topic. Args: - request (google.cloud.pubsublite_v1.types.CreateTopicRequest): + request (Union[google.cloud.pubsublite_v1.types.CreateTopicRequest, dict]): The request object. Request for CreateTopic. parent (str): Required. The parent location in which to create the @@ -480,7 +480,7 @@ def create_topic( def get_topic( self, - request: admin.GetTopicRequest = None, + request: Union[admin.GetTopicRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -490,7 +490,7 @@ def get_topic( r"""Returns the topic configuration. Args: - request (google.cloud.pubsublite_v1.types.GetTopicRequest): + request (Union[google.cloud.pubsublite_v1.types.GetTopicRequest, dict]): The request object. Request for GetTopic. name (str): Required. The name of the topic whose @@ -548,7 +548,7 @@ def get_topic( def get_topic_partitions( self, - request: admin.GetTopicPartitionsRequest = None, + request: Union[admin.GetTopicPartitionsRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -559,7 +559,7 @@ def get_topic_partitions( topic. Args: - request (google.cloud.pubsublite_v1.types.GetTopicPartitionsRequest): + request (Union[google.cloud.pubsublite_v1.types.GetTopicPartitionsRequest, dict]): The request object. Request for GetTopicPartitions. name (str): Required. The topic whose partition @@ -617,7 +617,7 @@ def get_topic_partitions( def list_topics( self, - request: admin.ListTopicsRequest = None, + request: Union[admin.ListTopicsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -627,7 +627,7 @@ def list_topics( r"""Returns the list of topics for the given project. Args: - request (google.cloud.pubsublite_v1.types.ListTopicsRequest): + request (Union[google.cloud.pubsublite_v1.types.ListTopicsRequest, dict]): The request object. Request for ListTopics. parent (str): Required. The parent whose topics are to be listed. @@ -696,7 +696,7 @@ def list_topics( def update_topic( self, - request: admin.UpdateTopicRequest = None, + request: Union[admin.UpdateTopicRequest, dict] = None, *, topic: common.Topic = None, update_mask: field_mask_pb2.FieldMask = None, @@ -707,7 +707,7 @@ def update_topic( r"""Updates properties of the specified topic. Args: - request (google.cloud.pubsublite_v1.types.UpdateTopicRequest): + request (Union[google.cloud.pubsublite_v1.types.UpdateTopicRequest, dict]): The request object. Request for UpdateTopic. topic (google.cloud.pubsublite_v1.types.Topic): Required. The topic to update. Its ``name`` field must @@ -776,7 +776,7 @@ def update_topic( def delete_topic( self, - request: admin.DeleteTopicRequest = None, + request: Union[admin.DeleteTopicRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -786,7 +786,7 @@ def delete_topic( r"""Deletes the specified topic. Args: - request (google.cloud.pubsublite_v1.types.DeleteTopicRequest): + request (Union[google.cloud.pubsublite_v1.types.DeleteTopicRequest, dict]): The request object. Request for DeleteTopic. name (str): Required. The name of the topic to @@ -839,7 +839,7 @@ def delete_topic( def list_topic_subscriptions( self, - request: admin.ListTopicSubscriptionsRequest = None, + request: Union[admin.ListTopicSubscriptionsRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -850,7 +850,7 @@ def list_topic_subscriptions( topic. Args: - request (google.cloud.pubsublite_v1.types.ListTopicSubscriptionsRequest): + request (Union[google.cloud.pubsublite_v1.types.ListTopicSubscriptionsRequest, dict]): The request object. Request for ListTopicSubscriptions. name (str): Required. The name of the topic whose @@ -918,7 +918,7 @@ def list_topic_subscriptions( def create_subscription( self, - request: admin.CreateSubscriptionRequest = None, + request: Union[admin.CreateSubscriptionRequest, dict] = None, *, parent: str = None, subscription: common.Subscription = None, @@ -930,7 +930,7 @@ def create_subscription( r"""Creates a new subscription. Args: - request (google.cloud.pubsublite_v1.types.CreateSubscriptionRequest): + request (Union[google.cloud.pubsublite_v1.types.CreateSubscriptionRequest, dict]): The request object. Request for CreateSubscription. parent (str): Required. The parent location in which to create the @@ -1011,7 +1011,7 @@ def create_subscription( def get_subscription( self, - request: admin.GetSubscriptionRequest = None, + request: Union[admin.GetSubscriptionRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1021,7 +1021,7 @@ def get_subscription( r"""Returns the subscription configuration. Args: - request (google.cloud.pubsublite_v1.types.GetSubscriptionRequest): + request (Union[google.cloud.pubsublite_v1.types.GetSubscriptionRequest, dict]): The request object. Request for GetSubscription. name (str): Required. The name of the @@ -1082,7 +1082,7 @@ def get_subscription( def list_subscriptions( self, - request: admin.ListSubscriptionsRequest = None, + request: Union[admin.ListSubscriptionsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1093,7 +1093,7 @@ def list_subscriptions( project. Args: - request (google.cloud.pubsublite_v1.types.ListSubscriptionsRequest): + request (Union[google.cloud.pubsublite_v1.types.ListSubscriptionsRequest, dict]): The request object. Request for ListSubscriptions. parent (str): Required. The parent whose subscriptions are to be @@ -1162,7 +1162,7 @@ def list_subscriptions( def update_subscription( self, - request: admin.UpdateSubscriptionRequest = None, + request: Union[admin.UpdateSubscriptionRequest, dict] = None, *, subscription: common.Subscription = None, update_mask: field_mask_pb2.FieldMask = None, @@ -1173,7 +1173,7 @@ def update_subscription( r"""Updates properties of the specified subscription. Args: - request (google.cloud.pubsublite_v1.types.UpdateSubscriptionRequest): + request (Union[google.cloud.pubsublite_v1.types.UpdateSubscriptionRequest, dict]): The request object. Request for UpdateSubscription. subscription (google.cloud.pubsublite_v1.types.Subscription): Required. The subscription to update. Its ``name`` field @@ -1244,7 +1244,7 @@ def update_subscription( def delete_subscription( self, - request: admin.DeleteSubscriptionRequest = None, + request: Union[admin.DeleteSubscriptionRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1254,7 +1254,7 @@ def delete_subscription( r"""Deletes the specified subscription. Args: - request (google.cloud.pubsublite_v1.types.DeleteSubscriptionRequest): + request (Union[google.cloud.pubsublite_v1.types.DeleteSubscriptionRequest, dict]): The request object. Request for DeleteSubscription. name (str): Required. The name of the @@ -1307,7 +1307,7 @@ def delete_subscription( def seek_subscription( self, - request: admin.SeekSubscriptionRequest = None, + request: Union[admin.SeekSubscriptionRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -1342,7 +1342,7 @@ def seek_subscription( supersede it. Args: - request (google.cloud.pubsublite_v1.types.SeekSubscriptionRequest): + request (Union[google.cloud.pubsublite_v1.types.SeekSubscriptionRequest, dict]): The request object. Request for SeekSubscription. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -1393,7 +1393,7 @@ def seek_subscription( def create_reservation( self, - request: admin.CreateReservationRequest = None, + request: Union[admin.CreateReservationRequest, dict] = None, *, parent: str = None, reservation: common.Reservation = None, @@ -1405,7 +1405,7 @@ def create_reservation( r"""Creates a new reservation. Args: - request (google.cloud.pubsublite_v1.types.CreateReservationRequest): + request (Union[google.cloud.pubsublite_v1.types.CreateReservationRequest, dict]): The request object. Request for CreateReservation. parent (str): Required. The parent location in which to create the @@ -1486,7 +1486,7 @@ def create_reservation( def get_reservation( self, - request: admin.GetReservationRequest = None, + request: Union[admin.GetReservationRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1496,7 +1496,7 @@ def get_reservation( r"""Returns the reservation configuration. Args: - request (google.cloud.pubsublite_v1.types.GetReservationRequest): + request (Union[google.cloud.pubsublite_v1.types.GetReservationRequest, dict]): The request object. Request for GetReservation. name (str): Required. The name of the reservation whose @@ -1557,7 +1557,7 @@ def get_reservation( def list_reservations( self, - request: admin.ListReservationsRequest = None, + request: Union[admin.ListReservationsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1568,7 +1568,7 @@ def list_reservations( project. Args: - request (google.cloud.pubsublite_v1.types.ListReservationsRequest): + request (Union[google.cloud.pubsublite_v1.types.ListReservationsRequest, dict]): The request object. Request for ListReservations. parent (str): Required. The parent whose reservations are to be @@ -1637,7 +1637,7 @@ def list_reservations( def update_reservation( self, - request: admin.UpdateReservationRequest = None, + request: Union[admin.UpdateReservationRequest, dict] = None, *, reservation: common.Reservation = None, update_mask: field_mask_pb2.FieldMask = None, @@ -1648,7 +1648,7 @@ def update_reservation( r"""Updates properties of the specified reservation. Args: - request (google.cloud.pubsublite_v1.types.UpdateReservationRequest): + request (Union[google.cloud.pubsublite_v1.types.UpdateReservationRequest, dict]): The request object. Request for UpdateReservation. reservation (google.cloud.pubsublite_v1.types.Reservation): Required. The reservation to update. Its ``name`` field @@ -1719,7 +1719,7 @@ def update_reservation( def delete_reservation( self, - request: admin.DeleteReservationRequest = None, + request: Union[admin.DeleteReservationRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1729,7 +1729,7 @@ def delete_reservation( r"""Deletes the specified reservation. Args: - request (google.cloud.pubsublite_v1.types.DeleteReservationRequest): + request (Union[google.cloud.pubsublite_v1.types.DeleteReservationRequest, dict]): The request object. Request for DeleteReservation. name (str): Required. The name of the reservation to delete. @@ -1783,7 +1783,7 @@ def delete_reservation( def list_reservation_topics( self, - request: admin.ListReservationTopicsRequest = None, + request: Union[admin.ListReservationTopicsRequest, dict] = None, *, name: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -1794,7 +1794,7 @@ def list_reservation_topics( reservation. Args: - request (google.cloud.pubsublite_v1.types.ListReservationTopicsRequest): + request (Union[google.cloud.pubsublite_v1.types.ListReservationTopicsRequest, dict]): The request object. Request for ListReservationTopics. name (str): Required. The name of the reservation whose topics to diff --git a/google/cloud/pubsublite_v1/services/admin_service/pagers.py b/google/cloud/pubsublite_v1/services/admin_service/pagers.py index c2673200..cb5a290c 100644 --- a/google/cloud/pubsublite_v1/services/admin_service/pagers.py +++ b/google/cloud/pubsublite_v1/services/admin_service/pagers.py @@ -18,10 +18,10 @@ AsyncIterator, Awaitable, Callable, - Iterator, Sequence, Tuple, Optional, + Iterator, ) from google.cloud.pubsublite_v1.types import admin diff --git a/google/cloud/pubsublite_v1/services/admin_service/transports/base.py b/google/cloud/pubsublite_v1/services/admin_service/transports/base.py index 15d64407..70e597a8 100644 --- a/google/cloud/pubsublite_v1/services/admin_service/transports/base.py +++ b/google/cloud/pubsublite_v1/services/admin_service/transports/base.py @@ -121,7 +121,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/pubsublite_v1/services/admin_service/transports/grpc.py b/google/cloud/pubsublite_v1/services/admin_service/transports/grpc.py index 2c6d34ed..e10979b1 100644 --- a/google/cloud/pubsublite_v1/services/admin_service/transports/grpc.py +++ b/google/cloud/pubsublite_v1/services/admin_service/transports/grpc.py @@ -86,16 +86,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/pubsublite_v1/services/admin_service/transports/grpc_asyncio.py b/google/cloud/pubsublite_v1/services/admin_service/transports/grpc_asyncio.py index a1590e0c..14896976 100644 --- a/google/cloud/pubsublite_v1/services/admin_service/transports/grpc_asyncio.py +++ b/google/cloud/pubsublite_v1/services/admin_service/transports/grpc_asyncio.py @@ -133,16 +133,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/pubsublite_v1/services/cursor_service/client.py b/google/cloud/pubsublite_v1/services/cursor_service/client.py index 8e5cb4f2..c0940bba 100644 --- a/google/cloud/pubsublite_v1/services/cursor_service/client.py +++ b/google/cloud/pubsublite_v1/services/cursor_service/client.py @@ -17,17 +17,7 @@ from distutils import util import os import re -from typing import ( - Callable, - Dict, - Optional, - Iterable, - Iterator, - Sequence, - Tuple, - Type, - Union, -) +from typing import Dict, Optional, Iterable, Iterator, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore @@ -402,7 +392,7 @@ def streaming_commit_cursor( def commit_cursor( self, - request: cursor.CommitCursorRequest = None, + request: Union[cursor.CommitCursorRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -411,7 +401,7 @@ def commit_cursor( r"""Updates the committed cursor. Args: - request (google.cloud.pubsublite_v1.types.CommitCursorRequest): + request (Union[google.cloud.pubsublite_v1.types.CommitCursorRequest, dict]): The request object. Request for CommitCursor. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -451,7 +441,7 @@ def commit_cursor( def list_partition_cursors( self, - request: cursor.ListPartitionCursorsRequest = None, + request: Union[cursor.ListPartitionCursorsRequest, dict] = None, *, parent: str = None, retry: retries.Retry = gapic_v1.method.DEFAULT, @@ -462,7 +452,7 @@ def list_partition_cursors( subscription. Args: - request (google.cloud.pubsublite_v1.types.ListPartitionCursorsRequest): + request (Union[google.cloud.pubsublite_v1.types.ListPartitionCursorsRequest, dict]): The request object. Request for ListPartitionCursors. parent (str): Required. The subscription for which to retrieve diff --git a/google/cloud/pubsublite_v1/services/cursor_service/pagers.py b/google/cloud/pubsublite_v1/services/cursor_service/pagers.py index 58ccd4bc..5fbc1abe 100644 --- a/google/cloud/pubsublite_v1/services/cursor_service/pagers.py +++ b/google/cloud/pubsublite_v1/services/cursor_service/pagers.py @@ -15,13 +15,13 @@ # from typing import ( Any, - AsyncIterable, + AsyncIterator, Awaitable, Callable, - Iterable, Sequence, Tuple, Optional, + Iterator, ) from google.cloud.pubsublite_v1.types import cursor @@ -74,14 +74,14 @@ def __getattr__(self, name: str) -> Any: return getattr(self._response, name) @property - def pages(self) -> Iterable[cursor.ListPartitionCursorsResponse]: + def pages(self) -> Iterator[cursor.ListPartitionCursorsResponse]: yield self._response while self._response.next_page_token: self._request.page_token = self._response.next_page_token self._response = self._method(self._request, metadata=self._metadata) yield self._response - def __iter__(self) -> Iterable[cursor.PartitionCursor]: + def __iter__(self) -> Iterator[cursor.PartitionCursor]: for page in self.pages: yield from page.partition_cursors @@ -136,14 +136,14 @@ def __getattr__(self, name: str) -> Any: return getattr(self._response, name) @property - async def pages(self) -> AsyncIterable[cursor.ListPartitionCursorsResponse]: + async def pages(self) -> AsyncIterator[cursor.ListPartitionCursorsResponse]: yield self._response while self._response.next_page_token: self._request.page_token = self._response.next_page_token self._response = await self._method(self._request, metadata=self._metadata) yield self._response - def __aiter__(self) -> AsyncIterable[cursor.PartitionCursor]: + def __aiter__(self) -> AsyncIterator[cursor.PartitionCursor]: async def async_generator(): async for page in self.pages: for response in page.partition_cursors: diff --git a/google/cloud/pubsublite_v1/services/cursor_service/transports/base.py b/google/cloud/pubsublite_v1/services/cursor_service/transports/base.py index bd867b29..91ebeb67 100644 --- a/google/cloud/pubsublite_v1/services/cursor_service/transports/base.py +++ b/google/cloud/pubsublite_v1/services/cursor_service/transports/base.py @@ -117,7 +117,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/pubsublite_v1/services/cursor_service/transports/grpc.py b/google/cloud/pubsublite_v1/services/cursor_service/transports/grpc.py index 5e75e176..4b3dca5a 100644 --- a/google/cloud/pubsublite_v1/services/cursor_service/transports/grpc.py +++ b/google/cloud/pubsublite_v1/services/cursor_service/transports/grpc.py @@ -83,16 +83,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/pubsublite_v1/services/cursor_service/transports/grpc_asyncio.py b/google/cloud/pubsublite_v1/services/cursor_service/transports/grpc_asyncio.py index 4d6bf39a..9c90420b 100644 --- a/google/cloud/pubsublite_v1/services/cursor_service/transports/grpc_asyncio.py +++ b/google/cloud/pubsublite_v1/services/cursor_service/transports/grpc_asyncio.py @@ -130,16 +130,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/pubsublite_v1/services/partition_assignment_service/client.py b/google/cloud/pubsublite_v1/services/partition_assignment_service/client.py index 59630e51..53a09070 100644 --- a/google/cloud/pubsublite_v1/services/partition_assignment_service/client.py +++ b/google/cloud/pubsublite_v1/services/partition_assignment_service/client.py @@ -17,17 +17,7 @@ from distutils import util import os import re -from typing import ( - Callable, - Dict, - Optional, - Iterable, - Iterator, - Sequence, - Tuple, - Type, - Union, -) +from typing import Dict, Optional, Iterable, Iterator, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore diff --git a/google/cloud/pubsublite_v1/services/partition_assignment_service/transports/base.py b/google/cloud/pubsublite_v1/services/partition_assignment_service/transports/base.py index 3f1d6eff..ebb7c247 100644 --- a/google/cloud/pubsublite_v1/services/partition_assignment_service/transports/base.py +++ b/google/cloud/pubsublite_v1/services/partition_assignment_service/transports/base.py @@ -117,7 +117,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/pubsublite_v1/services/partition_assignment_service/transports/grpc.py b/google/cloud/pubsublite_v1/services/partition_assignment_service/transports/grpc.py index 17f1517c..d7919627 100644 --- a/google/cloud/pubsublite_v1/services/partition_assignment_service/transports/grpc.py +++ b/google/cloud/pubsublite_v1/services/partition_assignment_service/transports/grpc.py @@ -81,16 +81,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/pubsublite_v1/services/partition_assignment_service/transports/grpc_asyncio.py b/google/cloud/pubsublite_v1/services/partition_assignment_service/transports/grpc_asyncio.py index 61c01e87..e3f68a35 100644 --- a/google/cloud/pubsublite_v1/services/partition_assignment_service/transports/grpc_asyncio.py +++ b/google/cloud/pubsublite_v1/services/partition_assignment_service/transports/grpc_asyncio.py @@ -130,16 +130,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/pubsublite_v1/services/publisher_service/client.py b/google/cloud/pubsublite_v1/services/publisher_service/client.py index 37d27905..c5d1e49d 100644 --- a/google/cloud/pubsublite_v1/services/publisher_service/client.py +++ b/google/cloud/pubsublite_v1/services/publisher_service/client.py @@ -17,17 +17,7 @@ from distutils import util import os import re -from typing import ( - Callable, - Dict, - Optional, - Iterable, - Iterator, - Sequence, - Tuple, - Type, - Union, -) +from typing import Dict, Optional, Iterable, Iterator, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore diff --git a/google/cloud/pubsublite_v1/services/publisher_service/transports/base.py b/google/cloud/pubsublite_v1/services/publisher_service/transports/base.py index 80e52699..04d89b03 100644 --- a/google/cloud/pubsublite_v1/services/publisher_service/transports/base.py +++ b/google/cloud/pubsublite_v1/services/publisher_service/transports/base.py @@ -117,7 +117,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/pubsublite_v1/services/publisher_service/transports/grpc.py b/google/cloud/pubsublite_v1/services/publisher_service/transports/grpc.py index 906ff27b..fd738a38 100644 --- a/google/cloud/pubsublite_v1/services/publisher_service/transports/grpc.py +++ b/google/cloud/pubsublite_v1/services/publisher_service/transports/grpc.py @@ -84,16 +84,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/pubsublite_v1/services/publisher_service/transports/grpc_asyncio.py b/google/cloud/pubsublite_v1/services/publisher_service/transports/grpc_asyncio.py index e2e64c94..7da63e06 100644 --- a/google/cloud/pubsublite_v1/services/publisher_service/transports/grpc_asyncio.py +++ b/google/cloud/pubsublite_v1/services/publisher_service/transports/grpc_asyncio.py @@ -131,16 +131,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/pubsublite_v1/services/subscriber_service/client.py b/google/cloud/pubsublite_v1/services/subscriber_service/client.py index 4903bc5a..129dc01c 100644 --- a/google/cloud/pubsublite_v1/services/subscriber_service/client.py +++ b/google/cloud/pubsublite_v1/services/subscriber_service/client.py @@ -17,17 +17,7 @@ from distutils import util import os import re -from typing import ( - Callable, - Dict, - Optional, - Iterable, - Iterator, - Sequence, - Tuple, - Type, - Union, -) +from typing import Dict, Optional, Iterable, Iterator, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore diff --git a/google/cloud/pubsublite_v1/services/subscriber_service/transports/base.py b/google/cloud/pubsublite_v1/services/subscriber_service/transports/base.py index bfe6b48e..01f3f2b0 100644 --- a/google/cloud/pubsublite_v1/services/subscriber_service/transports/base.py +++ b/google/cloud/pubsublite_v1/services/subscriber_service/transports/base.py @@ -117,7 +117,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/pubsublite_v1/services/subscriber_service/transports/grpc.py b/google/cloud/pubsublite_v1/services/subscriber_service/transports/grpc.py index 0a6f0194..cf1838b2 100644 --- a/google/cloud/pubsublite_v1/services/subscriber_service/transports/grpc.py +++ b/google/cloud/pubsublite_v1/services/subscriber_service/transports/grpc.py @@ -81,16 +81,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/pubsublite_v1/services/subscriber_service/transports/grpc_asyncio.py b/google/cloud/pubsublite_v1/services/subscriber_service/transports/grpc_asyncio.py index 290b854d..3cfe2cfe 100644 --- a/google/cloud/pubsublite_v1/services/subscriber_service/transports/grpc_asyncio.py +++ b/google/cloud/pubsublite_v1/services/subscriber_service/transports/grpc_asyncio.py @@ -128,16 +128,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/pubsublite_v1/services/topic_stats_service/client.py b/google/cloud/pubsublite_v1/services/topic_stats_service/client.py index 018252a8..4302e21b 100644 --- a/google/cloud/pubsublite_v1/services/topic_stats_service/client.py +++ b/google/cloud/pubsublite_v1/services/topic_stats_service/client.py @@ -17,7 +17,7 @@ from distutils import util import os import re -from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore @@ -357,7 +357,7 @@ def __init__( def compute_message_stats( self, - request: topic_stats.ComputeMessageStatsRequest = None, + request: Union[topic_stats.ComputeMessageStatsRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -367,7 +367,7 @@ def compute_message_stats( given topic and partition. Args: - request (google.cloud.pubsublite_v1.types.ComputeMessageStatsRequest): + request (Union[google.cloud.pubsublite_v1.types.ComputeMessageStatsRequest, dict]): The request object. Compute statistics about a range of messages in a given topic and partition. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -409,7 +409,7 @@ def compute_message_stats( def compute_head_cursor( self, - request: topic_stats.ComputeHeadCursorRequest = None, + request: Union[topic_stats.ComputeHeadCursorRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -424,7 +424,7 @@ def compute_head_cursor( messages in the partition. Args: - request (google.cloud.pubsublite_v1.types.ComputeHeadCursorRequest): + request (Union[google.cloud.pubsublite_v1.types.ComputeHeadCursorRequest, dict]): The request object. Compute the current head cursor for a partition. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -465,7 +465,7 @@ def compute_head_cursor( def compute_time_cursor( self, - request: topic_stats.ComputeTimeCursorRequest = None, + request: Union[topic_stats.ComputeTimeCursorRequest, dict] = None, *, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, @@ -475,7 +475,7 @@ def compute_time_cursor( event time in a topic partition. Args: - request (google.cloud.pubsublite_v1.types.ComputeTimeCursorRequest): + request (Union[google.cloud.pubsublite_v1.types.ComputeTimeCursorRequest, dict]): The request object. Compute the corresponding cursor for a publish or event time in a topic partition. retry (google.api_core.retry.Retry): Designation of what errors, if any, diff --git a/google/cloud/pubsublite_v1/services/topic_stats_service/transports/base.py b/google/cloud/pubsublite_v1/services/topic_stats_service/transports/base.py index e150f25c..08f43a84 100644 --- a/google/cloud/pubsublite_v1/services/topic_stats_service/transports/base.py +++ b/google/cloud/pubsublite_v1/services/topic_stats_service/transports/base.py @@ -117,7 +117,7 @@ def __init__( **scopes_kwargs, quota_project_id=quota_project_id ) - # If the credentials is service account credentials, then always try to use self signed JWT. + # If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) diff --git a/google/cloud/pubsublite_v1/services/topic_stats_service/transports/grpc.py b/google/cloud/pubsublite_v1/services/topic_stats_service/transports/grpc.py index 15f8f7ae..fe99e860 100644 --- a/google/cloud/pubsublite_v1/services/topic_stats_service/transports/grpc.py +++ b/google/cloud/pubsublite_v1/services/topic_stats_service/transports/grpc.py @@ -81,16 +81,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/google/cloud/pubsublite_v1/services/topic_stats_service/transports/grpc_asyncio.py b/google/cloud/pubsublite_v1/services/topic_stats_service/transports/grpc_asyncio.py index 3e5e9aeb..2ca2fd3d 100644 --- a/google/cloud/pubsublite_v1/services/topic_stats_service/transports/grpc_asyncio.py +++ b/google/cloud/pubsublite_v1/services/topic_stats_service/transports/grpc_asyncio.py @@ -128,16 +128,16 @@ def __init__( api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. If provided, it overrides the ``host`` argument and tries to create a mutual TLS channel with client SSL credentials from - ``client_cert_source`` or applicatin default SSL credentials. + ``client_cert_source`` or application default SSL credentials. client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): Deprecated. A callback to provide client SSL certificate bytes and private key bytes, both in PEM format. It is ignored if ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials - for grpc channel. It is ignored if ``channel`` is provided. + for the grpc channel. It is ignored if ``channel`` is provided. client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): A callback to provide client certificate bytes and private key bytes, - both in PEM format. It is used to configure mutual TLS channel. It is + both in PEM format. It is used to configure a mutual TLS channel. It is ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. diff --git a/noxfile.py b/noxfile.py index e2cd0e64..179b7148 100644 --- a/noxfile.py +++ b/noxfile.py @@ -27,6 +27,8 @@ BLACK_VERSION = "black==19.10b0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] +PYTYPE_VERSION = "pytype==2021.09.09" + DEFAULT_PYTHON_VERSION = "3.8" SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] @@ -249,5 +251,5 @@ def docfx(session): def pytype(session): """Run type checks.""" install_test_deps(session) - session.install("pytype") + session.install(PYTYPE_VERSION) session.run("pytype", "google/cloud/pubsublite") diff --git a/owlbot.py b/owlbot.py index 0aadbdcf..b5b8c480 100644 --- a/owlbot.py +++ b/owlbot.py @@ -55,6 +55,7 @@ "README.rst", "scripts/fixup*.py", # new libraries do not need the keyword fixup script "setup.py", + "noxfile.py", # exclude to opt-in to pytype ] s.move(library, excludes=excludes)