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,989 @@
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_database_v1.types import backup
41
+ from google.cloud.spanner_admin_database_v1.types import backup_schedule
42
+ from google.cloud.spanner_admin_database_v1.types import spanner_database_admin
43
+ from google.longrunning import operations_pb2 # type: ignore
44
+
45
+
46
+ class ListDatabasesPager:
47
+ """A pager for iterating through ``list_databases`` requests.
48
+
49
+ This class thinly wraps an initial
50
+ :class:`google.cloud.spanner_admin_database_v1.types.ListDatabasesResponse` object, and
51
+ provides an ``__iter__`` method to iterate through its
52
+ ``databases`` field.
53
+
54
+ If there are more pages, the ``__iter__`` method will make additional
55
+ ``ListDatabases`` requests and continue to iterate
56
+ through the ``databases`` field on the
57
+ corresponding responses.
58
+
59
+ All the usual :class:`google.cloud.spanner_admin_database_v1.types.ListDatabasesResponse`
60
+ attributes are available on the pager. If multiple requests are made, only
61
+ the most recent response is retained, and thus used for attribute lookup.
62
+ """
63
+
64
+ def __init__(
65
+ self,
66
+ method: Callable[..., spanner_database_admin.ListDatabasesResponse],
67
+ request: spanner_database_admin.ListDatabasesRequest,
68
+ response: spanner_database_admin.ListDatabasesResponse,
69
+ *,
70
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
71
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
72
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
73
+ ):
74
+ """Instantiate the pager.
75
+
76
+ Args:
77
+ method (Callable): The method that was originally called, and
78
+ which instantiated this pager.
79
+ request (google.cloud.spanner_admin_database_v1.types.ListDatabasesRequest):
80
+ The initial request object.
81
+ response (google.cloud.spanner_admin_database_v1.types.ListDatabasesResponse):
82
+ The initial response object.
83
+ retry (google.api_core.retry.Retry): Designation of what errors,
84
+ if any, should be retried.
85
+ timeout (float): The timeout for this request.
86
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
87
+ sent along with the request as metadata. Normally, each value must be of type `str`,
88
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
89
+ be of type `bytes`.
90
+ """
91
+ self._method = method
92
+ self._request = spanner_database_admin.ListDatabasesRequest(request)
93
+ self._response = response
94
+ self._retry = retry
95
+ self._timeout = timeout
96
+ self._metadata = metadata
97
+
98
+ def __getattr__(self, name: str) -> Any:
99
+ return getattr(self._response, name)
100
+
101
+ @property
102
+ def pages(self) -> Iterator[spanner_database_admin.ListDatabasesResponse]:
103
+ yield self._response
104
+ while self._response.next_page_token:
105
+ self._request.page_token = self._response.next_page_token
106
+ self._response = self._method(
107
+ self._request,
108
+ retry=self._retry,
109
+ timeout=self._timeout,
110
+ metadata=self._metadata,
111
+ )
112
+ yield self._response
113
+
114
+ def __iter__(self) -> Iterator[spanner_database_admin.Database]:
115
+ for page in self.pages:
116
+ yield from page.databases
117
+
118
+ def __repr__(self) -> str:
119
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
120
+
121
+
122
+ class ListDatabasesAsyncPager:
123
+ """A pager for iterating through ``list_databases`` requests.
124
+
125
+ This class thinly wraps an initial
126
+ :class:`google.cloud.spanner_admin_database_v1.types.ListDatabasesResponse` object, and
127
+ provides an ``__aiter__`` method to iterate through its
128
+ ``databases`` field.
129
+
130
+ If there are more pages, the ``__aiter__`` method will make additional
131
+ ``ListDatabases`` requests and continue to iterate
132
+ through the ``databases`` field on the
133
+ corresponding responses.
134
+
135
+ All the usual :class:`google.cloud.spanner_admin_database_v1.types.ListDatabasesResponse`
136
+ attributes are available on the pager. If multiple requests are made, only
137
+ the most recent response is retained, and thus used for attribute lookup.
138
+ """
139
+
140
+ def __init__(
141
+ self,
142
+ method: Callable[..., Awaitable[spanner_database_admin.ListDatabasesResponse]],
143
+ request: spanner_database_admin.ListDatabasesRequest,
144
+ response: spanner_database_admin.ListDatabasesResponse,
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_database_v1.types.ListDatabasesRequest):
156
+ The initial request object.
157
+ response (google.cloud.spanner_admin_database_v1.types.ListDatabasesResponse):
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_database_admin.ListDatabasesRequest(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_database_admin.ListDatabasesResponse]:
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_database_admin.Database]:
193
+ async def async_generator():
194
+ async for page in self.pages:
195
+ for response in page.databases:
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 ListBackupsPager:
205
+ """A pager for iterating through ``list_backups`` requests.
206
+
207
+ This class thinly wraps an initial
208
+ :class:`google.cloud.spanner_admin_database_v1.types.ListBackupsResponse` object, and
209
+ provides an ``__iter__`` method to iterate through its
210
+ ``backups`` field.
211
+
212
+ If there are more pages, the ``__iter__`` method will make additional
213
+ ``ListBackups`` requests and continue to iterate
214
+ through the ``backups`` field on the
215
+ corresponding responses.
216
+
217
+ All the usual :class:`google.cloud.spanner_admin_database_v1.types.ListBackupsResponse`
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[..., backup.ListBackupsResponse],
225
+ request: backup.ListBackupsRequest,
226
+ response: backup.ListBackupsResponse,
227
+ *,
228
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
229
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
230
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
231
+ ):
232
+ """Instantiate the pager.
233
+
234
+ Args:
235
+ method (Callable): The method that was originally called, and
236
+ which instantiated this pager.
237
+ request (google.cloud.spanner_admin_database_v1.types.ListBackupsRequest):
238
+ The initial request object.
239
+ response (google.cloud.spanner_admin_database_v1.types.ListBackupsResponse):
240
+ The initial response object.
241
+ retry (google.api_core.retry.Retry): Designation of what errors,
242
+ if any, should be retried.
243
+ timeout (float): The timeout for this request.
244
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
245
+ sent along with the request as metadata. Normally, each value must be of type `str`,
246
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
247
+ be of type `bytes`.
248
+ """
249
+ self._method = method
250
+ self._request = backup.ListBackupsRequest(request)
251
+ self._response = response
252
+ self._retry = retry
253
+ self._timeout = timeout
254
+ self._metadata = metadata
255
+
256
+ def __getattr__(self, name: str) -> Any:
257
+ return getattr(self._response, name)
258
+
259
+ @property
260
+ def pages(self) -> Iterator[backup.ListBackupsResponse]:
261
+ yield self._response
262
+ while self._response.next_page_token:
263
+ self._request.page_token = self._response.next_page_token
264
+ self._response = self._method(
265
+ self._request,
266
+ retry=self._retry,
267
+ timeout=self._timeout,
268
+ metadata=self._metadata,
269
+ )
270
+ yield self._response
271
+
272
+ def __iter__(self) -> Iterator[backup.Backup]:
273
+ for page in self.pages:
274
+ yield from page.backups
275
+
276
+ def __repr__(self) -> str:
277
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
278
+
279
+
280
+ class ListBackupsAsyncPager:
281
+ """A pager for iterating through ``list_backups`` requests.
282
+
283
+ This class thinly wraps an initial
284
+ :class:`google.cloud.spanner_admin_database_v1.types.ListBackupsResponse` object, and
285
+ provides an ``__aiter__`` method to iterate through its
286
+ ``backups`` field.
287
+
288
+ If there are more pages, the ``__aiter__`` method will make additional
289
+ ``ListBackups`` requests and continue to iterate
290
+ through the ``backups`` field on the
291
+ corresponding responses.
292
+
293
+ All the usual :class:`google.cloud.spanner_admin_database_v1.types.ListBackupsResponse`
294
+ attributes are available on the pager. If multiple requests are made, only
295
+ the most recent response is retained, and thus used for attribute lookup.
296
+ """
297
+
298
+ def __init__(
299
+ self,
300
+ method: Callable[..., Awaitable[backup.ListBackupsResponse]],
301
+ request: backup.ListBackupsRequest,
302
+ response: backup.ListBackupsResponse,
303
+ *,
304
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
305
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
306
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
307
+ ):
308
+ """Instantiates the pager.
309
+
310
+ Args:
311
+ method (Callable): The method that was originally called, and
312
+ which instantiated this pager.
313
+ request (google.cloud.spanner_admin_database_v1.types.ListBackupsRequest):
314
+ The initial request object.
315
+ response (google.cloud.spanner_admin_database_v1.types.ListBackupsResponse):
316
+ The initial response object.
317
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
318
+ if any, should be retried.
319
+ timeout (float): The timeout for this request.
320
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
321
+ sent along with the request as metadata. Normally, each value must be of type `str`,
322
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
323
+ be of type `bytes`.
324
+ """
325
+ self._method = method
326
+ self._request = backup.ListBackupsRequest(request)
327
+ self._response = response
328
+ self._retry = retry
329
+ self._timeout = timeout
330
+ self._metadata = metadata
331
+
332
+ def __getattr__(self, name: str) -> Any:
333
+ return getattr(self._response, name)
334
+
335
+ @property
336
+ async def pages(self) -> AsyncIterator[backup.ListBackupsResponse]:
337
+ yield self._response
338
+ while self._response.next_page_token:
339
+ self._request.page_token = self._response.next_page_token
340
+ self._response = await self._method(
341
+ self._request,
342
+ retry=self._retry,
343
+ timeout=self._timeout,
344
+ metadata=self._metadata,
345
+ )
346
+ yield self._response
347
+
348
+ def __aiter__(self) -> AsyncIterator[backup.Backup]:
349
+ async def async_generator():
350
+ async for page in self.pages:
351
+ for response in page.backups:
352
+ yield response
353
+
354
+ return async_generator()
355
+
356
+ def __repr__(self) -> str:
357
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
358
+
359
+
360
+ class ListDatabaseOperationsPager:
361
+ """A pager for iterating through ``list_database_operations`` requests.
362
+
363
+ This class thinly wraps an initial
364
+ :class:`google.cloud.spanner_admin_database_v1.types.ListDatabaseOperationsResponse` object, and
365
+ provides an ``__iter__`` method to iterate through its
366
+ ``operations`` field.
367
+
368
+ If there are more pages, the ``__iter__`` method will make additional
369
+ ``ListDatabaseOperations`` requests and continue to iterate
370
+ through the ``operations`` field on the
371
+ corresponding responses.
372
+
373
+ All the usual :class:`google.cloud.spanner_admin_database_v1.types.ListDatabaseOperationsResponse`
374
+ attributes are available on the pager. If multiple requests are made, only
375
+ the most recent response is retained, and thus used for attribute lookup.
376
+ """
377
+
378
+ def __init__(
379
+ self,
380
+ method: Callable[..., spanner_database_admin.ListDatabaseOperationsResponse],
381
+ request: spanner_database_admin.ListDatabaseOperationsRequest,
382
+ response: spanner_database_admin.ListDatabaseOperationsResponse,
383
+ *,
384
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
385
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
386
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
387
+ ):
388
+ """Instantiate the pager.
389
+
390
+ Args:
391
+ method (Callable): The method that was originally called, and
392
+ which instantiated this pager.
393
+ request (google.cloud.spanner_admin_database_v1.types.ListDatabaseOperationsRequest):
394
+ The initial request object.
395
+ response (google.cloud.spanner_admin_database_v1.types.ListDatabaseOperationsResponse):
396
+ The initial response object.
397
+ retry (google.api_core.retry.Retry): Designation of what errors,
398
+ if any, should be retried.
399
+ timeout (float): The timeout for this request.
400
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
401
+ sent along with the request as metadata. Normally, each value must be of type `str`,
402
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
403
+ be of type `bytes`.
404
+ """
405
+ self._method = method
406
+ self._request = spanner_database_admin.ListDatabaseOperationsRequest(request)
407
+ self._response = response
408
+ self._retry = retry
409
+ self._timeout = timeout
410
+ self._metadata = metadata
411
+
412
+ def __getattr__(self, name: str) -> Any:
413
+ return getattr(self._response, name)
414
+
415
+ @property
416
+ def pages(self) -> Iterator[spanner_database_admin.ListDatabaseOperationsResponse]:
417
+ yield self._response
418
+ while self._response.next_page_token:
419
+ self._request.page_token = self._response.next_page_token
420
+ self._response = self._method(
421
+ self._request,
422
+ retry=self._retry,
423
+ timeout=self._timeout,
424
+ metadata=self._metadata,
425
+ )
426
+ yield self._response
427
+
428
+ def __iter__(self) -> Iterator[operations_pb2.Operation]:
429
+ for page in self.pages:
430
+ yield from page.operations
431
+
432
+ def __repr__(self) -> str:
433
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
434
+
435
+
436
+ class ListDatabaseOperationsAsyncPager:
437
+ """A pager for iterating through ``list_database_operations`` requests.
438
+
439
+ This class thinly wraps an initial
440
+ :class:`google.cloud.spanner_admin_database_v1.types.ListDatabaseOperationsResponse` object, and
441
+ provides an ``__aiter__`` method to iterate through its
442
+ ``operations`` field.
443
+
444
+ If there are more pages, the ``__aiter__`` method will make additional
445
+ ``ListDatabaseOperations`` requests and continue to iterate
446
+ through the ``operations`` field on the
447
+ corresponding responses.
448
+
449
+ All the usual :class:`google.cloud.spanner_admin_database_v1.types.ListDatabaseOperationsResponse`
450
+ attributes are available on the pager. If multiple requests are made, only
451
+ the most recent response is retained, and thus used for attribute lookup.
452
+ """
453
+
454
+ def __init__(
455
+ self,
456
+ method: Callable[
457
+ ..., Awaitable[spanner_database_admin.ListDatabaseOperationsResponse]
458
+ ],
459
+ request: spanner_database_admin.ListDatabaseOperationsRequest,
460
+ response: spanner_database_admin.ListDatabaseOperationsResponse,
461
+ *,
462
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
463
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
464
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
465
+ ):
466
+ """Instantiates the pager.
467
+
468
+ Args:
469
+ method (Callable): The method that was originally called, and
470
+ which instantiated this pager.
471
+ request (google.cloud.spanner_admin_database_v1.types.ListDatabaseOperationsRequest):
472
+ The initial request object.
473
+ response (google.cloud.spanner_admin_database_v1.types.ListDatabaseOperationsResponse):
474
+ The initial response object.
475
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
476
+ if any, should be retried.
477
+ timeout (float): The timeout for this request.
478
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
479
+ sent along with the request as metadata. Normally, each value must be of type `str`,
480
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
481
+ be of type `bytes`.
482
+ """
483
+ self._method = method
484
+ self._request = spanner_database_admin.ListDatabaseOperationsRequest(request)
485
+ self._response = response
486
+ self._retry = retry
487
+ self._timeout = timeout
488
+ self._metadata = metadata
489
+
490
+ def __getattr__(self, name: str) -> Any:
491
+ return getattr(self._response, name)
492
+
493
+ @property
494
+ async def pages(
495
+ self,
496
+ ) -> AsyncIterator[spanner_database_admin.ListDatabaseOperationsResponse]:
497
+ yield self._response
498
+ while self._response.next_page_token:
499
+ self._request.page_token = self._response.next_page_token
500
+ self._response = await self._method(
501
+ self._request,
502
+ retry=self._retry,
503
+ timeout=self._timeout,
504
+ metadata=self._metadata,
505
+ )
506
+ yield self._response
507
+
508
+ def __aiter__(self) -> AsyncIterator[operations_pb2.Operation]:
509
+ async def async_generator():
510
+ async for page in self.pages:
511
+ for response in page.operations:
512
+ yield response
513
+
514
+ return async_generator()
515
+
516
+ def __repr__(self) -> str:
517
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
518
+
519
+
520
+ class ListBackupOperationsPager:
521
+ """A pager for iterating through ``list_backup_operations`` requests.
522
+
523
+ This class thinly wraps an initial
524
+ :class:`google.cloud.spanner_admin_database_v1.types.ListBackupOperationsResponse` object, and
525
+ provides an ``__iter__`` method to iterate through its
526
+ ``operations`` field.
527
+
528
+ If there are more pages, the ``__iter__`` method will make additional
529
+ ``ListBackupOperations`` requests and continue to iterate
530
+ through the ``operations`` field on the
531
+ corresponding responses.
532
+
533
+ All the usual :class:`google.cloud.spanner_admin_database_v1.types.ListBackupOperationsResponse`
534
+ attributes are available on the pager. If multiple requests are made, only
535
+ the most recent response is retained, and thus used for attribute lookup.
536
+ """
537
+
538
+ def __init__(
539
+ self,
540
+ method: Callable[..., backup.ListBackupOperationsResponse],
541
+ request: backup.ListBackupOperationsRequest,
542
+ response: backup.ListBackupOperationsResponse,
543
+ *,
544
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
545
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
546
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
547
+ ):
548
+ """Instantiate the pager.
549
+
550
+ Args:
551
+ method (Callable): The method that was originally called, and
552
+ which instantiated this pager.
553
+ request (google.cloud.spanner_admin_database_v1.types.ListBackupOperationsRequest):
554
+ The initial request object.
555
+ response (google.cloud.spanner_admin_database_v1.types.ListBackupOperationsResponse):
556
+ The initial response object.
557
+ retry (google.api_core.retry.Retry): Designation of what errors,
558
+ if any, should be retried.
559
+ timeout (float): The timeout for this request.
560
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
561
+ sent along with the request as metadata. Normally, each value must be of type `str`,
562
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
563
+ be of type `bytes`.
564
+ """
565
+ self._method = method
566
+ self._request = backup.ListBackupOperationsRequest(request)
567
+ self._response = response
568
+ self._retry = retry
569
+ self._timeout = timeout
570
+ self._metadata = metadata
571
+
572
+ def __getattr__(self, name: str) -> Any:
573
+ return getattr(self._response, name)
574
+
575
+ @property
576
+ def pages(self) -> Iterator[backup.ListBackupOperationsResponse]:
577
+ yield self._response
578
+ while self._response.next_page_token:
579
+ self._request.page_token = self._response.next_page_token
580
+ self._response = self._method(
581
+ self._request,
582
+ retry=self._retry,
583
+ timeout=self._timeout,
584
+ metadata=self._metadata,
585
+ )
586
+ yield self._response
587
+
588
+ def __iter__(self) -> Iterator[operations_pb2.Operation]:
589
+ for page in self.pages:
590
+ yield from page.operations
591
+
592
+ def __repr__(self) -> str:
593
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
594
+
595
+
596
+ class ListBackupOperationsAsyncPager:
597
+ """A pager for iterating through ``list_backup_operations`` requests.
598
+
599
+ This class thinly wraps an initial
600
+ :class:`google.cloud.spanner_admin_database_v1.types.ListBackupOperationsResponse` object, and
601
+ provides an ``__aiter__`` method to iterate through its
602
+ ``operations`` field.
603
+
604
+ If there are more pages, the ``__aiter__`` method will make additional
605
+ ``ListBackupOperations`` requests and continue to iterate
606
+ through the ``operations`` field on the
607
+ corresponding responses.
608
+
609
+ All the usual :class:`google.cloud.spanner_admin_database_v1.types.ListBackupOperationsResponse`
610
+ attributes are available on the pager. If multiple requests are made, only
611
+ the most recent response is retained, and thus used for attribute lookup.
612
+ """
613
+
614
+ def __init__(
615
+ self,
616
+ method: Callable[..., Awaitable[backup.ListBackupOperationsResponse]],
617
+ request: backup.ListBackupOperationsRequest,
618
+ response: backup.ListBackupOperationsResponse,
619
+ *,
620
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
621
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
622
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
623
+ ):
624
+ """Instantiates the pager.
625
+
626
+ Args:
627
+ method (Callable): The method that was originally called, and
628
+ which instantiated this pager.
629
+ request (google.cloud.spanner_admin_database_v1.types.ListBackupOperationsRequest):
630
+ The initial request object.
631
+ response (google.cloud.spanner_admin_database_v1.types.ListBackupOperationsResponse):
632
+ The initial response object.
633
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
634
+ if any, should be retried.
635
+ timeout (float): The timeout for this request.
636
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
637
+ sent along with the request as metadata. Normally, each value must be of type `str`,
638
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
639
+ be of type `bytes`.
640
+ """
641
+ self._method = method
642
+ self._request = backup.ListBackupOperationsRequest(request)
643
+ self._response = response
644
+ self._retry = retry
645
+ self._timeout = timeout
646
+ self._metadata = metadata
647
+
648
+ def __getattr__(self, name: str) -> Any:
649
+ return getattr(self._response, name)
650
+
651
+ @property
652
+ async def pages(self) -> AsyncIterator[backup.ListBackupOperationsResponse]:
653
+ yield self._response
654
+ while self._response.next_page_token:
655
+ self._request.page_token = self._response.next_page_token
656
+ self._response = await self._method(
657
+ self._request,
658
+ retry=self._retry,
659
+ timeout=self._timeout,
660
+ metadata=self._metadata,
661
+ )
662
+ yield self._response
663
+
664
+ def __aiter__(self) -> AsyncIterator[operations_pb2.Operation]:
665
+ async def async_generator():
666
+ async for page in self.pages:
667
+ for response in page.operations:
668
+ yield response
669
+
670
+ return async_generator()
671
+
672
+ def __repr__(self) -> str:
673
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
674
+
675
+
676
+ class ListDatabaseRolesPager:
677
+ """A pager for iterating through ``list_database_roles`` requests.
678
+
679
+ This class thinly wraps an initial
680
+ :class:`google.cloud.spanner_admin_database_v1.types.ListDatabaseRolesResponse` object, and
681
+ provides an ``__iter__`` method to iterate through its
682
+ ``database_roles`` field.
683
+
684
+ If there are more pages, the ``__iter__`` method will make additional
685
+ ``ListDatabaseRoles`` requests and continue to iterate
686
+ through the ``database_roles`` field on the
687
+ corresponding responses.
688
+
689
+ All the usual :class:`google.cloud.spanner_admin_database_v1.types.ListDatabaseRolesResponse`
690
+ attributes are available on the pager. If multiple requests are made, only
691
+ the most recent response is retained, and thus used for attribute lookup.
692
+ """
693
+
694
+ def __init__(
695
+ self,
696
+ method: Callable[..., spanner_database_admin.ListDatabaseRolesResponse],
697
+ request: spanner_database_admin.ListDatabaseRolesRequest,
698
+ response: spanner_database_admin.ListDatabaseRolesResponse,
699
+ *,
700
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
701
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
702
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
703
+ ):
704
+ """Instantiate the pager.
705
+
706
+ Args:
707
+ method (Callable): The method that was originally called, and
708
+ which instantiated this pager.
709
+ request (google.cloud.spanner_admin_database_v1.types.ListDatabaseRolesRequest):
710
+ The initial request object.
711
+ response (google.cloud.spanner_admin_database_v1.types.ListDatabaseRolesResponse):
712
+ The initial response object.
713
+ retry (google.api_core.retry.Retry): Designation of what errors,
714
+ if any, should be retried.
715
+ timeout (float): The timeout for this request.
716
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
717
+ sent along with the request as metadata. Normally, each value must be of type `str`,
718
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
719
+ be of type `bytes`.
720
+ """
721
+ self._method = method
722
+ self._request = spanner_database_admin.ListDatabaseRolesRequest(request)
723
+ self._response = response
724
+ self._retry = retry
725
+ self._timeout = timeout
726
+ self._metadata = metadata
727
+
728
+ def __getattr__(self, name: str) -> Any:
729
+ return getattr(self._response, name)
730
+
731
+ @property
732
+ def pages(self) -> Iterator[spanner_database_admin.ListDatabaseRolesResponse]:
733
+ yield self._response
734
+ while self._response.next_page_token:
735
+ self._request.page_token = self._response.next_page_token
736
+ self._response = self._method(
737
+ self._request,
738
+ retry=self._retry,
739
+ timeout=self._timeout,
740
+ metadata=self._metadata,
741
+ )
742
+ yield self._response
743
+
744
+ def __iter__(self) -> Iterator[spanner_database_admin.DatabaseRole]:
745
+ for page in self.pages:
746
+ yield from page.database_roles
747
+
748
+ def __repr__(self) -> str:
749
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
750
+
751
+
752
+ class ListDatabaseRolesAsyncPager:
753
+ """A pager for iterating through ``list_database_roles`` requests.
754
+
755
+ This class thinly wraps an initial
756
+ :class:`google.cloud.spanner_admin_database_v1.types.ListDatabaseRolesResponse` object, and
757
+ provides an ``__aiter__`` method to iterate through its
758
+ ``database_roles`` field.
759
+
760
+ If there are more pages, the ``__aiter__`` method will make additional
761
+ ``ListDatabaseRoles`` requests and continue to iterate
762
+ through the ``database_roles`` field on the
763
+ corresponding responses.
764
+
765
+ All the usual :class:`google.cloud.spanner_admin_database_v1.types.ListDatabaseRolesResponse`
766
+ attributes are available on the pager. If multiple requests are made, only
767
+ the most recent response is retained, and thus used for attribute lookup.
768
+ """
769
+
770
+ def __init__(
771
+ self,
772
+ method: Callable[
773
+ ..., Awaitable[spanner_database_admin.ListDatabaseRolesResponse]
774
+ ],
775
+ request: spanner_database_admin.ListDatabaseRolesRequest,
776
+ response: spanner_database_admin.ListDatabaseRolesResponse,
777
+ *,
778
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
779
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
780
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
781
+ ):
782
+ """Instantiates the pager.
783
+
784
+ Args:
785
+ method (Callable): The method that was originally called, and
786
+ which instantiated this pager.
787
+ request (google.cloud.spanner_admin_database_v1.types.ListDatabaseRolesRequest):
788
+ The initial request object.
789
+ response (google.cloud.spanner_admin_database_v1.types.ListDatabaseRolesResponse):
790
+ The initial response object.
791
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
792
+ if any, should be retried.
793
+ timeout (float): The timeout for this request.
794
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
795
+ sent along with the request as metadata. Normally, each value must be of type `str`,
796
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
797
+ be of type `bytes`.
798
+ """
799
+ self._method = method
800
+ self._request = spanner_database_admin.ListDatabaseRolesRequest(request)
801
+ self._response = response
802
+ self._retry = retry
803
+ self._timeout = timeout
804
+ self._metadata = metadata
805
+
806
+ def __getattr__(self, name: str) -> Any:
807
+ return getattr(self._response, name)
808
+
809
+ @property
810
+ async def pages(
811
+ self,
812
+ ) -> AsyncIterator[spanner_database_admin.ListDatabaseRolesResponse]:
813
+ yield self._response
814
+ while self._response.next_page_token:
815
+ self._request.page_token = self._response.next_page_token
816
+ self._response = await self._method(
817
+ self._request,
818
+ retry=self._retry,
819
+ timeout=self._timeout,
820
+ metadata=self._metadata,
821
+ )
822
+ yield self._response
823
+
824
+ def __aiter__(self) -> AsyncIterator[spanner_database_admin.DatabaseRole]:
825
+ async def async_generator():
826
+ async for page in self.pages:
827
+ for response in page.database_roles:
828
+ yield response
829
+
830
+ return async_generator()
831
+
832
+ def __repr__(self) -> str:
833
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
834
+
835
+
836
+ class ListBackupSchedulesPager:
837
+ """A pager for iterating through ``list_backup_schedules`` requests.
838
+
839
+ This class thinly wraps an initial
840
+ :class:`google.cloud.spanner_admin_database_v1.types.ListBackupSchedulesResponse` object, and
841
+ provides an ``__iter__`` method to iterate through its
842
+ ``backup_schedules`` field.
843
+
844
+ If there are more pages, the ``__iter__`` method will make additional
845
+ ``ListBackupSchedules`` requests and continue to iterate
846
+ through the ``backup_schedules`` field on the
847
+ corresponding responses.
848
+
849
+ All the usual :class:`google.cloud.spanner_admin_database_v1.types.ListBackupSchedulesResponse`
850
+ attributes are available on the pager. If multiple requests are made, only
851
+ the most recent response is retained, and thus used for attribute lookup.
852
+ """
853
+
854
+ def __init__(
855
+ self,
856
+ method: Callable[..., backup_schedule.ListBackupSchedulesResponse],
857
+ request: backup_schedule.ListBackupSchedulesRequest,
858
+ response: backup_schedule.ListBackupSchedulesResponse,
859
+ *,
860
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
861
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
862
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
863
+ ):
864
+ """Instantiate the pager.
865
+
866
+ Args:
867
+ method (Callable): The method that was originally called, and
868
+ which instantiated this pager.
869
+ request (google.cloud.spanner_admin_database_v1.types.ListBackupSchedulesRequest):
870
+ The initial request object.
871
+ response (google.cloud.spanner_admin_database_v1.types.ListBackupSchedulesResponse):
872
+ The initial response object.
873
+ retry (google.api_core.retry.Retry): Designation of what errors,
874
+ if any, should be retried.
875
+ timeout (float): The timeout for this request.
876
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
877
+ sent along with the request as metadata. Normally, each value must be of type `str`,
878
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
879
+ be of type `bytes`.
880
+ """
881
+ self._method = method
882
+ self._request = backup_schedule.ListBackupSchedulesRequest(request)
883
+ self._response = response
884
+ self._retry = retry
885
+ self._timeout = timeout
886
+ self._metadata = metadata
887
+
888
+ def __getattr__(self, name: str) -> Any:
889
+ return getattr(self._response, name)
890
+
891
+ @property
892
+ def pages(self) -> Iterator[backup_schedule.ListBackupSchedulesResponse]:
893
+ yield self._response
894
+ while self._response.next_page_token:
895
+ self._request.page_token = self._response.next_page_token
896
+ self._response = self._method(
897
+ self._request,
898
+ retry=self._retry,
899
+ timeout=self._timeout,
900
+ metadata=self._metadata,
901
+ )
902
+ yield self._response
903
+
904
+ def __iter__(self) -> Iterator[backup_schedule.BackupSchedule]:
905
+ for page in self.pages:
906
+ yield from page.backup_schedules
907
+
908
+ def __repr__(self) -> str:
909
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
910
+
911
+
912
+ class ListBackupSchedulesAsyncPager:
913
+ """A pager for iterating through ``list_backup_schedules`` requests.
914
+
915
+ This class thinly wraps an initial
916
+ :class:`google.cloud.spanner_admin_database_v1.types.ListBackupSchedulesResponse` object, and
917
+ provides an ``__aiter__`` method to iterate through its
918
+ ``backup_schedules`` field.
919
+
920
+ If there are more pages, the ``__aiter__`` method will make additional
921
+ ``ListBackupSchedules`` requests and continue to iterate
922
+ through the ``backup_schedules`` field on the
923
+ corresponding responses.
924
+
925
+ All the usual :class:`google.cloud.spanner_admin_database_v1.types.ListBackupSchedulesResponse`
926
+ attributes are available on the pager. If multiple requests are made, only
927
+ the most recent response is retained, and thus used for attribute lookup.
928
+ """
929
+
930
+ def __init__(
931
+ self,
932
+ method: Callable[..., Awaitable[backup_schedule.ListBackupSchedulesResponse]],
933
+ request: backup_schedule.ListBackupSchedulesRequest,
934
+ response: backup_schedule.ListBackupSchedulesResponse,
935
+ *,
936
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
937
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
938
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
939
+ ):
940
+ """Instantiates the pager.
941
+
942
+ Args:
943
+ method (Callable): The method that was originally called, and
944
+ which instantiated this pager.
945
+ request (google.cloud.spanner_admin_database_v1.types.ListBackupSchedulesRequest):
946
+ The initial request object.
947
+ response (google.cloud.spanner_admin_database_v1.types.ListBackupSchedulesResponse):
948
+ The initial response object.
949
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
950
+ if any, should be retried.
951
+ timeout (float): The timeout for this request.
952
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
953
+ sent along with the request as metadata. Normally, each value must be of type `str`,
954
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
955
+ be of type `bytes`.
956
+ """
957
+ self._method = method
958
+ self._request = backup_schedule.ListBackupSchedulesRequest(request)
959
+ self._response = response
960
+ self._retry = retry
961
+ self._timeout = timeout
962
+ self._metadata = metadata
963
+
964
+ def __getattr__(self, name: str) -> Any:
965
+ return getattr(self._response, name)
966
+
967
+ @property
968
+ async def pages(self) -> AsyncIterator[backup_schedule.ListBackupSchedulesResponse]:
969
+ yield self._response
970
+ while self._response.next_page_token:
971
+ self._request.page_token = self._response.next_page_token
972
+ self._response = await self._method(
973
+ self._request,
974
+ retry=self._retry,
975
+ timeout=self._timeout,
976
+ metadata=self._metadata,
977
+ )
978
+ yield self._response
979
+
980
+ def __aiter__(self) -> AsyncIterator[backup_schedule.BackupSchedule]:
981
+ async def async_generator():
982
+ async for page in self.pages:
983
+ for response in page.backup_schedules:
984
+ yield response
985
+
986
+ return async_generator()
987
+
988
+ def __repr__(self) -> str:
989
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)