Skip to content

Commit ca6255e

Browse files
gcf-owl-bot[bot]sakthivelmaniiparthea
authored
feat(spanner): add new change_stream.proto (#1382)
* build: ensure there's only a single service config file for the Spanner Admin Instances API PiperOrigin-RevId: 763646865 Source-Link: googleapis/googleapis@0a4ce50 Source-Link: googleapis/googleapis-gen@88e6355 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODhlNjM1NTE5NTk0ZTFhMTU5YTFmODExZDE0OTU4YzU1Y2ZhOGE4NSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat(spanner): add new change_stream.proto PiperOrigin-RevId: 766241102 Source-Link: googleapis/googleapis@2bea1fc Source-Link: googleapis/googleapis-gen@f429e2a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjQyOWUyYTg2NDkyZmUzNzc1NDA3OWZmMDIzNmNiYWMzYmUxYmZiYSJ9 * 🦉 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: Sakthivel Subramanian <[email protected]> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent 651ca9c commit ca6255e

30 files changed

+4258
-384
lines changed

google/cloud/spanner_admin_database_v1/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
from .types.spanner_database_admin import GetDatabaseDdlRequest
6464
from .types.spanner_database_admin import GetDatabaseDdlResponse
6565
from .types.spanner_database_admin import GetDatabaseRequest
66+
from .types.spanner_database_admin import InternalUpdateGraphOperationRequest
67+
from .types.spanner_database_admin import InternalUpdateGraphOperationResponse
6668
from .types.spanner_database_admin import ListDatabaseOperationsRequest
6769
from .types.spanner_database_admin import ListDatabaseOperationsResponse
6870
from .types.spanner_database_admin import ListDatabaseRolesRequest
@@ -117,6 +119,8 @@
117119
"GetDatabaseDdlResponse",
118120
"GetDatabaseRequest",
119121
"IncrementalBackupSpec",
122+
"InternalUpdateGraphOperationRequest",
123+
"InternalUpdateGraphOperationResponse",
120124
"ListBackupOperationsRequest",
121125
"ListBackupOperationsResponse",
122126
"ListBackupSchedulesRequest",

google/cloud/spanner_admin_database_v1/gapic_metadata.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@
7575
"get_iam_policy"
7676
]
7777
},
78+
"InternalUpdateGraphOperation": {
79+
"methods": [
80+
"internal_update_graph_operation"
81+
]
82+
},
7883
"ListBackupOperations": {
7984
"methods": [
8085
"list_backup_operations"
@@ -210,6 +215,11 @@
210215
"get_iam_policy"
211216
]
212217
},
218+
"InternalUpdateGraphOperation": {
219+
"methods": [
220+
"internal_update_graph_operation"
221+
]
222+
},
213223
"ListBackupOperations": {
214224
"methods": [
215225
"list_backup_operations"
@@ -345,6 +355,11 @@
345355
"get_iam_policy"
346356
]
347357
},
358+
"InternalUpdateGraphOperation": {
359+
"methods": [
360+
"internal_update_graph_operation"
361+
]
362+
},
348363
"ListBackupOperations": {
349364
"methods": [
350365
"list_backup_operations"

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

Lines changed: 121 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_database_v1 import gapic_version as package_version
3334

@@ -3858,6 +3859,126 @@ async def sample_list_backup_schedules():
38583859
# Done; return the response.
38593860
return response
38603861

3862+
async def internal_update_graph_operation(
3863+
self,
3864+
request: Optional[
3865+
Union[spanner_database_admin.InternalUpdateGraphOperationRequest, dict]
3866+
] = None,
3867+
*,
3868+
database: Optional[str] = None,
3869+
operation_id: Optional[str] = None,
3870+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3871+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3872+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3873+
) -> spanner_database_admin.InternalUpdateGraphOperationResponse:
3874+
r"""This is an internal API called by Spanner Graph jobs.
3875+
You should never need to call this API directly.
3876+
3877+
.. code-block:: python
3878+
3879+
# This snippet has been automatically generated and should be regarded as a
3880+
# code template only.
3881+
# It will require modifications to work:
3882+
# - It may require correct/in-range values for request initialization.
3883+
# - It may require specifying regional endpoints when creating the service
3884+
# client as shown in:
3885+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
3886+
from google.cloud import spanner_admin_database_v1
3887+
3888+
async def sample_internal_update_graph_operation():
3889+
# Create a client
3890+
client = spanner_admin_database_v1.DatabaseAdminAsyncClient()
3891+
3892+
# Initialize request argument(s)
3893+
request = spanner_admin_database_v1.InternalUpdateGraphOperationRequest(
3894+
database="database_value",
3895+
operation_id="operation_id_value",
3896+
vm_identity_token="vm_identity_token_value",
3897+
)
3898+
3899+
# Make the request
3900+
response = await client.internal_update_graph_operation(request=request)
3901+
3902+
# Handle the response
3903+
print(response)
3904+
3905+
Args:
3906+
request (Optional[Union[google.cloud.spanner_admin_database_v1.types.InternalUpdateGraphOperationRequest, dict]]):
3907+
The request object. Internal request proto, do not use
3908+
directly.
3909+
database (:class:`str`):
3910+
Internal field, do not use directly.
3911+
This corresponds to the ``database`` field
3912+
on the ``request`` instance; if ``request`` is provided, this
3913+
should not be set.
3914+
operation_id (:class:`str`):
3915+
Internal field, do not use directly.
3916+
This corresponds to the ``operation_id`` field
3917+
on the ``request`` instance; if ``request`` is provided, this
3918+
should not be set.
3919+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
3920+
should be retried.
3921+
timeout (float): The timeout for this request.
3922+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3923+
sent along with the request as metadata. Normally, each value must be of type `str`,
3924+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
3925+
be of type `bytes`.
3926+
3927+
Returns:
3928+
google.cloud.spanner_admin_database_v1.types.InternalUpdateGraphOperationResponse:
3929+
Internal response proto, do not use
3930+
directly.
3931+
3932+
"""
3933+
# Create or coerce a protobuf request object.
3934+
# - Quick check: If we got a request object, we should *not* have
3935+
# gotten any keyword arguments that map to the request.
3936+
flattened_params = [database, operation_id]
3937+
has_flattened_params = (
3938+
len([param for param in flattened_params if param is not None]) > 0
3939+
)
3940+
if request is not None and has_flattened_params:
3941+
raise ValueError(
3942+
"If the `request` argument is set, then none of "
3943+
"the individual field arguments should be set."
3944+
)
3945+
3946+
# - Use the request object if provided (there's no risk of modifying the input as
3947+
# there are no flattened fields), or create one.
3948+
if not isinstance(
3949+
request, spanner_database_admin.InternalUpdateGraphOperationRequest
3950+
):
3951+
request = spanner_database_admin.InternalUpdateGraphOperationRequest(
3952+
request
3953+
)
3954+
3955+
# If we have keyword arguments corresponding to fields on the
3956+
# request, apply these.
3957+
if database is not None:
3958+
request.database = database
3959+
if operation_id is not None:
3960+
request.operation_id = operation_id
3961+
3962+
# Wrap the RPC method; this adds retry and timeout information,
3963+
# and friendly error handling.
3964+
rpc = self._client._transport._wrapped_methods[
3965+
self._client._transport.internal_update_graph_operation
3966+
]
3967+
3968+
# Validate the universe domain.
3969+
self._client._validate_universe_domain()
3970+
3971+
# Send the request.
3972+
response = await rpc(
3973+
request,
3974+
retry=retry,
3975+
timeout=timeout,
3976+
metadata=metadata,
3977+
)
3978+
3979+
# Done; return the response.
3980+
return response
3981+
38613982
async def list_operations(
38623983
self,
38633984
request: Optional[operations_pb2.ListOperationsRequest] = None,

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

Lines changed: 120 additions & 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
@@ -4349,6 +4350,125 @@ def sample_list_backup_schedules():
43494350
# Done; return the response.
43504351
return response
43514352

4353+
def internal_update_graph_operation(
4354+
self,
4355+
request: Optional[
4356+
Union[spanner_database_admin.InternalUpdateGraphOperationRequest, dict]
4357+
] = None,
4358+
*,
4359+
database: Optional[str] = None,
4360+
operation_id: Optional[str] = None,
4361+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
4362+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
4363+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
4364+
) -> spanner_database_admin.InternalUpdateGraphOperationResponse:
4365+
r"""This is an internal API called by Spanner Graph jobs.
4366+
You should never need to call this API directly.
4367+
4368+
.. code-block:: python
4369+
4370+
# This snippet has been automatically generated and should be regarded as a
4371+
# code template only.
4372+
# It will require modifications to work:
4373+
# - It may require correct/in-range values for request initialization.
4374+
# - It may require specifying regional endpoints when creating the service
4375+
# client as shown in:
4376+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
4377+
from google.cloud import spanner_admin_database_v1
4378+
4379+
def sample_internal_update_graph_operation():
4380+
# Create a client
4381+
client = spanner_admin_database_v1.DatabaseAdminClient()
4382+
4383+
# Initialize request argument(s)
4384+
request = spanner_admin_database_v1.InternalUpdateGraphOperationRequest(
4385+
database="database_value",
4386+
operation_id="operation_id_value",
4387+
vm_identity_token="vm_identity_token_value",
4388+
)
4389+
4390+
# Make the request
4391+
response = client.internal_update_graph_operation(request=request)
4392+
4393+
# Handle the response
4394+
print(response)
4395+
4396+
Args:
4397+
request (Union[google.cloud.spanner_admin_database_v1.types.InternalUpdateGraphOperationRequest, dict]):
4398+
The request object. Internal request proto, do not use
4399+
directly.
4400+
database (str):
4401+
Internal field, do not use directly.
4402+
This corresponds to the ``database`` field
4403+
on the ``request`` instance; if ``request`` is provided, this
4404+
should not be set.
4405+
operation_id (str):
4406+
Internal field, do not use directly.
4407+
This corresponds to the ``operation_id`` field
4408+
on the ``request`` instance; if ``request`` is provided, this
4409+
should not be set.
4410+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
4411+
should be retried.
4412+
timeout (float): The timeout for this request.
4413+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
4414+
sent along with the request as metadata. Normally, each value must be of type `str`,
4415+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
4416+
be of type `bytes`.
4417+
4418+
Returns:
4419+
google.cloud.spanner_admin_database_v1.types.InternalUpdateGraphOperationResponse:
4420+
Internal response proto, do not use
4421+
directly.
4422+
4423+
"""
4424+
# Create or coerce a protobuf request object.
4425+
# - Quick check: If we got a request object, we should *not* have
4426+
# gotten any keyword arguments that map to the request.
4427+
flattened_params = [database, operation_id]
4428+
has_flattened_params = (
4429+
len([param for param in flattened_params if param is not None]) > 0
4430+
)
4431+
if request is not None and has_flattened_params:
4432+
raise ValueError(
4433+
"If the `request` argument is set, then none of "
4434+
"the individual field arguments should be set."
4435+
)
4436+
4437+
# - Use the request object if provided (there's no risk of modifying the input as
4438+
# there are no flattened fields), or create one.
4439+
if not isinstance(
4440+
request, spanner_database_admin.InternalUpdateGraphOperationRequest
4441+
):
4442+
request = spanner_database_admin.InternalUpdateGraphOperationRequest(
4443+
request
4444+
)
4445+
# If we have keyword arguments corresponding to fields on the
4446+
# request, apply these.
4447+
if database is not None:
4448+
request.database = database
4449+
if operation_id is not None:
4450+
request.operation_id = operation_id
4451+
4452+
# Wrap the RPC method; this adds retry and timeout information,
4453+
# and friendly error handling.
4454+
rpc = self._transport._wrapped_methods[
4455+
self._transport.internal_update_graph_operation
4456+
]
4457+
4458+
# Validate the universe domain.
4459+
self._validate_universe_domain()
4460+
4461+
# Send the request.
4462+
response = rpc(
4463+
request,
4464+
retry=retry,
4465+
timeout=timeout,
4466+
metadata=metadata,
4467+
)
4468+
4469+
# Done; return the response.
4470+
return response
4471+
43524472
def __enter__(self) -> "DatabaseAdminClient":
43534473
return self
43544474

google/cloud/spanner_admin_database_v1/services/database_admin/transports/base.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,11 @@ def _prep_wrapped_messages(self, client_info):
477477
default_timeout=3600.0,
478478
client_info=client_info,
479479
),
480+
self.internal_update_graph_operation: gapic_v1.method.wrap_method(
481+
self.internal_update_graph_operation,
482+
default_timeout=None,
483+
client_info=client_info,
484+
),
480485
self.cancel_operation: gapic_v1.method.wrap_method(
481486
self.cancel_operation,
482487
default_timeout=None,
@@ -779,6 +784,18 @@ def list_backup_schedules(
779784
]:
780785
raise NotImplementedError()
781786

787+
@property
788+
def internal_update_graph_operation(
789+
self,
790+
) -> Callable[
791+
[spanner_database_admin.InternalUpdateGraphOperationRequest],
792+
Union[
793+
spanner_database_admin.InternalUpdateGraphOperationResponse,
794+
Awaitable[spanner_database_admin.InternalUpdateGraphOperationResponse],
795+
],
796+
]:
797+
raise NotImplementedError()
798+
782799
@property
783800
def list_operations(
784801
self,

google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,39 @@ def list_backup_schedules(
12221222
)
12231223
return self._stubs["list_backup_schedules"]
12241224

1225+
@property
1226+
def internal_update_graph_operation(
1227+
self,
1228+
) -> Callable[
1229+
[spanner_database_admin.InternalUpdateGraphOperationRequest],
1230+
spanner_database_admin.InternalUpdateGraphOperationResponse,
1231+
]:
1232+
r"""Return a callable for the internal update graph
1233+
operation method over gRPC.
1234+
1235+
This is an internal API called by Spanner Graph jobs.
1236+
You should never need to call this API directly.
1237+
1238+
Returns:
1239+
Callable[[~.InternalUpdateGraphOperationRequest],
1240+
~.InternalUpdateGraphOperationResponse]:
1241+
A function that, when called, will call the underlying RPC
1242+
on the server.
1243+
"""
1244+
# Generate a "stub function" on-the-fly which will actually make
1245+
# the request.
1246+
# gRPC handles serialization and deserialization, so we just need
1247+
# to pass in the functions for each.
1248+
if "internal_update_graph_operation" not in self._stubs:
1249+
self._stubs[
1250+
"internal_update_graph_operation"
1251+
] = self._logged_channel.unary_unary(
1252+
"/google.spanner.admin.database.v1.DatabaseAdmin/InternalUpdateGraphOperation",
1253+
request_serializer=spanner_database_admin.InternalUpdateGraphOperationRequest.serialize,
1254+
response_deserializer=spanner_database_admin.InternalUpdateGraphOperationResponse.deserialize,
1255+
)
1256+
return self._stubs["internal_update_graph_operation"]
1257+
12251258
def close(self):
12261259
self._logged_channel.close()
12271260

0 commit comments

Comments
 (0)