Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit 43c7816

Browse files
1 parent 9dfcd93 commit 43c7816

File tree

306 files changed

+2420
-133247
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

306 files changed

+2420
-133247
lines changed

google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
Type,
2929
Union,
3030
)
31+
import uuid
3132

3233
from google.cloud.spanner_admin_database_v1 import gapic_version as package_version
3334

google/cloud/spanner_admin_database_v1/services/database_admin/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
Union,
3333
cast,
3434
)
35+
import uuid
3536
import warnings
3637

3738
from google.cloud.spanner_admin_database_v1 import gapic_version as package_version

google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
Type,
2929
Union,
3030
)
31+
import uuid
3132

3233
from google.cloud.spanner_admin_instance_v1 import gapic_version as package_version
3334

@@ -52,6 +53,7 @@
5253
from google.iam.v1 import iam_policy_pb2 # type: ignore
5354
from google.iam.v1 import policy_pb2 # type: ignore
5455
from google.longrunning import operations_pb2 # type: ignore
56+
from google.longrunning import operations_pb2 # type: ignore
5557
from google.protobuf import field_mask_pb2 # type: ignore
5658
from google.protobuf import timestamp_pb2 # type: ignore
5759
from .transports.base import InstanceAdminTransport, DEFAULT_CLIENT_INFO
@@ -3448,6 +3450,227 @@ async def sample_move_instance():
34483450
# Done; return the response.
34493451
return response
34503452

