google-cloud-network-security 0.9.17__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 (51) hide show
  1. google/cloud/network_security/__init__.py +91 -0
  2. google/cloud/network_security/gapic_version.py +16 -0
  3. google/cloud/network_security/py.typed +2 -0
  4. google/cloud/network_security_v1/__init__.py +86 -0
  5. google/cloud/network_security_v1/gapic_metadata.json +253 -0
  6. google/cloud/network_security_v1/gapic_version.py +16 -0
  7. google/cloud/network_security_v1/py.typed +2 -0
  8. google/cloud/network_security_v1/services/__init__.py +15 -0
  9. google/cloud/network_security_v1/services/network_security/__init__.py +22 -0
  10. google/cloud/network_security_v1/services/network_security/async_client.py +3074 -0
  11. google/cloud/network_security_v1/services/network_security/client.py +3525 -0
  12. google/cloud/network_security_v1/services/network_security/pagers.py +525 -0
  13. google/cloud/network_security_v1/services/network_security/transports/__init__.py +36 -0
  14. google/cloud/network_security_v1/services/network_security/transports/base.py +524 -0
  15. google/cloud/network_security_v1/services/network_security/transports/grpc.py +993 -0
  16. google/cloud/network_security_v1/services/network_security/transports/grpc_asyncio.py +1138 -0
  17. google/cloud/network_security_v1/services/network_security/transports/rest.py +5057 -0
  18. google/cloud/network_security_v1/services/network_security/transports/rest_base.py +1156 -0
  19. google/cloud/network_security_v1/types/__init__.py +78 -0
  20. google/cloud/network_security_v1/types/authorization_policy.py +430 -0
  21. google/cloud/network_security_v1/types/client_tls_policy.py +270 -0
  22. google/cloud/network_security_v1/types/common.py +93 -0
  23. google/cloud/network_security_v1/types/network_security.py +24 -0
  24. google/cloud/network_security_v1/types/server_tls_policy.py +295 -0
  25. google/cloud/network_security_v1/types/tls.py +153 -0
  26. google/cloud/network_security_v1beta1/__init__.py +86 -0
  27. google/cloud/network_security_v1beta1/gapic_metadata.json +173 -0
  28. google/cloud/network_security_v1beta1/gapic_version.py +16 -0
  29. google/cloud/network_security_v1beta1/py.typed +2 -0
  30. google/cloud/network_security_v1beta1/services/__init__.py +15 -0
  31. google/cloud/network_security_v1beta1/services/network_security/__init__.py +22 -0
  32. google/cloud/network_security_v1beta1/services/network_security/async_client.py +3074 -0
  33. google/cloud/network_security_v1beta1/services/network_security/client.py +3523 -0
  34. google/cloud/network_security_v1beta1/services/network_security/pagers.py +525 -0
  35. google/cloud/network_security_v1beta1/services/network_security/transports/__init__.py +32 -0
  36. google/cloud/network_security_v1beta1/services/network_security/transports/base.py +524 -0
  37. google/cloud/network_security_v1beta1/services/network_security/transports/grpc.py +993 -0
  38. google/cloud/network_security_v1beta1/services/network_security/transports/grpc_asyncio.py +1138 -0
  39. google/cloud/network_security_v1beta1/services/network_security/transports/rest.py +3195 -0
  40. google/cloud/network_security_v1beta1/types/__init__.py +78 -0
  41. google/cloud/network_security_v1beta1/types/authorization_policy.py +430 -0
  42. google/cloud/network_security_v1beta1/types/client_tls_policy.py +270 -0
  43. google/cloud/network_security_v1beta1/types/common.py +93 -0
  44. google/cloud/network_security_v1beta1/types/network_security.py +24 -0
  45. google/cloud/network_security_v1beta1/types/server_tls_policy.py +295 -0
  46. google/cloud/network_security_v1beta1/types/tls.py +153 -0
  47. google_cloud_network_security-0.9.17.dist-info/LICENSE +202 -0
  48. google_cloud_network_security-0.9.17.dist-info/METADATA +229 -0
  49. google_cloud_network_security-0.9.17.dist-info/RECORD +51 -0
  50. google_cloud_network_security-0.9.17.dist-info/WHEEL +5 -0
  51. google_cloud_network_security-0.9.17.dist-info/top_level.txt +1 -0
