diff --git a/google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py b/google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py index 8da5ebb260..c0f9389db8 100644 --- a/google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py +++ b/google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py @@ -33,14 +33,14 @@ from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -299,7 +299,7 @@ async def sample_list_databases(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -335,7 +335,7 @@ async def sample_list_databases(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_databases, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -453,7 +453,7 @@ async def sample_create_database(): This corresponds to the ``create_statement`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -571,7 +571,7 @@ async def sample_get_database(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -602,7 +602,7 @@ async def sample_get_database(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_database, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -736,7 +736,7 @@ async def sample_update_database(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -774,7 +774,7 @@ async def sample_update_database(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.update_database, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -901,7 +901,7 @@ async def sample_update_database_ddl(): This corresponds to the ``statements`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -946,7 +946,7 @@ async def sample_update_database_ddl(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.update_database_ddl, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -1033,7 +1033,7 @@ async def sample_drop_database(): This corresponds to the ``database`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1060,7 +1060,7 @@ async def sample_drop_database(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.drop_database, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -1142,7 +1142,7 @@ async def sample_get_database_ddl(): This corresponds to the ``database`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1175,7 +1175,7 @@ async def sample_get_database_ddl(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_database_ddl, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -1264,7 +1264,7 @@ async def sample_set_iam_policy(): This corresponds to the ``resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1407,7 +1407,7 @@ async def sample_get_iam_policy(): This corresponds to the ``resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1470,7 +1470,7 @@ async def sample_get_iam_policy(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_iam_policy, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -1571,7 +1571,7 @@ async def sample_test_iam_permissions(): This corresponds to the ``permissions`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1712,7 +1712,7 @@ async def sample_create_backup(): This corresponds to the ``backup_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1883,7 +1883,7 @@ async def sample_copy_backup(): This corresponds to the ``expire_time`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -2003,7 +2003,7 @@ async def sample_get_backup(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -2034,7 +2034,7 @@ async def sample_get_backup(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_backup, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -2130,7 +2130,7 @@ async def sample_update_backup(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -2163,7 +2163,7 @@ async def sample_update_backup(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.update_backup, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -2243,7 +2243,7 @@ async def sample_delete_backup(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -2270,7 +2270,7 @@ async def sample_delete_backup(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_backup, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -2349,7 +2349,7 @@ async def sample_list_backups(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -2385,7 +2385,7 @@ async def sample_list_backups(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_backups, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -2522,7 +2522,7 @@ async def sample_restore_database(): This corresponds to the ``backup`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -2652,7 +2652,7 @@ async def sample_list_database_operations(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -2688,7 +2688,7 @@ async def sample_list_database_operations(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_database_operations, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -2789,7 +2789,7 @@ async def sample_list_backup_operations(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -2825,7 +2825,7 @@ async def sample_list_backup_operations(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_backup_operations, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -2917,7 +2917,7 @@ async def sample_list_database_roles(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -2953,7 +2953,7 @@ async def sample_list_database_roles(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_database_roles, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -3007,7 +3007,7 @@ async def list_operations( request (:class:`~.operations_pb2.ListOperationsRequest`): The request object. Request message for `ListOperations` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.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 @@ -3024,7 +3024,7 @@ async def list_operations( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_operations, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -3061,7 +3061,7 @@ async def get_operation( request (:class:`~.operations_pb2.GetOperationRequest`): The request object. Request message for `GetOperation` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.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 @@ -3078,7 +3078,7 @@ async def get_operation( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_operation, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -3120,7 +3120,7 @@ async def delete_operation( request (:class:`~.operations_pb2.DeleteOperationRequest`): The request object. Request message for `DeleteOperation` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.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 @@ -3136,7 +3136,7 @@ async def delete_operation( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_operation, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, @@ -3174,7 +3174,7 @@ async def cancel_operation( request (:class:`~.operations_pb2.CancelOperationRequest`): The request object. Request message for `CancelOperation` method. - retry (google.api_core.retry.Retry): Designation of what errors, + retry (google.api_core.retry_async.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 @@ -3190,7 +3190,7 @@ async def cancel_operation( # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. - rpc = gapic_v1.method.wrap_method( + rpc = gapic_v1.method_async.wrap_method( self._client._transport.cancel_operation, default_timeout=None, client_info=DEFAULT_CLIENT_INFO, diff --git a/google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py b/google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py index 3c35c25c5d..a6ad4ca887 100644 --- a/google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py +++ b/google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py @@ -33,14 +33,14 @@ from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore @@ -300,7 +300,7 @@ async def sample_list_instance_configs(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -336,7 +336,7 @@ async def sample_list_instance_configs(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_instance_configs, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -428,7 +428,7 @@ async def sample_get_instance_config(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -463,7 +463,7 @@ async def sample_get_instance_config(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_instance_config, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -616,7 +616,7 @@ async def sample_create_instance_config(): This corresponds to the ``instance_config_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -805,7 +805,7 @@ async def sample_update_instance_config(): This corresponds to the ``update_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -930,7 +930,7 @@ async def sample_delete_instance_config(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1037,7 +1037,7 @@ async def sample_list_instance_config_operations(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1155,7 +1155,7 @@ async def sample_list_instances(): This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1191,7 +1191,7 @@ async def sample_list_instances(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_instances, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -1281,7 +1281,7 @@ async def sample_get_instance(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1315,7 +1315,7 @@ async def sample_get_instance(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_instance, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -1462,7 +1462,7 @@ async def sample_create_instance(): This corresponds to the ``instance`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1651,7 +1651,7 @@ async def sample_update_instance(): This corresponds to the ``field_mask`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1779,7 +1779,7 @@ async def sample_delete_instance(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1806,7 +1806,7 @@ async def sample_delete_instance(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_instance, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -1888,7 +1888,7 @@ async def sample_set_iam_policy(): This corresponds to the ``resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -2027,7 +2027,7 @@ async def sample_get_iam_policy(): This corresponds to the ``resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -2090,7 +2090,7 @@ async def sample_get_iam_policy(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_iam_policy, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=1.0, maximum=32.0, multiplier=1.3, @@ -2188,7 +2188,7 @@ async def sample_test_iam_permissions(): This corresponds to the ``permissions`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 diff --git a/google/cloud/spanner_v1/services/spanner/async_client.py b/google/cloud/spanner_v1/services/spanner/async_client.py index 371500333e..f4cd066bd9 100644 --- a/google/cloud/spanner_v1/services/spanner/async_client.py +++ b/google/cloud/spanner_v1/services/spanner/async_client.py @@ -35,14 +35,14 @@ from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 -from google.api_core import retry as retries +from google.api_core import retry_async as retries from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore try: - OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER - OptionalRetry = Union[retries.Retry, object] # type: ignore + OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore from google.cloud.spanner_v1.services.spanner import pagers from google.cloud.spanner_v1.types import commit_response @@ -286,7 +286,7 @@ async def sample_create_session(): This corresponds to the ``database`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -317,7 +317,7 @@ async def sample_create_session(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.create_session, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.25, maximum=32.0, multiplier=1.3, @@ -413,7 +413,7 @@ async def sample_batch_create_sessions(): This corresponds to the ``session_count`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -448,7 +448,7 @@ async def sample_batch_create_sessions(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.batch_create_sessions, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.25, maximum=32.0, multiplier=1.3, @@ -528,7 +528,7 @@ async def sample_get_session(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -559,7 +559,7 @@ async def sample_get_session(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.get_session, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.25, maximum=32.0, multiplier=1.3, @@ -638,7 +638,7 @@ async def sample_list_sessions(): This corresponds to the ``database`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -674,7 +674,7 @@ async def sample_list_sessions(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.list_sessions, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.25, maximum=32.0, multiplier=1.3, @@ -760,7 +760,7 @@ async def sample_delete_session(): This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -787,7 +787,7 @@ async def sample_delete_session(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.delete_session, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.25, maximum=32.0, multiplier=1.3, @@ -869,7 +869,7 @@ async def sample_execute_sql(): The request object. The request for [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -888,7 +888,7 @@ async def sample_execute_sql(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.execute_sql, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.25, maximum=32.0, multiplier=1.3, @@ -966,7 +966,7 @@ async def sample_execute_streaming_sql(): The request object. The request for [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1067,7 +1067,7 @@ async def sample_execute_batch_dml(): request (Optional[Union[google.cloud.spanner_v1.types.ExecuteBatchDmlRequest, dict]]): The request object. The request for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1126,7 +1126,7 @@ async def sample_execute_batch_dml(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.execute_batch_dml, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.25, maximum=32.0, multiplier=1.3, @@ -1213,7 +1213,7 @@ async def sample_read(): The request object. The request for [Read][google.spanner.v1.Spanner.Read] and [StreamingRead][google.spanner.v1.Spanner.StreamingRead]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1232,7 +1232,7 @@ async def sample_read(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.read, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.25, maximum=32.0, multiplier=1.3, @@ -1311,7 +1311,7 @@ async def sample_streaming_read(): The request object. The request for [Read][google.spanner.v1.Spanner.Read] and [StreamingRead][google.spanner.v1.Spanner.StreamingRead]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1414,7 +1414,7 @@ async def sample_begin_transaction(): This corresponds to the ``options`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1447,7 +1447,7 @@ async def sample_begin_transaction(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.begin_transaction, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.25, maximum=32.0, multiplier=1.3, @@ -1575,7 +1575,7 @@ async def sample_commit(): This corresponds to the ``single_use_transaction`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1616,7 +1616,7 @@ async def sample_commit(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.commit, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.25, maximum=32.0, multiplier=1.3, @@ -1709,7 +1709,7 @@ async def sample_rollback(): This corresponds to the ``transaction_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1738,7 +1738,7 @@ async def sample_rollback(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.rollback, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.25, maximum=32.0, multiplier=1.3, @@ -1819,7 +1819,7 @@ async def sample_partition_query(): request (Optional[Union[google.cloud.spanner_v1.types.PartitionQueryRequest, dict]]): The request object. The request for [PartitionQuery][google.spanner.v1.Spanner.PartitionQuery] - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1839,7 +1839,7 @@ async def sample_partition_query(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.partition_query, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.25, maximum=32.0, multiplier=1.3, @@ -1926,7 +1926,7 @@ async def sample_partition_read(): request (Optional[Union[google.cloud.spanner_v1.types.PartitionReadRequest, dict]]): The request object. The request for [PartitionRead][google.spanner.v1.Spanner.PartitionRead] - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 @@ -1946,7 +1946,7 @@ async def sample_partition_read(): # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.partition_read, - default_retry=retries.Retry( + default_retry=retries.AsyncRetry( initial=0.25, maximum=32.0, multiplier=1.3, @@ -2057,7 +2057,7 @@ async def sample_batch_write(): This corresponds to the ``mutation_groups`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, + retry (google.api_core.retry_async.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 diff --git a/tests/unit/gapic/spanner_admin_database_v1/test_database_admin.py b/tests/unit/gapic/spanner_admin_database_v1/test_database_admin.py index 7a9e9c5d33..48d300b32a 100644 --- a/tests/unit/gapic/spanner_admin_database_v1/test_database_admin.py +++ b/tests/unit/gapic/spanner_admin_database_v1/test_database_admin.py @@ -14052,7 +14052,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation_async(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc_asyncio"): client = DatabaseAdminAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -14191,7 +14191,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation_async(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc_asyncio"): client = DatabaseAdminAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -14330,7 +14330,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation_async(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc_asyncio"): client = DatabaseAdminAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -14475,7 +14475,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations_async(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc_asyncio"): client = DatabaseAdminAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport,