Skip to content

Commit ac71140

Browse files
fix: use retry_async instead of retry in async client (#458)
* chore: Update gapic-generator-python to v1.12.0 PiperOrigin-RevId: 586356061 Source-Link: googleapis/googleapis@72a1f55 Source-Link: googleapis/googleapis-gen@558a04b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU4YTA0YmNkMWNjMDU3NmU4ZmFjMTA4OWU0OGU0OGIyN2FjMTYxYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: Update gapic-generator-python to v1.13.0 PiperOrigin-RevId: 586460538 Source-Link: googleapis/googleapis@44582d0 Source-Link: googleapis/googleapis-gen@5e7073c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWU3MDczYzlkZTg0NzkyOWM0YWU5N2Y4YTQ0NGMzZmNhMmQ0NWE2YiJ9 * 🦉 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 <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent 4918956 commit ac71140

File tree

12 files changed

+120
-120
lines changed

12 files changed

+120
-120
lines changed

google/cloud/pubsublite_v1/services/admin_service/async_client.py

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
from google.api_core.client_options import ClientOptions
3434
from google.api_core import exceptions as core_exceptions
3535
from google.api_core import gapic_v1
36-
from google.api_core import retry as retries
36+
from google.api_core import retry_async as retries
3737
from google.auth import credentials as ga_credentials # type: ignore
3838
from google.oauth2 import service_account # type: ignore
3939

4040
try:
41-
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
41+
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault]
4242
except AttributeError: # pragma: NO COVER
43-
OptionalRetry = Union[retries.Retry, object] # type: ignore
43+
OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore
4444

