google-cloud-spanner 3.55.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. google/cloud/spanner.py +47 -0
  2. google/cloud/spanner_admin_database_v1/__init__.py +146 -0
  3. google/cloud/spanner_admin_database_v1/gapic_metadata.json +418 -0
  4. google/cloud/spanner_admin_database_v1/gapic_version.py +16 -0
  5. google/cloud/spanner_admin_database_v1/py.typed +2 -0
  6. google/cloud/spanner_admin_database_v1/services/__init__.py +15 -0
  7. google/cloud/spanner_admin_database_v1/services/database_admin/__init__.py +22 -0
  8. google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py +4097 -0
  9. google/cloud/spanner_admin_database_v1/services/database_admin/client.py +4602 -0
  10. google/cloud/spanner_admin_database_v1/services/database_admin/pagers.py +989 -0
  11. google/cloud/spanner_admin_database_v1/services/database_admin/transports/__init__.py +38 -0
  12. google/cloud/spanner_admin_database_v1/services/database_admin/transports/base.py +820 -0
  13. google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc.py +1303 -0
  14. google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc_asyncio.py +1688 -0
  15. google/cloud/spanner_admin_database_v1/services/database_admin/transports/rest.py +6512 -0
  16. google/cloud/spanner_admin_database_v1/services/database_admin/transports/rest_base.py +1650 -0
  17. google/cloud/spanner_admin_database_v1/types/__init__.py +144 -0
  18. google/cloud/spanner_admin_database_v1/types/backup.py +1106 -0
  19. google/cloud/spanner_admin_database_v1/types/backup_schedule.py +369 -0
  20. google/cloud/spanner_admin_database_v1/types/common.py +180 -0
  21. google/cloud/spanner_admin_database_v1/types/spanner_database_admin.py +1303 -0
  22. google/cloud/spanner_admin_instance_v1/__init__.py +110 -0
  23. google/cloud/spanner_admin_instance_v1/gapic_metadata.json +343 -0
  24. google/cloud/spanner_admin_instance_v1/gapic_version.py +16 -0
  25. google/cloud/spanner_admin_instance_v1/py.typed +2 -0
  26. google/cloud/spanner_admin_instance_v1/services/__init__.py +15 -0
  27. google/cloud/spanner_admin_instance_v1/services/instance_admin/__init__.py +22 -0
  28. google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py +3466 -0
  29. google/cloud/spanner_admin_instance_v1/services/instance_admin/client.py +3881 -0
  30. google/cloud/spanner_admin_instance_v1/services/instance_admin/pagers.py +856 -0
  31. google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/__init__.py +38 -0
  32. google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/base.py +545 -0
  33. google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc.py +1347 -0
  34. google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc_asyncio.py +1539 -0
  35. google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/rest.py +4834 -0
  36. google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/rest_base.py +1198 -0
  37. google/cloud/spanner_admin_instance_v1/types/__init__.py +104 -0
  38. google/cloud/spanner_admin_instance_v1/types/common.py +99 -0
  39. google/cloud/spanner_admin_instance_v1/types/spanner_instance_admin.py +2375 -0
  40. google/cloud/spanner_dbapi/__init__.py +93 -0
  41. google/cloud/spanner_dbapi/_helpers.py +113 -0
  42. google/cloud/spanner_dbapi/batch_dml_executor.py +135 -0
  43. google/cloud/spanner_dbapi/checksum.py +80 -0
  44. google/cloud/spanner_dbapi/client_side_statement_executor.py +140 -0
  45. google/cloud/spanner_dbapi/client_side_statement_parser.py +106 -0
  46. google/cloud/spanner_dbapi/connection.py +818 -0
  47. google/cloud/spanner_dbapi/cursor.py +609 -0
  48. google/cloud/spanner_dbapi/exceptions.py +172 -0
  49. google/cloud/spanner_dbapi/parse_utils.py +392 -0
  50. google/cloud/spanner_dbapi/parsed_statement.py +63 -0
  51. google/cloud/spanner_dbapi/parser.py +258 -0
  52. google/cloud/spanner_dbapi/partition_helper.py +41 -0
  53. google/cloud/spanner_dbapi/transaction_helper.py +294 -0
  54. google/cloud/spanner_dbapi/types.py +106 -0
  55. google/cloud/spanner_dbapi/utils.py +147 -0
  56. google/cloud/spanner_dbapi/version.py +20 -0
  57. google/cloud/spanner_v1/__init__.py +154 -0
  58. google/cloud/spanner_v1/_helpers.py +751 -0
  59. google/cloud/spanner_v1/_opentelemetry_tracing.py +165 -0
  60. google/cloud/spanner_v1/backup.py +397 -0
  61. google/cloud/spanner_v1/batch.py +433 -0
  62. google/cloud/spanner_v1/client.py +538 -0
  63. google/cloud/spanner_v1/data_types.py +350 -0
  64. google/cloud/spanner_v1/database.py +1968 -0
  65. google/cloud/spanner_v1/database_sessions_manager.py +249 -0
  66. google/cloud/spanner_v1/gapic_metadata.json +268 -0
  67. google/cloud/spanner_v1/gapic_version.py +16 -0
  68. google/cloud/spanner_v1/instance.py +735 -0
  69. google/cloud/spanner_v1/keyset.py +193 -0
  70. google/cloud/spanner_v1/merged_result_set.py +146 -0
  71. google/cloud/spanner_v1/metrics/constants.py +71 -0
  72. google/cloud/spanner_v1/metrics/metrics_capture.py +75 -0
  73. google/cloud/spanner_v1/metrics/metrics_exporter.py +384 -0
  74. google/cloud/spanner_v1/metrics/metrics_interceptor.py +156 -0
  75. google/cloud/spanner_v1/metrics/metrics_tracer.py +588 -0
  76. google/cloud/spanner_v1/metrics/metrics_tracer_factory.py +328 -0
  77. google/cloud/spanner_v1/metrics/spanner_metrics_tracer_factory.py +172 -0
  78. google/cloud/spanner_v1/param_types.py +110 -0
  79. google/cloud/spanner_v1/pool.py +813 -0
  80. google/cloud/spanner_v1/py.typed +2 -0
  81. google/cloud/spanner_v1/request_id_header.py +64 -0
  82. google/cloud/spanner_v1/services/__init__.py +15 -0
  83. google/cloud/spanner_v1/services/spanner/__init__.py +22 -0
  84. google/cloud/spanner_v1/services/spanner/async_client.py +2205 -0
  85. google/cloud/spanner_v1/services/spanner/client.py +2624 -0
  86. google/cloud/spanner_v1/services/spanner/pagers.py +196 -0
  87. google/cloud/spanner_v1/services/spanner/transports/__init__.py +38 -0
  88. google/cloud/spanner_v1/services/spanner/transports/base.py +520 -0
  89. google/cloud/spanner_v1/services/spanner/transports/grpc.py +911 -0
  90. google/cloud/spanner_v1/services/spanner/transports/grpc_asyncio.py +1144 -0
  91. google/cloud/spanner_v1/services/spanner/transports/rest.py +3468 -0
  92. google/cloud/spanner_v1/services/spanner/transports/rest_base.py +981 -0
  93. google/cloud/spanner_v1/session.py +631 -0
  94. google/cloud/spanner_v1/session_options.py +133 -0
  95. google/cloud/spanner_v1/snapshot.py +1057 -0
  96. google/cloud/spanner_v1/streamed.py +402 -0
  97. google/cloud/spanner_v1/table.py +181 -0
  98. google/cloud/spanner_v1/testing/__init__.py +0 -0
  99. google/cloud/spanner_v1/testing/database_test.py +121 -0
  100. google/cloud/spanner_v1/testing/interceptors.py +118 -0
  101. google/cloud/spanner_v1/testing/mock_database_admin.py +38 -0
  102. google/cloud/spanner_v1/testing/mock_spanner.py +261 -0
  103. google/cloud/spanner_v1/testing/spanner_database_admin_pb2_grpc.py +1267 -0
  104. google/cloud/spanner_v1/testing/spanner_pb2_grpc.py +882 -0
  105. google/cloud/spanner_v1/transaction.py +747 -0
  106. google/cloud/spanner_v1/types/__init__.py +118 -0
  107. google/cloud/spanner_v1/types/commit_response.py +94 -0
  108. google/cloud/spanner_v1/types/keys.py +248 -0
  109. google/cloud/spanner_v1/types/mutation.py +201 -0
  110. google/cloud/spanner_v1/types/query_plan.py +220 -0
  111. google/cloud/spanner_v1/types/result_set.py +379 -0
  112. google/cloud/spanner_v1/types/spanner.py +1815 -0
  113. google/cloud/spanner_v1/types/transaction.py +818 -0
  114. google/cloud/spanner_v1/types/type.py +288 -0
  115. google_cloud_spanner-3.55.0.dist-info/LICENSE +202 -0
  116. google_cloud_spanner-3.55.0.dist-info/METADATA +318 -0
  117. google_cloud_spanner-3.55.0.dist-info/RECORD +119 -0
  118. google_cloud_spanner-3.55.0.dist-info/WHEEL +5 -0
  119. google_cloud_spanner-3.55.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1198 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2025 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ import json # type: ignore
