22
22
Optional ,
23
23
Sequence ,
24
24
Tuple ,
25
+ Union ,
25
26
)
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
+
27
41
from google .cloud .orgpolicy_v2 .types import constraint , orgpolicy
28
42
29
43
@@ -51,6 +65,8 @@ def __init__(
51
65
request : orgpolicy .ListConstraintsRequest ,
52
66
response : orgpolicy .ListConstraintsResponse ,
53
67
* ,
68
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
69
+ timeout : Union [float , object ] = gapic_v1 .method .DEFAULT ,
54
70
metadata : Sequence [Tuple [str , str ]] = ()
55
71
):
56
72
"""Instantiate the pager.
@@ -62,12 +78,17 @@ def __init__(
62
78
The initial request object.
63
79
response (google.cloud.orgpolicy_v2.types.ListConstraintsResponse):
64
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.
65
84
metadata (Sequence[Tuple[str, str]]): Strings which should be
66
85
sent along with the request as metadata.
67
86
"""
68
87
self ._method = method
69
88
self ._request = orgpolicy .ListConstraintsRequest (request )
70
89
self ._response = response
90
+ self ._retry = retry
91
+ self ._timeout = timeout
71
92
self ._metadata = metadata
72
93
73
94
def __getattr__ (self , name : str ) -> Any :
@@ -78,7 +99,12 @@ def pages(self) -> Iterator[orgpolicy.ListConstraintsResponse]:
78
99
yield self ._response
79
100
while self ._response .next_page_token :
80
101
self ._request .page_token = self ._response .next_page_token
81
- self ._response = self ._method (self ._request , metadata = self ._metadata )
102
+ self ._response = self ._method (
103
+ self ._request ,
104
+ retry = self ._retry ,
105
+ timeout = self ._timeout ,
106
+ metadata = self ._metadata ,
107
+ )
82
108
yield self ._response
83
109
84
110
def __iter__ (self ) -> Iterator [constraint .Constraint ]:
@@ -113,6 +139,8 @@ def __init__(
113
139
request : orgpolicy .ListConstraintsRequest ,
114
140
response : orgpolicy .ListConstraintsResponse ,
115
141
* ,
142
+ retry : OptionalAsyncRetry = gapic_v1 .method .DEFAULT ,
143
+ timeout : Union [float , object ] = gapic_v1 .method .DEFAULT ,
116
144
metadata : Sequence [Tuple [str , str ]] = ()
117
145
):
118
146
"""Instantiates the pager.
@@ -124,12 +152,17 @@ def __init__(
124
152
The initial request object.
125
153
response (google.cloud.orgpolicy_v2.types.ListConstraintsResponse):
126
154
The initial response object.
155
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
156
+ if any, should be retried.
157
+ timeout (float): The timeout for this request.
127
158
metadata (Sequence[Tuple[str, str]]): Strings which should be
128
159
sent along with the request as metadata.
129
160
"""
130
161
self ._method = method
131
162
self ._request = orgpolicy .ListConstraintsRequest (request )
132
163
self ._response = response
164
+ self ._retry = retry
165
+ self ._timeout = timeout
133
166
self ._metadata = metadata
134
167
135
168
def __getattr__ (self , name : str ) -> Any :
@@ -140,7 +173,12 @@ async def pages(self) -> AsyncIterator[orgpolicy.ListConstraintsResponse]:
140
173
yield self ._response
141
174
while self ._response .next_page_token :
142
175
self ._request .page_token = self ._response .next_page_token
143
- self ._response = await self ._method (self ._request , metadata = self ._metadata )
176
+ self ._response = await self ._method (
177
+ self ._request ,
178
+ retry = self ._retry ,
179
+ timeout = self ._timeout ,
180
+ metadata = self ._metadata ,
181
+ )
144
182
yield self ._response
145
183
146
184
def __aiter__ (self ) -> AsyncIterator [constraint .Constraint ]:
@@ -179,6 +217,8 @@ def __init__(
179
217
request : orgpolicy .ListPoliciesRequest ,
180
218
response : orgpolicy .ListPoliciesResponse ,
181
219
* ,
220
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
221
+ timeout : Union [float , object ] = gapic_v1 .method .DEFAULT ,
182
222
metadata : Sequence [Tuple [str , str ]] = ()
183
223
):
184
224
"""Instantiate the pager.
@@ -190,12 +230,17 @@ def __init__(
190
230
The initial request object.
191
231
response (google.cloud.orgpolicy_v2.types.ListPoliciesResponse):
192
232
The initial response object.
233
+ retry (google.api_core.retry.Retry): Designation of what errors,
234
+ if any, should be retried.
235
+ timeout (float): The timeout for this request.
193
236
metadata (Sequence[Tuple[str, str]]): Strings which should be
194
237
sent along with the request as metadata.
195
238
"""
196
239
self ._method = method
197
240
self ._request = orgpolicy .ListPoliciesRequest (request )
198
241
self ._response = response
242
+ self ._retry = retry
243
+ self ._timeout = timeout
199
244
self ._metadata = metadata
200
245
201
246
def __getattr__ (self , name : str ) -> Any :
@@ -206,7 +251,12 @@ def pages(self) -> Iterator[orgpolicy.ListPoliciesResponse]:
206
251
yield self ._response
207
252
while self ._response .next_page_token :
208
253
self ._request .page_token = self ._response .next_page_token
209
- self ._response = self ._method (self ._request , metadata = self ._metadata )
254
+ self ._response = self ._method (
255
+ self ._request ,
256
+ retry = self ._retry ,
257
+ timeout = self ._timeout ,
258
+ metadata = self ._metadata ,
259
+ )
210
260
yield self ._response
211
261
212
262
def __iter__ (self ) -> Iterator [orgpolicy .Policy ]:
@@ -241,6 +291,8 @@ def __init__(
241
291
request : orgpolicy .ListPoliciesRequest ,
242
292
response : orgpolicy .ListPoliciesResponse ,
243
293
* ,
294
+ retry : OptionalAsyncRetry = gapic_v1 .method .DEFAULT ,
295
+ timeout : Union [float , object ] = gapic_v1 .method .DEFAULT ,
244
296
metadata : Sequence [Tuple [str , str ]] = ()
245
297
):
246
298
"""Instantiates the pager.
@@ -252,12 +304,17 @@ def __init__(
252
304
The initial request object.
253
305
response (google.cloud.orgpolicy_v2.types.ListPoliciesResponse):
254
306
The initial response object.
307
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
308
+ if any, should be retried.
309
+ timeout (float): The timeout for this request.
255
310
metadata (Sequence[Tuple[str, str]]): Strings which should be
256
311
sent along with the request as metadata.
257
312
"""
258
313
self ._method = method
259
314
self ._request = orgpolicy .ListPoliciesRequest (request )
260
315
self ._response = response
316
+ self ._retry = retry
317
+ self ._timeout = timeout
261
318
self ._metadata = metadata
262
319
263
320
def __getattr__ (self , name : str ) -> Any :
@@ -268,7 +325,12 @@ async def pages(self) -> AsyncIterator[orgpolicy.ListPoliciesResponse]:
268
325
yield self ._response
269
326
while self ._response .next_page_token :
270
327
self ._request .page_token = self ._response .next_page_token
271
- self ._response = await self ._method (self ._request , metadata = self ._metadata )
328
+ self ._response = await self ._method (
329
+ self ._request ,
330
+ retry = self ._retry ,
331
+ timeout = self ._timeout ,
332
+ metadata = self ._metadata ,
333
+ )
272
334
yield self ._response
273
335
274
336
def __aiter__ (self ) -> AsyncIterator [orgpolicy .Policy ]:
@@ -307,6 +369,8 @@ def __init__(
307
369
request : orgpolicy .ListCustomConstraintsRequest ,
308
370
response : orgpolicy .ListCustomConstraintsResponse ,
309
371
* ,
372
+ retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
373
+ timeout : Union [float , object ] = gapic_v1 .method .DEFAULT ,
310
374
metadata : Sequence [Tuple [str , str ]] = ()
311
375
):
312
376
"""Instantiate the pager.
@@ -318,12 +382,17 @@ def __init__(
318
382
The initial request object.
319
383
response (google.cloud.orgpolicy_v2.types.ListCustomConstraintsResponse):
320
384
The initial response object.
385
+ retry (google.api_core.retry.Retry): Designation of what errors,
386
+ if any, should be retried.
387
+ timeout (float): The timeout for this request.
321
388
metadata (Sequence[Tuple[str, str]]): Strings which should be
322
389
sent along with the request as metadata.
323
390
"""
324
391
self ._method = method
325
392
self ._request = orgpolicy .ListCustomConstraintsRequest (request )
326
393
self ._response = response
394
+ self ._retry = retry
395
+ self ._timeout = timeout
327
396
self ._metadata = metadata
328
397
329
398
def __getattr__ (self , name : str ) -> Any :
@@ -334,7 +403,12 @@ def pages(self) -> Iterator[orgpolicy.ListCustomConstraintsResponse]:
334
403
yield self ._response
335
404
while self ._response .next_page_token :
336
405
self ._request .page_token = self ._response .next_page_token
337
- self ._response = self ._method (self ._request , metadata = self ._metadata )
406
+ self ._response = self ._method (
407
+ self ._request ,
408
+ retry = self ._retry ,
409
+ timeout = self ._timeout ,
410
+ metadata = self ._metadata ,
411
+ )
338
412
yield self ._response
339
413
340
414
def __iter__ (self ) -> Iterator [constraint .CustomConstraint ]:
@@ -369,6 +443,8 @@ def __init__(
369
443
request : orgpolicy .ListCustomConstraintsRequest ,
370
444
response : orgpolicy .ListCustomConstraintsResponse ,
371
445
* ,
446
+ retry : OptionalAsyncRetry = gapic_v1 .method .DEFAULT ,
447
+ timeout : Union [float , object ] = gapic_v1 .method .DEFAULT ,
372
448
metadata : Sequence [Tuple [str , str ]] = ()
373
449
):
374
450
"""Instantiates the pager.
@@ -380,12 +456,17 @@ def __init__(
380
456
The initial request object.
381
457
response (google.cloud.orgpolicy_v2.types.ListCustomConstraintsResponse):
382
458
The initial response object.
459
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
460
+ if any, should be retried.
461
+ timeout (float): The timeout for this request.
383
462
metadata (Sequence[Tuple[str, str]]): Strings which should be
384
463
sent along with the request as metadata.
385
464
"""
386
465
self ._method = method
387
466
self ._request = orgpolicy .ListCustomConstraintsRequest (request )
388
467
self ._response = response
468
+ self ._retry = retry
469
+ self ._timeout = timeout
389
470
self ._metadata = metadata
390
471
391
472
def __getattr__ (self , name : str ) -> Any :
@@ -396,7 +477,12 @@ async def pages(self) -> AsyncIterator[orgpolicy.ListCustomConstraintsResponse]:
396
477
yield self ._response
397
478
while self ._response .next_page_token :
398
479
self ._request .page_token = self ._response .next_page_token
399
- self ._response = await self ._method (self ._request , metadata = self ._metadata )
480
+ self ._response = await self ._method (
481
+ self ._request ,
482
+ retry = self ._retry ,
483
+ timeout = self ._timeout ,
484
+ metadata = self ._metadata ,
485
+ )
400
486
yield self ._response
401
487
402
488
def __aiter__ (self ) -> AsyncIterator [constraint .CustomConstraint ]:
0 commit comments