google-cloud-datastream 1.13.2__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 (44) hide show
  1. google/cloud/datastream/__init__.py +219 -0
  2. google/cloud/datastream/gapic_version.py +16 -0
  3. google/cloud/datastream/py.typed +2 -0
  4. google/cloud/datastream_v1/__init__.py +216 -0
  5. google/cloud/datastream_v1/gapic_metadata.json +418 -0
  6. google/cloud/datastream_v1/gapic_version.py +16 -0
  7. google/cloud/datastream_v1/py.typed +2 -0
  8. google/cloud/datastream_v1/services/__init__.py +15 -0
  9. google/cloud/datastream_v1/services/datastream/__init__.py +22 -0
  10. google/cloud/datastream_v1/services/datastream/async_client.py +3939 -0
  11. google/cloud/datastream_v1/services/datastream/client.py +4420 -0
  12. google/cloud/datastream_v1/services/datastream/pagers.py +977 -0
  13. google/cloud/datastream_v1/services/datastream/transports/__init__.py +36 -0
  14. google/cloud/datastream_v1/services/datastream/transports/base.py +639 -0
  15. google/cloud/datastream_v1/services/datastream/transports/grpc.py +1193 -0
  16. google/cloud/datastream_v1/services/datastream/transports/grpc_asyncio.py +1389 -0
  17. google/cloud/datastream_v1/services/datastream/transports/rest.py +6861 -0
  18. google/cloud/datastream_v1/services/datastream/transports/rest_base.py +1591 -0
  19. google/cloud/datastream_v1/types/__init__.py +208 -0
  20. google/cloud/datastream_v1/types/datastream.py +1491 -0
  21. google/cloud/datastream_v1/types/datastream_resources.py +2986 -0
  22. google/cloud/datastream_v1alpha1/__init__.py +156 -0
  23. google/cloud/datastream_v1alpha1/gapic_metadata.json +343 -0
  24. google/cloud/datastream_v1alpha1/gapic_version.py +16 -0
  25. google/cloud/datastream_v1alpha1/py.typed +2 -0
  26. google/cloud/datastream_v1alpha1/services/__init__.py +15 -0
  27. google/cloud/datastream_v1alpha1/services/datastream/__init__.py +22 -0
  28. google/cloud/datastream_v1alpha1/services/datastream/async_client.py +3018 -0
  29. google/cloud/datastream_v1alpha1/services/datastream/client.py +3458 -0
  30. google/cloud/datastream_v1alpha1/services/datastream/pagers.py +821 -0
  31. google/cloud/datastream_v1alpha1/services/datastream/transports/__init__.py +36 -0
  32. google/cloud/datastream_v1alpha1/services/datastream/transports/base.py +467 -0
  33. google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py +942 -0
  34. google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py +1078 -0
  35. google/cloud/datastream_v1alpha1/services/datastream/transports/rest.py +4770 -0
  36. google/cloud/datastream_v1alpha1/services/datastream/transports/rest_base.py +1152 -0
  37. google/cloud/datastream_v1alpha1/types/__init__.py +148 -0
  38. google/cloud/datastream_v1alpha1/types/datastream.py +1230 -0
  39. google/cloud/datastream_v1alpha1/types/datastream_resources.py +1416 -0
  40. google_cloud_datastream-1.13.2.dist-info/LICENSE +202 -0
  41. google_cloud_datastream-1.13.2.dist-info/METADATA +229 -0
  42. google_cloud_datastream-1.13.2.dist-info/RECORD +44 -0
  43. google_cloud_datastream-1.13.2.dist-info/WHEEL +5 -0
  44. google_cloud_datastream-1.13.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,821 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 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 typing import (
17
+ Any,
18
+ AsyncIterator,
19
+ Awaitable,
20
+ Callable,
21
+ Iterator,
22
+ Optional,
23
+ Sequence,
24
+ Tuple,
25
+ Union,
26
+ )
27
+
28
+ from google.api_core import gapic_v1
29
+ from google.api_core import retry as retries
30
+ from google.api_core import retry_async as retries_async
31
+
32
+ try:
33
+ OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]
34
+ OptionalAsyncRetry = Union[
35
+ retries_async.AsyncRetry, gapic_v1.method._MethodDefault, None
36
+ ]
37
+ except AttributeError: # pragma: NO COVER
38
+ OptionalRetry = Union[retries.Retry, object, None] # type: ignore
39
+ OptionalAsyncRetry = Union[retries_async.AsyncRetry, object, None] # type: ignore
40
+
41
+ from google.cloud.datastream_v1alpha1.types import datastream, datastream_resources
42
+
43
+
44
+ class ListConnectionProfilesPager:
45
+ """A pager for iterating through ``list_connection_profiles`` requests.
46
+
47
+ This class thinly wraps an initial
48
+ :class:`google.cloud.datastream_v1alpha1.types.ListConnectionProfilesResponse` object, and
49
+ provides an ``__iter__`` method to iterate through its
50
+ ``connection_profiles`` field.
51
+
52
+ If there are more pages, the ``__iter__`` method will make additional
53
+ ``ListConnectionProfiles`` requests and continue to iterate
54
+ through the ``connection_profiles`` field on the
55
+ corresponding responses.
56
+
57
+ All the usual :class:`google.cloud.datastream_v1alpha1.types.ListConnectionProfilesResponse`
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[..., datastream.ListConnectionProfilesResponse],
65
+ request: datastream.ListConnectionProfilesRequest,
66
+ response: datastream.ListConnectionProfilesResponse,
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.datastream_v1alpha1.types.ListConnectionProfilesRequest):
78
+ The initial request object.
79
+ response (google.cloud.datastream_v1alpha1.types.ListConnectionProfilesResponse):
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 = datastream.ListConnectionProfilesRequest(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[datastream.ListConnectionProfilesResponse]:
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[datastream_resources.ConnectionProfile]:
113
+ for page in self.pages:
114
+ yield from page.connection_profiles
115
+
116
+ def __repr__(self) -> str:
117
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
118
+
119
+
120
+ class ListConnectionProfilesAsyncPager:
121
+ """A pager for iterating through ``list_connection_profiles`` requests.
122
+
123
+ This class thinly wraps an initial
124
+ :class:`google.cloud.datastream_v1alpha1.types.ListConnectionProfilesResponse` object, and
125
+ provides an ``__aiter__`` method to iterate through its
126
+ ``connection_profiles`` field.
127
+
128
+ If there are more pages, the ``__aiter__`` method will make additional
129
+ ``ListConnectionProfiles`` requests and continue to iterate
130
+ through the ``connection_profiles`` field on the
131
+ corresponding responses.
132
+
133
+ All the usual :class:`google.cloud.datastream_v1alpha1.types.ListConnectionProfilesResponse`
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[..., Awaitable[datastream.ListConnectionProfilesResponse]],
141
+ request: datastream.ListConnectionProfilesRequest,
142
+ response: datastream.ListConnectionProfilesResponse,
143
+ *,
144
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
145
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
146
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
147
+ ):
148
+ """Instantiates the pager.
149
+
150
+ Args:
151
+ method (Callable): The method that was originally called, and
152
+ which instantiated this pager.
153
+ request (google.cloud.datastream_v1alpha1.types.ListConnectionProfilesRequest):
154
+ The initial request object.
155
+ response (google.cloud.datastream_v1alpha1.types.ListConnectionProfilesResponse):
156
+ The initial response object.
157
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
158
+ if any, should be retried.
159
+ timeout (float): The timeout for this request.
160
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
161
+ sent along with the request as metadata. Normally, each value must be of type `str`,
162
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
163
+ be of type `bytes`.
164
+ """
165
+ self._method = method
166
+ self._request = datastream.ListConnectionProfilesRequest(request)
167
+ self._response = response
168
+ self._retry = retry
169
+ self._timeout = timeout
170
+ self._metadata = metadata
171
+
172
+ def __getattr__(self, name: str) -> Any:
173
+ return getattr(self._response, name)
174
+
175
+ @property
176
+ async def pages(self) -> AsyncIterator[datastream.ListConnectionProfilesResponse]:
177
+ yield self._response
178
+ while self._response.next_page_token:
179
+ self._request.page_token = self._response.next_page_token
180
+ self._response = await self._method(
181
+ self._request,
182
+ retry=self._retry,
183
+ timeout=self._timeout,
184
+ metadata=self._metadata,
185
+ )
186
+ yield self._response
187
+
188
+ def __aiter__(self) -> AsyncIterator[datastream_resources.ConnectionProfile]:
189
+ async def async_generator():
190
+ async for page in self.pages:
191
+ for response in page.connection_profiles:
192
+ yield response
193
+
194
+ return async_generator()
195
+
196
+ def __repr__(self) -> str:
197
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
198
+
199
+
200
+ class ListStreamsPager:
201
+ """A pager for iterating through ``list_streams`` requests.
202
+
203
+ This class thinly wraps an initial
204
+ :class:`google.cloud.datastream_v1alpha1.types.ListStreamsResponse` object, and
205
+ provides an ``__iter__`` method to iterate through its
206
+ ``streams`` field.
207
+
208
+ If there are more pages, the ``__iter__`` method will make additional
209
+ ``ListStreams`` requests and continue to iterate
210
+ through the ``streams`` field on the
211
+ corresponding responses.
212
+
213
+ All the usual :class:`google.cloud.datastream_v1alpha1.types.ListStreamsResponse`
214
+ attributes are available on the pager. If multiple requests are made, only
215
+ the most recent response is retained, and thus used for attribute lookup.
216
+ """
217
+
218
+ def __init__(
219
+ self,
220
+ method: Callable[..., datastream.ListStreamsResponse],
221
+ request: datastream.ListStreamsRequest,
222
+ response: datastream.ListStreamsResponse,
223
+ *,
224
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
225
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
226
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
227
+ ):
228
+ """Instantiate the pager.
229
+
230
+ Args:
231
+ method (Callable): The method that was originally called, and
232
+ which instantiated this pager.
233
+ request (google.cloud.datastream_v1alpha1.types.ListStreamsRequest):
234
+ The initial request object.
235
+ response (google.cloud.datastream_v1alpha1.types.ListStreamsResponse):
236
+ The initial response object.
237
+ retry (google.api_core.retry.Retry): Designation of what errors,
238
+ if any, should be retried.
239
+ timeout (float): The timeout for this request.
240
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
241
+ sent along with the request as metadata. Normally, each value must be of type `str`,
242
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
243
+ be of type `bytes`.
244
+ """
245
+ self._method = method
246
+ self._request = datastream.ListStreamsRequest(request)
247
+ self._response = response
248
+ self._retry = retry
249
+ self._timeout = timeout
250
+ self._metadata = metadata
251
+
252
+ def __getattr__(self, name: str) -> Any:
253
+ return getattr(self._response, name)
254
+
255
+ @property
256
+ def pages(self) -> Iterator[datastream.ListStreamsResponse]:
257
+ yield self._response
258
+ while self._response.next_page_token:
259
+ self._request.page_token = self._response.next_page_token
260
+ self._response = self._method(
261
+ self._request,
262
+ retry=self._retry,
263
+ timeout=self._timeout,
264
+ metadata=self._metadata,
265
+ )
266
+ yield self._response
267
+
268
+ def __iter__(self) -> Iterator[datastream_resources.Stream]:
269
+ for page in self.pages:
270
+ yield from page.streams
271
+
272
+ def __repr__(self) -> str:
273
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
274
+
275
+
276
+ class ListStreamsAsyncPager:
277
+ """A pager for iterating through ``list_streams`` requests.
278
+
279
+ This class thinly wraps an initial
280
+ :class:`google.cloud.datastream_v1alpha1.types.ListStreamsResponse` object, and
281
+ provides an ``__aiter__`` method to iterate through its
282
+ ``streams`` field.
283
+
284
+ If there are more pages, the ``__aiter__`` method will make additional
285
+ ``ListStreams`` requests and continue to iterate
286
+ through the ``streams`` field on the
287
+ corresponding responses.
288
+
289
+ All the usual :class:`google.cloud.datastream_v1alpha1.types.ListStreamsResponse`
290
+ attributes are available on the pager. If multiple requests are made, only
291
+ the most recent response is retained, and thus used for attribute lookup.
292
+ """
293
+
294
+ def __init__(
295
+ self,
296
+ method: Callable[..., Awaitable[datastream.ListStreamsResponse]],
297
+ request: datastream.ListStreamsRequest,
298
+ response: datastream.ListStreamsResponse,
299
+ *,
300
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
301
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
302
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
303
+ ):
304
+ """Instantiates the pager.
305
+
306
+ Args:
307
+ method (Callable): The method that was originally called, and
308
+ which instantiated this pager.
309
+ request (google.cloud.datastream_v1alpha1.types.ListStreamsRequest):
310
+ The initial request object.
311
+ response (google.cloud.datastream_v1alpha1.types.ListStreamsResponse):
312
+ The initial response object.
313
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
314
+ if any, should be retried.
315
+ timeout (float): The timeout for this request.
316
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
317
+ sent along with the request as metadata. Normally, each value must be of type `str`,
318
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
319
+ be of type `bytes`.
320
+ """
321
+ self._method = method
322
+ self._request = datastream.ListStreamsRequest(request)
323
+ self._response = response
324
+ self._retry = retry
325
+ self._timeout = timeout
326
+ self._metadata = metadata
327
+
328
+ def __getattr__(self, name: str) -> Any:
329
+ return getattr(self._response, name)
330
+
331
+ @property
332
+ async def pages(self) -> AsyncIterator[datastream.ListStreamsResponse]:
333
+ yield self._response
334
+ while self._response.next_page_token:
335
+ self._request.page_token = self._response.next_page_token
336
+ self._response = await self._method(
337
+ self._request,
338
+ retry=self._retry,
339
+ timeout=self._timeout,
340
+ metadata=self._metadata,
341
+ )
342
+ yield self._response
343
+
344
+ def __aiter__(self) -> AsyncIterator[datastream_resources.Stream]:
345
+ async def async_generator():
346
+ async for page in self.pages:
347
+ for response in page.streams:
348
+ yield response
349
+
350
+ return async_generator()
351
+
352
+ def __repr__(self) -> str:
353
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
354
+
355
+
356
+ class FetchStaticIpsPager:
357
+ """A pager for iterating through ``fetch_static_ips`` requests.
358
+
359
+ This class thinly wraps an initial
360
+ :class:`google.cloud.datastream_v1alpha1.types.FetchStaticIpsResponse` object, and
361
+ provides an ``__iter__`` method to iterate through its
362
+ ``static_ips`` field.
363
+
364
+ If there are more pages, the ``__iter__`` method will make additional
365
+ ``FetchStaticIps`` requests and continue to iterate
366
+ through the ``static_ips`` field on the
367
+ corresponding responses.
368
+
369
+ All the usual :class:`google.cloud.datastream_v1alpha1.types.FetchStaticIpsResponse`
370
+ attributes are available on the pager. If multiple requests are made, only
371
+ the most recent response is retained, and thus used for attribute lookup.
372
+ """
373
+
374
+ def __init__(
375
+ self,
376
+ method: Callable[..., datastream.FetchStaticIpsResponse],
377
+ request: datastream.FetchStaticIpsRequest,
378
+ response: datastream.FetchStaticIpsResponse,
379
+ *,
380
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
381
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
382
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
383
+ ):
384
+ """Instantiate the pager.
385
+
386
+ Args:
387
+ method (Callable): The method that was originally called, and
388
+ which instantiated this pager.
389
+ request (google.cloud.datastream_v1alpha1.types.FetchStaticIpsRequest):
390
+ The initial request object.
391
+ response (google.cloud.datastream_v1alpha1.types.FetchStaticIpsResponse):
392
+ The initial response object.
393
+ retry (google.api_core.retry.Retry): Designation of what errors,
394
+ if any, should be retried.
395
+ timeout (float): The timeout for this request.
396
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
397
+ sent along with the request as metadata. Normally, each value must be of type `str`,
398
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
399
+ be of type `bytes`.
400
+ """
401
+ self._method = method
402
+ self._request = datastream.FetchStaticIpsRequest(request)
403
+ self._response = response
404
+ self._retry = retry
405
+ self._timeout = timeout
406
+ self._metadata = metadata
407
+
408
+ def __getattr__(self, name: str) -> Any:
409
+ return getattr(self._response, name)
410
+
411
+ @property
412
+ def pages(self) -> Iterator[datastream.FetchStaticIpsResponse]:
413
+ yield self._response
414
+ while self._response.next_page_token:
415
+ self._request.page_token = self._response.next_page_token
416
+ self._response = self._method(
417
+ self._request,
418
+ retry=self._retry,
419
+ timeout=self._timeout,
420
+ metadata=self._metadata,
421
+ )
422
+ yield self._response
423
+
424
+ def __iter__(self) -> Iterator[str]:
425
+ for page in self.pages:
426
+ yield from page.static_ips
427
+
428
+ def __repr__(self) -> str:
429
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
430
+
431
+
432
+ class FetchStaticIpsAsyncPager:
433
+ """A pager for iterating through ``fetch_static_ips`` requests.
434
+
435
+ This class thinly wraps an initial
436
+ :class:`google.cloud.datastream_v1alpha1.types.FetchStaticIpsResponse` object, and
437
+ provides an ``__aiter__`` method to iterate through its
438
+ ``static_ips`` field.
439
+
440
+ If there are more pages, the ``__aiter__`` method will make additional
441
+ ``FetchStaticIps`` requests and continue to iterate
442
+ through the ``static_ips`` field on the
443
+ corresponding responses.
444
+
445
+ All the usual :class:`google.cloud.datastream_v1alpha1.types.FetchStaticIpsResponse`
446
+ attributes are available on the pager. If multiple requests are made, only
447
+ the most recent response is retained, and thus used for attribute lookup.
448
+ """
449
+
450
+ def __init__(
451
+ self,
452
+ method: Callable[..., Awaitable[datastream.FetchStaticIpsResponse]],
453
+ request: datastream.FetchStaticIpsRequest,
454
+ response: datastream.FetchStaticIpsResponse,
455
+ *,
456
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
457
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
458
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
459
+ ):
460
+ """Instantiates the pager.
461
+
462
+ Args:
463
+ method (Callable): The method that was originally called, and
464
+ which instantiated this pager.
465
+ request (google.cloud.datastream_v1alpha1.types.FetchStaticIpsRequest):
466
+ The initial request object.
467
+ response (google.cloud.datastream_v1alpha1.types.FetchStaticIpsResponse):
468
+ The initial response object.
469
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
470
+ if any, should be retried.
471
+ timeout (float): The timeout for this request.
472
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
473
+ sent along with the request as metadata. Normally, each value must be of type `str`,
474
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
475
+ be of type `bytes`.
476
+ """
477
+ self._method = method
478
+ self._request = datastream.FetchStaticIpsRequest(request)
479
+ self._response = response
480
+ self._retry = retry
481
+ self._timeout = timeout
482
+ self._metadata = metadata
483
+
484
+ def __getattr__(self, name: str) -> Any:
485
+ return getattr(self._response, name)
486
+
487
+ @property
488
+ async def pages(self) -> AsyncIterator[datastream.FetchStaticIpsResponse]:
489
+ yield self._response
490
+ while self._response.next_page_token:
491
+ self._request.page_token = self._response.next_page_token
492
+ self._response = await self._method(
493
+ self._request,
494
+ retry=self._retry,
495
+ timeout=self._timeout,
496
+ metadata=self._metadata,
497
+ )
498
+ yield self._response
499
+
500
+ def __aiter__(self) -> AsyncIterator[str]:
501
+ async def async_generator():
502
+ async for page in self.pages:
503
+ for response in page.static_ips:
504
+ yield response
505
+
506
+ return async_generator()
507
+
508
+ def __repr__(self) -> str:
509
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
510
+
511
+
512
+ class ListPrivateConnectionsPager:
513
+ """A pager for iterating through ``list_private_connections`` requests.
514
+
515
+ This class thinly wraps an initial
516
+ :class:`google.cloud.datastream_v1alpha1.types.ListPrivateConnectionsResponse` object, and
517
+ provides an ``__iter__`` method to iterate through its
518
+ ``private_connections`` field.
519
+
520
+ If there are more pages, the ``__iter__`` method will make additional
521
+ ``ListPrivateConnections`` requests and continue to iterate
522
+ through the ``private_connections`` field on the
523
+ corresponding responses.
524
+
525
+ All the usual :class:`google.cloud.datastream_v1alpha1.types.ListPrivateConnectionsResponse`
526
+ attributes are available on the pager. If multiple requests are made, only
527
+ the most recent response is retained, and thus used for attribute lookup.
528
+ """
529
+
530
+ def __init__(
531
+ self,
532
+ method: Callable[..., datastream.ListPrivateConnectionsResponse],
533
+ request: datastream.ListPrivateConnectionsRequest,
534
+ response: datastream.ListPrivateConnectionsResponse,
535
+ *,
536
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
537
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
538
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
539
+ ):
540
+ """Instantiate the pager.
541
+
542
+ Args:
543
+ method (Callable): The method that was originally called, and
544
+ which instantiated this pager.
545
+ request (google.cloud.datastream_v1alpha1.types.ListPrivateConnectionsRequest):
546
+ The initial request object.
547
+ response (google.cloud.datastream_v1alpha1.types.ListPrivateConnectionsResponse):
548
+ The initial response object.
549
+ retry (google.api_core.retry.Retry): Designation of what errors,
550
+ if any, should be retried.
551
+ timeout (float): The timeout for this request.
552
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
553
+ sent along with the request as metadata. Normally, each value must be of type `str`,
554
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
555
+ be of type `bytes`.
556
+ """
557
+ self._method = method
558
+ self._request = datastream.ListPrivateConnectionsRequest(request)
559
+ self._response = response
560
+ self._retry = retry
561
+ self._timeout = timeout
562
+ self._metadata = metadata
563
+
564
+ def __getattr__(self, name: str) -> Any:
565
+ return getattr(self._response, name)
566
+
567
+ @property
568
+ def pages(self) -> Iterator[datastream.ListPrivateConnectionsResponse]:
569
+ yield self._response
570
+ while self._response.next_page_token:
571
+ self._request.page_token = self._response.next_page_token
572
+ self._response = self._method(
573
+ self._request,
574
+ retry=self._retry,
575
+ timeout=self._timeout,
576
+ metadata=self._metadata,
577
+ )
578
+ yield self._response
579
+
580
+ def __iter__(self) -> Iterator[datastream_resources.PrivateConnection]:
581
+ for page in self.pages:
582
+ yield from page.private_connections
583
+
584
+ def __repr__(self) -> str:
585
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
586
+
587
+
588
+ class ListPrivateConnectionsAsyncPager:
589
+ """A pager for iterating through ``list_private_connections`` requests.
590
+
591
+ This class thinly wraps an initial
592
+ :class:`google.cloud.datastream_v1alpha1.types.ListPrivateConnectionsResponse` object, and
593
+ provides an ``__aiter__`` method to iterate through its
594
+ ``private_connections`` field.
595
+
596
+ If there are more pages, the ``__aiter__`` method will make additional
597
+ ``ListPrivateConnections`` requests and continue to iterate
598
+ through the ``private_connections`` field on the
599
+ corresponding responses.
600
+
601
+ All the usual :class:`google.cloud.datastream_v1alpha1.types.ListPrivateConnectionsResponse`
602
+ attributes are available on the pager. If multiple requests are made, only
603
+ the most recent response is retained, and thus used for attribute lookup.
604
+ """
605
+
606
+ def __init__(
607
+ self,
608
+ method: Callable[..., Awaitable[datastream.ListPrivateConnectionsResponse]],
609
+ request: datastream.ListPrivateConnectionsRequest,
610
+ response: datastream.ListPrivateConnectionsResponse,
611
+ *,
612
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
613
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
614
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
615
+ ):
616
+ """Instantiates the pager.
617
+
618
+ Args:
619
+ method (Callable): The method that was originally called, and
620
+ which instantiated this pager.
621
+ request (google.cloud.datastream_v1alpha1.types.ListPrivateConnectionsRequest):
622
+ The initial request object.
623
+ response (google.cloud.datastream_v1alpha1.types.ListPrivateConnectionsResponse):
624
+ The initial response object.
625
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
626
+ if any, should be retried.
627
+ timeout (float): The timeout for this request.
628
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
629
+ sent along with the request as metadata. Normally, each value must be of type `str`,
630
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
631
+ be of type `bytes`.
632
+ """
633
+ self._method = method
634
+ self._request = datastream.ListPrivateConnectionsRequest(request)
635
+ self._response = response
636
+ self._retry = retry
637
+ self._timeout = timeout
638
+ self._metadata = metadata
639
+
640
+ def __getattr__(self, name: str) -> Any:
641
+ return getattr(self._response, name)
642
+
643
+ @property
644
+ async def pages(self) -> AsyncIterator[datastream.ListPrivateConnectionsResponse]:
645
+ yield self._response
646
+ while self._response.next_page_token:
647
+ self._request.page_token = self._response.next_page_token
648
+ self._response = await self._method(
649
+ self._request,
650
+ retry=self._retry,
651
+ timeout=self._timeout,
652
+ metadata=self._metadata,
653
+ )
654
+ yield self._response
655
+
656
+ def __aiter__(self) -> AsyncIterator[datastream_resources.PrivateConnection]:
657
+ async def async_generator():
658
+ async for page in self.pages:
659
+ for response in page.private_connections:
660
+ yield response
661
+
662
+ return async_generator()
663
+
664
+ def __repr__(self) -> str:
665
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
666
+
667
+
668
+ class ListRoutesPager:
669
+ """A pager for iterating through ``list_routes`` requests.
670
+
671
+ This class thinly wraps an initial
672
+ :class:`google.cloud.datastream_v1alpha1.types.ListRoutesResponse` object, and
673
+ provides an ``__iter__`` method to iterate through its
674
+ ``routes`` field.
675
+
676
+ If there are more pages, the ``__iter__`` method will make additional
677
+ ``ListRoutes`` requests and continue to iterate
678
+ through the ``routes`` field on the
679
+ corresponding responses.
680
+
681
+ All the usual :class:`google.cloud.datastream_v1alpha1.types.ListRoutesResponse`
682
+ attributes are available on the pager. If multiple requests are made, only
683
+ the most recent response is retained, and thus used for attribute lookup.
684
+ """
685
+
686
+ def __init__(
687
+ self,
688
+ method: Callable[..., datastream.ListRoutesResponse],
689
+ request: datastream.ListRoutesRequest,
690
+ response: datastream.ListRoutesResponse,
691
+ *,
692
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
693
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
694
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
695
+ ):
696
+ """Instantiate the pager.
697
+
698
+ Args:
699
+ method (Callable): The method that was originally called, and
700
+ which instantiated this pager.
701
+ request (google.cloud.datastream_v1alpha1.types.ListRoutesRequest):
702
+ The initial request object.
703
+ response (google.cloud.datastream_v1alpha1.types.ListRoutesResponse):
704
+ The initial response object.
705
+ retry (google.api_core.retry.Retry): Designation of what errors,
706
+ if any, should be retried.
707
+ timeout (float): The timeout for this request.
708
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
709
+ sent along with the request as metadata. Normally, each value must be of type `str`,
710
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
711
+ be of type `bytes`.
712
+ """
713
+ self._method = method
714
+ self._request = datastream.ListRoutesRequest(request)
715
+ self._response = response
716
+ self._retry = retry
717
+ self._timeout = timeout
718
+ self._metadata = metadata
719
+
720
+ def __getattr__(self, name: str) -> Any:
721
+ return getattr(self._response, name)
722
+
723
+ @property
724
+ def pages(self) -> Iterator[datastream.ListRoutesResponse]:
725
+ yield self._response
726
+ while self._response.next_page_token:
727
+ self._request.page_token = self._response.next_page_token
728
+ self._response = self._method(
729
+ self._request,
730
+ retry=self._retry,
731
+ timeout=self._timeout,
732
+ metadata=self._metadata,
733
+ )
734
+ yield self._response
735
+
736
+ def __iter__(self) -> Iterator[datastream_resources.Route]:
737
+ for page in self.pages:
738
+ yield from page.routes
739
+
740
+ def __repr__(self) -> str:
741
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
742
+
743
+
744
+ class ListRoutesAsyncPager:
745
+ """A pager for iterating through ``list_routes`` requests.
746
+
747
+ This class thinly wraps an initial
748
+ :class:`google.cloud.datastream_v1alpha1.types.ListRoutesResponse` object, and
749
+ provides an ``__aiter__`` method to iterate through its
750
+ ``routes`` field.
751
+
752
+ If there are more pages, the ``__aiter__`` method will make additional
753
+ ``ListRoutes`` requests and continue to iterate
754
+ through the ``routes`` field on the
755
+ corresponding responses.
756
+
757
+ All the usual :class:`google.cloud.datastream_v1alpha1.types.ListRoutesResponse`
758
+ attributes are available on the pager. If multiple requests are made, only
759
+ the most recent response is retained, and thus used for attribute lookup.
760
+ """
761
+
762
+ def __init__(
763
+ self,
764
+ method: Callable[..., Awaitable[datastream.ListRoutesResponse]],
765
+ request: datastream.ListRoutesRequest,
766
+ response: datastream.ListRoutesResponse,
767
+ *,
768
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
769
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
770
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
771
+ ):
772
+ """Instantiates the pager.
773
+
774
+ Args:
775
+ method (Callable): The method that was originally called, and
776
+ which instantiated this pager.
777
+ request (google.cloud.datastream_v1alpha1.types.ListRoutesRequest):
778
+ The initial request object.
779
+ response (google.cloud.datastream_v1alpha1.types.ListRoutesResponse):
780
+ The initial response object.
781
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
782
+ if any, should be retried.
783
+ timeout (float): The timeout for this request.
784
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
785
+ sent along with the request as metadata. Normally, each value must be of type `str`,
786
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
787
+ be of type `bytes`.
788
+ """
789
+ self._method = method
790
+ self._request = datastream.ListRoutesRequest(request)
791
+ self._response = response
792
+ self._retry = retry
793
+ self._timeout = timeout
794
+ self._metadata = metadata
795
+
796
+ def __getattr__(self, name: str) -> Any:
797
+ return getattr(self._response, name)
798
+
799
+ @property
800
+ async def pages(self) -> AsyncIterator[datastream.ListRoutesResponse]:
801
+ yield self._response
802
+ while self._response.next_page_token:
803
+ self._request.page_token = self._response.next_page_token
804
+ self._response = await self._method(
805
+ self._request,
806
+ retry=self._retry,
807
+ timeout=self._timeout,
808
+ metadata=self._metadata,
809
+ )
810
+ yield self._response
811
+
812
+ def __aiter__(self) -> AsyncIterator[datastream_resources.Route]:
813
+ async def async_generator():
814
+ async for page in self.pages:
815
+ for response in page.routes:
816
+ yield response
817
+
818
+ return async_generator()
819
+
820
+ def __repr__(self) -> str:
821
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)