17
+ from google.api_core import path_template
18
+ from google.api_core import gapic_v1
19
+
20
+ from google.protobuf import json_format
21
+ from .base import InstanceAdminTransport, DEFAULT_CLIENT_INFO
22
+
23
+ import re
24
+ from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
25
+
26
+
27
+ from google.cloud.spanner_admin_instance_v1.types import spanner_instance_admin
28
+ from google.iam.v1 import iam_policy_pb2 # type: ignore
29
+ from google.iam.v1 import policy_pb2 # type: ignore
30
+ from google.protobuf import empty_pb2 # type: ignore
31
+ from google.longrunning import operations_pb2 # type: ignore
32
+
33
+
34
+ class _BaseInstanceAdminRestTransport(InstanceAdminTransport):
35
+ """Base REST backend transport for InstanceAdmin.
36
+
37
+ Note: This class is not meant to be used directly. Use its sync and
38
+ async sub-classes instead.
39
+
40
+ This class defines the same methods as the primary client, so the
41
+ primary client can load the underlying transport implementation
42
+ and call it.
43
+
44
+ It sends JSON representations of protocol buffers over HTTP/1.1
45
+ """
46
+
47
+ def __init__(
48
+ self,
49
+ *,
50
+ host: str = "spanner.googleapis.com",
51
+ credentials: Optional[Any] = None,
52
+ client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
53
+ always_use_jwt_access: Optional[bool] = False,
54
+ url_scheme: str = "https",
55
+ api_audience: Optional[str] = None,
56
+ ) -> None:
57
+ """Instantiate the transport.
58
+ Args:
59
+ host (Optional[str]):
60
+ The hostname to connect to (default: 'spanner.googleapis.com').
61
+ credentials (Optional[Any]): The
62
+ authorization credentials to attach to requests. These
63
+ credentials identify the application to the service; if none
64
+ are specified, the client will attempt to ascertain the
65
+ credentials from the environment.
66
+ client_info (google.api_core.gapic_v1.client_info.ClientInfo):
67
+ The client info used to send a user-agent string along with
68
+ API requests. If ``None``, then default info will be used.
69
+ Generally, you only need to set this if you are developing
70
+ your own client library.
71
+ always_use_jwt_access (Optional[bool]): Whether self signed JWT should
72
+ be used for service account credentials.
73
+ url_scheme: the protocol scheme for the API endpoint. Normally
74
+ "https", but for testing or local servers,
75
+ "http" can be specified.
76
+ """
77
+ # Run the base constructor
78
+ maybe_url_match = re.match("^(?P<scheme>http(?:s)?://)?(?P<host>.*)$", host)
79
+ if maybe_url_match is None:
80
+ raise ValueError(
81
+ f"Unexpected hostname structure: {host}"
82
+ ) # pragma: NO COVER
83
+
84
+ url_match_items = maybe_url_match.groupdict()
85
+
86
+ host = f"{url_scheme}://{host}" if not url_match_items["scheme"] else host
87
+
88
+ super().__init__(
89
+ host=host,
90
+ credentials=credentials,
91
+ client_info=client_info,
92
+ always_use_jwt_access=always_use_jwt_access,
93
+ api_audience=api_audience,
94
+ )
95
+
96
+ class _BaseCreateInstance:
97
+ def __hash__(self): # pragma: NO COVER
98
+ return NotImplementedError("__hash__ must be implemented.")
99
+
100
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
101
+
102
+ @classmethod
103
+ def _get_unset_required_fields(cls, message_dict):
104
+ return {
105
+ k: v
106
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
107
+ if k not in message_dict
108
+ }
109
+
110
+ @staticmethod
111
+ def _get_http_options():
112
+ http_options: List[Dict[str, str]] = [
113
+ {
114
+ "method": "post",
115
+ "uri": "/v1/{parent=projects/*}/instances",
116
+ "body": "*",
117
+ },
118
+ ]
119
+ return http_options
120
+
121
+ @staticmethod
122
+ def _get_transcoded_request(http_options, request):
123
+ pb_request = spanner_instance_admin.CreateInstanceRequest.pb(request)
124
+ transcoded_request = path_template.transcode(http_options, pb_request)
125
+ return transcoded_request
126
+
127
+ @staticmethod
128
+ def _get_request_body_json(transcoded_request):
129
+ # Jsonify the request body
130
+
131
+ body = json_format.MessageToJson(
132
+ transcoded_request["body"], use_integers_for_enums=True
133
+ )
134
+ return body
135
+
136
+ @staticmethod
137
+ def _get_query_params_json(transcoded_request):
138
+ query_params = json.loads(
139
+ json_format.MessageToJson(
140
+ transcoded_request["query_params"],
141
+ use_integers_for_enums=True,
142
+ )
143
+ )
144
+ query_params.update(
145
+ _BaseInstanceAdminRestTransport._BaseCreateInstance._get_unset_required_fields(
146
+ query_params
147
+ )
148
+ )
149
+
150
+ query_params["$alt"] = "json;enum-encoding=int"
151
+ return query_params
152
+
153
+ class _BaseCreateInstanceConfig:
154
+ def __hash__(self): # pragma: NO COVER
155
+ return NotImplementedError("__hash__ must be implemented.")
156
+
157
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
158
+
159
+ @classmethod
160
+ def _get_unset_required_fields(cls, message_dict):
161
+ return {
162
+ k: v
163
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
164
+ if k not in message_dict
165
+ }
166
+
167
+ @staticmethod
168
+ def _get_http_options():
169
+ http_options: List[Dict[str, str]] = [
170
+ {
171
+ "method": "post",
172
+ "uri": "/v1/{parent=projects/*}/instanceConfigs",
173
+ "body": "*",
174
+ },
175
+ ]
176
+ return http_options
177
+
178
+ @staticmethod
179
+ def _get_transcoded_request(http_options, request):
180
+ pb_request = spanner_instance_admin.CreateInstanceConfigRequest.pb(request)
181
+ transcoded_request = path_template.transcode(http_options, pb_request)
182
+ return transcoded_request
183
+
184
+ @staticmethod
185
+ def _get_request_body_json(transcoded_request):
186
+ # Jsonify the request body
187
+
188
+ body = json_format.MessageToJson(
189
+ transcoded_request["body"], use_integers_for_enums=True
190
+ )
191
+ return body
192
+
193
+ @staticmethod
194
+ def _get_query_params_json(transcoded_request):
195
+ query_params = json.loads(
196
+ json_format.MessageToJson(
197
+ transcoded_request["query_params"],
198
+ use_integers_for_enums=True,
199
+ )
200
+ )
201
+ query_params.update(
202
+ _BaseInstanceAdminRestTransport._BaseCreateInstanceConfig._get_unset_required_fields(
203
+ query_params
204
+ )
205
+ )
206
+
207
+ query_params["$alt"] = "json;enum-encoding=int"
208
+ return query_params
209
+
210
+ class _BaseCreateInstancePartition:
211
+ def __hash__(self): # pragma: NO COVER
212
+ return NotImplementedError("__hash__ must be implemented.")
213
+
214
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
215
+
216
+ @classmethod
217
+ def _get_unset_required_fields(cls, message_dict):
218
+ return {
219
+ k: v
220
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
221
+ if k not in message_dict
222
+ }
223
+
224
+ @staticmethod
225
+ def _get_http_options():
226
+ http_options: List[Dict[str, str]] = [
227
+ {
228
+ "method": "post",
229
+ "uri": "/v1/{parent=projects/*/instances/*}/instancePartitions",
230
+ "body": "*",
231
+ },
232
+ ]
233
+ return http_options
234
+
235
+ @staticmethod
236
+ def _get_transcoded_request(http_options, request):
237
+ pb_request = spanner_instance_admin.CreateInstancePartitionRequest.pb(
238
+ request
239
+ )
240
+ transcoded_request = path_template.transcode(http_options, pb_request)
241
+ return transcoded_request
242
+
243
+ @staticmethod
244
+ def _get_request_body_json(transcoded_request):
245
+ # Jsonify the request body
246
+
247
+ body = json_format.MessageToJson(
248
+ transcoded_request["body"], use_integers_for_enums=True
249
+ )
250
+ return body
251
+
252
+ @staticmethod
253
+ def _get_query_params_json(transcoded_request):
254
+ query_params = json.loads(
255
+ json_format.MessageToJson(
256
+ transcoded_request["query_params"],
257
+ use_integers_for_enums=True,
258
+ )
259
+ )
260
+ query_params.update(
261
+ _BaseInstanceAdminRestTransport._BaseCreateInstancePartition._get_unset_required_fields(
262
+ query_params
263
+ )
264
+ )
265
+
266
+ query_params["$alt"] = "json;enum-encoding=int"
267
+ return query_params
268
+
269
+ class _BaseDeleteInstance:
270
+ def __hash__(self): # pragma: NO COVER
271
+ return NotImplementedError("__hash__ must be implemented.")
272
+
273
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
274
+
275
+ @classmethod
276
+ def _get_unset_required_fields(cls, message_dict):
277
+ return {
278
+ k: v
279
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
280
+ if k not in message_dict
281
+ }
282
+
283
+ @staticmethod
284
+ def _get_http_options():
285
+ http_options: List[Dict[str, str]] = [
286
+ {
287
+ "method": "delete",
288
+ "uri": "/v1/{name=projects/*/instances/*}",
289
+ },
290
+ ]
291
+ return http_options
292
+
293
+ @staticmethod
294
+ def _get_transcoded_request(http_options, request):
295
+ pb_request = spanner_instance_admin.DeleteInstanceRequest.pb(request)
296
+ transcoded_request = path_template.transcode(http_options, pb_request)
297
+ return transcoded_request
298
+
299
+ @staticmethod
300
+ def _get_query_params_json(transcoded_request):
301
+ query_params = json.loads(
302
+ json_format.MessageToJson(
303
+ transcoded_request["query_params"],
304
+ use_integers_for_enums=True,
305
+ )
306
+ )
307
+ query_params.update(
308
+ _BaseInstanceAdminRestTransport._BaseDeleteInstance._get_unset_required_fields(
309
+ query_params
310
+ )
311
+ )
312
+
313
+ query_params["$alt"] = "json;enum-encoding=int"
314
+ return query_params
315
+
316
+ class _BaseDeleteInstanceConfig:
317
+ def __hash__(self): # pragma: NO COVER
318
+ return NotImplementedError("__hash__ must be implemented.")
319
+
320
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
321
+
322
+ @classmethod
323
+ def _get_unset_required_fields(cls, message_dict):
324
+ return {
325
+ k: v
326
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
327
+ if k not in message_dict
328
+ }
329
+
330
+ @staticmethod
331
+ def _get_http_options():
332
+ http_options: List[Dict[str, str]] = [
333
+ {
334
+ "method": "delete",
335
+ "uri": "/v1/{name=projects/*/instanceConfigs/*}",
336
+ },
337
+ ]
338
+ return http_options
339
+
340
+ @staticmethod
341
+ def _get_transcoded_request(http_options, request):
342
+ pb_request = spanner_instance_admin.DeleteInstanceConfigRequest.pb(request)
343
+ transcoded_request = path_template.transcode(http_options, pb_request)
344
+ return transcoded_request
345
+
346
+ @staticmethod
347
+ def _get_query_params_json(transcoded_request):
348
+ query_params = json.loads(
349
+ json_format.MessageToJson(
350
+ transcoded_request["query_params"],
351
+ use_integers_for_enums=True,
352
+ )
353
+ )
354
+ query_params.update(
355
+ _BaseInstanceAdminRestTransport._BaseDeleteInstanceConfig._get_unset_required_fields(
356
+ query_params
357
+ )
358
+ )
359
+
360
+ query_params["$alt"] = "json;enum-encoding=int"
361
+ return query_params
362
+
363
+ class _BaseDeleteInstancePartition:
364
+ def __hash__(self): # pragma: NO COVER
365
+ return NotImplementedError("__hash__ must be implemented.")
366
+
367
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
368
+
369
+ @classmethod
370
+ def _get_unset_required_fields(cls, message_dict):
371
+ return {
372
+ k: v
373
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
374
+ if k not in message_dict
375
+ }
376
+
377
+ @staticmethod
378
+ def _get_http_options():
379
+ http_options: List[Dict[str, str]] = [
380
+ {
381
+ "method": "delete",
382
+ "uri": "/v1/{name=projects/*/instances/*/instancePartitions/*}",
383
+ },
384
+ ]
385
+ return http_options
386
+
387
+ @staticmethod
388
+ def _get_transcoded_request(http_options, request):
389
+ pb_request = spanner_instance_admin.DeleteInstancePartitionRequest.pb(
390
+ request
391
+ )
392
+ transcoded_request = path_template.transcode(http_options, pb_request)
393
+ return transcoded_request
394
+
395
+ @staticmethod
396
+ def _get_query_params_json(transcoded_request):
397
+ query_params = json.loads(
398
+ json_format.MessageToJson(
399
+ transcoded_request["query_params"],
400
+ use_integers_for_enums=True,
401
+ )
402
+ )
403
+ query_params.update(
404
+ _BaseInstanceAdminRestTransport._BaseDeleteInstancePartition._get_unset_required_fields(
405
+ query_params
406
+ )
407
+ )
408
+
409
+ query_params["$alt"] = "json;enum-encoding=int"
410
+ return query_params
411
+
412
+ class _BaseGetIamPolicy:
413
+ def __hash__(self): # pragma: NO COVER
414
+ return NotImplementedError("__hash__ must be implemented.")
415
+
416
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
417
+
418
+ @classmethod
419
+ def _get_unset_required_fields(cls, message_dict):
420
+ return {
421
+ k: v
422
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
423
+ if k not in message_dict
424
+ }
425
+
426
+ @staticmethod
427
+ def _get_http_options():
428
+ http_options: List[Dict[str, str]] = [
429
+ {
430
+ "method": "post",
431
+ "uri": "/v1/{resource=projects/*/instances/*}:getIamPolicy",
432
+ "body": "*",
433
+ },
434
+ ]
435
+ return http_options
436
+
437
+ @staticmethod
438
+ def _get_transcoded_request(http_options, request):
439
+ pb_request = request
440
+ transcoded_request = path_template.transcode(http_options, pb_request)
441
+ return transcoded_request
442
+
443
+ @staticmethod
444
+ def _get_request_body_json(transcoded_request):
445
+ # Jsonify the request body
446
+
447
+ body = json_format.MessageToJson(
448
+ transcoded_request["body"], use_integers_for_enums=True
449
+ )
450
+ return body
451
+
452
+ @staticmethod
453
+ def _get_query_params_json(transcoded_request):
454
+ query_params = json.loads(
455
+ json_format.MessageToJson(
456
+ transcoded_request["query_params"],
457
+ use_integers_for_enums=True,
458
+ )
459
+ )
460
+ query_params.update(
461
+ _BaseInstanceAdminRestTransport._BaseGetIamPolicy._get_unset_required_fields(
462
+ query_params
463
+ )
464
+ )
465
+
466
+ query_params["$alt"] = "json;enum-encoding=int"
467
+ return query_params
468
+
469
+ class _BaseGetInstance:
470
+ def __hash__(self): # pragma: NO COVER
471
+ return NotImplementedError("__hash__ must be implemented.")
472
+
473
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
474
+
475
+ @classmethod
476
+ def _get_unset_required_fields(cls, message_dict):
477
+ return {
478
+ k: v
479
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
480
+ if k not in message_dict
481
+ }
482
+
483
+ @staticmethod
484
+ def _get_http_options():
485
+ http_options: List[Dict[str, str]] = [
486
+ {
487
+ "method": "get",
488
+ "uri": "/v1/{name=projects/*/instances/*}",
489
+ },
490
+ ]
491
+ return http_options
492
+
493
+ @staticmethod
494
+ def _get_transcoded_request(http_options, request):
495
+ pb_request = spanner_instance_admin.GetInstanceRequest.pb(request)
496
+ transcoded_request = path_template.transcode(http_options, pb_request)
497
+ return transcoded_request
498
+
499
+ @staticmethod
500
+ def _get_query_params_json(transcoded_request):
501
+ query_params = json.loads(
502
+ json_format.MessageToJson(
503
+ transcoded_request["query_params"],
504
+ use_integers_for_enums=True,
505
+ )
506
+ )
507
+ query_params.update(
508
+ _BaseInstanceAdminRestTransport._BaseGetInstance._get_unset_required_fields(
509
+ query_params
510
+ )
511
+ )
512
+
513
+ query_params["$alt"] = "json;enum-encoding=int"
514
+ return query_params
515
+
516
+ class _BaseGetInstanceConfig:
517
+ def __hash__(self): # pragma: NO COVER
518
+ return NotImplementedError("__hash__ must be implemented.")
519
+
520
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
521
+
522
+ @classmethod
523
+ def _get_unset_required_fields(cls, message_dict):
524
+ return {
525
+ k: v
526
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
527
+ if k not in message_dict
528
+ }
529
+
530
+ @staticmethod
531
+ def _get_http_options():
532
+ http_options: List[Dict[str, str]] = [
533
+ {
534
+ "method": "get",
535
+ "uri": "/v1/{name=projects/*/instanceConfigs/*}",
536
+ },
537
+ ]
538
+ return http_options
539
+
540
+ @staticmethod
541
+ def _get_transcoded_request(http_options, request):
542
+ pb_request = spanner_instance_admin.GetInstanceConfigRequest.pb(request)
543
+ transcoded_request = path_template.transcode(http_options, pb_request)
544
+ return transcoded_request
545
+
546
+ @staticmethod
547
+ def _get_query_params_json(transcoded_request):
548
+ query_params = json.loads(
549
+ json_format.MessageToJson(
550
+ transcoded_request["query_params"],
551
+ use_integers_for_enums=True,
552
+ )
553
+ )
554
+ query_params.update(
555
+ _BaseInstanceAdminRestTransport._BaseGetInstanceConfig._get_unset_required_fields(
556
+ query_params
557
+ )
558
+ )
559
+
560
+ query_params["$alt"] = "json;enum-encoding=int"
561
+ return query_params
562
+
563
+ class _BaseGetInstancePartition:
564
+ def __hash__(self): # pragma: NO COVER
565
+ return NotImplementedError("__hash__ must be implemented.")
566
+
567
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
568
+
569
+ @classmethod
570
+ def _get_unset_required_fields(cls, message_dict):
571
+ return {
572
+ k: v
573
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
574
+ if k not in message_dict
575
+ }
576
+
577
+ @staticmethod
578
+ def _get_http_options():
579
+ http_options: List[Dict[str, str]] = [
580
+ {
581
+ "method": "get",
582
+ "uri": "/v1/{name=projects/*/instances/*/instancePartitions/*}",
583
+ },
584
+ ]
585
+ return http_options
586
+
587
+ @staticmethod
588
+ def _get_transcoded_request(http_options, request):
589
+ pb_request = spanner_instance_admin.GetInstancePartitionRequest.pb(request)
590
+ transcoded_request = path_template.transcode(http_options, pb_request)
591
+ return transcoded_request
592
+
593
+ @staticmethod
594
+ def _get_query_params_json(transcoded_request):
595
+ query_params = json.loads(
596
+ json_format.MessageToJson(
597
+ transcoded_request["query_params"],
598
+ use_integers_for_enums=True,
599
+ )
600
+ )
601
+ query_params.update(
602
+ _BaseInstanceAdminRestTransport._BaseGetInstancePartition._get_unset_required_fields(
603
+ query_params
604
+ )
605
+ )
606
+
607
+ query_params["$alt"] = "json;enum-encoding=int"
608
+ return query_params
609
+
610
+ class _BaseListInstanceConfigOperations:
611
+ def __hash__(self): # pragma: NO COVER
612
+ return NotImplementedError("__hash__ must be implemented.")
613
+
614
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
615
+
616
+ @classmethod
617
+ def _get_unset_required_fields(cls, message_dict):
618
+ return {
619
+ k: v
620
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
621
+ if k not in message_dict
622
+ }
623
+
624
+ @staticmethod
625
+ def _get_http_options():
626
+ http_options: List[Dict[str, str]] = [
627
+ {
628
+ "method": "get",
629
+ "uri": "/v1/{parent=projects/*}/instanceConfigOperations",
630
+ },
631
+ ]
632
+ return http_options
633
+
634
+ @staticmethod
635
+ def _get_transcoded_request(http_options, request):
636
+ pb_request = spanner_instance_admin.ListInstanceConfigOperationsRequest.pb(
637
+ request
638
+ )
639
+ transcoded_request = path_template.transcode(http_options, pb_request)
640
+ return transcoded_request
641
+
642
+ @staticmethod
643
+ def _get_query_params_json(transcoded_request):
644
+ query_params = json.loads(
645
+ json_format.MessageToJson(
646
+ transcoded_request["query_params"],
647
+ use_integers_for_enums=True,
648
+ )
649
+ )
650
+ query_params.update(
651
+ _BaseInstanceAdminRestTransport._BaseListInstanceConfigOperations._get_unset_required_fields(
652
+ query_params
653
+ )
654
+ )
655
+
656
+ query_params["$alt"] = "json;enum-encoding=int"
657
+ return query_params
658
+
659
+ class _BaseListInstanceConfigs:
660
+ def __hash__(self): # pragma: NO COVER
661
+ return NotImplementedError("__hash__ must be implemented.")
662
+
663
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
664
+
665
+ @classmethod
666
+ def _get_unset_required_fields(cls, message_dict):
667
+ return {
668
+ k: v
669
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
670
+ if k not in message_dict
671
+ }
672
+
673
+ @staticmethod
674
+ def _get_http_options():
675
+ http_options: List[Dict[str, str]] = [
676
+ {
677
+ "method": "get",
678
+ "uri": "/v1/{parent=projects/*}/instanceConfigs",
679
+ },
680
+ ]
681
+ return http_options
682
+
683
+ @staticmethod
684
+ def _get_transcoded_request(http_options, request):
685
+ pb_request = spanner_instance_admin.ListInstanceConfigsRequest.pb(request)
686
+ transcoded_request = path_template.transcode(http_options, pb_request)
687
+ return transcoded_request
688
+
689
+ @staticmethod
690
+ def _get_query_params_json(transcoded_request):
691
+ query_params = json.loads(
692
+ json_format.MessageToJson(
693
+ transcoded_request["query_params"],
694
+ use_integers_for_enums=True,
695
+ )
696
+ )
697
+ query_params.update(
698
+ _BaseInstanceAdminRestTransport._BaseListInstanceConfigs._get_unset_required_fields(
699
+ query_params
700
+ )
701
+ )
702
+
703
+ query_params["$alt"] = "json;enum-encoding=int"
704
+ return query_params
705
+
706
+ class _BaseListInstancePartitionOperations:
707
+ def __hash__(self): # pragma: NO COVER
708
+ return NotImplementedError("__hash__ must be implemented.")
709
+
710
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
711
+
712
+ @classmethod
713
+ def _get_unset_required_fields(cls, message_dict):
714
+ return {
715
+ k: v
716
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
717
+ if k not in message_dict
718
+ }
719
+
720
+ @staticmethod
721
+ def _get_http_options():
722
+ http_options: List[Dict[str, str]] = [
723
+ {
724
+ "method": "get",
725
+ "uri": "/v1/{parent=projects/*/instances/*}/instancePartitionOperations",
726
+ },
727
+ ]
728
+ return http_options
729
+
730
+ @staticmethod
731
+ def _get_transcoded_request(http_options, request):
732
+ pb_request = (
733
+ spanner_instance_admin.ListInstancePartitionOperationsRequest.pb(
734
+ request
735
+ )
736
+ )
737
+ transcoded_request = path_template.transcode(http_options, pb_request)
738
+ return transcoded_request
739
+
740
+ @staticmethod
741
+ def _get_query_params_json(transcoded_request):
742
+ query_params = json.loads(
743
+ json_format.MessageToJson(
744
+ transcoded_request["query_params"],
745
+ use_integers_for_enums=True,
746
+ )
747
+ )
748
+ query_params.update(
749
+ _BaseInstanceAdminRestTransport._BaseListInstancePartitionOperations._get_unset_required_fields(
750
+ query_params
751
+ )
752
+ )
753
+
754
+ query_params["$alt"] = "json;enum-encoding=int"
755
+ return query_params
756
+
757
+ class _BaseListInstancePartitions:
758
+ def __hash__(self): # pragma: NO COVER
759
+ return NotImplementedError("__hash__ must be implemented.")
760
+
761
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
762
+
763
+ @classmethod
764
+ def _get_unset_required_fields(cls, message_dict):
765
+ return {
766
+ k: v
767
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
768
+ if k not in message_dict
769
+ }
770
+
771
+ @staticmethod
772
+ def _get_http_options():
773
+ http_options: List[Dict[str, str]] = [
774
+ {
775
+ "method": "get",
776
+ "uri": "/v1/{parent=projects/*/instances/*}/instancePartitions",
777
+ },
778
+ ]
779
+ return http_options
780
+
781
+ @staticmethod
782
+ def _get_transcoded_request(http_options, request):
783
+ pb_request = spanner_instance_admin.ListInstancePartitionsRequest.pb(
784
+ request
785
+ )
786
+ transcoded_request = path_template.transcode(http_options, pb_request)
787
+ return transcoded_request
788
+
789
+ @staticmethod
790
+ def _get_query_params_json(transcoded_request):
791
+ query_params = json.loads(
792
+ json_format.MessageToJson(
793
+ transcoded_request["query_params"],
794
+ use_integers_for_enums=True,
795
+ )
796
+ )
797
+ query_params.update(
798
+ _BaseInstanceAdminRestTransport._BaseListInstancePartitions._get_unset_required_fields(
799
+ query_params
800
+ )
801
+ )
802
+
803
+ query_params["$alt"] = "json;enum-encoding=int"
804
+ return query_params
805
+
806
+ class _BaseListInstances:
807
+ def __hash__(self): # pragma: NO COVER
808
+ return NotImplementedError("__hash__ must be implemented.")
809
+
810
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
811
+
812
+ @classmethod
813
+ def _get_unset_required_fields(cls, message_dict):
814
+ return {
815
+ k: v
816
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
817
+ if k not in message_dict
818
+ }
819
+
820
+ @staticmethod
821
+ def _get_http_options():
822
+ http_options: List[Dict[str, str]] = [
823
+ {
824
+ "method": "get",
825
+ "uri": "/v1/{parent=projects/*}/instances",
826
+ },
827
+ ]
828
+ return http_options
829
+
830
+ @staticmethod
831
+ def _get_transcoded_request(http_options, request):
832
+ pb_request = spanner_instance_admin.ListInstancesRequest.pb(request)
833
+ transcoded_request = path_template.transcode(http_options, pb_request)
834
+ return transcoded_request
835
+
836
+ @staticmethod
837
+ def _get_query_params_json(transcoded_request):
838
+ query_params = json.loads(
839
+ json_format.MessageToJson(
840
+ transcoded_request["query_params"],
841
+ use_integers_for_enums=True,
842
+ )
843
+ )
844
+ query_params.update(
845
+ _BaseInstanceAdminRestTransport._BaseListInstances._get_unset_required_fields(
846
+ query_params
847
+ )
848
+ )
849
+
850
+ query_params["$alt"] = "json;enum-encoding=int"
851
+ return query_params
852
+
853
+ class _BaseMoveInstance:
854
+ def __hash__(self): # pragma: NO COVER
855
+ return NotImplementedError("__hash__ must be implemented.")
856
+
857
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
858
+
859
+ @classmethod
860
+ def _get_unset_required_fields(cls, message_dict):
861
+ return {
862
+ k: v
863
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
864
+ if k not in message_dict
865
+ }
866
+
867
+ @staticmethod
868
+ def _get_http_options():
869
+ http_options: List[Dict[str, str]] = [
870
+ {
871
+ "method": "post",
872
+ "uri": "/v1/{name=projects/*/instances/*}:move",
873
+ "body": "*",
874
+ },
875
+ ]
876
+ return http_options
877
+
878
+ @staticmethod
879
+ def _get_transcoded_request(http_options, request):
880
+ pb_request = spanner_instance_admin.MoveInstanceRequest.pb(request)
881
+ transcoded_request = path_template.transcode(http_options, pb_request)
882
+ return transcoded_request
883
+
884
+ @staticmethod
885
+ def _get_request_body_json(transcoded_request):
886
+ # Jsonify the request body
887
+
888
+ body = json_format.MessageToJson(
889
+ transcoded_request["body"], use_integers_for_enums=True
890
+ )
891
+ return body
892
+
893
+ @staticmethod
894
+ def _get_query_params_json(transcoded_request):
895
+ query_params = json.loads(
896
+ json_format.MessageToJson(
897
+ transcoded_request["query_params"],
898
+ use_integers_for_enums=True,
899
+ )
900
+ )
901
+ query_params.update(
902
+ _BaseInstanceAdminRestTransport._BaseMoveInstance._get_unset_required_fields(
903
+ query_params
904
+ )
905
+ )
906
+
907
+ query_params["$alt"] = "json;enum-encoding=int"
908
+ return query_params
909
+
910
+ class _BaseSetIamPolicy:
911
+ def __hash__(self): # pragma: NO COVER
912
+ return NotImplementedError("__hash__ must be implemented.")
913
+
914
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
915
+
916
+ @classmethod
917
+ def _get_unset_required_fields(cls, message_dict):
918
+ return {
919
+ k: v
920
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
921
+ if k not in message_dict
922
+ }
923
+
924
+ @staticmethod
925
+ def _get_http_options():
926
+ http_options: List[Dict[str, str]] = [
927
+ {
928
+ "method": "post",
929
+ "uri": "/v1/{resource=projects/*/instances/*}:setIamPolicy",
930
+ "body": "*",
931
+ },
932
+ ]
933
+ return http_options
934
+
935
+ @staticmethod
936
+ def _get_transcoded_request(http_options, request):
937
+ pb_request = request
938
+ transcoded_request = path_template.transcode(http_options, pb_request)
939
+ return transcoded_request
940
+
941
+ @staticmethod
942
+ def _get_request_body_json(transcoded_request):
943
+ # Jsonify the request body
944
+
945
+ body = json_format.MessageToJson(
946
+ transcoded_request["body"], use_integers_for_enums=True
947
+ )
948
+ return body
949
+
950
+ @staticmethod
951
+ def _get_query_params_json(transcoded_request):
952
+ query_params = json.loads(
953
+ json_format.MessageToJson(
954
+ transcoded_request["query_params"],
955
+ use_integers_for_enums=True,
956
+ )
957
+ )
958
+ query_params.update(
959
+ _BaseInstanceAdminRestTransport._BaseSetIamPolicy._get_unset_required_fields(
960
+ query_params
961
+ )
962
+ )
963
+
964
+ query_params["$alt"] = "json;enum-encoding=int"
965
+ return query_params
966
+
967
+ class _BaseTestIamPermissions:
968
+ def __hash__(self): # pragma: NO COVER
969
+ return NotImplementedError("__hash__ must be implemented.")
970
+
971
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
972
+
973
+ @classmethod
974
+ def _get_unset_required_fields(cls, message_dict):
975
+ return {
976
+ k: v
977
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
978
+ if k not in message_dict
979
+ }
980
+
981
+ @staticmethod
982
+ def _get_http_options():
983
+ http_options: List[Dict[str, str]] = [
984
+ {
985
+ "method": "post",
986
+ "uri": "/v1/{resource=projects/*/instances/*}:testIamPermissions",
987
+ "body": "*",
988
+ },
989
+ ]
990
+ return http_options
991
+
992
+ @staticmethod
993
+ def _get_transcoded_request(http_options, request):
994
+ pb_request = request
995
+ transcoded_request = path_template.transcode(http_options, pb_request)
996
+ return transcoded_request
997
+
998
+ @staticmethod
999
+ def _get_request_body_json(transcoded_request):
1000
+ # Jsonify the request body
1001
+
1002
+ body = json_format.MessageToJson(
1003
+ transcoded_request["body"], use_integers_for_enums=True
1004
+ )
1005
+ return body
1006
+
1007
+ @staticmethod
1008
+ def _get_query_params_json(transcoded_request):
1009
+ query_params = json.loads(
1010
+ json_format.MessageToJson(
1011
+ transcoded_request["query_params"],
1012
+ use_integers_for_enums=True,
1013
+ )
1014
+ )
1015
+ query_params.update(
1016
+ _BaseInstanceAdminRestTransport._BaseTestIamPermissions._get_unset_required_fields(
1017
+ query_params
1018
+ )
1019
+ )
1020
+
1021
+ query_params["$alt"] = "json;enum-encoding=int"
1022
+ return query_params
1023
+
1024
+ class _BaseUpdateInstance:
1025
+ def __hash__(self): # pragma: NO COVER
1026
+ return NotImplementedError("__hash__ must be implemented.")
1027
+
1028
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
1029
+
1030
+ @classmethod
1031
+ def _get_unset_required_fields(cls, message_dict):
1032
+ return {
1033
+ k: v
1034
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
1035
+ if k not in message_dict
1036
+ }
1037
+
1038
+ @staticmethod
1039
+ def _get_http_options():
1040
+ http_options: List[Dict[str, str]] = [
1041
+ {
1042
+ "method": "patch",
1043
+ "uri": "/v1/{instance.name=projects/*/instances/*}",
1044
+ "body": "*",
1045
+ },
1046
+ ]
1047
+ return http_options
1048
+
1049
+ @staticmethod
1050
+ def _get_transcoded_request(http_options, request):
1051
+ pb_request = spanner_instance_admin.UpdateInstanceRequest.pb(request)
1052
+ transcoded_request = path_template.transcode(http_options, pb_request)
1053
+ return transcoded_request
1054
+
1055
+ @staticmethod
1056
+ def _get_request_body_json(transcoded_request):
1057
+ # Jsonify the request body
1058
+
1059
+ body = json_format.MessageToJson(
1060
+ transcoded_request["body"], use_integers_for_enums=True
1061
+ )
1062
+ return body
1063
+
1064
+ @staticmethod
1065
+ def _get_query_params_json(transcoded_request):
1066
+ query_params = json.loads(
1067
+ json_format.MessageToJson(
1068
+ transcoded_request["query_params"],
1069
+ use_integers_for_enums=True,
1070
+ )
1071
+ )
1072
+ query_params.update(
1073
+ _BaseInstanceAdminRestTransport._BaseUpdateInstance._get_unset_required_fields(
1074
+ query_params
1075
+ )
1076
+ )
1077
+
1078
+ query_params["$alt"] = "json;enum-encoding=int"
1079
+ return query_params
1080
+
1081
+ class _BaseUpdateInstanceConfig:
1082
+ def __hash__(self): # pragma: NO COVER
1083
+ return NotImplementedError("__hash__ must be implemented.")
1084
+
1085
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
1086
+
1087
+ @classmethod
1088
+ def _get_unset_required_fields(cls, message_dict):
1089
+ return {
1090
+ k: v
1091
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
1092
+ if k not in message_dict
1093
+ }
1094
+
1095
+ @staticmethod
1096
+ def _get_http_options():
1097
+ http_options: List[Dict[str, str]] = [
1098
+ {
1099
+ "method": "patch",
1100
+ "uri": "/v1/{instance_config.name=projects/*/instanceConfigs/*}",
1101
+ "body": "*",
1102
+ },
1103
+ ]
1104
+ return http_options
1105
+
1106
+ @staticmethod
1107
+ def _get_transcoded_request(http_options, request):
1108
+ pb_request = spanner_instance_admin.UpdateInstanceConfigRequest.pb(request)
1109
+ transcoded_request = path_template.transcode(http_options, pb_request)
1110
+ return transcoded_request
1111
+
1112
+ @staticmethod
1113
+ def _get_request_body_json(transcoded_request):
1114
+ # Jsonify the request body
1115
+
1116
+ body = json_format.MessageToJson(
1117
+ transcoded_request["body"], use_integers_for_enums=True
1118
+ )
1119
+ return body
1120
+
1121
+ @staticmethod
1122
+ def _get_query_params_json(transcoded_request):
1123
+ query_params = json.loads(
1124
+ json_format.MessageToJson(
1125
+ transcoded_request["query_params"],
1126
+ use_integers_for_enums=True,
1127
+ )
1128
+ )
1129
+ query_params.update(
1130
+ _BaseInstanceAdminRestTransport._BaseUpdateInstanceConfig._get_unset_required_fields(
1131
+ query_params
1132
+ )
1133
+ )
1134
+
1135
+ query_params["$alt"] = "json;enum-encoding=int"
1136
+ return query_params
1137
+
1138
+ class _BaseUpdateInstancePartition:
1139
+ def __hash__(self): # pragma: NO COVER
1140
+ return NotImplementedError("__hash__ must be implemented.")
1141
+
1142
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
1143
+
1144
+ @classmethod
1145
+ def _get_unset_required_fields(cls, message_dict):
1146
+ return {
1147
+ k: v
1148
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
1149
+ if k not in message_dict
1150
+ }
1151
+
1152
+ @staticmethod
1153
+ def _get_http_options():
1154
+ http_options: List[Dict[str, str]] = [
1155
+ {
1156
+ "method": "patch",
1157
+ "uri": "/v1/{instance_partition.name=projects/*/instances/*/instancePartitions/*}",
1158
+ "body": "*",
1159
+ },
1160
+ ]
1161
+ return http_options
1162
+
1163
+ @staticmethod
1164
+ def _get_transcoded_request(http_options, request):
1165
+ pb_request = spanner_instance_admin.UpdateInstancePartitionRequest.pb(
1166
+ request
1167
+ )
1168
+ transcoded_request = path_template.transcode(http_options, pb_request)
1169
+ return transcoded_request
1170
+
1171
+ @staticmethod
1172
+ def _get_request_body_json(transcoded_request):
1173
+ # Jsonify the request body
1174
+
1175
+ body = json_format.MessageToJson(
1176
+ transcoded_request["body"], use_integers_for_enums=True
1177
+ )
1178
+ return body
1179
+
1180
+ @staticmethod
1181
+ def _get_query_params_json(transcoded_request):
1182
+ query_params = json.loads(
1183
+ json_format.MessageToJson(
1184
+ transcoded_request["query_params"],
1185
+ use_integers_for_enums=True,
1186
+ )
1187
+ )
1188
+ query_params.update(
1189
+ _BaseInstanceAdminRestTransport._BaseUpdateInstancePartition._get_unset_required_fields(
1190
+ query_params
1191
+ )
1192
+ )
1193
+
1194
+ query_params["$alt"] = "json;enum-encoding=int"
1195
+ return query_params
1196
+
1197
+
1198
+ __all__ = ("_BaseInstanceAdminRestTransport",)