@@ -0,0 +1,525 @@
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.network_security_v1.types import (
42
+ authorization_policy,
43
+ client_tls_policy,
44
+ server_tls_policy,
45
+ )
46
+
47
+
48
+ class ListAuthorizationPoliciesPager:
49
+ """A pager for iterating through ``list_authorization_policies`` requests.
50
+
51
+ This class thinly wraps an initial
52
+ :class:`google.cloud.network_security_v1.types.ListAuthorizationPoliciesResponse` object, and
53
+ provides an ``__iter__`` method to iterate through its
54
+ ``authorization_policies`` field.
55
+
56
+ If there are more pages, the ``__iter__`` method will make additional
57
+ ``ListAuthorizationPolicies`` requests and continue to iterate
58
+ through the ``authorization_policies`` field on the
59
+ corresponding responses.
60
+
61
+ All the usual :class:`google.cloud.network_security_v1.types.ListAuthorizationPoliciesResponse`
62
+ attributes are available on the pager. If multiple requests are made, only
63
+ the most recent response is retained, and thus used for attribute lookup.
64
+ """
65
+
66
+ def __init__(
67
+ self,
68
+ method: Callable[..., authorization_policy.ListAuthorizationPoliciesResponse],
69
+ request: authorization_policy.ListAuthorizationPoliciesRequest,
70
+ response: authorization_policy.ListAuthorizationPoliciesResponse,
71
+ *,
72
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
73
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
74
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
75
+ ):
76
+ """Instantiate the pager.
77
+
78
+ Args:
79
+ method (Callable): The method that was originally called, and
80
+ which instantiated this pager.
81
+ request (google.cloud.network_security_v1.types.ListAuthorizationPoliciesRequest):
82
+ The initial request object.
83
+ response (google.cloud.network_security_v1.types.ListAuthorizationPoliciesResponse):
84
+ The initial response object.
85
+ retry (google.api_core.retry.Retry): Designation of what errors,
86
+ if any, should be retried.
87
+ timeout (float): The timeout for this request.
88
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
89
+ sent along with the request as metadata. Normally, each value must be of type `str`,
90
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
91
+ be of type `bytes`.
92
+ """
93
+ self._method = method
94
+ self._request = authorization_policy.ListAuthorizationPoliciesRequest(request)
95
+ self._response = response
96
+ self._retry = retry
97
+ self._timeout = timeout
98
+ self._metadata = metadata
99
+
100
+ def __getattr__(self, name: str) -> Any:
101
+ return getattr(self._response, name)
102
+
103
+ @property
104
+ def pages(self) -> Iterator[authorization_policy.ListAuthorizationPoliciesResponse]:
105
+ yield self._response
106
+ while self._response.next_page_token:
107
+ self._request.page_token = self._response.next_page_token
108
+ self._response = self._method(
109
+ self._request,
110
+ retry=self._retry,
111
+ timeout=self._timeout,
112
+ metadata=self._metadata,
113
+ )
114
+ yield self._response
115
+
116
+ def __iter__(self) -> Iterator[authorization_policy.AuthorizationPolicy]:
117
+ for page in self.pages:
118
+ yield from page.authorization_policies
119
+
120
+ def __repr__(self) -> str:
121
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
122
+
123
+
124
+ class ListAuthorizationPoliciesAsyncPager:
125
+ """A pager for iterating through ``list_authorization_policies`` requests.
126
+
127
+ This class thinly wraps an initial
128
+ :class:`google.cloud.network_security_v1.types.ListAuthorizationPoliciesResponse` object, and
129
+ provides an ``__aiter__`` method to iterate through its
130
+ ``authorization_policies`` field.
131
+
132
+ If there are more pages, the ``__aiter__`` method will make additional
133
+ ``ListAuthorizationPolicies`` requests and continue to iterate
134
+ through the ``authorization_policies`` field on the
135
+ corresponding responses.
136
+
137
+ All the usual :class:`google.cloud.network_security_v1.types.ListAuthorizationPoliciesResponse`
138
+ attributes are available on the pager. If multiple requests are made, only
139
+ the most recent response is retained, and thus used for attribute lookup.
140
+ """
141
+
142
+ def __init__(
143
+ self,
144
+ method: Callable[
145
+ ..., Awaitable[authorization_policy.ListAuthorizationPoliciesResponse]
146
+ ],
147
+ request: authorization_policy.ListAuthorizationPoliciesRequest,
148
+ response: authorization_policy.ListAuthorizationPoliciesResponse,
149
+ *,
150
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
151
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
152
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
153
+ ):
154
+ """Instantiates the pager.
155
+
156
+ Args:
157
+ method (Callable): The method that was originally called, and
158
+ which instantiated this pager.
159
+ request (google.cloud.network_security_v1.types.ListAuthorizationPoliciesRequest):
160
+ The initial request object.
161
+ response (google.cloud.network_security_v1.types.ListAuthorizationPoliciesResponse):
162
+ The initial response object.
163
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
164
+ if any, should be retried.
165
+ timeout (float): The timeout for this request.
166
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
167
+ sent along with the request as metadata. Normally, each value must be of type `str`,
168
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
169
+ be of type `bytes`.
170
+ """
171
+ self._method = method
172
+ self._request = authorization_policy.ListAuthorizationPoliciesRequest(request)
173
+ self._response = response
174
+ self._retry = retry
175
+ self._timeout = timeout
176
+ self._metadata = metadata
177
+
178
+ def __getattr__(self, name: str) -> Any:
179
+ return getattr(self._response, name)
180
+
181
+ @property
182
+ async def pages(
183
+ self,
184
+ ) -> AsyncIterator[authorization_policy.ListAuthorizationPoliciesResponse]:
185
+ yield self._response
186
+ while self._response.next_page_token:
187
+ self._request.page_token = self._response.next_page_token
188
+ self._response = await self._method(
189
+ self._request,
190
+ retry=self._retry,
191
+ timeout=self._timeout,
192
+ metadata=self._metadata,
193
+ )
194
+ yield self._response
195
+
196
+ def __aiter__(self) -> AsyncIterator[authorization_policy.AuthorizationPolicy]:
197
+ async def async_generator():
198
+ async for page in self.pages:
199
+ for response in page.authorization_policies:
200
+ yield response
201
+
202
+ return async_generator()
203
+
204
+ def __repr__(self) -> str:
205
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
206
+
207
+
208
+ class ListServerTlsPoliciesPager:
209
+ """A pager for iterating through ``list_server_tls_policies`` requests.
210
+
211
+ This class thinly wraps an initial
212
+ :class:`google.cloud.network_security_v1.types.ListServerTlsPoliciesResponse` object, and
213
+ provides an ``__iter__`` method to iterate through its
214
+ ``server_tls_policies`` field.
215
+
216
+ If there are more pages, the ``__iter__`` method will make additional
217
+ ``ListServerTlsPolicies`` requests and continue to iterate
218
+ through the ``server_tls_policies`` field on the
219
+ corresponding responses.
220
+
221
+ All the usual :class:`google.cloud.network_security_v1.types.ListServerTlsPoliciesResponse`
222
+ attributes are available on the pager. If multiple requests are made, only
223
+ the most recent response is retained, and thus used for attribute lookup.
224
+ """
225
+
226
+ def __init__(
227
+ self,
228
+ method: Callable[..., server_tls_policy.ListServerTlsPoliciesResponse],
229
+ request: server_tls_policy.ListServerTlsPoliciesRequest,
230
+ response: server_tls_policy.ListServerTlsPoliciesResponse,
231
+ *,
232
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
233
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
234
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
235
+ ):
236
+ """Instantiate the pager.
237
+
238
+ Args:
239
+ method (Callable): The method that was originally called, and
240
+ which instantiated this pager.
241
+ request (google.cloud.network_security_v1.types.ListServerTlsPoliciesRequest):
242
+ The initial request object.
243
+ response (google.cloud.network_security_v1.types.ListServerTlsPoliciesResponse):
244
+ The initial response object.
245
+ retry (google.api_core.retry.Retry): Designation of what errors,
246
+ if any, should be retried.
247
+ timeout (float): The timeout for this request.
248
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
249
+ sent along with the request as metadata. Normally, each value must be of type `str`,
250
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
251
+ be of type `bytes`.
252
+ """
253
+ self._method = method
254
+ self._request = server_tls_policy.ListServerTlsPoliciesRequest(request)
255
+ self._response = response
256
+ self._retry = retry
257
+ self._timeout = timeout
258
+ self._metadata = metadata
259
+
260
+ def __getattr__(self, name: str) -> Any:
261
+ return getattr(self._response, name)
262
+
263
+ @property
264
+ def pages(self) -> Iterator[server_tls_policy.ListServerTlsPoliciesResponse]:
265
+ yield self._response
266
+ while self._response.next_page_token:
267
+ self._request.page_token = self._response.next_page_token
268
+ self._response = self._method(
269
+ self._request,
270
+ retry=self._retry,
271
+ timeout=self._timeout,
272
+ metadata=self._metadata,
273
+ )
274
+ yield self._response
275
+
276
+ def __iter__(self) -> Iterator[server_tls_policy.ServerTlsPolicy]:
277
+ for page in self.pages:
278
+ yield from page.server_tls_policies
279
+
280
+ def __repr__(self) -> str:
281
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
282
+
283
+
284
+ class ListServerTlsPoliciesAsyncPager:
285
+ """A pager for iterating through ``list_server_tls_policies`` requests.
286
+
287
+ This class thinly wraps an initial
288
+ :class:`google.cloud.network_security_v1.types.ListServerTlsPoliciesResponse` object, and
289
+ provides an ``__aiter__`` method to iterate through its
290
+ ``server_tls_policies`` field.
291
+
292
+ If there are more pages, the ``__aiter__`` method will make additional
293
+ ``ListServerTlsPolicies`` requests and continue to iterate
294
+ through the ``server_tls_policies`` field on the
295
+ corresponding responses.
296
+
297
+ All the usual :class:`google.cloud.network_security_v1.types.ListServerTlsPoliciesResponse`
298
+ attributes are available on the pager. If multiple requests are made, only
299
+ the most recent response is retained, and thus used for attribute lookup.
300
+ """
301
+
302
+ def __init__(
303
+ self,
304
+ method: Callable[
305
+ ..., Awaitable[server_tls_policy.ListServerTlsPoliciesResponse]
306
+ ],
307
+ request: server_tls_policy.ListServerTlsPoliciesRequest,
308
+ response: server_tls_policy.ListServerTlsPoliciesResponse,
309
+ *,
310
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
311
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
312
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
313
+ ):
314
+ """Instantiates the pager.
315
+
316
+ Args:
317
+ method (Callable): The method that was originally called, and
318
+ which instantiated this pager.
319
+ request (google.cloud.network_security_v1.types.ListServerTlsPoliciesRequest):
320
+ The initial request object.
321
+ response (google.cloud.network_security_v1.types.ListServerTlsPoliciesResponse):
322
+ The initial response object.
323
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
324
+ if any, should be retried.
325
+ timeout (float): The timeout for this request.
326
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
327
+ sent along with the request as metadata. Normally, each value must be of type `str`,
328
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
329
+ be of type `bytes`.
330
+ """
331
+ self._method = method
332
+ self._request = server_tls_policy.ListServerTlsPoliciesRequest(request)
333
+ self._response = response
334
+ self._retry = retry
335
+ self._timeout = timeout
336
+ self._metadata = metadata
337
+
338
+ def __getattr__(self, name: str) -> Any:
339
+ return getattr(self._response, name)
340
+
341
+ @property
342
+ async def pages(
343
+ self,
344
+ ) -> AsyncIterator[server_tls_policy.ListServerTlsPoliciesResponse]:
345
+ yield self._response
346
+ while self._response.next_page_token:
347
+ self._request.page_token = self._response.next_page_token
348
+ self._response = await self._method(
349
+ self._request,
350
+ retry=self._retry,
351
+ timeout=self._timeout,
352
+ metadata=self._metadata,
353
+ )
354
+ yield self._response
355
+
356
+ def __aiter__(self) -> AsyncIterator[server_tls_policy.ServerTlsPolicy]:
357
+ async def async_generator():
358
+ async for page in self.pages:
359
+ for response in page.server_tls_policies:
360
+ yield response
361
+
362
+ return async_generator()
363
+
364
+ def __repr__(self) -> str:
365
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
366
+
367
+
368
+ class ListClientTlsPoliciesPager:
369
+ """A pager for iterating through ``list_client_tls_policies`` requests.
370
+
371
+ This class thinly wraps an initial
372
+ :class:`google.cloud.network_security_v1.types.ListClientTlsPoliciesResponse` object, and
373
+ provides an ``__iter__`` method to iterate through its
374
+ ``client_tls_policies`` field.
375
+
376
+ If there are more pages, the ``__iter__`` method will make additional
377
+ ``ListClientTlsPolicies`` requests and continue to iterate
378
+ through the ``client_tls_policies`` field on the
379
+ corresponding responses.
380
+
381
+ All the usual :class:`google.cloud.network_security_v1.types.ListClientTlsPoliciesResponse`
382
+ attributes are available on the pager. If multiple requests are made, only
383
+ the most recent response is retained, and thus used for attribute lookup.
384
+ """
385
+
386
+ def __init__(
387
+ self,
388
+ method: Callable[..., client_tls_policy.ListClientTlsPoliciesResponse],
389
+ request: client_tls_policy.ListClientTlsPoliciesRequest,
390
+ response: client_tls_policy.ListClientTlsPoliciesResponse,
391
+ *,
392
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
393
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
394
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
395
+ ):
396
+ """Instantiate the pager.
397
+
398
+ Args:
399
+ method (Callable): The method that was originally called, and
400
+ which instantiated this pager.
401
+ request (google.cloud.network_security_v1.types.ListClientTlsPoliciesRequest):
402
+ The initial request object.
403
+ response (google.cloud.network_security_v1.types.ListClientTlsPoliciesResponse):
404
+ The initial response object.
405
+ retry (google.api_core.retry.Retry): Designation of what errors,
406
+ if any, should be retried.
407
+ timeout (float): The timeout for this request.
408
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
409
+ sent along with the request as metadata. Normally, each value must be of type `str`,
410
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
411
+ be of type `bytes`.
412
+ """
413
+ self._method = method
414
+ self._request = client_tls_policy.ListClientTlsPoliciesRequest(request)
415
+ self._response = response
416
+ self._retry = retry
417
+ self._timeout = timeout
418
+ self._metadata = metadata
419
+
420
+ def __getattr__(self, name: str) -> Any:
421
+ return getattr(self._response, name)
422
+
423
+ @property
424
+ def pages(self) -> Iterator[client_tls_policy.ListClientTlsPoliciesResponse]:
425
+ yield self._response
426
+ while self._response.next_page_token:
427
+ self._request.page_token = self._response.next_page_token
428
+ self._response = self._method(
429
+ self._request,
430
+ retry=self._retry,
431
+ timeout=self._timeout,
432
+ metadata=self._metadata,
433
+ )
434
+ yield self._response
435
+
436
+ def __iter__(self) -> Iterator[client_tls_policy.ClientTlsPolicy]:
437
+ for page in self.pages:
438
+ yield from page.client_tls_policies
439
+
440
+ def __repr__(self) -> str:
441
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
442
+
443
+
444
+ class ListClientTlsPoliciesAsyncPager:
445
+ """A pager for iterating through ``list_client_tls_policies`` requests.
446
+
447
+ This class thinly wraps an initial
448
+ :class:`google.cloud.network_security_v1.types.ListClientTlsPoliciesResponse` object, and
449
+ provides an ``__aiter__`` method to iterate through its
450
+ ``client_tls_policies`` field.
451
+
452
+ If there are more pages, the ``__aiter__`` method will make additional
453
+ ``ListClientTlsPolicies`` requests and continue to iterate
454
+ through the ``client_tls_policies`` field on the
455
+ corresponding responses.
456
+
457
+ All the usual :class:`google.cloud.network_security_v1.types.ListClientTlsPoliciesResponse`
458
+ attributes are available on the pager. If multiple requests are made, only
459
+ the most recent response is retained, and thus used for attribute lookup.
460
+ """
461
+
462
+ def __init__(
463
+ self,
464
+ method: Callable[
465
+ ..., Awaitable[client_tls_policy.ListClientTlsPoliciesResponse]
466
+ ],
467
+ request: client_tls_policy.ListClientTlsPoliciesRequest,
468
+ response: client_tls_policy.ListClientTlsPoliciesResponse,
469
+ *,
470
+ retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
471
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
472
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
473
+ ):
474
+ """Instantiates the pager.
475
+
476
+ Args:
477
+ method (Callable): The method that was originally called, and
478
+ which instantiated this pager.
479
+ request (google.cloud.network_security_v1.types.ListClientTlsPoliciesRequest):
480
+ The initial request object.
481
+ response (google.cloud.network_security_v1.types.ListClientTlsPoliciesResponse):
482
+ The initial response object.
483
+ retry (google.api_core.retry.AsyncRetry): Designation of what errors,
484
+ if any, should be retried.
485
+ timeout (float): The timeout for this request.
486
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
487
+ sent along with the request as metadata. Normally, each value must be of type `str`,
488
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
489
+ be of type `bytes`.
490
+ """
491
+ self._method = method
492
+ self._request = client_tls_policy.ListClientTlsPoliciesRequest(request)
493
+ self._response = response
494
+ self._retry = retry
495
+ self._timeout = timeout
496
+ self._metadata = metadata
497
+
498
+ def __getattr__(self, name: str) -> Any:
499
+ return getattr(self._response, name)
500
+
501
+ @property
502
+ async def pages(
503
+ self,
504
+ ) -> AsyncIterator[client_tls_policy.ListClientTlsPoliciesResponse]:
505
+ yield self._response
506
+ while self._response.next_page_token:
507
+ self._request.page_token = self._response.next_page_token
508
+ self._response = await self._method(
509
+ self._request,
510
+ retry=self._retry,
511
+ timeout=self._timeout,
512
+ metadata=self._metadata,
513
+ )
514
+ yield self._response
515
+
516
+ def __aiter__(self) -> AsyncIterator[client_tls_policy.ClientTlsPolicy]:
517
+ async def async_generator():
518
+ async for page in self.pages:
519
+ for response in page.client_tls_policies:
520
+ yield response
521
+
522
+ return async_generator()
523
+
524
+ def __repr__(self) -> str:
525
+ return "{0}<{1!r}>".format(self.__class__.__name__, self._response)
@@ -0,0 +1,36 @@
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 collections import OrderedDict
17
+ from typing import Dict, Type
18
+
19
+ from .base import NetworkSecurityTransport
20
+ from .grpc import NetworkSecurityGrpcTransport
21
+ from .grpc_asyncio import NetworkSecurityGrpcAsyncIOTransport
22
+ from .rest import NetworkSecurityRestInterceptor, NetworkSecurityRestTransport
23
+
24
+ # Compile a registry of transports.
25
+ _transport_registry = OrderedDict() # type: Dict[str, Type[NetworkSecurityTransport]]
26
+ _transport_registry["grpc"] = NetworkSecurityGrpcTransport
27
+ _transport_registry["grpc_asyncio"] = NetworkSecurityGrpcAsyncIOTransport
28
+ _transport_registry["rest"] = NetworkSecurityRestTransport
29
+
30
+ __all__ = (
31
+ "NetworkSecurityTransport",
32
+ "NetworkSecurityGrpcTransport",
33
+ "NetworkSecurityGrpcAsyncIOTransport",
34
+ "NetworkSecurityRestTransport",
35
+ "NetworkSecurityRestInterceptor",
36
+ )