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,856 @@
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
+ from google.api_core import gapic_v1
17
+ from google.api_core import retry as retries
18
+ from google.api_core import retry_async as retries_async
19
+ from typing import (
20
+ Any,
21
+ AsyncIterator,
22
+ Awaitable,
23
+ Callable,
24
+ Sequence,
25
+ Tuple,
26
+ Optional,
27
+ Iterator,
28
+ Union,
29
+ )
30
+
31
+ try:
32
+ OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]
33
+ OptionalAsyncRetry = Union[
34
+ retries_async.AsyncRetry, gapic_v1.method._MethodDefault, None
35
+ ]
36
+ except AttributeError: # pragma: NO COVER
37
+ OptionalRetry = Union[retries.Retry, object, None] # type: ignore
38
+ OptionalAsyncRetry = Union[retries_async.AsyncRetry, object, None] # type: ignore
39
+
40
+ from google.cloud.spanner_admin_instance_v1.types import spanner_instance_admin
41
+ from google.longrunning import operations_pb2 # type: ignore
42
+
43
+
44
+ class ListInstanceConfigsPager:
45
+ """A pager for iterating through ``list_instance_configs`` requests.
46
+
47
+ This class thinly wraps an initial
48
+ :class:`google.cloud.spanner_admin_instance_v1.types.ListInstanceConfigsResponse` object, and
49
+ provides an ``__iter__`` method to iterate through its
50
+ ``instance_configs`` field.
51
+
52
+ If there are more pages, the ``__iter__`` method will make additional
53
+ ``ListInstanceConfigs`` requests and continue to iterate
54
+ through the ``instance_configs`` field on the
55
+ corresponding responses.
56
+
57
+ All the usual :class:`google.cloud.spanner_admin_instance_v1.types.ListInstanceConfigsResponse`
58
+ attributes are available on the pager. If multiple requests are made, only
59
+ the most recent response is retained, and thus used for attribute lookup.
60
+ """
61
+
62
+ def __init__(
63
+ self,
64
+ method: Callable[..., spanner_instance_admin.ListInstanceConfigsResponse],
65
+ request: spanner_instance_admin.ListInstanceConfigsRequest,
66
+ response: spanner_instance_admin.ListInstanceConfigsResponse,
67
+ *,
68
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
69
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
70
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
71
+ ):
72
+ """Instantiate the pager.
73
+
74
+ Args:
75
+ method (Callable): The method that was originally called, and
76
+ which instantiated this pager.
77
+ request (google.cloud.spanner_admin_instance_v1.types.ListInstanceConfigsRequest):
78
+ The initial request object.
79
+ response (google.cloud.spanner_admin_instance_v1.types.ListInstanceConfigsResponse):
80
+ The initial response object.
81
+ retry (google.api_core.retry.Retry): Designation of what errors,
82
+ if any, should be retried.
83
+ timeout (float): The timeout for this request.
84
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
85
+ sent along with the request as metadata. Normally, each value must be of type `str`,
86
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
87
+ be of type `bytes`.
88
+ """
89
+ self._method = method
90
+ self._request = spanner_instance_admin.ListInstanceConfigsRequest(request)
91
+ self._response = response
92
+ self._retry = retry
93
+ self._timeout = timeout
94
+ self._metadata = metadata
95
+
96
+ def __getattr__(self, name: str) -> Any:
97
+ return getattr(self._response, name)
98
+
99
+ @property
100
+ def pages(self) -> Iterator[spanner_instance_admin.ListInstanceConfigsResponse]:
101
+ yield self._response
102
+ while self._response.next_page_token:
103
+ self._request.page_token = self._response.next_page_token
104
+ self._response = self._method(
105
+ self._request,
106
+ retry=self._retry,
107
+ timeout=self._timeout,
108
+ metadata=self._metadata,
109
+ )
110
+ yield self._response
111
+
112
+ def __iter__(self) -> Iterator[spanner_instance_admin.InstanceConfig]:
113
+ for page in self.pages:
114
+ yield from page.instance_configs
115
+
116
+ def __repr__(self) -> str:
117
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
118
+
119
+
120
+ class ListInstanceConfigsAsyncPager:
121
+ """A pager for iterating through ``list_instance_configs`` requests.
122
+
123
+ This class thinly wraps an initial
124
+ :class:`google.cloud.spanner_admin_instance_v1.types.ListInstanceConfigsResponse` object, and
125
+ provides an ``__aiter__`` method to iterate through its
126
+ ``instance_configs`` field.
127
+
128
+ If there are more pages, the ``__aiter__`` method will make additional
129
+ ``ListInstanceConfigs`` requests and continue to iterate
130
+ through the ``instance_configs`` field on the
131
+ corresponding responses.
132
+
133
+ All the usual :class:`google.cloud.spanner_admin_instance_v1.types.ListInstanceConfigsResponse`
134
+ attributes are available on the pager. If multiple requests are made, only
135
+ the most recent response is retained, and thus used for attribute lookup.
136
+ """
137
+
138
+ def __init__(
139
+ self,
140
+ method: Callable[
141
+ ..., Awaitable[spanner_instance_admin.ListInstanceConfigsResponse]
142
+ ],
143
+ request: spanner_instance_admin.ListInstanceConfigsRequest,
144
+ response: spanner_instance_admin.ListInstanceConfigsResponse,
145
+ *,
146
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
147
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
148
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
149
+ ):
150
+ """Instantiates the pager.
151
+
152
+ Args:
153
+ method (Callable): The method that was originally called, and
154
+ which instantiated this pager.
155
+ request (google.cloud.spanner_admin_instance_v1.types.ListInstanceConfigsRequest):
156
+ The initial request object.
157
+ response (google.cloud.spanner_admin_instance_v1.types.ListInstanceConfigsResponse):
158
+ The initial response object.
159
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
160
+ if any, should be retried.
161
+ timeout (float): The timeout for this request.
162
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
163
+ sent along with the request as metadata. Normally, each value must be of type `str`,
164
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
165
+ be of type `bytes`.
166
+ """
167
+ self._method = method
168
+ self._request = spanner_instance_admin.ListInstanceConfigsRequest(request)
169
+ self._response = response
170
+ self._retry = retry
171
+ self._timeout = timeout
172
+ self._metadata = metadata
173
+
174
+ def __getattr__(self, name: str) -> Any:
175
+ return getattr(self._response, name)
176
+
177
+ @property
178
+ async def pages(
179
+ self,
180
+ ) -> AsyncIterator[spanner_instance_admin.ListInstanceConfigsResponse]:
181
+ yield self._response
182
+ while self._response.next_page_token:
183
+ self._request.page_token = self._response.next_page_token
184
+ self._response = await self._method(
185
+ self._request,
186
+ retry=self._retry,
187
+ timeout=self._timeout,
188
+ metadata=self._metadata,
189
+ )
190
+ yield self._response
191
+
192
+ def __aiter__(self) -> AsyncIterator[spanner_instance_admin.InstanceConfig]:
193
+ async def async_generator():
194
+ async for page in self.pages:
195
+ for response in page.instance_configs:
196
+ yield response
197
+
198
+ return async_generator()
199
+
200
+ def __repr__(self) -> str:
201
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
202
+
203
+
204
+ class ListInstanceConfigOperationsPager:
205
+ """A pager for iterating through ``list_instance_config_operations`` requests.
206
+
207
+ This class thinly wraps an initial
208
+ :class:`google.cloud.spanner_admin_instance_v1.types.ListInstanceConfigOperationsResponse` object, and
209
+ provides an ``__iter__`` method to iterate through its
210
+ ``operations`` field.
211
+
212
+ If there are more pages, the ``__iter__`` method will make additional
213
+ ``ListInstanceConfigOperations`` requests and continue to iterate
214
+ through the ``operations`` field on the
215
+ corresponding responses.
216
+
217
+ All the usual :class:`google.cloud.spanner_admin_instance_v1.types.ListInstanceConfigOperationsResponse`
218
+ attributes are available on the pager. If multiple requests are made, only
219
+ the most recent response is retained, and thus used for attribute lookup.
220
+ """
221
+
222
+ def __init__(
223
+ self,
224
+ method: Callable[
225
+ ..., spanner_instance_admin.ListInstanceConfigOperationsResponse
226
+ ],
227
+ request: spanner_instance_admin.ListInstanceConfigOperationsRequest,
228
+ response: spanner_instance_admin.ListInstanceConfigOperationsResponse,
229
+ *,
230
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
231
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
232
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
233
+ ):
234
+ """Instantiate the pager.
235
+
236
+ Args:
237
+ method (Callable): The method that was originally called, and
238
+ which instantiated this pager.
239
+ request (google.cloud.spanner_admin_instance_v1.types.ListInstanceConfigOperationsRequest):
240
+ The initial request object.
241
+ response (google.cloud.spanner_admin_instance_v1.types.ListInstanceConfigOperationsResponse):
242
+ The initial response object.
243
+ retry (google.api_core.retry.Retry): Designation of what errors,
244
+ if any, should be retried.
245
+ timeout (float): The timeout for this request.
246
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
247
+ sent along with the request as metadata. Normally, each value must be of type `str`,
248
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
249
+ be of type `bytes`.
250
+ """
251
+ self._method = method
252
+ self._request = spanner_instance_admin.ListInstanceConfigOperationsRequest(
253
+ request
254
+ )
255
+ self._response = response
256
+ self._retry = retry
257
+ self._timeout = timeout
258
+ self._metadata = metadata
259
+
260
+ def __getattr__(self, name: str) -> Any:
261
+ return getattr(self._response, name)
262
+
263
+ @property
264
+ def pages(
265
+ self,
266
+ ) -> Iterator[spanner_instance_admin.ListInstanceConfigOperationsResponse]:
267
+ yield self._response
268
+ while self._response.next_page_token:
269
+ self._request.page_token = self._response.next_page_token
270
+ self._response = self._method(
271
+ self._request,
272
+ retry=self._retry,
273
+ timeout=self._timeout,
274
+ metadata=self._metadata,
275
+ )
276
+ yield self._response
277
+
278
+ def __iter__(self) -> Iterator[operations_pb2.Operation]:
279
+ for page in self.pages:
280
+ yield from page.operations
281
+
282
+ def __repr__(self) -> str:
283
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
284
+
285
+
286
+ class ListInstanceConfigOperationsAsyncPager:
287
+ """A pager for iterating through ``list_instance_config_operations`` requests.
288
+
289
+ This class thinly wraps an initial
290
+ :class:`google.cloud.spanner_admin_instance_v1.types.ListInstanceConfigOperationsResponse` object, and
291
+ provides an ``__aiter__`` method to iterate through its
292
+ ``operations`` field.
293
+
294
+ If there are more pages, the ``__aiter__`` method will make additional
295
+ ``ListInstanceConfigOperations`` requests and continue to iterate
296
+ through the ``operations`` field on the
297
+ corresponding responses.
298
+
299
+ All the usual :class:`google.cloud.spanner_admin_instance_v1.types.ListInstanceConfigOperationsResponse`
300
+ attributes are available on the pager. If multiple requests are made, only
301
+ the most recent response is retained, and thus used for attribute lookup.
302
+ """
303
+
304
+ def __init__(
305
+ self,
306
+ method: Callable[
307
+ ..., Awaitable[spanner_instance_admin.ListInstanceConfigOperationsResponse]
308
+ ],
309
+ request: spanner_instance_admin.ListInstanceConfigOperationsRequest,
310
+ response: spanner_instance_admin.ListInstanceConfigOperationsResponse,
311
+ *,
312
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
313
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
314
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
315
+ ):
316
+ """Instantiates the pager.
317
+
318
+ Args:
319
+ method (Callable): The method that was originally called, and
320
+ which instantiated this pager.
321
+ request (google.cloud.spanner_admin_instance_v1.types.ListInstanceConfigOperationsRequest):
322
+ The initial request object.
323
+ response (google.cloud.spanner_admin_instance_v1.types.ListInstanceConfigOperationsResponse):
324
+ The initial response object.
325
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
326
+ if any, should be retried.
327
+ timeout (float): The timeout for this request.
328
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
329
+ sent along with the request as metadata. Normally, each value must be of type `str`,
330
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
331
+ be of type `bytes`.
332
+ """
333
+ self._method = method
334
+ self._request = spanner_instance_admin.ListInstanceConfigOperationsRequest(
335
+ request
336
+ )
337
+ self._response = response
338
+ self._retry = retry
339
+ self._timeout = timeout
340
+ self._metadata = metadata
341
+
342
+ def __getattr__(self, name: str) -> Any:
343
+ return getattr(self._response, name)
344
+
345
+ @property
346
+ async def pages(
347
+ self,
348
+ ) -> AsyncIterator[spanner_instance_admin.ListInstanceConfigOperationsResponse]:
349
+ yield self._response
350
+ while self._response.next_page_token:
351
+ self._request.page_token = self._response.next_page_token
352
+ self._response = await self._method(
353
+ self._request,
354
+ retry=self._retry,
355
+ timeout=self._timeout,
356
+ metadata=self._metadata,
357
+ )
358
+ yield self._response
359
+
360
+ def __aiter__(self) -> AsyncIterator[operations_pb2.Operation]:
361
+ async def async_generator():
362
+ async for page in self.pages:
363
+ for response in page.operations:
364
+ yield response
365
+
366
+ return async_generator()
367
+
368
+ def __repr__(self) -> str:
369
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
370
+
371
+
372
+ class ListInstancesPager:
373
+ """A pager for iterating through ``list_instances`` requests.
374
+
375
+ This class thinly wraps an initial
376
+ :class:`google.cloud.spanner_admin_instance_v1.types.ListInstancesResponse` object, and
377
+ provides an ``__iter__`` method to iterate through its
378
+ ``instances`` field.
379
+
380
+ If there are more pages, the ``__iter__`` method will make additional
381
+ ``ListInstances`` requests and continue to iterate
382
+ through the ``instances`` field on the
383
+ corresponding responses.
384
+
385
+ All the usual :class:`google.cloud.spanner_admin_instance_v1.types.ListInstancesResponse`
386
+ attributes are available on the pager. If multiple requests are made, only
387
+ the most recent response is retained, and thus used for attribute lookup.
388
+ """
389
+
390
+ def __init__(
391
+ self,
392
+ method: Callable[..., spanner_instance_admin.ListInstancesResponse],
393
+ request: spanner_instance_admin.ListInstancesRequest,
394
+ response: spanner_instance_admin.ListInstancesResponse,
395
+ *,
396
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
397
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
398
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
399
+ ):
400
+ """Instantiate the pager.
401
+
402
+ Args:
403
+ method (Callable): The method that was originally called, and
404
+ which instantiated this pager.
405
+ request (google.cloud.spanner_admin_instance_v1.types.ListInstancesRequest):
406
+ The initial request object.
407
+ response (google.cloud.spanner_admin_instance_v1.types.ListInstancesResponse):
408
+ The initial response object.
409
+ retry (google.api_core.retry.Retry): Designation of what errors,
410
+ if any, should be retried.
411
+ timeout (float): The timeout for this request.
412
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
413
+ sent along with the request as metadata. Normally, each value must be of type `str`,
414
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
415
+ be of type `bytes`.
416
+ """
417
+ self._method = method
418
+ self._request = spanner_instance_admin.ListInstancesRequest(request)
419
+ self._response = response
420
+ self._retry = retry
421
+ self._timeout = timeout
422
+ self._metadata = metadata
423
+
424
+ def __getattr__(self, name: str) -> Any:
425
+ return getattr(self._response, name)
426
+
427
+ @property
428
+ def pages(self) -> Iterator[spanner_instance_admin.ListInstancesResponse]:
429
+ yield self._response
430
+ while self._response.next_page_token:
431
+ self._request.page_token = self._response.next_page_token
432
+ self._response = self._method(
433
+ self._request,
434
+ retry=self._retry,
435
+ timeout=self._timeout,
436
+ metadata=self._metadata,
437
+ )
438
+ yield self._response
439
+
440
+ def __iter__(self) -> Iterator[spanner_instance_admin.Instance]:
441
+ for page in self.pages:
442
+ yield from page.instances
443
+
444
+ def __repr__(self) -> str:
445
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
446
+
447
+
448
+ class ListInstancesAsyncPager:
449
+ """A pager for iterating through ``list_instances`` requests.
450
+
451
+ This class thinly wraps an initial
452
+ :class:`google.cloud.spanner_admin_instance_v1.types.ListInstancesResponse` object, and
453
+ provides an ``__aiter__`` method to iterate through its
454
+ ``instances`` field.
455
+
456
+ If there are more pages, the ``__aiter__`` method will make additional
457
+ ``ListInstances`` requests and continue to iterate
458
+ through the ``instances`` field on the
459
+ corresponding responses.
460
+
461
+ All the usual :class:`google.cloud.spanner_admin_instance_v1.types.ListInstancesResponse`
462
+ attributes are available on the pager. If multiple requests are made, only
463
+ the most recent response is retained, and thus used for attribute lookup.
464
+ """
465
+
466
+ def __init__(
467
+ self,
468
+ method: Callable[..., Awaitable[spanner_instance_admin.ListInstancesResponse]],
469
+ request: spanner_instance_admin.ListInstancesRequest,
470
+ response: spanner_instance_admin.ListInstancesResponse,
471
+ *,
472
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
473
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
474
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
475
+ ):
476
+ """Instantiates the pager.
477
+
478
+ Args:
479
+ method (Callable): The method that was originally called, and
480
+ which instantiated this pager.
481
+ request (google.cloud.spanner_admin_instance_v1.types.ListInstancesRequest):
482
+ The initial request object.
483
+ response (google.cloud.spanner_admin_instance_v1.types.ListInstancesResponse):
484
+ The initial response object.
485
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
486
+ if any, should be retried.
487
+ timeout (float): The timeout for this request.
488
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
489
+ sent along with the request as metadata. Normally, each value must be of type `str`,
490
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
491
+ be of type `bytes`.
492
+ """
493
+ self._method = method
494
+ self._request = spanner_instance_admin.ListInstancesRequest(request)
495
+ self._response = response
496
+ self._retry = retry
497
+ self._timeout = timeout
498
+ self._metadata = metadata
499
+
500
+ def __getattr__(self, name: str) -> Any:
501
+ return getattr(self._response, name)
502
+
503
+ @property
504
+ async def pages(
505
+ self,
506
+ ) -> AsyncIterator[spanner_instance_admin.ListInstancesResponse]:
507
+ yield self._response
508
+ while self._response.next_page_token:
509
+ self._request.page_token = self._response.next_page_token
510
+ self._response = await self._method(
511
+ self._request,
512
+ retry=self._retry,
513
+ timeout=self._timeout,
514
+ metadata=self._metadata,
515
+ )
516
+ yield self._response
517
+
518
+ def __aiter__(self) -> AsyncIterator[spanner_instance_admin.Instance]:
519
+ async def async_generator():
520
+ async for page in self.pages:
521
+ for response in page.instances:
522
+ yield response
523
+
524
+ return async_generator()
525
+
526
+ def __repr__(self) -> str:
527
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
528
+
529
+
530
+ class ListInstancePartitionsPager:
531
+ """A pager for iterating through ``list_instance_partitions`` requests.
532
+
533
+ This class thinly wraps an initial
534
+ :class:`google.cloud.spanner_admin_instance_v1.types.ListInstancePartitionsResponse` object, and
535
+ provides an ``__iter__`` method to iterate through its
536
+ ``instance_partitions`` field.
537
+
538
+ If there are more pages, the ``__iter__`` method will make additional
539
+ ``ListInstancePartitions`` requests and continue to iterate
540
+ through the ``instance_partitions`` field on the
541
+ corresponding responses.
542
+
543
+ All the usual :class:`google.cloud.spanner_admin_instance_v1.types.ListInstancePartitionsResponse`
544
+ attributes are available on the pager. If multiple requests are made, only
545
+ the most recent response is retained, and thus used for attribute lookup.
546
+ """
547
+
548
+ def __init__(
549
+ self,
550
+ method: Callable[..., spanner_instance_admin.ListInstancePartitionsResponse],
551
+ request: spanner_instance_admin.ListInstancePartitionsRequest,
552
+ response: spanner_instance_admin.ListInstancePartitionsResponse,
553
+ *,
554
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
555
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
556
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
557
+ ):
558
+ """Instantiate the pager.
559
+
560
+ Args:
561
+ method (Callable): The method that was originally called, and
562
+ which instantiated this pager.
563
+ request (google.cloud.spanner_admin_instance_v1.types.ListInstancePartitionsRequest):
564
+ The initial request object.
565
+ response (google.cloud.spanner_admin_instance_v1.types.ListInstancePartitionsResponse):
566
+ The initial response object.
567
+ retry (google.api_core.retry.Retry): Designation of what errors,
568
+ if any, should be retried.
569
+ timeout (float): The timeout for this request.
570
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
571
+ sent along with the request as metadata. Normally, each value must be of type `str`,
572
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
573
+ be of type `bytes`.
574
+ """
575
+ self._method = method
576
+ self._request = spanner_instance_admin.ListInstancePartitionsRequest(request)
577
+ self._response = response
578
+ self._retry = retry
579
+ self._timeout = timeout
580
+ self._metadata = metadata
581
+
582
+ def __getattr__(self, name: str) -> Any:
583
+ return getattr(self._response, name)
584
+
585
+ @property
586
+ def pages(self) -> Iterator[spanner_instance_admin.ListInstancePartitionsResponse]:
587
+ yield self._response
588
+ while self._response.next_page_token:
589
+ self._request.page_token = self._response.next_page_token
590
+ self._response = self._method(
591
+ self._request,
592
+ retry=self._retry,
593
+ timeout=self._timeout,
594
+ metadata=self._metadata,
595
+ )
596
+ yield self._response
597
+
598
+ def __iter__(self) -> Iterator[spanner_instance_admin.InstancePartition]:
599
+ for page in self.pages:
600
+ yield from page.instance_partitions
601
+
602
+ def __repr__(self) -> str:
603
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
604
+
605
+
606
+ class ListInstancePartitionsAsyncPager:
607
+ """A pager for iterating through ``list_instance_partitions`` requests.
608
+
609
+ This class thinly wraps an initial
610
+ :class:`google.cloud.spanner_admin_instance_v1.types.ListInstancePartitionsResponse` object, and
611
+ provides an ``__aiter__`` method to iterate through its
612
+ ``instance_partitions`` field.
613
+
614
+ If there are more pages, the ``__aiter__`` method will make additional
615
+ ``ListInstancePartitions`` requests and continue to iterate
616
+ through the ``instance_partitions`` field on the
617
+ corresponding responses.
618
+
619
+ All the usual :class:`google.cloud.spanner_admin_instance_v1.types.ListInstancePartitionsResponse`
620
+ attributes are available on the pager. If multiple requests are made, only
621
+ the most recent response is retained, and thus used for attribute lookup.
622
+ """
623
+
624
+ def __init__(
625
+ self,
626
+ method: Callable[
627
+ ..., Awaitable[spanner_instance_admin.ListInstancePartitionsResponse]
628
+ ],
629
+ request: spanner_instance_admin.ListInstancePartitionsRequest,
630
+ response: spanner_instance_admin.ListInstancePartitionsResponse,
631
+ *,
632
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
633
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
634
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
635
+ ):
636
+ """Instantiates the pager.
637
+
638
+ Args:
639
+ method (Callable): The method that was originally called, and
640
+ which instantiated this pager.
641
+ request (google.cloud.spanner_admin_instance_v1.types.ListInstancePartitionsRequest):
642
+ The initial request object.
643
+ response (google.cloud.spanner_admin_instance_v1.types.ListInstancePartitionsResponse):
644
+ The initial response object.
645
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
646
+ if any, should be retried.
647
+ timeout (float): The timeout for this request.
648
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
649
+ sent along with the request as metadata. Normally, each value must be of type `str`,
650
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
651
+ be of type `bytes`.
652
+ """
653
+ self._method = method
654
+ self._request = spanner_instance_admin.ListInstancePartitionsRequest(request)
655
+ self._response = response
656
+ self._retry = retry
657
+ self._timeout = timeout
658
+ self._metadata = metadata
659
+
660
+ def __getattr__(self, name: str) -> Any:
661
+ return getattr(self._response, name)
662
+
663
+ @property
664
+ async def pages(
665
+ self,
666
+ ) -> AsyncIterator[spanner_instance_admin.ListInstancePartitionsResponse]:
667
+ yield self._response
668
+ while self._response.next_page_token:
669
+ self._request.page_token = self._response.next_page_token
670
+ self._response = await self._method(
671
+ self._request,
672
+ retry=self._retry,
673
+ timeout=self._timeout,
674
+ metadata=self._metadata,
675
+ )
676
+ yield self._response
677
+
678
+ def __aiter__(self) -> AsyncIterator[spanner_instance_admin.InstancePartition]:
679
+ async def async_generator():
680
+ async for page in self.pages:
681
+ for response in page.instance_partitions:
682
+ yield response
683
+
684
+ return async_generator()
685
+
686
+ def __repr__(self) -> str:
687
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
688
+
689
+
690
+ class ListInstancePartitionOperationsPager:
691
+ """A pager for iterating through ``list_instance_partition_operations`` requests.
692
+
693
+ This class thinly wraps an initial
694
+ :class:`google.cloud.spanner_admin_instance_v1.types.ListInstancePartitionOperationsResponse` object, and
695
+ provides an ``__iter__`` method to iterate through its
696
+ ``operations`` field.
697
+
698
+ If there are more pages, the ``__iter__`` method will make additional
699
+ ``ListInstancePartitionOperations`` requests and continue to iterate
700
+ through the ``operations`` field on the
701
+ corresponding responses.
702
+
703
+ All the usual :class:`google.cloud.spanner_admin_instance_v1.types.ListInstancePartitionOperationsResponse`
704
+ attributes are available on the pager. If multiple requests are made, only
705
+ the most recent response is retained, and thus used for attribute lookup.
706
+ """
707
+
708
+ def __init__(
709
+ self,
710
+ method: Callable[
711
+ ..., spanner_instance_admin.ListInstancePartitionOperationsResponse
712
+ ],
713
+ request: spanner_instance_admin.ListInstancePartitionOperationsRequest,
714
+ response: spanner_instance_admin.ListInstancePartitionOperationsResponse,
715
+ *,
716
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
717
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
718
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
719
+ ):
720
+ """Instantiate the pager.
721
+
722
+ Args:
723
+ method (Callable): The method that was originally called, and
724
+ which instantiated this pager.
725
+ request (google.cloud.spanner_admin_instance_v1.types.ListInstancePartitionOperationsRequest):
726
+ The initial request object.
727
+ response (google.cloud.spanner_admin_instance_v1.types.ListInstancePartitionOperationsResponse):
728
+ The initial response object.
729
+ retry (google.api_core.retry.Retry): Designation of what errors,
730
+ if any, should be retried.
731
+ timeout (float): The timeout for this request.
732
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
733
+ sent along with the request as metadata. Normally, each value must be of type `str`,
734
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
735
+ be of type `bytes`.
736
+ """
737
+ self._method = method
738
+ self._request = spanner_instance_admin.ListInstancePartitionOperationsRequest(
739
+ request
740
+ )
741
+ self._response = response
742
+ self._retry = retry
743
+ self._timeout = timeout
744
+ self._metadata = metadata
745
+
746
+ def __getattr__(self, name: str) -> Any:
747
+ return getattr(self._response, name)
748
+
749
+ @property
750
+ def pages(
751
+ self,
752
+ ) -> Iterator[spanner_instance_admin.ListInstancePartitionOperationsResponse]:
753
+ yield self._response
754
+ while self._response.next_page_token:
755
+ self._request.page_token = self._response.next_page_token
756
+ self._response = self._method(
757
+ self._request,
758
+ retry=self._retry,
759
+ timeout=self._timeout,
760
+ metadata=self._metadata,
761
+ )
762
+ yield self._response
763
+
764
+ def __iter__(self) -> Iterator[operations_pb2.Operation]:
765
+ for page in self.pages:
766
+ yield from page.operations
767
+
768
+ def __repr__(self) -> str:
769
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
770
+
771
+
772
+ class ListInstancePartitionOperationsAsyncPager:
773
+ """A pager for iterating through ``list_instance_partition_operations`` requests.
774
+
775
+ This class thinly wraps an initial
776
+ :class:`google.cloud.spanner_admin_instance_v1.types.ListInstancePartitionOperationsResponse` object, and
777
+ provides an ``__aiter__`` method to iterate through its
778
+ ``operations`` field.
779
+
780
+ If there are more pages, the ``__aiter__`` method will make additional
781
+ ``ListInstancePartitionOperations`` requests and continue to iterate
782
+ through the ``operations`` field on the
783
+ corresponding responses.
784
+
785
+ All the usual :class:`google.cloud.spanner_admin_instance_v1.types.ListInstancePartitionOperationsResponse`
786
+ attributes are available on the pager. If multiple requests are made, only
787
+ the most recent response is retained, and thus used for attribute lookup.
788
+ """
789
+
790
+ def __init__(
791
+ self,
792
+ method: Callable[
793
+ ...,
794
+ Awaitable[spanner_instance_admin.ListInstancePartitionOperationsResponse],
795
+ ],
796
+ request: spanner_instance_admin.ListInstancePartitionOperationsRequest,
797
+ response: spanner_instance_admin.ListInstancePartitionOperationsResponse,
798
+ *,
799
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
800
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
801
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
802
+ ):
803
+ """Instantiates the pager.
804
+
805
+ Args:
806
+ method (Callable): The method that was originally called, and
807
+ which instantiated this pager.
808
+ request (google.cloud.spanner_admin_instance_v1.types.ListInstancePartitionOperationsRequest):
809
+ The initial request object.
810
+ response (google.cloud.spanner_admin_instance_v1.types.ListInstancePartitionOperationsResponse):
811
+ The initial response object.
812
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
813
+ if any, should be retried.
814
+ timeout (float): The timeout for this request.
815
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
816
+ sent along with the request as metadata. Normally, each value must be of type `str`,
817
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
818
+ be of type `bytes`.
819
+ """
820
+ self._method = method
821
+ self._request = spanner_instance_admin.ListInstancePartitionOperationsRequest(
822
+ request
823
+ )
824
+ self._response = response
825
+ self._retry = retry
826
+ self._timeout = timeout
827
+ self._metadata = metadata
828
+
829
+ def __getattr__(self, name: str) -> Any:
830
+ return getattr(self._response, name)
831
+
832
+ @property
833
+ async def pages(
834
+ self,
835
+ ) -> AsyncIterator[spanner_instance_admin.ListInstancePartitionOperationsResponse]:
836
+ yield self._response
837
+ while self._response.next_page_token:
838
+ self._request.page_token = self._response.next_page_token
839
+ self._response = await self._method(
840
+ self._request,
841
+ retry=self._retry,
842
+ timeout=self._timeout,
843
+ metadata=self._metadata,
844
+ )
845
+ yield self._response
846
+
847
+ def __aiter__(self) -> AsyncIterator[operations_pb2.Operation]:
848
+ async def async_generator():
849
+ async for page in self.pages:
850
+ for response in page.operations:
851
+ yield response
852
+
853
+ return async_generator()
854
+
855
+ def __repr__(self) -> str:
856
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)