google-cloud-beyondcorp-clientgateways 0.4.16__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 (25) hide show
  1. google/cloud/beyondcorp_clientgateways/__init__.py +47 -0
  2. google/cloud/beyondcorp_clientgateways/gapic_version.py +16 -0
  3. google/cloud/beyondcorp_clientgateways/py.typed +2 -0
  4. google/cloud/beyondcorp_clientgateways_v1/__init__.py +45 -0
  5. google/cloud/beyondcorp_clientgateways_v1/gapic_metadata.json +88 -0
  6. google/cloud/beyondcorp_clientgateways_v1/gapic_version.py +16 -0
  7. google/cloud/beyondcorp_clientgateways_v1/py.typed +2 -0
  8. google/cloud/beyondcorp_clientgateways_v1/services/__init__.py +15 -0
  9. google/cloud/beyondcorp_clientgateways_v1/services/client_gateways_service/__init__.py +22 -0
  10. google/cloud/beyondcorp_clientgateways_v1/services/client_gateways_service/async_client.py +1489 -0
  11. google/cloud/beyondcorp_clientgateways_v1/services/client_gateways_service/client.py +1932 -0
  12. google/cloud/beyondcorp_clientgateways_v1/services/client_gateways_service/pagers.py +201 -0
  13. google/cloud/beyondcorp_clientgateways_v1/services/client_gateways_service/transports/__init__.py +41 -0
  14. google/cloud/beyondcorp_clientgateways_v1/services/client_gateways_service/transports/base.py +347 -0
  15. google/cloud/beyondcorp_clientgateways_v1/services/client_gateways_service/transports/grpc.py +663 -0
  16. google/cloud/beyondcorp_clientgateways_v1/services/client_gateways_service/transports/grpc_asyncio.py +747 -0
  17. google/cloud/beyondcorp_clientgateways_v1/services/client_gateways_service/transports/rest.py +2591 -0
  18. google/cloud/beyondcorp_clientgateways_v1/services/client_gateways_service/transports/rest_base.py +592 -0
  19. google/cloud/beyondcorp_clientgateways_v1/types/__init__.py +34 -0
  20. google/cloud/beyondcorp_clientgateways_v1/types/client_gateways_service.py +381 -0
  21. google_cloud_beyondcorp_clientgateways-0.4.16.dist-info/LICENSE +202 -0
  22. google_cloud_beyondcorp_clientgateways-0.4.16.dist-info/METADATA +229 -0
  23. google_cloud_beyondcorp_clientgateways-0.4.16.dist-info/RECORD +25 -0
  24. google_cloud_beyondcorp_clientgateways-0.4.16.dist-info/WHEEL +5 -0
  25. google_cloud_beyondcorp_clientgateways-0.4.16.dist-info/top_level.txt +1 -0
