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