Skip to content

Commit

Permalink
chore: Update gapic-generator-python to v1.18.5 (#1231)
Browse files Browse the repository at this point in the history
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Aug 12, 2024
1 parent 5aca748 commit 7cf2d11
Show file tree
Hide file tree
Showing 13 changed files with 471 additions and 177 deletions.
11 changes: 7 additions & 4 deletions google/pubsub_v1/services/publisher/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# limitations under the License.
#
from collections import OrderedDict
import functools
import re
from typing import (
Dict,
Expand Down Expand Up @@ -192,9 +191,7 @@ def universe_domain(self) -> str:
"""
return self._client._universe_domain

get_transport_class = functools.partial(
type(PublisherClient).get_transport_class, type(PublisherClient)
)
get_transport_class = PublisherClient.get_transport_class

def __init__(
self,
Expand Down Expand Up @@ -826,6 +823,8 @@ async def sample_list_topics():
method=rpc,
request=request,
response=response,
retry=retry,
timeout=timeout,
metadata=metadata,
)

Expand Down Expand Up @@ -946,6 +945,8 @@ async def sample_list_topic_subscriptions():
method=rpc,
request=request,
response=response,
retry=retry,
timeout=timeout,
metadata=metadata,
)

Expand Down Expand Up @@ -1070,6 +1071,8 @@ async def sample_list_topic_snapshots():
method=rpc,
request=request,
response=response,
retry=retry,
timeout=timeout,
metadata=metadata,
)

Expand Down
8 changes: 7 additions & 1 deletion google/pubsub_v1/services/publisher/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def __init__(
transport_init: Union[
Type[PublisherTransport], Callable[..., PublisherTransport]
] = (
type(self).get_transport_class(transport)
PublisherClient.get_transport_class(transport)
if isinstance(transport, str) or transport is None
else cast(Callable[..., PublisherTransport], transport)
)
Expand Down Expand Up @@ -1284,6 +1284,8 @@ def sample_list_topics():
method=rpc,
request=request,
response=response,
retry=retry,
timeout=timeout,
metadata=metadata,
)

Expand Down Expand Up @@ -1401,6 +1403,8 @@ def sample_list_topic_subscriptions():
method=rpc,
request=request,
response=response,
retry=retry,
timeout=timeout,
metadata=metadata,
)

Expand Down Expand Up @@ -1522,6 +1526,8 @@ def sample_list_topic_snapshots():
method=rpc,
request=request,
response=response,
retry=retry,
timeout=timeout,
metadata=metadata,
)

Expand Down
97 changes: 91 additions & 6 deletions google/pubsub_v1/services/publisher/pagers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.api_core import retry_async as retries_async
from typing import (
Any,
AsyncIterator,
Expand All @@ -22,8 +25,18 @@
Tuple,
Optional,
Iterator,
Union,
)

try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]
OptionalAsyncRetry = Union[
retries_async.AsyncRetry, gapic_v1.method._MethodDefault, None
]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object, None] # type: ignore
OptionalAsyncRetry = Union[retries_async.AsyncRetry, object, None] # type: ignore

from google.pubsub_v1.types import pubsub


Expand Down Expand Up @@ -51,6 +64,8 @@ def __init__(
request: pubsub.ListTopicsRequest,
response: pubsub.ListTopicsResponse,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = ()
):
"""Instantiate the pager.
Expand All @@ -62,12 +77,17 @@ def __init__(
The initial request object.
response (google.pubsub_v1.types.ListTopicsResponse):
The initial response object.
retry (google.api_core.retry.Retry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
"""
self._method = method
self._request = pubsub.ListTopicsRequest(request)
self._response = response
self._retry = retry
self._timeout = timeout
self._metadata = metadata

def __getattr__(self, name: str) -> Any:
Expand All @@ -78,7 +98,12 @@ def pages(self) -> Iterator[pubsub.ListTopicsResponse]:
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)
self._response = self._method(
self._request,
retry=self._retry,
timeout=self._timeout,
metadata=self._metadata,
)
yield self._response

def __iter__(self) -> Iterator[pubsub.Topic]:
Expand Down Expand Up @@ -113,6 +138,8 @@ def __init__(
request: pubsub.ListTopicsRequest,
response: pubsub.ListTopicsResponse,
*,
retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = ()
):
"""Instantiates the pager.
Expand All @@ -124,12 +151,17 @@ def __init__(
The initial request object.
response (google.pubsub_v1.types.ListTopicsResponse):
The initial response object.
retry (google.api_core.retry.AsyncRetry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
"""
self._method = method
self._request = pubsub.ListTopicsRequest(request)
self._response = response
self._retry = retry
self._timeout = timeout
self._metadata = metadata

def __getattr__(self, name: str) -> Any:
Expand All @@ -140,7 +172,12 @@ async def pages(self) -> AsyncIterator[pubsub.ListTopicsResponse]:
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)
self._response = await self._method(
self._request,
retry=self._retry,
timeout=self._timeout,
metadata=self._metadata,
)
yield self._response

def __aiter__(self) -> AsyncIterator[pubsub.Topic]:
Expand Down Expand Up @@ -179,6 +216,8 @@ def __init__(
request: pubsub.ListTopicSubscriptionsRequest,
response: pubsub.ListTopicSubscriptionsResponse,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = ()
):
"""Instantiate the pager.
Expand All @@ -190,12 +229,17 @@ def __init__(
The initial request object.
response (google.pubsub_v1.types.ListTopicSubscriptionsResponse):
The initial response object.
retry (google.api_core.retry.Retry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
"""
self._method = method
self._request = pubsub.ListTopicSubscriptionsRequest(request)
self._response = response
self._retry = retry
self._timeout = timeout
self._metadata = metadata

def __getattr__(self, name: str) -> Any:
Expand All @@ -206,7 +250,12 @@ def pages(self) -> Iterator[pubsub.ListTopicSubscriptionsResponse]:
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)
self._response = self._method(
self._request,
retry=self._retry,
timeout=self._timeout,
metadata=self._metadata,
)
yield self._response

def __iter__(self) -> Iterator[str]:
Expand Down Expand Up @@ -241,6 +290,8 @@ def __init__(
request: pubsub.ListTopicSubscriptionsRequest,
response: pubsub.ListTopicSubscriptionsResponse,
*,
retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = ()
):
"""Instantiates the pager.
Expand All @@ -252,12 +303,17 @@ def __init__(
The initial request object.
response (google.pubsub_v1.types.ListTopicSubscriptionsResponse):
The initial response object.
retry (google.api_core.retry.AsyncRetry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
"""
self._method = method
self._request = pubsub.ListTopicSubscriptionsRequest(request)
self._response = response
self._retry = retry
self._timeout = timeout
self._metadata = metadata

def __getattr__(self, name: str) -> Any:
Expand All @@ -268,7 +324,12 @@ async def pages(self) -> AsyncIterator[pubsub.ListTopicSubscriptionsResponse]:
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)
self._response = await self._method(
self._request,
retry=self._retry,
timeout=self._timeout,
metadata=self._metadata,
)
yield self._response

def __aiter__(self) -> AsyncIterator[str]:
Expand Down Expand Up @@ -307,6 +368,8 @@ def __init__(
request: pubsub.ListTopicSnapshotsRequest,
response: pubsub.ListTopicSnapshotsResponse,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = ()
):
"""Instantiate the pager.
Expand All @@ -318,12 +381,17 @@ def __init__(
The initial request object.
response (google.pubsub_v1.types.ListTopicSnapshotsResponse):
The initial response object.
retry (google.api_core.retry.Retry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
"""
self._method = method
self._request = pubsub.ListTopicSnapshotsRequest(request)
self._response = response
self._retry = retry
self._timeout = timeout
self._metadata = metadata

def __getattr__(self, name: str) -> Any:
Expand All @@ -334,7 +402,12 @@ def pages(self) -> Iterator[pubsub.ListTopicSnapshotsResponse]:
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)
self._response = self._method(
self._request,
retry=self._retry,
timeout=self._timeout,
metadata=self._metadata,
)
yield self._response

def __iter__(self) -> Iterator[str]:
Expand Down Expand Up @@ -369,6 +442,8 @@ def __init__(
request: pubsub.ListTopicSnapshotsRequest,
response: pubsub.ListTopicSnapshotsResponse,
*,
retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = ()
):
"""Instantiates the pager.
Expand All @@ -380,12 +455,17 @@ def __init__(
The initial request object.
response (google.pubsub_v1.types.ListTopicSnapshotsResponse):
The initial response object.
retry (google.api_core.retry.AsyncRetry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
"""
self._method = method
self._request = pubsub.ListTopicSnapshotsRequest(request)
self._response = response
self._retry = retry
self._timeout = timeout
self._metadata = metadata

def __getattr__(self, name: str) -> Any:
Expand All @@ -396,7 +476,12 @@ async def pages(self) -> AsyncIterator[pubsub.ListTopicSnapshotsResponse]:
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)
self._response = await self._method(
self._request,
retry=self._retry,
timeout=self._timeout,
metadata=self._metadata,
)
yield self._response

def __aiter__(self) -> AsyncIterator[str]:
Expand Down
9 changes: 5 additions & 4 deletions google/pubsub_v1/services/schema_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# limitations under the License.
#
from collections import OrderedDict
import functools
import re
from typing import (
Dict,
Expand Down Expand Up @@ -191,9 +190,7 @@ def universe_domain(self) -> str:
"""
return self._client._universe_domain

get_transport_class = functools.partial(
type(SchemaServiceClient).get_transport_class, type(SchemaServiceClient)
)
get_transport_class = SchemaServiceClient.get_transport_class

def __init__(
self,
Expand Down Expand Up @@ -609,6 +606,8 @@ async def sample_list_schemas():
method=rpc,
request=request,
response=response,
retry=retry,
timeout=timeout,
metadata=metadata,
)

Expand Down Expand Up @@ -726,6 +725,8 @@ async def sample_list_schema_revisions():
method=rpc,
request=request,
response=response,
retry=retry,
timeout=timeout,
metadata=metadata,
)

Expand Down
Loading

0 comments on commit 7cf2d11

Please sign in to comment.