4545
from google.api_core import operation # type: ignore
4646
from google.api_core import operation_async # type: ignore
@@ -288,7 +288,7 @@ async def sample_create_topic():
288288
This corresponds to the ``topic_id`` field
289289
on the ``request`` instance; if ``request`` is provided, this
290290
should not be set.
291-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
291+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
292292
should be retried.
293293
timeout (float): The timeout for this request.
294294
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -391,7 +391,7 @@ async def sample_get_topic():
391391
This corresponds to the ``name`` field
392392
on the ``request`` instance; if ``request`` is provided, this
393393
should not be set.
394-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
394+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
395395
should be retried.
396396
timeout (float): The timeout for this request.
397397
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -491,7 +491,7 @@ async def sample_get_topic_partitions():
491491
This corresponds to the ``name`` field
492492
on the ``request`` instance; if ``request`` is provided, this
493493
should not be set.
494-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
494+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
495495
should be retried.
496496
timeout (float): The timeout for this request.
497497
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -592,7 +592,7 @@ async def sample_list_topics():
592592
This corresponds to the ``parent`` field
593593
on the ``request`` instance; if ``request`` is provided, this
594594
should not be set.
595-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
595+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
596596
should be retried.
597597
timeout (float): The timeout for this request.
598598
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -712,7 +712,7 @@ async def sample_update_topic():
712712
This corresponds to the ``update_mask`` field
713713
on the ``request`` instance; if ``request`` is provided, this
714714
should not be set.
715-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
715+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
716716
should be retried.
717717
timeout (float): The timeout for this request.
718718
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -812,7 +812,7 @@ async def sample_delete_topic():
812812
This corresponds to the ``name`` field
813813
on the ``request`` instance; if ``request`` is provided, this
814814
should not be set.
815-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
815+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
816816
should be retried.
817817
timeout (float): The timeout for this request.
818818
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -906,7 +906,7 @@ async def sample_list_topic_subscriptions():
906906
This corresponds to the ``name`` field
907907
on the ``request`` instance; if ``request`` is provided, this
908908
should not be set.
909-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
909+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
910910
should be retried.
911911
timeout (float): The timeout for this request.
912912
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1039,7 +1039,7 @@ async def sample_create_subscription():
10391039
This corresponds to the ``subscription_id`` field
10401040
on the ``request`` instance; if ``request`` is provided, this
10411041
should not be set.
1042-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1042+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
10431043
should be retried.
10441044
timeout (float): The timeout for this request.
10451045
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1145,7 +1145,7 @@ async def sample_get_subscription():
11451145
This corresponds to the ``name`` field
11461146
on the ``request`` instance; if ``request`` is provided, this
11471147
should not be set.
1148-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1148+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
11491149
should be retried.
11501150
timeout (float): The timeout for this request.
11511151
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1249,7 +1249,7 @@ async def sample_list_subscriptions():
12491249
This corresponds to the ``parent`` field
12501250
on the ``request`` instance; if ``request`` is provided, this
12511251
should not be set.
1252-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1252+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
12531253
should be retried.
12541254
timeout (float): The timeout for this request.
12551255
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1369,7 +1369,7 @@ async def sample_update_subscription():
13691369
This corresponds to the ``update_mask`` field
13701370
on the ``request`` instance; if ``request`` is provided, this
13711371
should not be set.
1372-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1372+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
13731373
should be retried.
13741374
timeout (float): The timeout for this request.
13751375
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1471,7 +1471,7 @@ async def sample_delete_subscription():
14711471
This corresponds to the ``name`` field
14721472
on the ``request`` instance; if ``request`` is provided, this
14731473
should not be set.
1474-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1474+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
14751475
should be retried.
14761476
timeout (float): The timeout for this request.
14771477
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1586,7 +1586,7 @@ async def sample_seek_subscription():
15861586
Args:
15871587
request (Optional[Union[google.cloud.pubsublite_v1.types.SeekSubscriptionRequest, dict]]):
15881588
The request object. Request for SeekSubscription.
1589-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1589+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
15901590
should be retried.
15911591
timeout (float): The timeout for this request.
15921592
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1704,7 +1704,7 @@ async def sample_create_reservation():
17041704
This corresponds to the ``reservation_id`` field
17051705
on the ``request`` instance; if ``request`` is provided, this
17061706
should not be set.
1707-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1707+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
17081708
should be retried.
17091709
timeout (float): The timeout for this request.
17101710
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1810,7 +1810,7 @@ async def sample_get_reservation():
18101810
This corresponds to the ``name`` field
18111811
on the ``request`` instance; if ``request`` is provided, this
18121812
should not be set.
1813-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1813+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
18141814
should be retried.
18151815
timeout (float): The timeout for this request.
18161816
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1914,7 +1914,7 @@ async def sample_list_reservations():
19141914
This corresponds to the ``parent`` field
19151915
on the ``request`` instance; if ``request`` is provided, this
19161916
should not be set.
1917-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1917+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
19181918
should be retried.
19191919
timeout (float): The timeout for this request.
19201920
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -2034,7 +2034,7 @@ async def sample_update_reservation():
20342034
This corresponds to the ``update_mask`` field
20352035
on the ``request`` instance; if ``request`` is provided, this
20362036
should not be set.
2037-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
2037+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
20382038
should be retried.
20392039
timeout (float): The timeout for this request.
20402040
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -2137,7 +2137,7 @@ async def sample_delete_reservation():
21372137
This corresponds to the ``name`` field
21382138
on the ``request`` instance; if ``request`` is provided, this
21392139
should not be set.
2140-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
2140+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
21412141
should be retried.
21422142
timeout (float): The timeout for this request.
21432143
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -2232,7 +2232,7 @@ async def sample_list_reservation_topics():
22322232
This corresponds to the ``name`` field
22332233
on the ``request`` instance; if ``request`` is provided, this
22342234
should not be set.
2235-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
2235+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
22362236
should be retried.
22372237
timeout (float): The timeout for this request.
22382238
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -2312,7 +2312,7 @@ async def list_operations(
23122312
request (:class:`~.operations_pb2.ListOperationsRequest`):
23132313
The request object. Request message for
23142314
`ListOperations` method.
2315-
retry (google.api_core.retry.Retry): Designation of what errors,
2315+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
23162316
if any, should be retried.
23172317
timeout (float): The timeout for this request.
23182318
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -2329,7 +2329,7 @@ async def list_operations(
23292329

23302330
# Wrap the RPC method; this adds retry and timeout information,
23312331
# and friendly error handling.
2332-
rpc = gapic_v1.method.wrap_method(
2332+
rpc = gapic_v1.method_async.wrap_method(
23332333
self._client._transport.list_operations,
23342334
default_timeout=None,
23352335
client_info=DEFAULT_CLIENT_INFO,
@@ -2366,7 +2366,7 @@ async def get_operation(
23662366
request (:class:`~.operations_pb2.GetOperationRequest`):
23672367
The request object. Request message for
23682368
`GetOperation` method.
2369-
retry (google.api_core.retry.Retry): Designation of what errors,
2369+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
23702370
if any, should be retried.
23712371
timeout (float): The timeout for this request.
23722372
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -2383,7 +2383,7 @@ async def get_operation(
23832383

23842384
# Wrap the RPC method; this adds retry and timeout information,
23852385
# and friendly error handling.
2386-
rpc = gapic_v1.method.wrap_method(
2386+
rpc = gapic_v1.method_async.wrap_method(
23872387
self._client._transport.get_operation,
23882388
default_timeout=None,
23892389
client_info=DEFAULT_CLIENT_INFO,
@@ -2425,7 +2425,7 @@ async def delete_operation(
24252425
request (:class:`~.operations_pb2.DeleteOperationRequest`):
24262426
The request object. Request message for
24272427
`DeleteOperation` method.
2428-
retry (google.api_core.retry.Retry): Designation of what errors,
2428+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
24292429
if any, should be retried.
24302430
timeout (float): The timeout for this request.
24312431
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -2441,7 +2441,7 @@ async def delete_operation(
24412441

24422442
# Wrap the RPC method; this adds retry and timeout information,
24432443
# and friendly error handling.
2444-
rpc = gapic_v1.method.wrap_method(
2444+
rpc = gapic_v1.method_async.wrap_method(
24452445
self._client._transport.delete_operation,
24462446
default_timeout=None,
24472447
client_info=DEFAULT_CLIENT_INFO,
@@ -2479,7 +2479,7 @@ async def cancel_operation(
24792479
request (:class:`~.operations_pb2.CancelOperationRequest`):
24802480
The request object. Request message for
24812481
`CancelOperation` method.
2482-
retry (google.api_core.retry.Retry): Designation of what errors,
2482+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
24832483
if any, should be retried.
24842484
timeout (float): The timeout for this request.
24852485
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -2495,7 +2495,7 @@ async def cancel_operation(
24952495

24962496
# Wrap the RPC method; this adds retry and timeout information,
24972497
# and friendly error handling.
2498-
rpc = gapic_v1.method.wrap_method(
2498+
rpc = gapic_v1.method_async.wrap_method(
24992499
self._client._transport.cancel_operation,
25002500
default_timeout=None,
25012501
client_info=DEFAULT_CLIENT_INFO,

0 commit comments

Comments
 (0)