Skip to content

Commit 4e15ce6

Browse files
feat: added Generator API (#502)
1 parent d1d60fa commit 4e15ce6

File tree

4 files changed

+50
-50
lines changed

4 files changed

+50
-50
lines changed

google/cloud/datastore_admin_v1/services/datastore_admin/async_client.py

Lines changed: 19 additions & 19 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
@@ -376,7 +376,7 @@ async def sample_export_entities():
376376
This corresponds to the ``output_url_prefix`` field
377377
on the ``request`` instance; if ``request`` is provided, this
378378
should not be set.
379-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
379+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
380380
should be retried.
381381
timeout (float): The timeout for this request.
382382
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -549,7 +549,7 @@ async def sample_import_entities():
549549
This corresponds to the ``entity_filter`` field
550550
on the ``request`` instance; if ``request`` is provided, this
551551
should not be set.
552-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
552+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
553553
should be retried.
554554
timeout (float): The timeout for this request.
555555
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -687,7 +687,7 @@ async def sample_create_index():
687687
request (Optional[Union[google.cloud.datastore_admin_v1.types.CreateIndexRequest, dict]]):
688688
The request object. The request for
689689
[google.datastore.admin.v1.DatastoreAdmin.CreateIndex][google.datastore.admin.v1.DatastoreAdmin.CreateIndex].
690-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
690+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
691691
should be retried.
692692
timeout (float): The timeout for this request.
693693
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -796,7 +796,7 @@ async def sample_delete_index():
796796
request (Optional[Union[google.cloud.datastore_admin_v1.types.DeleteIndexRequest, dict]]):
797797
The request object. The request for
798798
[google.datastore.admin.v1.DatastoreAdmin.DeleteIndex][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex].
799-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
799+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
800800
should be retried.
801801
timeout (float): The timeout for this request.
802802
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -891,7 +891,7 @@ async def sample_get_index():
891891
request (Optional[Union[google.cloud.datastore_admin_v1.types.GetIndexRequest, dict]]):
892892
The request object. The request for
893893
[google.datastore.admin.v1.DatastoreAdmin.GetIndex][google.datastore.admin.v1.DatastoreAdmin.GetIndex].
894-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
894+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
895895
should be retried.
896896
timeout (float): The timeout for this request.
897897
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -908,7 +908,7 @@ async def sample_get_index():
908908
# and friendly error handling.
909909
rpc = gapic_v1.method_async.wrap_method(
910910
self._client._transport.get_index,
911-
default_retry=retries.Retry(
911+
default_retry=retries.AsyncRetry(
912912
initial=0.1,
913913
maximum=60.0,
914914
multiplier=1.3,
@@ -987,7 +987,7 @@ async def sample_list_indexes():
987987
request (Optional[Union[google.cloud.datastore_admin_v1.types.ListIndexesRequest, dict]]):
988988
The request object. The request for
989989
[google.datastore.admin.v1.DatastoreAdmin.ListIndexes][google.datastore.admin.v1.DatastoreAdmin.ListIndexes].
990-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
990+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
991991
should be retried.
992992
timeout (float): The timeout for this request.
993993
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1009,7 +1009,7 @@ async def sample_list_indexes():
10091009
# and friendly error handling.
10101010
rpc = gapic_v1.method_async.wrap_method(
10111011
self._client._transport.list_indexes,
1012-
default_retry=retries.Retry(
1012+
default_retry=retries.AsyncRetry(
10131013
initial=0.1,
10141014
maximum=60.0,
10151015
multiplier=1.3,
@@ -1065,7 +1065,7 @@ async def list_operations(
10651065
request (:class:`~.operations_pb2.ListOperationsRequest`):
10661066
The request object. Request message for
10671067
`ListOperations` method.
1068-
retry (google.api_core.retry.Retry): Designation of what errors,
1068+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
10691069
if any, should be retried.
10701070
timeout (float): The timeout for this request.
10711071
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1082,7 +1082,7 @@ async def list_operations(
10821082

10831083
# Wrap the RPC method; this adds retry and timeout information,
10841084
# and friendly error handling.
1085-
rpc = gapic_v1.method.wrap_method(
1085+
rpc = gapic_v1.method_async.wrap_method(
10861086
self._client._transport.list_operations,
10871087
default_timeout=None,
10881088
client_info=DEFAULT_CLIENT_INFO,
@@ -1119,7 +1119,7 @@ async def get_operation(
11191119
request (:class:`~.operations_pb2.GetOperationRequest`):
11201120
The request object. Request message for
11211121
`GetOperation` method.
1122-
retry (google.api_core.retry.Retry): Designation of what errors,
1122+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
11231123
if any, should be retried.
11241124
timeout (float): The timeout for this request.
11251125
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1136,7 +1136,7 @@ async def get_operation(
11361136

11371137
# Wrap the RPC method; this adds retry and timeout information,
11381138
# and friendly error handling.
1139-
rpc = gapic_v1.method.wrap_method(
1139+
rpc = gapic_v1.method_async.wrap_method(
11401140
self._client._transport.get_operation,
11411141
default_timeout=None,
11421142
client_info=DEFAULT_CLIENT_INFO,
@@ -1178,7 +1178,7 @@ async def delete_operation(
11781178
request (:class:`~.operations_pb2.DeleteOperationRequest`):
11791179
The request object. Request message for
11801180
`DeleteOperation` method.
1181-
retry (google.api_core.retry.Retry): Designation of what errors,
1181+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
11821182
if any, should be retried.
11831183
timeout (float): The timeout for this request.
11841184
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1194,7 +1194,7 @@ async def delete_operation(
11941194

11951195
# Wrap the RPC method; this adds retry and timeout information,
11961196
# and friendly error handling.
1197-
rpc = gapic_v1.method.wrap_method(
1197+
rpc = gapic_v1.method_async.wrap_method(
11981198
self._client._transport.delete_operation,
11991199
default_timeout=None,
12001200
client_info=DEFAULT_CLIENT_INFO,
@@ -1232,7 +1232,7 @@ async def cancel_operation(
12321232
request (:class:`~.operations_pb2.CancelOperationRequest`):
12331233
The request object. Request message for
12341234
`CancelOperation` method.
1235-
retry (google.api_core.retry.Retry): Designation of what errors,
1235+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
12361236
if any, should be retried.
12371237
timeout (float): The timeout for this request.
12381238
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1248,7 +1248,7 @@ async def cancel_operation(
12481248

12491249
# Wrap the RPC method; this adds retry and timeout information,
12501250
# and friendly error handling.
1251-
rpc = gapic_v1.method.wrap_method(
1251+
rpc = gapic_v1.method_async.wrap_method(
12521252
self._client._transport.cancel_operation,
12531253
default_timeout=None,
12541254
client_info=DEFAULT_CLIENT_INFO,

google/cloud/datastore_v1/services/datastore/async_client.py

Lines changed: 23 additions & 23 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.cloud.datastore_v1.types import aggregation_result
4646
from google.cloud.datastore_v1.types import datastore
@@ -278,7 +278,7 @@ async def sample_lookup():
278278
This corresponds to the ``keys`` field
279279
on the ``request`` instance; if ``request`` is provided, this
280280
should not be set.
281-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
281+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
282282
should be retried.
283283
timeout (float): The timeout for this request.
284284
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -315,7 +315,7 @@ async def sample_lookup():
315315
# and friendly error handling.
316316
rpc = gapic_v1.method_async.wrap_method(
317317
self._client._transport.lookup,
318-
default_retry=retries.Retry(
318+
default_retry=retries.AsyncRetry(
319319
initial=0.1,
320320
maximum=60.0,
321321
multiplier=1.3,
@@ -388,7 +388,7 @@ async def sample_run_query():
388388
request (Optional[Union[google.cloud.datastore_v1.types.RunQueryRequest, dict]]):
389389
The request object. The request for
390390
[Datastore.RunQuery][google.datastore.v1.Datastore.RunQuery].
391-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
391+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
392392
should be retried.
393393
timeout (float): The timeout for this request.
394394
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -407,7 +407,7 @@ async def sample_run_query():
407407
# and friendly error handling.
408408
rpc = gapic_v1.method_async.wrap_method(
409409
self._client._transport.run_query,
410-
default_retry=retries.Retry(
410+
default_retry=retries.AsyncRetry(
411411
initial=0.1,
412412
maximum=60.0,
413413
multiplier=1.3,
@@ -480,7 +480,7 @@ async def sample_run_aggregation_query():
480480
request (Optional[Union[google.cloud.datastore_v1.types.RunAggregationQueryRequest, dict]]):
481481
The request object. The request for
482482
[Datastore.RunAggregationQuery][google.datastore.v1.Datastore.RunAggregationQuery].
483-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
483+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
484484
should be retried.
485485
timeout (float): The timeout for this request.
486486
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -499,7 +499,7 @@ async def sample_run_aggregation_query():
499499
# and friendly error handling.
500500
rpc = gapic_v1.method_async.wrap_method(
501501
self._client._transport.run_aggregation_query,
502-
default_retry=retries.Retry(
502+
default_retry=retries.AsyncRetry(
503503
initial=0.1,
504504
maximum=60.0,
505505
multiplier=1.3,
@@ -580,7 +580,7 @@ async def sample_begin_transaction():
580580
This corresponds to the ``project_id`` field
581581
on the ``request`` instance; if ``request`` is provided, this
582582
should not be set.
583-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
583+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
584584
should be retried.
585585
timeout (float): The timeout for this request.
586586
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -724,7 +724,7 @@ async def sample_commit():
724724
This corresponds to the ``mutations`` field
725725
on the ``request`` instance; if ``request`` is provided, this
726726
should not be set.
727-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
727+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
728728
should be retried.
729729
timeout (float): The timeout for this request.
730730
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -844,7 +844,7 @@ async def sample_rollback():
844844
This corresponds to the ``transaction`` field
845845
on the ``request`` instance; if ``request`` is provided, this
846846
should not be set.
847-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
847+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
848848
should be retried.
849849
timeout (float): The timeout for this request.
850850
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -962,7 +962,7 @@ async def sample_allocate_ids():
962962
This corresponds to the ``keys`` field
963963
on the ``request`` instance; if ``request`` is provided, this
964964
should not be set.
965-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
965+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
966966
should be retried.
967967
timeout (float): The timeout for this request.
968968
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1078,7 +1078,7 @@ async def sample_reserve_ids():
10781078
This corresponds to the ``keys`` field
10791079
on the ``request`` instance; if ``request`` is provided, this
10801080
should not be set.
1081-
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1081+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
10821082
should be retried.
10831083
timeout (float): The timeout for this request.
10841084
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1113,7 +1113,7 @@ async def sample_reserve_ids():
11131113
# and friendly error handling.
11141114
rpc = gapic_v1.method_async.wrap_method(
11151115
self._client._transport.reserve_ids,
1116-
default_retry=retries.Retry(
1116+
default_retry=retries.AsyncRetry(
11171117
initial=0.1,
11181118
maximum=60.0,
11191119
multiplier=1.3,
@@ -1160,7 +1160,7 @@ async def list_operations(
11601160
request (:class:`~.operations_pb2.ListOperationsRequest`):
11611161
The request object. Request message for
11621162
`ListOperations` method.
1163-
retry (google.api_core.retry.Retry): Designation of what errors,
1163+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
11641164
if any, should be retried.
11651165
timeout (float): The timeout for this request.
11661166
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1177,7 +1177,7 @@ async def list_operations(
11771177

11781178
# Wrap the RPC method; this adds retry and timeout information,
11791179
# and friendly error handling.
1180-
rpc = gapic_v1.method.wrap_method(
1180+
rpc = gapic_v1.method_async.wrap_method(
11811181
self._client._transport.list_operations,
11821182
default_timeout=None,
11831183
client_info=DEFAULT_CLIENT_INFO,
@@ -1214,7 +1214,7 @@ async def get_operation(
12141214
request (:class:`~.operations_pb2.GetOperationRequest`):
12151215
The request object. Request message for
12161216
`GetOperation` method.
1217-
retry (google.api_core.retry.Retry): Designation of what errors,
1217+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
12181218
if any, should be retried.
12191219
timeout (float): The timeout for this request.
12201220
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1231,7 +1231,7 @@ async def get_operation(
12311231

12321232
# Wrap the RPC method; this adds retry and timeout information,
12331233
# and friendly error handling.
1234-
rpc = gapic_v1.method.wrap_method(
1234+
rpc = gapic_v1.method_async.wrap_method(
12351235
self._client._transport.get_operation,
12361236
default_timeout=None,
12371237
client_info=DEFAULT_CLIENT_INFO,
@@ -1273,7 +1273,7 @@ async def delete_operation(
12731273
request (:class:`~.operations_pb2.DeleteOperationRequest`):
12741274
The request object. Request message for
12751275
`DeleteOperation` method.
1276-
retry (google.api_core.retry.Retry): Designation of what errors,
1276+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
12771277
if any, should be retried.
12781278
timeout (float): The timeout for this request.
12791279
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1289,7 +1289,7 @@ async def delete_operation(
12891289

12901290
# Wrap the RPC method; this adds retry and timeout information,
12911291
# and friendly error handling.
1292-
rpc = gapic_v1.method.wrap_method(
1292+
rpc = gapic_v1.method_async.wrap_method(
12931293
self._client._transport.delete_operation,
12941294
default_timeout=None,
12951295
client_info=DEFAULT_CLIENT_INFO,
@@ -1327,7 +1327,7 @@ async def cancel_operation(
13271327
request (:class:`~.operations_pb2.CancelOperationRequest`):
13281328
The request object. Request message for
13291329
`CancelOperation` method.
1330-
retry (google.api_core.retry.Retry): Designation of what errors,
1330+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
13311331
if any, should be retried.
13321332
timeout (float): The timeout for this request.
13331333
metadata (Sequence[Tuple[str, str]]): Strings which should be
@@ -1343,7 +1343,7 @@ async def cancel_operation(
13431343

13441344
# Wrap the RPC method; this adds retry and timeout information,
13451345
# and friendly error handling.
1346-
rpc = gapic_v1.method.wrap_method(
1346+
rpc = gapic_v1.method_async.wrap_method(
13471347
self._client._transport.cancel_operation,
13481348
default_timeout=None,
13491349
client_info=DEFAULT_CLIENT_INFO,

0 commit comments

Comments
 (0)