google-cloud-datastream 1.13.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. google/cloud/datastream/__init__.py +219 -0
  2. google/cloud/datastream/gapic_version.py +16 -0
  3. google/cloud/datastream/py.typed +2 -0
  4. google/cloud/datastream_v1/__init__.py +216 -0
  5. google/cloud/datastream_v1/gapic_metadata.json +418 -0
  6. google/cloud/datastream_v1/gapic_version.py +16 -0
  7. google/cloud/datastream_v1/py.typed +2 -0
  8. google/cloud/datastream_v1/services/__init__.py +15 -0
  9. google/cloud/datastream_v1/services/datastream/__init__.py +22 -0
  10. google/cloud/datastream_v1/services/datastream/async_client.py +3939 -0
  11. google/cloud/datastream_v1/services/datastream/client.py +4420 -0
  12. google/cloud/datastream_v1/services/datastream/pagers.py +977 -0
  13. google/cloud/datastream_v1/services/datastream/transports/__init__.py +36 -0
  14. google/cloud/datastream_v1/services/datastream/transports/base.py +639 -0
  15. google/cloud/datastream_v1/services/datastream/transports/grpc.py +1193 -0
  16. google/cloud/datastream_v1/services/datastream/transports/grpc_asyncio.py +1389 -0
  17. google/cloud/datastream_v1/services/datastream/transports/rest.py +6861 -0
  18. google/cloud/datastream_v1/services/datastream/transports/rest_base.py +1591 -0
  19. google/cloud/datastream_v1/types/__init__.py +208 -0
  20. google/cloud/datastream_v1/types/datastream.py +1491 -0
  21. google/cloud/datastream_v1/types/datastream_resources.py +2986 -0
  22. google/cloud/datastream_v1alpha1/__init__.py +156 -0
  23. google/cloud/datastream_v1alpha1/gapic_metadata.json +343 -0
  24. google/cloud/datastream_v1alpha1/gapic_version.py +16 -0
  25. google/cloud/datastream_v1alpha1/py.typed +2 -0
  26. google/cloud/datastream_v1alpha1/services/__init__.py +15 -0
  27. google/cloud/datastream_v1alpha1/services/datastream/__init__.py +22 -0
  28. google/cloud/datastream_v1alpha1/services/datastream/async_client.py +3018 -0
  29. google/cloud/datastream_v1alpha1/services/datastream/client.py +3458 -0
  30. google/cloud/datastream_v1alpha1/services/datastream/pagers.py +821 -0
  31. google/cloud/datastream_v1alpha1/services/datastream/transports/__init__.py +36 -0
  32. google/cloud/datastream_v1alpha1/services/datastream/transports/base.py +467 -0
  33. google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py +942 -0
  34. google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py +1078 -0
  35. google/cloud/datastream_v1alpha1/services/datastream/transports/rest.py +4770 -0
  36. google/cloud/datastream_v1alpha1/services/datastream/transports/rest_base.py +1152 -0
  37. google/cloud/datastream_v1alpha1/types/__init__.py +148 -0
  38. google/cloud/datastream_v1alpha1/types/datastream.py +1230 -0
  39. google/cloud/datastream_v1alpha1/types/datastream_resources.py +1416 -0
  40. google_cloud_datastream-1.13.2.dist-info/LICENSE +202 -0
  41. google_cloud_datastream-1.13.2.dist-info/METADATA +229 -0
  42. google_cloud_datastream-1.13.2.dist-info/RECORD +44 -0
  43. google_cloud_datastream-1.13.2.dist-info/WHEEL +5 -0
  44. google_cloud_datastream-1.13.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,942 @@
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.longrunning import operations_pb2 # type: ignore
27
+ from google.protobuf.json_format import MessageToJson
28
+ import google.protobuf.message
29
+ import grpc # type: ignore
30
+ import proto # type: ignore
31
+
32
+ from google.cloud.datastream_v1alpha1.types import datastream, datastream_resources
33
+
34
+ from .base import DEFAULT_CLIENT_INFO, DatastreamTransport
35
+
36
+ try:
37
+ from google.api_core import client_logging # type: ignore
38
+
39
+ CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER
40
+ except ImportError: # pragma: NO COVER
41
+ CLIENT_LOGGING_SUPPORTED = False
42
+
43
+ _LOGGER = std_logging.getLogger(__name__)
44
+
45
+
46
+ class _LoggingClientInterceptor(grpc.UnaryUnaryClientInterceptor): # pragma: NO COVER
47
+ def intercept_unary_unary(self, continuation, client_call_details, request):
48
+ logging_enabled = CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
49
+ std_logging.DEBUG
50
+ )
51
+ if logging_enabled: # pragma: NO COVER
52
+ request_metadata = client_call_details.metadata
53
+ if isinstance(request, proto.Message):
54
+ request_payload = type(request).to_json(request)
55
+ elif isinstance(request, google.protobuf.message.Message):
56
+ request_payload = MessageToJson(request)
57
+ else:
58
+ request_payload = f"{type(request).__name__}: {pickle.dumps(request)}"
59
+
60
+ request_metadata = {
61
+ key: value.decode("utf-8") if isinstance(value, bytes) else value
62
+ for key, value in request_metadata
63
+ }
64
+ grpc_request = {
65
+ "payload": request_payload,
66
+ "requestMethod": "grpc",
67
+ "metadata": dict(request_metadata),
68
+ }
69
+ _LOGGER.debug(
70
+ f"Sending request for {client_call_details.method}",
71
+ extra={
72
+ "serviceName": "google.cloud.datastream.v1alpha1.Datastream",
73
+ "rpcName": client_call_details.method,
74
+ "request": grpc_request,
75
+ "metadata": grpc_request["metadata"],
76
+ },
77
+ )
78
+
79
+ response = continuation(client_call_details, request)
80
+ if logging_enabled: # pragma: NO COVER
81
+ response_metadata = response.trailing_metadata()
82
+ # Convert gRPC metadata `<class 'grpc.aio._metadata.Metadata'>` to list of tuples
83
+ metadata = (
84
+ dict([(k, str(v)) for k, v in response_metadata])
85
+ if response_metadata
86
+ else None
87
+ )
88
+ result = response.result()
89
+ if isinstance(result, proto.Message):
90
+ response_payload = type(result).to_json(result)
91
+ elif isinstance(result, google.protobuf.message.Message):
92
+ response_payload = MessageToJson(result)
93
+ else:
94
+ response_payload = f"{type(result).__name__}: {pickle.dumps(result)}"
95
+ grpc_response = {
96
+ "payload": response_payload,
97
+ "metadata": metadata,
98
+ "status": "OK",
99
+ }
100
+ _LOGGER.debug(
101
+ f"Received response for {client_call_details.method}.",
102
+ extra={
103
+ "serviceName": "google.cloud.datastream.v1alpha1.Datastream",
104
+ "rpcName": client_call_details.method,
105
+ "response": grpc_response,
106
+ "metadata": grpc_response["metadata"],
107
+ },
108
+ )
109
+ return response
110
+
111
+
112
+ class DatastreamGrpcTransport(DatastreamTransport):
113
+ """gRPC backend transport for Datastream.
114
+
115
+ Datastream service
116
+
117
+ This class defines the same methods as the primary client, so the
118
+ primary client can load the underlying transport implementation
119
+ and call it.
120
+
121
+ It sends protocol buffers over the wire using gRPC (which is built on
122
+ top of HTTP/2); the ``grpcio`` package must be installed.
123
+ """
124
+
125
+ _stubs: Dict[str, Callable]
126
+
127
+ def __init__(
128
+ self,
129
+ *,
130
+ host: str = "datastream.googleapis.com",
131
+ credentials: Optional[ga_credentials.Credentials] = None,
132
+ credentials_file: Optional[str] = None,
133
+ scopes: Optional[Sequence[str]] = None,
134
+ channel: Optional[Union[grpc.Channel, Callable[..., grpc.Channel]]] = None,
135
+ api_mtls_endpoint: Optional[str] = None,
136
+ client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
137
+ ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
138
+ client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
139
+ quota_project_id: Optional[str] = None,
140
+ client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
141
+ always_use_jwt_access: Optional[bool] = False,
142
+ api_audience: Optional[str] = None,
143
+ ) -> None:
144
+ """Instantiate the transport.
145
+
146
+ Args:
147
+ host (Optional[str]):
148
+ The hostname to connect to (default: 'datastream.googleapis.com').
149
+ credentials (Optional[google.auth.credentials.Credentials]): The
150
+ authorization credentials to attach to requests. These
151
+ credentials identify the application to the service; if none
152
+ are specified, the client will attempt to ascertain the
153
+ credentials from the environment.
154
+ This argument is ignored if a ``channel`` instance is provided.
155
+ credentials_file (Optional[str]): A file with credentials that can
156
+ be loaded with :func:`google.auth.load_credentials_from_file`.
157
+ This argument is ignored if a ``channel`` instance is provided.
158
+ scopes (Optional(Sequence[str])): A list of scopes. This argument is
159
+ ignored if a ``channel`` instance is provided.
160
+ channel (Optional[Union[grpc.Channel, Callable[..., grpc.Channel]]]):
161
+ A ``Channel`` instance through which to make calls, or a Callable
162
+ that constructs and returns one. If set to None, ``self.create_channel``
163
+ is used to create the channel. If a Callable is given, it will be called
164
+ with the same arguments as used in ``self.create_channel``.
165
+ api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
166
+ If provided, it overrides the ``host`` argument and tries to create
167
+ a mutual TLS channel with client SSL credentials from
168
+ ``client_cert_source`` or application default SSL credentials.
169
+ client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]):
170
+ Deprecated. A callback to provide client SSL certificate bytes and
171
+ private key bytes, both in PEM format. It is ignored if
172
+ ``api_mtls_endpoint`` is None.
173
+ ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
174
+ for the grpc channel. It is ignored if a ``channel`` instance is provided.
175
+ client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
176
+ A callback to provide client certificate bytes and private key bytes,
177
+ both in PEM format. It is used to configure a mutual TLS channel. It is
178
+ ignored if a ``channel`` instance or ``ssl_channel_credentials`` is provided.
179
+ quota_project_id (Optional[str]): An optional project to use for billing
180
+ and quota.
181
+ client_info (google.api_core.gapic_v1.client_info.ClientInfo):
182
+ The client info used to send a user-agent string along with
183
+ API requests. If ``None``, then default info will be used.
184
+ Generally, you only need to set this if you're developing
185
+ your own client library.
186
+ always_use_jwt_access (Optional[bool]): Whether self signed JWT should
187
+ be used for service account credentials.
188
+
189
+ Raises:
190
+ google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport
191
+ creation failed for any reason.
192
+ google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials``
193
+ and ``credentials_file`` are passed.
194
+ """
195
+ self._grpc_channel = None
196
+ self._ssl_channel_credentials = ssl_channel_credentials
197
+ self._stubs: Dict[str, Callable] = {}
198
+ self._operations_client: Optional[operations_v1.OperationsClient] = None
199
+
200
+ if api_mtls_endpoint:
201
+ warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
202
+ if client_cert_source:
203
+ warnings.warn("client_cert_source is deprecated", DeprecationWarning)
204
+
205
+ if isinstance(channel, grpc.Channel):
206
+ # Ignore credentials if a channel was passed.
207
+ credentials = None
208
+ self._ignore_credentials = True
209
+ # If a channel was explicitly provided, set it.
210
+ self._grpc_channel = channel
211
+ self._ssl_channel_credentials = None
212
+
213
+ else:
214
+ if api_mtls_endpoint:
215
+ host = api_mtls_endpoint
216
+
217
+ # Create SSL credentials with client_cert_source or application
218
+ # default SSL credentials.
219
+ if client_cert_source:
220
+ cert, key = client_cert_source()
221
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
222
+ certificate_chain=cert, private_key=key
223
+ )
224
+ else:
225
+ self._ssl_channel_credentials = SslCredentials().ssl_credentials
226
+
227
+ else:
228
+ if client_cert_source_for_mtls and not ssl_channel_credentials:
229
+ cert, key = client_cert_source_for_mtls()
230
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
231
+ certificate_chain=cert, private_key=key
232
+ )
233
+
234
+ # The base transport sets the host, credentials and scopes
235
+ super().__init__(
236
+ host=host,
237
+ credentials=credentials,
238
+ credentials_file=credentials_file,
239
+ scopes=scopes,
240
+ quota_project_id=quota_project_id,
241
+ client_info=client_info,
242
+ always_use_jwt_access=always_use_jwt_access,
243
+ api_audience=api_audience,
244
+ )
245
+
246
+ if not self._grpc_channel:
247
+ # initialize with the provided callable or the default channel
248
+ channel_init = channel or type(self).create_channel
249
+ self._grpc_channel = channel_init(
250
+ self._host,
251
+ # use the credentials which are saved
252
+ credentials=self._credentials,
253
+ # Set ``credentials_file`` to ``None`` here as
254
+ # the credentials that we saved earlier should be used.
255
+ credentials_file=None,
256
+ scopes=self._scopes,
257
+ ssl_credentials=self._ssl_channel_credentials,
258
+ quota_project_id=quota_project_id,
259
+ options=[
260
+ ("grpc.max_send_message_length", -1),
261
+ ("grpc.max_receive_message_length", -1),
262
+ ],
263
+ )
264
+
265
+ self._interceptor = _LoggingClientInterceptor()
266
+ self._logged_channel = grpc.intercept_channel(
267
+ self._grpc_channel, self._interceptor
268
+ )
269
+
270
+ # Wrap messages. This must be done after self._logged_channel exists
271
+ self._prep_wrapped_messages(client_info)
272
+
273
+ @classmethod
274
+ def create_channel(
275
+ cls,
276
+ host: str = "datastream.googleapis.com",
277
+ credentials: Optional[ga_credentials.Credentials] = None,
278
+ credentials_file: Optional[str] = None,
279
+ scopes: Optional[Sequence[str]] = None,
280
+ quota_project_id: Optional[str] = None,
281
+ **kwargs,
282
+ ) -> grpc.Channel:
283
+ """Create and return a gRPC channel object.
284
+ Args:
285
+ host (Optional[str]): The host for the channel to use.
286
+ credentials (Optional[~.Credentials]): The
287
+ authorization credentials to attach to requests. These
288
+ credentials identify this application to the service. If
289
+ none are specified, the client will attempt to ascertain
290
+ the credentials from the environment.
291
+ credentials_file (Optional[str]): A file with credentials that can
292
+ be loaded with :func:`google.auth.load_credentials_from_file`.
293
+ This argument is mutually exclusive with credentials.
294
+ scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
295
+ service. These are only used when credentials are not specified and
296
+ are passed to :func:`google.auth.default`.
297
+ quota_project_id (Optional[str]): An optional project to use for billing
298
+ and quota.
299
+ kwargs (Optional[dict]): Keyword arguments, which are passed to the
300
+ channel creation.
301
+ Returns:
302
+ grpc.Channel: A gRPC channel object.
303
+
304
+ Raises:
305
+ google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials``
306
+ and ``credentials_file`` are passed.
307
+ """
308
+
309
+ return grpc_helpers.create_channel(
310
+ host,
311
+ credentials=credentials,
312
+ credentials_file=credentials_file,
313
+ quota_project_id=quota_project_id,
314
+ default_scopes=cls.AUTH_SCOPES,
315
+ scopes=scopes,
316
+ default_host=cls.DEFAULT_HOST,
317
+ **kwargs,
318
+ )
319
+
320
+ @property
321
+ def grpc_channel(self) -> grpc.Channel:
322
+ """Return the channel designed to connect to this service."""
323
+ return self._grpc_channel
324
+
325
+ @property
326
+ def operations_client(self) -> operations_v1.OperationsClient:
327
+ """Create the client designed to process long-running operations.
328
+
329
+ This property caches on the instance; repeated calls return the same
330
+ client.
331
+ """
332
+ # Quick check: Only create a new client if we do not already have one.
333
+ if self._operations_client is None:
334
+ self._operations_client = operations_v1.OperationsClient(
335
+ self._logged_channel
336
+ )
337
+
338
+ # Return the client from cache.
339
+ return self._operations_client
340
+
341
+ @property
342
+ def list_connection_profiles(
343
+ self,
344
+ ) -> Callable[
345
+ [datastream.ListConnectionProfilesRequest],
346
+ datastream.ListConnectionProfilesResponse,
347
+ ]:
348
+ r"""Return a callable for the list connection profiles method over gRPC.
349
+
350
+ Use this method to list connection profiles created
351
+ in a project and location.
352
+
353
+ Returns:
354
+ Callable[[~.ListConnectionProfilesRequest],
355
+ ~.ListConnectionProfilesResponse]:
356
+ A function that, when called, will call the underlying RPC
357
+ on the server.
358
+ """
359
+ # Generate a "stub function" on-the-fly which will actually make
360
+ # the request.
361
+ # gRPC handles serialization and deserialization, so we just need
362
+ # to pass in the functions for each.
363
+ if "list_connection_profiles" not in self._stubs:
364
+ self._stubs["list_connection_profiles"] = self._logged_channel.unary_unary(
365
+ "/google.cloud.datastream.v1alpha1.Datastream/ListConnectionProfiles",
366
+ request_serializer=datastream.ListConnectionProfilesRequest.serialize,
367
+ response_deserializer=datastream.ListConnectionProfilesResponse.deserialize,
368
+ )
369
+ return self._stubs["list_connection_profiles"]
370
+
371
+ @property
372
+ def get_connection_profile(
373
+ self,
374
+ ) -> Callable[
375
+ [datastream.GetConnectionProfileRequest], datastream_resources.ConnectionProfile
376
+ ]:
377
+ r"""Return a callable for the get connection profile method over gRPC.
378
+
379
+ Use this method to get details about a connection
380
+ profile.
381
+
382
+ Returns:
383
+ Callable[[~.GetConnectionProfileRequest],
384
+ ~.ConnectionProfile]:
385
+ A function that, when called, will call the underlying RPC
386
+ on the server.
387
+ """
388
+ # Generate a "stub function" on-the-fly which will actually make
389
+ # the request.
390
+ # gRPC handles serialization and deserialization, so we just need
391
+ # to pass in the functions for each.
392
+ if "get_connection_profile" not in self._stubs:
393
+ self._stubs["get_connection_profile"] = self._logged_channel.unary_unary(
394
+ "/google.cloud.datastream.v1alpha1.Datastream/GetConnectionProfile",
395
+ request_serializer=datastream.GetConnectionProfileRequest.serialize,
396
+ response_deserializer=datastream_resources.ConnectionProfile.deserialize,
397
+ )
398
+ return self._stubs["get_connection_profile"]
399
+
400
+ @property
401
+ def create_connection_profile(
402
+ self,
403
+ ) -> Callable[
404
+ [datastream.CreateConnectionProfileRequest], operations_pb2.Operation
405
+ ]:
406
+ r"""Return a callable for the create connection profile method over gRPC.
407
+
408
+ Use this method to create a connection profile in a
409
+ project and location.
410
+
411
+ Returns:
412
+ Callable[[~.CreateConnectionProfileRequest],
413
+ ~.Operation]:
414
+ A function that, when called, will call the underlying RPC
415
+ on the server.
416
+ """
417
+ # Generate a "stub function" on-the-fly which will actually make
418
+ # the request.
419
+ # gRPC handles serialization and deserialization, so we just need
420
+ # to pass in the functions for each.
421
+ if "create_connection_profile" not in self._stubs:
422
+ self._stubs["create_connection_profile"] = self._logged_channel.unary_unary(
423
+ "/google.cloud.datastream.v1alpha1.Datastream/CreateConnectionProfile",
424
+ request_serializer=datastream.CreateConnectionProfileRequest.serialize,
425
+ response_deserializer=operations_pb2.Operation.FromString,
426
+ )
427
+ return self._stubs["create_connection_profile"]
428
+
429
+ @property
430
+ def update_connection_profile(
431
+ self,
432
+ ) -> Callable[
433
+ [datastream.UpdateConnectionProfileRequest], operations_pb2.Operation
434
+ ]:
435
+ r"""Return a callable for the update connection profile method over gRPC.
436
+
437
+ Use this method to update the parameters of a
438
+ connection profile.
439
+
440
+ Returns:
441
+ Callable[[~.UpdateConnectionProfileRequest],
442
+ ~.Operation]:
443
+ A function that, when called, will call the underlying RPC
444
+ on the server.
445
+ """
446
+ # Generate a "stub function" on-the-fly which will actually make
447
+ # the request.
448
+ # gRPC handles serialization and deserialization, so we just need
449
+ # to pass in the functions for each.
450
+ if "update_connection_profile" not in self._stubs:
451
+ self._stubs["update_connection_profile"] = self._logged_channel.unary_unary(
452
+ "/google.cloud.datastream.v1alpha1.Datastream/UpdateConnectionProfile",
453
+ request_serializer=datastream.UpdateConnectionProfileRequest.serialize,
454
+ response_deserializer=operations_pb2.Operation.FromString,
455
+ )
456
+ return self._stubs["update_connection_profile"]
457
+
458
+ @property
459
+ def delete_connection_profile(
460
+ self,
461
+ ) -> Callable[
462
+ [datastream.DeleteConnectionProfileRequest], operations_pb2.Operation
463
+ ]:
464
+ r"""Return a callable for the delete connection profile method over gRPC.
465
+
466
+ Use this method to delete a connection profile..
467
+
468
+ Returns:
469
+ Callable[[~.DeleteConnectionProfileRequest],
470
+ ~.Operation]:
471
+ A function that, when called, will call the underlying RPC
472
+ on the server.
473
+ """
474
+ # Generate a "stub function" on-the-fly which will actually make
475
+ # the request.
476
+ # gRPC handles serialization and deserialization, so we just need
477
+ # to pass in the functions for each.
478
+ if "delete_connection_profile" not in self._stubs:
479
+ self._stubs["delete_connection_profile"] = self._logged_channel.unary_unary(
480
+ "/google.cloud.datastream.v1alpha1.Datastream/DeleteConnectionProfile",
481
+ request_serializer=datastream.DeleteConnectionProfileRequest.serialize,
482
+ response_deserializer=operations_pb2.Operation.FromString,
483
+ )
484
+ return self._stubs["delete_connection_profile"]
485
+
486
+ @property
487
+ def discover_connection_profile(
488
+ self,
489
+ ) -> Callable[
490
+ [datastream.DiscoverConnectionProfileRequest],
491
+ datastream.DiscoverConnectionProfileResponse,
492
+ ]:
493
+ r"""Return a callable for the discover connection profile method over gRPC.
494
+
495
+ Use this method to discover a connection profile.
496
+ The discover API call exposes the data objects and
497
+ metadata belonging to the profile. Typically, a request
498
+ returns children data objects under a parent data object
499
+ that's optionally supplied in the request.
500
+
501
+ Returns:
502
+ Callable[[~.DiscoverConnectionProfileRequest],
503
+ ~.DiscoverConnectionProfileResponse]:
504
+ A function that, when called, will call the underlying RPC
505
+ on the server.
506
+ """
507
+ # Generate a "stub function" on-the-fly which will actually make
508
+ # the request.
509
+ # gRPC handles serialization and deserialization, so we just need
510
+ # to pass in the functions for each.
511
+ if "discover_connection_profile" not in self._stubs:
512
+ self._stubs[
513
+ "discover_connection_profile"
514
+ ] = self._logged_channel.unary_unary(
515
+ "/google.cloud.datastream.v1alpha1.Datastream/DiscoverConnectionProfile",
516
+ request_serializer=datastream.DiscoverConnectionProfileRequest.serialize,
517
+ response_deserializer=datastream.DiscoverConnectionProfileResponse.deserialize,
518
+ )
519
+ return self._stubs["discover_connection_profile"]
520
+
521
+ @property
522
+ def list_streams(
523
+ self,
524
+ ) -> Callable[[datastream.ListStreamsRequest], datastream.ListStreamsResponse]:
525
+ r"""Return a callable for the list streams method over gRPC.
526
+
527
+ Use this method to list streams in a project and
528
+ location.
529
+
530
+ Returns:
531
+ Callable[[~.ListStreamsRequest],
532
+ ~.ListStreamsResponse]:
533
+ A function that, when called, will call the underlying RPC
534
+ on the server.
535
+ """
536
+ # Generate a "stub function" on-the-fly which will actually make
537
+ # the request.
538
+ # gRPC handles serialization and deserialization, so we just need
539
+ # to pass in the functions for each.
540
+ if "list_streams" not in self._stubs:
541
+ self._stubs["list_streams"] = self._logged_channel.unary_unary(
542
+ "/google.cloud.datastream.v1alpha1.Datastream/ListStreams",
543
+ request_serializer=datastream.ListStreamsRequest.serialize,
544
+ response_deserializer=datastream.ListStreamsResponse.deserialize,
545
+ )
546
+ return self._stubs["list_streams"]
547
+
548
+ @property
549
+ def get_stream(
550
+ self,
551
+ ) -> Callable[[datastream.GetStreamRequest], datastream_resources.Stream]:
552
+ r"""Return a callable for the get stream method over gRPC.
553
+
554
+ Use this method to get details about a stream.
555
+
556
+ Returns:
557
+ Callable[[~.GetStreamRequest],
558
+ ~.Stream]:
559
+ A function that, when called, will call the underlying RPC
560
+ on the server.
561
+ """
562
+ # Generate a "stub function" on-the-fly which will actually make
563
+ # the request.
564
+ # gRPC handles serialization and deserialization, so we just need
565
+ # to pass in the functions for each.
566
+ if "get_stream" not in self._stubs:
567
+ self._stubs["get_stream"] = self._logged_channel.unary_unary(
568
+ "/google.cloud.datastream.v1alpha1.Datastream/GetStream",
569
+ request_serializer=datastream.GetStreamRequest.serialize,
570
+ response_deserializer=datastream_resources.Stream.deserialize,
571
+ )
572
+ return self._stubs["get_stream"]
573
+
574
+ @property
575
+ def create_stream(
576
+ self,
577
+ ) -> Callable[[datastream.CreateStreamRequest], operations_pb2.Operation]:
578
+ r"""Return a callable for the create stream method over gRPC.
579
+
580
+ Use this method to create a stream.
581
+
582
+ Returns:
583
+ Callable[[~.CreateStreamRequest],
584
+ ~.Operation]:
585
+ A function that, when called, will call the underlying RPC
586
+ on the server.
587
+ """
588
+ # Generate a "stub function" on-the-fly which will actually make
589
+ # the request.
590
+ # gRPC handles serialization and deserialization, so we just need
591
+ # to pass in the functions for each.
592
+ if "create_stream" not in self._stubs:
593
+ self._stubs["create_stream"] = self._logged_channel.unary_unary(
594
+ "/google.cloud.datastream.v1alpha1.Datastream/CreateStream",
595
+ request_serializer=datastream.CreateStreamRequest.serialize,
596
+ response_deserializer=operations_pb2.Operation.FromString,
597
+ )
598
+ return self._stubs["create_stream"]
599
+
600
+ @property
601
+ def update_stream(
602
+ self,
603
+ ) -> Callable[[datastream.UpdateStreamRequest], operations_pb2.Operation]:
604
+ r"""Return a callable for the update stream method over gRPC.
605
+
606
+ Use this method to update the configuration of a
607
+ stream.
608
+
609
+ Returns:
610
+ Callable[[~.UpdateStreamRequest],
611
+ ~.Operation]:
612
+ A function that, when called, will call the underlying RPC
613
+ on the server.
614
+ """
615
+ # Generate a "stub function" on-the-fly which will actually make
616
+ # the request.
617
+ # gRPC handles serialization and deserialization, so we just need
618
+ # to pass in the functions for each.
619
+ if "update_stream" not in self._stubs:
620
+ self._stubs["update_stream"] = self._logged_channel.unary_unary(
621
+ "/google.cloud.datastream.v1alpha1.Datastream/UpdateStream",
622
+ request_serializer=datastream.UpdateStreamRequest.serialize,
623
+ response_deserializer=operations_pb2.Operation.FromString,
624
+ )
625
+ return self._stubs["update_stream"]
626
+
627
+ @property
628
+ def delete_stream(
629
+ self,
630
+ ) -> Callable[[datastream.DeleteStreamRequest], operations_pb2.Operation]:
631
+ r"""Return a callable for the delete stream method over gRPC.
632
+
633
+ Use this method to delete a stream.
634
+
635
+ Returns:
636
+ Callable[[~.DeleteStreamRequest],
637
+ ~.Operation]:
638
+ A function that, when called, will call the underlying RPC
639
+ on the server.
640
+ """
641
+ # Generate a "stub function" on-the-fly which will actually make
642
+ # the request.
643
+ # gRPC handles serialization and deserialization, so we just need
644
+ # to pass in the functions for each.
645
+ if "delete_stream" not in self._stubs:
646
+ self._stubs["delete_stream"] = self._logged_channel.unary_unary(
647
+ "/google.cloud.datastream.v1alpha1.Datastream/DeleteStream",
648
+ request_serializer=datastream.DeleteStreamRequest.serialize,
649
+ response_deserializer=operations_pb2.Operation.FromString,
650
+ )
651
+ return self._stubs["delete_stream"]
652
+
653
+ @property
654
+ def fetch_errors(
655
+ self,
656
+ ) -> Callable[[datastream.FetchErrorsRequest], operations_pb2.Operation]:
657
+ r"""Return a callable for the fetch errors method over gRPC.
658
+
659
+ Use this method to fetch any errors associated with a
660
+ stream.
661
+
662
+ Returns:
663
+ Callable[[~.FetchErrorsRequest],
664
+ ~.Operation]:
665
+ A function that, when called, will call the underlying RPC
666
+ on the server.
667
+ """
668
+ # Generate a "stub function" on-the-fly which will actually make
669
+ # the request.
670
+ # gRPC handles serialization and deserialization, so we just need
671
+ # to pass in the functions for each.
672
+ if "fetch_errors" not in self._stubs:
673
+ self._stubs["fetch_errors"] = self._logged_channel.unary_unary(
674
+ "/google.cloud.datastream.v1alpha1.Datastream/FetchErrors",
675
+ request_serializer=datastream.FetchErrorsRequest.serialize,
676
+ response_deserializer=operations_pb2.Operation.FromString,
677
+ )
678
+ return self._stubs["fetch_errors"]
679
+
680
+ @property
681
+ def fetch_static_ips(
682
+ self,
683
+ ) -> Callable[
684
+ [datastream.FetchStaticIpsRequest], datastream.FetchStaticIpsResponse
685
+ ]:
686
+ r"""Return a callable for the fetch static ips method over gRPC.
687
+
688
+ The FetchStaticIps API call exposes the static ips
689
+ used by Datastream. Typically, a request returns
690
+ children data objects under a parent data object that's
691
+ optionally supplied in the request.
692
+
693
+ Returns:
694
+ Callable[[~.FetchStaticIpsRequest],
695
+ ~.FetchStaticIpsResponse]:
696
+ A function that, when called, will call the underlying RPC
697
+ on the server.
698
+ """
699
+ # Generate a "stub function" on-the-fly which will actually make
700
+ # the request.
701
+ # gRPC handles serialization and deserialization, so we just need
702
+ # to pass in the functions for each.
703
+ if "fetch_static_ips" not in self._stubs:
704
+ self._stubs["fetch_static_ips"] = self._logged_channel.unary_unary(
705
+ "/google.cloud.datastream.v1alpha1.Datastream/FetchStaticIps",
706
+ request_serializer=datastream.FetchStaticIpsRequest.serialize,
707
+ response_deserializer=datastream.FetchStaticIpsResponse.deserialize,
708
+ )
709
+ return self._stubs["fetch_static_ips"]
710
+
711
+ @property
712
+ def create_private_connection(
713
+ self,
714
+ ) -> Callable[
715
+ [datastream.CreatePrivateConnectionRequest], operations_pb2.Operation
716
+ ]:
717
+ r"""Return a callable for the create private connection method over gRPC.
718
+
719
+ Use this method to create a private connectivity
720
+ configuration.
721
+
722
+ Returns:
723
+ Callable[[~.CreatePrivateConnectionRequest],
724
+ ~.Operation]:
725
+ A function that, when called, will call the underlying RPC
726
+ on the server.
727
+ """
728
+ # Generate a "stub function" on-the-fly which will actually make
729
+ # the request.
730
+ # gRPC handles serialization and deserialization, so we just need
731
+ # to pass in the functions for each.
732
+ if "create_private_connection" not in self._stubs:
733
+ self._stubs["create_private_connection"] = self._logged_channel.unary_unary(
734
+ "/google.cloud.datastream.v1alpha1.Datastream/CreatePrivateConnection",
735
+ request_serializer=datastream.CreatePrivateConnectionRequest.serialize,
736
+ response_deserializer=operations_pb2.Operation.FromString,
737
+ )
738
+ return self._stubs["create_private_connection"]
739
+
740
+ @property
741
+ def get_private_connection(
742
+ self,
743
+ ) -> Callable[
744
+ [datastream.GetPrivateConnectionRequest], datastream_resources.PrivateConnection
745
+ ]:
746
+ r"""Return a callable for the get private connection method over gRPC.
747
+
748
+ Use this method to get details about a private
749
+ connectivity configuration.
750
+
751
+ Returns:
752
+ Callable[[~.GetPrivateConnectionRequest],
753
+ ~.PrivateConnection]:
754
+ A function that, when called, will call the underlying RPC
755
+ on the server.
756
+ """
757
+ # Generate a "stub function" on-the-fly which will actually make
758
+ # the request.
759
+ # gRPC handles serialization and deserialization, so we just need
760
+ # to pass in the functions for each.
761
+ if "get_private_connection" not in self._stubs:
762
+ self._stubs["get_private_connection"] = self._logged_channel.unary_unary(
763
+ "/google.cloud.datastream.v1alpha1.Datastream/GetPrivateConnection",
764
+ request_serializer=datastream.GetPrivateConnectionRequest.serialize,
765
+ response_deserializer=datastream_resources.PrivateConnection.deserialize,
766
+ )
767
+ return self._stubs["get_private_connection"]
768
+
769
+ @property
770
+ def list_private_connections(
771
+ self,
772
+ ) -> Callable[
773
+ [datastream.ListPrivateConnectionsRequest],
774
+ datastream.ListPrivateConnectionsResponse,
775
+ ]:
776
+ r"""Return a callable for the list private connections method over gRPC.
777
+
778
+ Use this method to list private connectivity
779
+ configurations in a project and location.
780
+
781
+ Returns:
782
+ Callable[[~.ListPrivateConnectionsRequest],
783
+ ~.ListPrivateConnectionsResponse]:
784
+ A function that, when called, will call the underlying RPC
785
+ on the server.
786
+ """
787
+ # Generate a "stub function" on-the-fly which will actually make
788
+ # the request.
789
+ # gRPC handles serialization and deserialization, so we just need
790
+ # to pass in the functions for each.
791
+ if "list_private_connections" not in self._stubs:
792
+ self._stubs["list_private_connections"] = self._logged_channel.unary_unary(
793
+ "/google.cloud.datastream.v1alpha1.Datastream/ListPrivateConnections",
794
+ request_serializer=datastream.ListPrivateConnectionsRequest.serialize,
795
+ response_deserializer=datastream.ListPrivateConnectionsResponse.deserialize,
796
+ )
797
+ return self._stubs["list_private_connections"]
798
+
799
+ @property
800
+ def delete_private_connection(
801
+ self,
802
+ ) -> Callable[
803
+ [datastream.DeletePrivateConnectionRequest], operations_pb2.Operation
804
+ ]:
805
+ r"""Return a callable for the delete private connection method over gRPC.
806
+
807
+ Use this method to delete a private connectivity
808
+ configuration.
809
+
810
+ Returns:
811
+ Callable[[~.DeletePrivateConnectionRequest],
812
+ ~.Operation]:
813
+ A function that, when called, will call the underlying RPC
814
+ on the server.
815
+ """
816
+ # Generate a "stub function" on-the-fly which will actually make
817
+ # the request.
818
+ # gRPC handles serialization and deserialization, so we just need
819
+ # to pass in the functions for each.
820
+ if "delete_private_connection" not in self._stubs:
821
+ self._stubs["delete_private_connection"] = self._logged_channel.unary_unary(
822
+ "/google.cloud.datastream.v1alpha1.Datastream/DeletePrivateConnection",
823
+ request_serializer=datastream.DeletePrivateConnectionRequest.serialize,
824
+ response_deserializer=operations_pb2.Operation.FromString,
825
+ )
826
+ return self._stubs["delete_private_connection"]
827
+
828
+ @property
829
+ def create_route(
830
+ self,
831
+ ) -> Callable[[datastream.CreateRouteRequest], operations_pb2.Operation]:
832
+ r"""Return a callable for the create route method over gRPC.
833
+
834
+ Use this method to create a route for a private
835
+ connectivity in a project and location.
836
+
837
+ Returns:
838
+ Callable[[~.CreateRouteRequest],
839
+ ~.Operation]:
840
+ A function that, when called, will call the underlying RPC
841
+ on the server.
842
+ """
843
+ # Generate a "stub function" on-the-fly which will actually make
844
+ # the request.
845
+ # gRPC handles serialization and deserialization, so we just need
846
+ # to pass in the functions for each.
847
+ if "create_route" not in self._stubs:
848
+ self._stubs["create_route"] = self._logged_channel.unary_unary(
849
+ "/google.cloud.datastream.v1alpha1.Datastream/CreateRoute",
850
+ request_serializer=datastream.CreateRouteRequest.serialize,
851
+ response_deserializer=operations_pb2.Operation.FromString,
852
+ )
853
+ return self._stubs["create_route"]
854
+
855
+ @property
856
+ def get_route(
857
+ self,
858
+ ) -> Callable[[datastream.GetRouteRequest], datastream_resources.Route]:
859
+ r"""Return a callable for the get route method over gRPC.
860
+
861
+ Use this method to get details about a route.
862
+
863
+ Returns:
864
+ Callable[[~.GetRouteRequest],
865
+ ~.Route]:
866
+ A function that, when called, will call the underlying RPC
867
+ on the server.
868
+ """
869
+ # Generate a "stub function" on-the-fly which will actually make
870
+ # the request.
871
+ # gRPC handles serialization and deserialization, so we just need
872
+ # to pass in the functions for each.
873
+ if "get_route" not in self._stubs:
874
+ self._stubs["get_route"] = self._logged_channel.unary_unary(
875
+ "/google.cloud.datastream.v1alpha1.Datastream/GetRoute",
876
+ request_serializer=datastream.GetRouteRequest.serialize,
877
+ response_deserializer=datastream_resources.Route.deserialize,
878
+ )
879
+ return self._stubs["get_route"]
880
+
881
+ @property
882
+ def list_routes(
883
+ self,
884
+ ) -> Callable[[datastream.ListRoutesRequest], datastream.ListRoutesResponse]:
885
+ r"""Return a callable for the list routes method over gRPC.
886
+
887
+ Use this method to list routes created for a private
888
+ connectivity in a project and location.
889
+
890
+ Returns:
891
+ Callable[[~.ListRoutesRequest],
892
+ ~.ListRoutesResponse]:
893
+ A function that, when called, will call the underlying RPC
894
+ on the server.
895
+ """
896
+ # Generate a "stub function" on-the-fly which will actually make
897
+ # the request.
898
+ # gRPC handles serialization and deserialization, so we just need
899
+ # to pass in the functions for each.
900
+ if "list_routes" not in self._stubs:
901
+ self._stubs["list_routes"] = self._logged_channel.unary_unary(
902
+ "/google.cloud.datastream.v1alpha1.Datastream/ListRoutes",
903
+ request_serializer=datastream.ListRoutesRequest.serialize,
904
+ response_deserializer=datastream.ListRoutesResponse.deserialize,
905
+ )
906
+ return self._stubs["list_routes"]
907
+
908
+ @property
909
+ def delete_route(
910
+ self,
911
+ ) -> Callable[[datastream.DeleteRouteRequest], operations_pb2.Operation]:
912
+ r"""Return a callable for the delete route method over gRPC.
913
+
914
+ Use this method to delete a route.
915
+
916
+ Returns:
917
+ Callable[[~.DeleteRouteRequest],
918
+ ~.Operation]:
919
+ A function that, when called, will call the underlying RPC
920
+ on the server.
921
+ """
922
+ # Generate a "stub function" on-the-fly which will actually make
923
+ # the request.
924
+ # gRPC handles serialization and deserialization, so we just need
925
+ # to pass in the functions for each.
926
+ if "delete_route" not in self._stubs:
927
+ self._stubs["delete_route"] = self._logged_channel.unary_unary(
928
+ "/google.cloud.datastream.v1alpha1.Datastream/DeleteRoute",
929
+ request_serializer=datastream.DeleteRouteRequest.serialize,
930
+ response_deserializer=operations_pb2.Operation.FromString,
931
+ )
932
+ return self._stubs["delete_route"]
933
+
934
+ def close(self):
935
+ self._logged_channel.close()
936
+
937
+ @property
938
+ def kind(self) -> str:
939
+ return "grpc"
940
+
941
+
942
+ __all__ = ("DatastreamGrpcTransport",)