3453+
async def list_operations(
3454+
self,
3455+
request: Optional[operations_pb2.ListOperationsRequest] = None,
3456+
*,
3457+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3458+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3459+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3460+
) -> operations_pb2.ListOperationsResponse:
3461+
r"""Lists operations that match the specified filter in the request.
3462+
3463+
Args:
3464+
request (:class:`~.operations_pb2.ListOperationsRequest`):
3465+
The request object. Request message for
3466+
`ListOperations` method.
3467+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
3468+
if any, should be retried.
3469+
timeout (float): The timeout for this request.
3470+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3471+
sent along with the request as metadata. Normally, each value must be of type `str`,
3472+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
3473+
be of type `bytes`.
3474+
Returns:
3475+
~.operations_pb2.ListOperationsResponse:
3476+
Response message for ``ListOperations`` method.
3477+
"""
3478+
# Create or coerce a protobuf request object.
3479+
# The request isn't a proto-plus wrapped type,
3480+
# so it must be constructed via keyword expansion.
3481+
if isinstance(request, dict):
3482+
request = operations_pb2.ListOperationsRequest(**request)
3483+
3484+
# Wrap the RPC method; this adds retry and timeout information,
3485+
# and friendly error handling.
3486+
rpc = self.transport._wrapped_methods[self._client._transport.list_operations]
3487+
3488+
# Certain fields should be provided within the metadata header;
3489+
# add these here.
3490+
metadata = tuple(metadata) + (
3491+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
3492+
)
3493+
3494+
# Validate the universe domain.
3495+
self._client._validate_universe_domain()
3496+
3497+
# Send the request.
3498+
response = await rpc(
3499+
request,
3500+
retry=retry,
3501+
timeout=timeout,
3502+
metadata=metadata,
3503+
)
3504+
3505+
# Done; return the response.
3506+
return response
3507+
3508+
async def get_operation(
3509+
self,
3510+
request: Optional[operations_pb2.GetOperationRequest] = None,
3511+
*,
3512+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3513+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3514+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3515+
) -> operations_pb2.Operation:
3516+
r"""Gets the latest state of a long-running operation.
3517+
3518+
Args:
3519+
request (:class:`~.operations_pb2.GetOperationRequest`):
3520+
The request object. Request message for
3521+
`GetOperation` method.
3522+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
3523+
if any, should be retried.
3524+
timeout (float): The timeout for this request.
3525+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3526+
sent along with the request as metadata. Normally, each value must be of type `str`,
3527+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
3528+
be of type `bytes`.
3529+
Returns:
3530+
~.operations_pb2.Operation:
3531+
An ``Operation`` object.
3532+
"""
3533+
# Create or coerce a protobuf request object.
3534+
# The request isn't a proto-plus wrapped type,
3535+
# so it must be constructed via keyword expansion.
3536+
if isinstance(request, dict):
3537+
request = operations_pb2.GetOperationRequest(**request)
3538+
3539+
# Wrap the RPC method; this adds retry and timeout information,
3540+
# and friendly error handling.
3541+
rpc = self.transport._wrapped_methods[self._client._transport.get_operation]
3542+
3543+
# Certain fields should be provided within the metadata header;
3544+
# add these here.
3545+
metadata = tuple(metadata) + (
3546+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
3547+
)
3548+
3549+
# Validate the universe domain.
3550+
self._client._validate_universe_domain()
3551+
3552+
# Send the request.
3553+
response = await rpc(
3554+
request,
3555+
retry=retry,
3556+
timeout=timeout,
3557+
metadata=metadata,
3558+
)
3559+
3560+
# Done; return the response.
3561+
return response
3562+
3563+
async def delete_operation(
3564+
self,
3565+
request: Optional[operations_pb2.DeleteOperationRequest] = None,
3566+
*,
3567+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3568+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3569+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3570+
) -> None:
3571+
r"""Deletes a long-running operation.
3572+
3573+
This method indicates that the client is no longer interested
3574+
in the operation result. It does not cancel the operation.
3575+
If the server doesn't support this method, it returns
3576+
`google.rpc.Code.UNIMPLEMENTED`.
3577+
3578+
Args:
3579+
request (:class:`~.operations_pb2.DeleteOperationRequest`):
3580+
The request object. Request message for
3581+
`DeleteOperation` method.
3582+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
3583+
if any, should be retried.
3584+
timeout (float): The timeout for this request.
3585+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3586+
sent along with the request as metadata. Normally, each value must be of type `str`,
3587+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
3588+
be of type `bytes`.
3589+
Returns:
3590+
None
3591+
"""
3592+
# Create or coerce a protobuf request object.
3593+
# The request isn't a proto-plus wrapped type,
3594+
# so it must be constructed via keyword expansion.
3595+
if isinstance(request, dict):
3596+
request = operations_pb2.DeleteOperationRequest(**request)
3597+
3598+
# Wrap the RPC method; this adds retry and timeout information,
3599+
# and friendly error handling.
3600+
rpc = self.transport._wrapped_methods[self._client._transport.delete_operation]
3601+
3602+
# Certain fields should be provided within the metadata header;
3603+
# add these here.
3604+
metadata = tuple(metadata) + (
3605+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
3606+
)
3607+
3608+
# Validate the universe domain.
3609+
self._client._validate_universe_domain()
3610+
3611+
# Send the request.
3612+
await rpc(
3613+
request,
3614+
retry=retry,
3615+
timeout=timeout,
3616+
metadata=metadata,
3617+
)
3618+
3619+
async def cancel_operation(
3620+
self,
3621+
request: Optional[operations_pb2.CancelOperationRequest] = None,
3622+
*,
3623+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3624+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3625+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3626+
) -> None:
3627+
r"""Starts asynchronous cancellation on a long-running operation.
3628+
3629+
The server makes a best effort to cancel the operation, but success
3630+
is not guaranteed. If the server doesn't support this method, it returns
3631+
`google.rpc.Code.UNIMPLEMENTED`.
3632+
3633+
Args:
3634+
request (:class:`~.operations_pb2.CancelOperationRequest`):
3635+
The request object. Request message for
3636+
`CancelOperation` method.
3637+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
3638+
if any, should be retried.
3639+
timeout (float): The timeout for this request.
3640+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3641+
sent along with the request as metadata. Normally, each value must be of type `str`,
3642+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
3643+
be of type `bytes`.
3644+
Returns:
3645+
None
3646+
"""
3647+
# Create or coerce a protobuf request object.
3648+
# The request isn't a proto-plus wrapped type,
3649+
# so it must be constructed via keyword expansion.
3650+
if isinstance(request, dict):
3651+
request = operations_pb2.CancelOperationRequest(**request)
3652+
3653+
# Wrap the RPC method; this adds retry and timeout information,
3654+
# and friendly error handling.
3655+
rpc = self.transport._wrapped_methods[self._client._transport.cancel_operation]
3656+
3657+
# Certain fields should be provided within the metadata header;
3658+
# add these here.
3659+
metadata = tuple(metadata) + (
3660+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
3661+
)
3662+
3663+
# Validate the universe domain.
3664+
self._client._validate_universe_domain()
3665+
3666+
# Send the request.
3667+
await rpc(
3668+
request,
3669+
retry=retry,
3670+
timeout=timeout,
3671+
metadata=metadata,
3672+
)
3673+
34513674
async def __aenter__(self) -> "InstanceAdminAsyncClient":
34523675
return self
34533676

0 commit comments

Comments
 (0)