@@ -0,0 +1,747 @@
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
+ import inspect
17
+ import json
18
+ import logging as std_logging
19
+ import pickle
20
+ from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
21
+ import warnings
22
+
23
+ from google.api_core import exceptions as core_exceptions
24
+ from google.api_core import gapic_v1, grpc_helpers_async, operations_v1
25
+ from google.api_core import retry_async as retries
26
+ from google.auth import credentials as ga_credentials # type: ignore
27
+ from google.auth.transport.grpc import SslCredentials # type: ignore
28
+ from google.cloud.location import locations_pb2 # type: ignore
29
+ from google.iam.v1 import iam_policy_pb2 # type: ignore
30
+ from google.iam.v1 import policy_pb2 # type: ignore
31
+ from google.longrunning import operations_pb2 # type: ignore
32
+ from google.protobuf.json_format import MessageToJson
33
+ import google.protobuf.message
34
+ import grpc # type: ignore
35
+ from grpc.experimental import aio # type: ignore
36
+ import proto # type: ignore
37
+
38
+ from google.cloud.beyondcorp_clientgateways_v1.types import client_gateways_service
39
+
40
+ from .base import DEFAULT_CLIENT_INFO, ClientGatewaysServiceTransport
41
+ from .grpc import ClientGatewaysServiceGrpcTransport
42
+
43
+ try:
44
+ from google.api_core import client_logging # type: ignore
45
+
46
+ CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER
47
+ except ImportError: # pragma: NO COVER
48
+ CLIENT_LOGGING_SUPPORTED = False
49
+
50
+ _LOGGER = std_logging.getLogger(__name__)
51
+
52
+
53
+ class _LoggingClientAIOInterceptor(
54
+ grpc.aio.UnaryUnaryClientInterceptor
55
+ ): # pragma: NO COVER
56
+ async def intercept_unary_unary(self, continuation, client_call_details, request):
57
+ logging_enabled = CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
58
+ std_logging.DEBUG
59
+ )
60
+ if logging_enabled: # pragma: NO COVER
61
+ request_metadata = client_call_details.metadata
62
+ if isinstance(request, proto.Message):
63
+ request_payload = type(request).to_json(request)
64
+ elif isinstance(request, google.protobuf.message.Message):
65
+ request_payload = MessageToJson(request)
66
+ else:
67
+ request_payload = f"{type(request).__name__}: {pickle.dumps(request)}"
68
+
69
+ request_metadata = {
70
+ key: value.decode("utf-8") if isinstance(value, bytes) else value
71
+ for key, value in request_metadata
72
+ }
73
+ grpc_request = {
74
+ "payload": request_payload,
75
+ "requestMethod": "grpc",
76
+ "metadata": dict(request_metadata),
77
+ }
78
+ _LOGGER.debug(
79
+ f"Sending request for {client_call_details.method}",
80
+ extra={
81
+ "serviceName": "google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService",
82
+ "rpcName": str(client_call_details.method),
83
+ "request": grpc_request,
84
+ "metadata": grpc_request["metadata"],
85
+ },
86
+ )
87
+ response = await continuation(client_call_details, request)
88
+ if logging_enabled: # pragma: NO COVER
89
+ response_metadata = await response.trailing_metadata()
90
+ # Convert gRPC metadata `<class 'grpc.aio._metadata.Metadata'>` to list of tuples
91
+ metadata = (
92
+ dict([(k, str(v)) for k, v in response_metadata])
93
+ if response_metadata
94
+ else None
95
+ )
96
+ result = await response
97
+ if isinstance(result, proto.Message):
98
+ response_payload = type(result).to_json(result)
99
+ elif isinstance(result, google.protobuf.message.Message):
100
+ response_payload = MessageToJson(result)
101
+ else:
102
+ response_payload = f"{type(result).__name__}: {pickle.dumps(result)}"
103
+ grpc_response = {
104
+ "payload": response_payload,
105
+ "metadata": metadata,
106
+ "status": "OK",
107
+ }
108
+ _LOGGER.debug(
109
+ f"Received response to rpc {client_call_details.method}.",
110
+ extra={
111
+ "serviceName": "google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService",
112
+ "rpcName": str(client_call_details.method),
113
+ "response": grpc_response,
114
+ "metadata": grpc_response["metadata"],
115
+ },
116
+ )
117
+ return response
118
+
119
+
120
+ class ClientGatewaysServiceGrpcAsyncIOTransport(ClientGatewaysServiceTransport):
121
+ """gRPC AsyncIO backend transport for ClientGatewaysService.
122
+
123
+ API Overview:
124
+
125
+ The ``beyondcorp.googleapis.com`` service implements the Google
126
+ Cloud BeyondCorp API.
127
+
128
+ Data Model:
129
+
130
+ The ClientGatewaysService exposes the following resources:
131
+
132
+ - Client Gateways, named as follows:
133
+ ``projects/{project_id}/locations/{location_id}/clientGateways/{client_gateway_id}``.
134
+
135
+ This class defines the same methods as the primary client, so the
136
+ primary client can load the underlying transport implementation
137
+ and call it.
138
+
139
+ It sends protocol buffers over the wire using gRPC (which is built on
140
+ top of HTTP/2); the ``grpcio`` package must be installed.
141
+ """
142
+
143
+ _grpc_channel: aio.Channel
144
+ _stubs: Dict[str, Callable] = {}
145
+
146
+ @classmethod
147
+ def create_channel(
148
+ cls,
149
+ host: str = "beyondcorp.googleapis.com",
150
+ credentials: Optional[ga_credentials.Credentials] = None,
151
+ credentials_file: Optional[str] = None,
152
+ scopes: Optional[Sequence[str]] = None,
153
+ quota_project_id: Optional[str] = None,
154
+ **kwargs,
155
+ ) -> aio.Channel:
156
+ """Create and return a gRPC AsyncIO channel object.
157
+ Args:
158
+ host (Optional[str]): The host for the channel to use.
159
+ credentials (Optional[~.Credentials]): The
160
+ authorization credentials to attach to requests. These
161
+ credentials identify this application to the service. If
162
+ none are specified, the client will attempt to ascertain
163
+ the credentials from the environment.
164
+ credentials_file (Optional[str]): A file with credentials that can
165
+ be loaded with :func:`google.auth.load_credentials_from_file`.
166
+ scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
167
+ service. These are only used when credentials are not specified and
168
+ are passed to :func:`google.auth.default`.
169
+ quota_project_id (Optional[str]): An optional project to use for billing
170
+ and quota.
171
+ kwargs (Optional[dict]): Keyword arguments, which are passed to the
172
+ channel creation.
173
+ Returns:
174
+ aio.Channel: A gRPC AsyncIO channel object.
175
+ """
176
+
177
+ return grpc_helpers_async.create_channel(
178
+ host,
179
+ credentials=credentials,
180
+ credentials_file=credentials_file,
181
+ quota_project_id=quota_project_id,
182
+ default_scopes=cls.AUTH_SCOPES,
183
+ scopes=scopes,
184
+ default_host=cls.DEFAULT_HOST,
185
+ **kwargs,
186
+ )
187
+
188
+ def __init__(
189
+ self,
190
+ *,
191
+ host: str = "beyondcorp.googleapis.com",
192
+ credentials: Optional[ga_credentials.Credentials] = None,
193
+ credentials_file: Optional[str] = None,
194
+ scopes: Optional[Sequence[str]] = None,
195
+ channel: Optional[Union[aio.Channel, Callable[..., aio.Channel]]] = None,
196
+ api_mtls_endpoint: Optional[str] = None,
197
+ client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
198
+ ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
199
+ client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
200
+ quota_project_id: Optional[str] = None,
201
+ client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
202
+ always_use_jwt_access: Optional[bool] = False,
203
+ api_audience: Optional[str] = None,
204
+ ) -> None:
205
+ """Instantiate the transport.
206
+
207
+ Args:
208
+ host (Optional[str]):
209
+ The hostname to connect to (default: 'beyondcorp.googleapis.com').
210
+ credentials (Optional[google.auth.credentials.Credentials]): The
211
+ authorization credentials to attach to requests. These
212
+ credentials identify the application to the service; if none
213
+ are specified, the client will attempt to ascertain the
214
+ credentials from the environment.
215
+ This argument is ignored if a ``channel`` instance is provided.
216
+ credentials_file (Optional[str]): A file with credentials that can
217
+ be loaded with :func:`google.auth.load_credentials_from_file`.
218
+ This argument is ignored if a ``channel`` instance is provided.
219
+ scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
220
+ service. These are only used when credentials are not specified and
221
+ are passed to :func:`google.auth.default`.
222
+ channel (Optional[Union[aio.Channel, Callable[..., aio.Channel]]]):
223
+ A ``Channel`` instance through which to make calls, or a Callable
224
+ that constructs and returns one. If set to None, ``self.create_channel``
225
+ is used to create the channel. If a Callable is given, it will be called
226
+ with the same arguments as used in ``self.create_channel``.
227
+ api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
228
+ If provided, it overrides the ``host`` argument and tries to create
229
+ a mutual TLS channel with client SSL credentials from
230
+ ``client_cert_source`` or application default SSL credentials.
231
+ client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]):
232
+ Deprecated. A callback to provide client SSL certificate bytes and
233
+ private key bytes, both in PEM format. It is ignored if
234
+ ``api_mtls_endpoint`` is None.
235
+ ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
236
+ for the grpc channel. It is ignored if a ``channel`` instance is provided.
237
+ client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
238
+ A callback to provide client certificate bytes and private key bytes,
239
+ both in PEM format. It is used to configure a mutual TLS channel. It is
240
+ ignored if a ``channel`` instance or ``ssl_channel_credentials`` is provided.
241
+ quota_project_id (Optional[str]): An optional project to use for billing
242
+ and quota.
243
+ client_info (google.api_core.gapic_v1.client_info.ClientInfo):
244
+ The client info used to send a user-agent string along with
245
+ API requests. If ``None``, then default info will be used.
246
+ Generally, you only need to set this if you're developing
247
+ your own client library.
248
+ always_use_jwt_access (Optional[bool]): Whether self signed JWT should
249
+ be used for service account credentials.
250
+
251
+ Raises:
252
+ google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
253
+ creation failed for any reason.
254
+ google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials``
255
+ and ``credentials_file`` are passed.
256
+ """
257
+ self._grpc_channel = None
258
+ self._ssl_channel_credentials = ssl_channel_credentials
259
+ self._stubs: Dict[str, Callable] = {}
260
+ self._operations_client: Optional[operations_v1.OperationsAsyncClient] = None
261
+
262
+ if api_mtls_endpoint:
263
+ warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
264
+ if client_cert_source:
265
+ warnings.warn("client_cert_source is deprecated", DeprecationWarning)
266
+
267
+ if isinstance(channel, aio.Channel):
268
+ # Ignore credentials if a channel was passed.
269
+ credentials = None
270
+ self._ignore_credentials = True
271
+ # If a channel was explicitly provided, set it.
272
+ self._grpc_channel = channel
273
+ self._ssl_channel_credentials = None
274
+ else:
275
+ if api_mtls_endpoint:
276
+ host = api_mtls_endpoint
277
+
278
+ # Create SSL credentials with client_cert_source or application
279
+ # default SSL credentials.
280
+ if client_cert_source:
281
+ cert, key = client_cert_source()
282
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
283
+ certificate_chain=cert, private_key=key
284
+ )
285
+ else:
286
+ self._ssl_channel_credentials = SslCredentials().ssl_credentials
287
+
288
+ else:
289
+ if client_cert_source_for_mtls and not ssl_channel_credentials:
290
+ cert, key = client_cert_source_for_mtls()
291
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
292
+ certificate_chain=cert, private_key=key
293
+ )
294
+
295
+ # The base transport sets the host, credentials and scopes
296
+ super().__init__(
297
+ host=host,
298
+ credentials=credentials,
299
+ credentials_file=credentials_file,
300
+ scopes=scopes,
301
+ quota_project_id=quota_project_id,
302
+ client_info=client_info,
303
+ always_use_jwt_access=always_use_jwt_access,
304
+ api_audience=api_audience,
305
+ )
306
+
307
+ if not self._grpc_channel:
308
+ # initialize with the provided callable or the default channel
309
+ channel_init = channel or type(self).create_channel
310
+ self._grpc_channel = channel_init(
311
+ self._host,
312
+ # use the credentials which are saved
313
+ credentials=self._credentials,
314
+ # Set ``credentials_file`` to ``None`` here as
315
+ # the credentials that we saved earlier should be used.
316
+ credentials_file=None,
317
+ scopes=self._scopes,
318
+ ssl_credentials=self._ssl_channel_credentials,
319
+ quota_project_id=quota_project_id,
320
+ options=[
321
+ ("grpc.max_send_message_length", -1),
322
+ ("grpc.max_receive_message_length", -1),
323
+ ],
324
+ )
325
+
326
+ self._interceptor = _LoggingClientAIOInterceptor()
327
+ self._grpc_channel._unary_unary_interceptors.append(self._interceptor)
328
+ self._logged_channel = self._grpc_channel
329
+ self._wrap_with_kind = (
330
+ "kind" in inspect.signature(gapic_v1.method_async.wrap_method).parameters
331
+ )
332
+ # Wrap messages. This must be done after self._logged_channel exists
333
+ self._prep_wrapped_messages(client_info)
334
+
335
+ @property
336
+ def grpc_channel(self) -> aio.Channel:
337
+ """Create the channel designed to connect to this service.
338
+
339
+ This property caches on the instance; repeated calls return
340
+ the same channel.
341
+ """
342
+ # Return the channel from cache.
343
+ return self._grpc_channel
344
+
345
+ @property
346
+ def operations_client(self) -> operations_v1.OperationsAsyncClient:
347
+ """Create the client designed to process long-running operations.
348
+
349
+ This property caches on the instance; repeated calls return the same
350
+ client.
351
+ """
352
+ # Quick check: Only create a new client if we do not already have one.
353
+ if self._operations_client is None:
354
+ self._operations_client = operations_v1.OperationsAsyncClient(
355
+ self._logged_channel
356
+ )
357
+
358
+ # Return the client from cache.
359
+ return self._operations_client
360
+
361
+ @property
362
+ def list_client_gateways(
363
+ self,
364
+ ) -> Callable[
365
+ [client_gateways_service.ListClientGatewaysRequest],
366
+ Awaitable[client_gateways_service.ListClientGatewaysResponse],
367
+ ]:
368
+ r"""Return a callable for the list client gateways method over gRPC.
369
+
370
+ Lists ClientGateways in a given project and location.
371
+
372
+ Returns:
373
+ Callable[[~.ListClientGatewaysRequest],
374
+ Awaitable[~.ListClientGatewaysResponse]]:
375
+ A function that, when called, will call the underlying RPC
376
+ on the server.
377
+ """
378
+ # Generate a "stub function" on-the-fly which will actually make
379
+ # the request.
380
+ # gRPC handles serialization and deserialization, so we just need
381
+ # to pass in the functions for each.
382
+ if "list_client_gateways" not in self._stubs:
383
+ self._stubs["list_client_gateways"] = self._logged_channel.unary_unary(
384
+ "/google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService/ListClientGateways",
385
+ request_serializer=client_gateways_service.ListClientGatewaysRequest.serialize,
386
+ response_deserializer=client_gateways_service.ListClientGatewaysResponse.deserialize,
387
+ )
388
+ return self._stubs["list_client_gateways"]
389
+
390
+ @property
391
+ def get_client_gateway(
392
+ self,
393
+ ) -> Callable[
394
+ [client_gateways_service.GetClientGatewayRequest],
395
+ Awaitable[client_gateways_service.ClientGateway],
396
+ ]:
397
+ r"""Return a callable for the get client gateway method over gRPC.
398
+
399
+ Gets details of a single ClientGateway.
400
+
401
+ Returns:
402
+ Callable[[~.GetClientGatewayRequest],
403
+ Awaitable[~.ClientGateway]]:
404
+ A function that, when called, will call the underlying RPC
405
+ on the server.
406
+ """
407
+ # Generate a "stub function" on-the-fly which will actually make
408
+ # the request.
409
+ # gRPC handles serialization and deserialization, so we just need
410
+ # to pass in the functions for each.
411
+ if "get_client_gateway" not in self._stubs:
412
+ self._stubs["get_client_gateway"] = self._logged_channel.unary_unary(
413
+ "/google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService/GetClientGateway",
414
+ request_serializer=client_gateways_service.GetClientGatewayRequest.serialize,
415
+ response_deserializer=client_gateways_service.ClientGateway.deserialize,
416
+ )
417
+ return self._stubs["get_client_gateway"]
418
+
419
+ @property
420
+ def create_client_gateway(
421
+ self,
422
+ ) -> Callable[
423
+ [client_gateways_service.CreateClientGatewayRequest],
424
+ Awaitable[operations_pb2.Operation],
425
+ ]:
426
+ r"""Return a callable for the create client gateway method over gRPC.
427
+
428
+ Creates a new ClientGateway in a given project and
429
+ location.
430
+
431
+ Returns:
432
+ Callable[[~.CreateClientGatewayRequest],
433
+ Awaitable[~.Operation]]:
434
+ A function that, when called, will call the underlying RPC
435
+ on the server.
436
+ """
437
+ # Generate a "stub function" on-the-fly which will actually make
438
+ # the request.
439
+ # gRPC handles serialization and deserialization, so we just need
440
+ # to pass in the functions for each.
441
+ if "create_client_gateway" not in self._stubs:
442
+ self._stubs["create_client_gateway"] = self._logged_channel.unary_unary(
443
+ "/google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService/CreateClientGateway",
444
+ request_serializer=client_gateways_service.CreateClientGatewayRequest.serialize,
445
+ response_deserializer=operations_pb2.Operation.FromString,
446
+ )
447
+ return self._stubs["create_client_gateway"]
448
+
449
+ @property
450
+ def delete_client_gateway(
451
+ self,
452
+ ) -> Callable[
453
+ [client_gateways_service.DeleteClientGatewayRequest],
454
+ Awaitable[operations_pb2.Operation],
455
+ ]:
456
+ r"""Return a callable for the delete client gateway method over gRPC.
457
+
458
+ Deletes a single ClientGateway.
459
+
460
+ Returns:
461
+ Callable[[~.DeleteClientGatewayRequest],
462
+ Awaitable[~.Operation]]:
463
+ A function that, when called, will call the underlying RPC
464
+ on the server.
465
+ """
466
+ # Generate a "stub function" on-the-fly which will actually make
467
+ # the request.
468
+ # gRPC handles serialization and deserialization, so we just need
469
+ # to pass in the functions for each.
470
+ if "delete_client_gateway" not in self._stubs:
471
+ self._stubs["delete_client_gateway"] = self._logged_channel.unary_unary(
472
+ "/google.cloud.beyondcorp.clientgateways.v1.ClientGatewaysService/DeleteClientGateway",
473
+ request_serializer=client_gateways_service.DeleteClientGatewayRequest.serialize,
474
+ response_deserializer=operations_pb2.Operation.FromString,
475
+ )
476
+ return self._stubs["delete_client_gateway"]
477
+
478
+ def _prep_wrapped_messages(self, client_info):
479
+ """Precompute the wrapped methods, overriding the base class method to use async wrappers."""
480
+ self._wrapped_methods = {
481
+ self.list_client_gateways: self._wrap_method(
482
+ self.list_client_gateways,
483
+ default_timeout=None,
484
+ client_info=client_info,
485
+ ),
486
+ self.get_client_gateway: self._wrap_method(
487
+ self.get_client_gateway,
488
+ default_timeout=None,
489
+ client_info=client_info,
490
+ ),
491
+ self.create_client_gateway: self._wrap_method(
492
+ self.create_client_gateway,
493
+ default_timeout=None,
494
+ client_info=client_info,
495
+ ),
496
+ self.delete_client_gateway: self._wrap_method(
497
+ self.delete_client_gateway,
498
+ default_timeout=None,
499
+ client_info=client_info,
500
+ ),
501
+ self.get_location: self._wrap_method(
502
+ self.get_location,
503
+ default_timeout=None,
504
+ client_info=client_info,
505
+ ),
506
+ self.list_locations: self._wrap_method(
507
+ self.list_locations,
508
+ default_timeout=None,
509
+ client_info=client_info,
510
+ ),
511
+ self.get_iam_policy: self._wrap_method(
512
+ self.get_iam_policy,
513
+ default_timeout=None,
514
+ client_info=client_info,
515
+ ),
516
+ self.set_iam_policy: self._wrap_method(
517
+ self.set_iam_policy,
518
+ default_timeout=None,
519
+ client_info=client_info,
520
+ ),
521
+ self.test_iam_permissions: self._wrap_method(
522
+ self.test_iam_permissions,
523
+ default_timeout=None,
524
+ client_info=client_info,
525
+ ),
526
+ self.cancel_operation: self._wrap_method(
527
+ self.cancel_operation,
528
+ default_timeout=None,
529
+ client_info=client_info,
530
+ ),
531
+ self.delete_operation: self._wrap_method(
532
+ self.delete_operation,
533
+ default_timeout=None,
534
+ client_info=client_info,
535
+ ),
536
+ self.get_operation: self._wrap_method(
537
+ self.get_operation,
538
+ default_timeout=None,
539
+ client_info=client_info,
540
+ ),
541
+ self.list_operations: self._wrap_method(
542
+ self.list_operations,
543
+ default_timeout=None,
544
+ client_info=client_info,
545
+ ),
546
+ }
547
+
548
+ def _wrap_method(self, func, *args, **kwargs):
549
+ if self._wrap_with_kind: # pragma: NO COVER
550
+ kwargs["kind"] = self.kind
551
+ return gapic_v1.method_async.wrap_method(func, *args, **kwargs)
552
+
553
+ def close(self):
554
+ return self._logged_channel.close()
555
+
556
+ @property
557
+ def kind(self) -> str:
558
+ return "grpc_asyncio"
559
+
560
+ @property
561
+ def delete_operation(
562
+ self,
563
+ ) -> Callable[[operations_pb2.DeleteOperationRequest], None]:
564
+ r"""Return a callable for the delete_operation method over gRPC."""
565
+ # Generate a "stub function" on-the-fly which will actually make
566
+ # the request.
567
+ # gRPC handles serialization and deserialization, so we just need
568
+ # to pass in the functions for each.
569
+ if "delete_operation" not in self._stubs:
570
+ self._stubs["delete_operation"] = self._logged_channel.unary_unary(
571
+ "/google.longrunning.Operations/DeleteOperation",
572
+ request_serializer=operations_pb2.DeleteOperationRequest.SerializeToString,
573
+ response_deserializer=None,
574
+ )
575
+ return self._stubs["delete_operation"]
576
+
577
+ @property
578
+ def cancel_operation(
579
+ self,
580
+ ) -> Callable[[operations_pb2.CancelOperationRequest], None]:
581
+ r"""Return a callable for the cancel_operation method over gRPC."""
582
+ # Generate a "stub function" on-the-fly which will actually make
583
+ # the request.
584
+ # gRPC handles serialization and deserialization, so we just need
585
+ # to pass in the functions for each.
586
+ if "cancel_operation" not in self._stubs:
587
+ self._stubs["cancel_operation"] = self._logged_channel.unary_unary(
588
+ "/google.longrunning.Operations/CancelOperation",
589
+ request_serializer=operations_pb2.CancelOperationRequest.SerializeToString,
590
+ response_deserializer=None,
591
+ )
592
+ return self._stubs["cancel_operation"]
593
+
594
+ @property
595
+ def get_operation(
596
+ self,
597
+ ) -> Callable[[operations_pb2.GetOperationRequest], operations_pb2.Operation]:
598
+ r"""Return a callable for the get_operation method over gRPC."""
599
+ # Generate a "stub function" on-the-fly which will actually make
600
+ # the request.
601
+ # gRPC handles serialization and deserialization, so we just need
602
+ # to pass in the functions for each.
603
+ if "get_operation" not in self._stubs:
604
+ self._stubs["get_operation"] = self._logged_channel.unary_unary(
605
+ "/google.longrunning.Operations/GetOperation",
606
+ request_serializer=operations_pb2.GetOperationRequest.SerializeToString,
607
+ response_deserializer=operations_pb2.Operation.FromString,
608
+ )
609
+ return self._stubs["get_operation"]
610
+
611
+ @property
612
+ def list_operations(
613
+ self,
614
+ ) -> Callable[
615
+ [operations_pb2.ListOperationsRequest], operations_pb2.ListOperationsResponse
616
+ ]:
617
+ r"""Return a callable for the list_operations method over gRPC."""
618
+ # Generate a "stub function" on-the-fly which will actually make
619
+ # the request.
620
+ # gRPC handles serialization and deserialization, so we just need
621
+ # to pass in the functions for each.
622
+ if "list_operations" not in self._stubs:
623
+ self._stubs["list_operations"] = self._logged_channel.unary_unary(
624
+ "/google.longrunning.Operations/ListOperations",
625
+ request_serializer=operations_pb2.ListOperationsRequest.SerializeToString,
626
+ response_deserializer=operations_pb2.ListOperationsResponse.FromString,
627
+ )
628
+ return self._stubs["list_operations"]
629
+
630
+ @property
631
+ def list_locations(
632
+ self,
633
+ ) -> Callable[
634
+ [locations_pb2.ListLocationsRequest], locations_pb2.ListLocationsResponse
635
+ ]:
636
+ r"""Return a callable for the list locations method over gRPC."""
637
+ # Generate a "stub function" on-the-fly which will actually make
638
+ # the request.
639
+ # gRPC handles serialization and deserialization, so we just need
640
+ # to pass in the functions for each.
641
+ if "list_locations" not in self._stubs:
642
+ self._stubs["list_locations"] = self._logged_channel.unary_unary(
643
+ "/google.cloud.location.Locations/ListLocations",
644
+ request_serializer=locations_pb2.ListLocationsRequest.SerializeToString,
645
+ response_deserializer=locations_pb2.ListLocationsResponse.FromString,
646
+ )
647
+ return self._stubs["list_locations"]
648
+
649
+ @property
650
+ def get_location(
651
+ self,
652
+ ) -> Callable[[locations_pb2.GetLocationRequest], locations_pb2.Location]:
653
+ r"""Return a callable for the list locations method over gRPC."""
654
+ # Generate a "stub function" on-the-fly which will actually make
655
+ # the request.
656
+ # gRPC handles serialization and deserialization, so we just need
657
+ # to pass in the functions for each.
658
+ if "get_location" not in self._stubs:
659
+ self._stubs["get_location"] = self._logged_channel.unary_unary(
660
+ "/google.cloud.location.Locations/GetLocation",
661
+ request_serializer=locations_pb2.GetLocationRequest.SerializeToString,
662
+ response_deserializer=locations_pb2.Location.FromString,
663
+ )
664
+ return self._stubs["get_location"]
665
+
666
+ @property
667
+ def set_iam_policy(
668
+ self,
669
+ ) -> Callable[[iam_policy_pb2.SetIamPolicyRequest], policy_pb2.Policy]:
670
+ r"""Return a callable for the set iam policy method over gRPC.
671
+ Sets the IAM access control policy on the specified
672
+ function. Replaces any existing policy.
673
+ Returns:
674
+ Callable[[~.SetIamPolicyRequest],
675
+ ~.Policy]:
676
+ A function that, when called, will call the underlying RPC
677
+ on the server.
678
+ """
679
+ # Generate a "stub function" on-the-fly which will actually make
680
+ # the request.
681
+ # gRPC handles serialization and deserialization, so we just need
682
+ # to pass in the functions for each.
683
+ if "set_iam_policy" not in self._stubs:
684
+ self._stubs["set_iam_policy"] = self._logged_channel.unary_unary(
685
+ "/google.iam.v1.IAMPolicy/SetIamPolicy",
686
+ request_serializer=iam_policy_pb2.SetIamPolicyRequest.SerializeToString,
687
+ response_deserializer=policy_pb2.Policy.FromString,
688
+ )
689
+ return self._stubs["set_iam_policy"]
690
+
691
+ @property
692
+ def get_iam_policy(
693
+ self,
694
+ ) -> Callable[[iam_policy_pb2.GetIamPolicyRequest], policy_pb2.Policy]:
695
+ r"""Return a callable for the get iam policy method over gRPC.
696
+ Gets the IAM access control policy for a function.
697
+ Returns an empty policy if the function exists and does
698
+ not have a policy set.
699
+ Returns:
700
+ Callable[[~.GetIamPolicyRequest],
701
+ ~.Policy]:
702
+ A function that, when called, will call the underlying RPC
703
+ on the server.
704
+ """
705
+ # Generate a "stub function" on-the-fly which will actually make
706
+ # the request.
707
+ # gRPC handles serialization and deserialization, so we just need
708
+ # to pass in the functions for each.
709
+ if "get_iam_policy" not in self._stubs:
710
+ self._stubs["get_iam_policy"] = self._logged_channel.unary_unary(
711
+ "/google.iam.v1.IAMPolicy/GetIamPolicy",
712
+ request_serializer=iam_policy_pb2.GetIamPolicyRequest.SerializeToString,
713
+ response_deserializer=policy_pb2.Policy.FromString,
714
+ )
715
+ return self._stubs["get_iam_policy"]
716
+
717
+ @property
718
+ def test_iam_permissions(
719
+ self,
720
+ ) -> Callable[
721
+ [iam_policy_pb2.TestIamPermissionsRequest],
722
+ iam_policy_pb2.TestIamPermissionsResponse,
723
+ ]:
724
+ r"""Return a callable for the test iam permissions method over gRPC.
725
+ Tests the specified permissions against the IAM access control
726
+ policy for a function. If the function does not exist, this will
727
+ return an empty set of permissions, not a NOT_FOUND error.
728
+ Returns:
729
+ Callable[[~.TestIamPermissionsRequest],
730
+ ~.TestIamPermissionsResponse]:
731
+ A function that, when called, will call the underlying RPC
732
+ on the server.
733
+ """
734
+ # Generate a "stub function" on-the-fly which will actually make
735
+ # the request.
736
+ # gRPC handles serialization and deserialization, so we just need
737
+ # to pass in the functions for each.
738
+ if "test_iam_permissions" not in self._stubs:
739
+ self._stubs["test_iam_permissions"] = self._logged_channel.unary_unary(
740
+ "/google.iam.v1.IAMPolicy/TestIamPermissions",
741
+ request_serializer=iam_policy_pb2.TestIamPermissionsRequest.SerializeToString,
742
+ response_deserializer=iam_policy_pb2.TestIamPermissionsResponse.FromString,
743
+ )
744
+ return self._stubs["test_iam_permissions"]
745
+
746
+
747
+ __all__ = ("ClientGatewaysServiceGrpcAsyncIOTransport",)