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,36 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ from collections import OrderedDict
17
+ from typing import Dict, Type
18
+
19
+ from .base import DatastreamTransport
20
+ from .grpc import DatastreamGrpcTransport
21
+ from .grpc_asyncio import DatastreamGrpcAsyncIOTransport
22
+ from .rest import DatastreamRestInterceptor, DatastreamRestTransport
23
+
24
+ # Compile a registry of transports.
25
+ _transport_registry = OrderedDict() # type: Dict[str, Type[DatastreamTransport]]
26
+ _transport_registry["grpc"] = DatastreamGrpcTransport
27
+ _transport_registry["grpc_asyncio"] = DatastreamGrpcAsyncIOTransport
28
+ _transport_registry["rest"] = DatastreamRestTransport
29
+
30
+ __all__ = (
31
+ "DatastreamTransport",
32
+ "DatastreamGrpcTransport",
33
+ "DatastreamGrpcAsyncIOTransport",
34
+ "DatastreamRestTransport",
35
+ "DatastreamRestInterceptor",
36
+ )
@@ -0,0 +1,467 @@
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 abc
17
+ from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
18
+
19
+ import google.api_core
20
+ from google.api_core import exceptions as core_exceptions
21
+ from google.api_core import gapic_v1, operations_v1
22
+ from google.api_core import retry as retries
23
+ import google.auth # type: ignore
24
+ from google.auth import credentials as ga_credentials # type: ignore
25
+ from google.longrunning import operations_pb2 # type: ignore
26
+ from google.oauth2 import service_account # type: ignore
27
+
28
+ from google.cloud.datastream_v1alpha1 import gapic_version as package_version
29
+ from google.cloud.datastream_v1alpha1.types import datastream, datastream_resources
30
+
31
+ DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
32
+ gapic_version=package_version.__version__
33
+ )
34
+
35
+
36
+ class DatastreamTransport(abc.ABC):
37
+ """Abstract transport class for Datastream."""
38
+
39
+ AUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",)
40
+
41
+ DEFAULT_HOST: str = "datastream.googleapis.com"
42
+
43
+ def __init__(
44
+ self,
45
+ *,
46
+ host: str = DEFAULT_HOST,
47
+ credentials: Optional[ga_credentials.Credentials] = None,
48
+ credentials_file: Optional[str] = None,
49
+ scopes: Optional[Sequence[str]] = None,
50
+ quota_project_id: Optional[str] = None,
51
+ client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
52
+ always_use_jwt_access: Optional[bool] = False,
53
+ api_audience: Optional[str] = None,
54
+ **kwargs,
55
+ ) -> None:
56
+ """Instantiate the transport.
57
+
58
+ Args:
59
+ host (Optional[str]):
60
+ The hostname to connect to (default: 'datastream.googleapis.com').
61
+ credentials (Optional[google.auth.credentials.Credentials]): The
62
+ authorization credentials to attach to requests. These
63
+ credentials identify the application to the service; if none
64
+ are specified, the client will attempt to ascertain the
65
+ credentials from the environment.
66
+ credentials_file (Optional[str]): A file with credentials that can
67
+ be loaded with :func:`google.auth.load_credentials_from_file`.
68
+ This argument is mutually exclusive with credentials.
69
+ scopes (Optional[Sequence[str]]): A list of scopes.
70
+ quota_project_id (Optional[str]): An optional project to use for billing
71
+ and quota.
72
+ client_info (google.api_core.gapic_v1.client_info.ClientInfo):
73
+ The client info used to send a user-agent string along with
74
+ API requests. If ``None``, then default info will be used.
75
+ Generally, you only need to set this if you're developing
76
+ your own client library.
77
+ always_use_jwt_access (Optional[bool]): Whether self signed JWT should
78
+ be used for service account credentials.
79
+ """
80
+
81
+ scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
82
+
83
+ # Save the scopes.
84
+ self._scopes = scopes
85
+ if not hasattr(self, "_ignore_credentials"):
86
+ self._ignore_credentials: bool = False
87
+
88
+ # If no credentials are provided, then determine the appropriate
89
+ # defaults.
90
+ if credentials and credentials_file:
91
+ raise core_exceptions.DuplicateCredentialArgs(
92
+ "'credentials_file' and 'credentials' are mutually exclusive"
93
+ )
94
+
95
+ if credentials_file is not None:
96
+ credentials, _ = google.auth.load_credentials_from_file(
97
+ credentials_file, **scopes_kwargs, quota_project_id=quota_project_id
98
+ )
99
+ elif credentials is None and not self._ignore_credentials:
100
+ credentials, _ = google.auth.default(
101
+ **scopes_kwargs, quota_project_id=quota_project_id
102
+ )
103
+ # Don't apply audience if the credentials file passed from user.
104
+ if hasattr(credentials, "with_gdch_audience"):
105
+ credentials = credentials.with_gdch_audience(
106
+ api_audience if api_audience else host
107
+ )
108
+
109
+ # If the credentials are service account credentials, then always try to use self signed JWT.
110
+ if (
111
+ always_use_jwt_access
112
+ and isinstance(credentials, service_account.Credentials)
113
+ and hasattr(service_account.Credentials, "with_always_use_jwt_access")
114
+ ):
115
+ credentials = credentials.with_always_use_jwt_access(True)
116
+
117
+ # Save the credentials.
118
+ self._credentials = credentials
119
+
120
+ # Save the hostname. Default to port 443 (HTTPS) if none is specified.
121
+ if ":" not in host:
122
+ host += ":443"
123
+ self._host = host
124
+
125
+ @property
126
+ def host(self):
127
+ return self._host
128
+
129
+ def _prep_wrapped_messages(self, client_info):
130
+ # Precompute the wrapped methods.
131
+ self._wrapped_methods = {
132
+ self.list_connection_profiles: gapic_v1.method.wrap_method(
133
+ self.list_connection_profiles,
134
+ default_timeout=None,
135
+ client_info=client_info,
136
+ ),
137
+ self.get_connection_profile: gapic_v1.method.wrap_method(
138
+ self.get_connection_profile,
139
+ default_timeout=None,
140
+ client_info=client_info,
141
+ ),
142
+ self.create_connection_profile: gapic_v1.method.wrap_method(
143
+ self.create_connection_profile,
144
+ default_timeout=60.0,
145
+ client_info=client_info,
146
+ ),
147
+ self.update_connection_profile: gapic_v1.method.wrap_method(
148
+ self.update_connection_profile,
149
+ default_timeout=60.0,
150
+ client_info=client_info,
151
+ ),
152
+ self.delete_connection_profile: gapic_v1.method.wrap_method(
153
+ self.delete_connection_profile,
154
+ default_timeout=60.0,
155
+ client_info=client_info,
156
+ ),
157
+ self.discover_connection_profile: gapic_v1.method.wrap_method(
158
+ self.discover_connection_profile,
159
+ default_timeout=None,
160
+ client_info=client_info,
161
+ ),
162
+ self.list_streams: gapic_v1.method.wrap_method(
163
+ self.list_streams,
164
+ default_timeout=None,
165
+ client_info=client_info,
166
+ ),
167
+ self.get_stream: gapic_v1.method.wrap_method(
168
+ self.get_stream,
169
+ default_timeout=None,
170
+ client_info=client_info,
171
+ ),
172
+ self.create_stream: gapic_v1.method.wrap_method(
173
+ self.create_stream,
174
+ default_timeout=60.0,
175
+ client_info=client_info,
176
+ ),
177
+ self.update_stream: gapic_v1.method.wrap_method(
178
+ self.update_stream,
179
+ default_timeout=60.0,
180
+ client_info=client_info,
181
+ ),
182
+ self.delete_stream: gapic_v1.method.wrap_method(
183
+ self.delete_stream,
184
+ default_timeout=60.0,
185
+ client_info=client_info,
186
+ ),
187
+ self.fetch_errors: gapic_v1.method.wrap_method(
188
+ self.fetch_errors,
189
+ default_timeout=None,
190
+ client_info=client_info,
191
+ ),
192
+ self.fetch_static_ips: gapic_v1.method.wrap_method(
193
+ self.fetch_static_ips,
194
+ default_timeout=None,
195
+ client_info=client_info,
196
+ ),
197
+ self.create_private_connection: gapic_v1.method.wrap_method(
198
+ self.create_private_connection,
199
+ default_timeout=60.0,
200
+ client_info=client_info,
201
+ ),
202
+ self.get_private_connection: gapic_v1.method.wrap_method(
203
+ self.get_private_connection,
204
+ default_timeout=None,
205
+ client_info=client_info,
206
+ ),
207
+ self.list_private_connections: gapic_v1.method.wrap_method(
208
+ self.list_private_connections,
209
+ default_timeout=None,
210
+ client_info=client_info,
211
+ ),
212
+ self.delete_private_connection: gapic_v1.method.wrap_method(
213
+ self.delete_private_connection,
214
+ default_timeout=60.0,
215
+ client_info=client_info,
216
+ ),
217
+ self.create_route: gapic_v1.method.wrap_method(
218
+ self.create_route,
219
+ default_timeout=60.0,
220
+ client_info=client_info,
221
+ ),
222
+ self.get_route: gapic_v1.method.wrap_method(
223
+ self.get_route,
224
+ default_timeout=None,
225
+ client_info=client_info,
226
+ ),
227
+ self.list_routes: gapic_v1.method.wrap_method(
228
+ self.list_routes,
229
+ default_timeout=None,
230
+ client_info=client_info,
231
+ ),
232
+ self.delete_route: gapic_v1.method.wrap_method(
233
+ self.delete_route,
234
+ default_timeout=60.0,
235
+ client_info=client_info,
236
+ ),
237
+ }
238
+
239
+ def close(self):
240
+ """Closes resources associated with the transport.
241
+
242
+ .. warning::
243
+ Only call this method if the transport is NOT shared
244
+ with other clients - this may cause errors in other clients!
245
+ """
246
+ raise NotImplementedError()
247
+
248
+ @property
249
+ def operations_client(self):
250
+ """Return the client designed to process long-running operations."""
251
+ raise NotImplementedError()
252
+
253
+ @property
254
+ def list_connection_profiles(
255
+ self,
256
+ ) -> Callable[
257
+ [datastream.ListConnectionProfilesRequest],
258
+ Union[
259
+ datastream.ListConnectionProfilesResponse,
260
+ Awaitable[datastream.ListConnectionProfilesResponse],
261
+ ],
262
+ ]:
263
+ raise NotImplementedError()
264
+
265
+ @property
266
+ def get_connection_profile(
267
+ self,
268
+ ) -> Callable[
269
+ [datastream.GetConnectionProfileRequest],
270
+ Union[
271
+ datastream_resources.ConnectionProfile,
272
+ Awaitable[datastream_resources.ConnectionProfile],
273
+ ],
274
+ ]:
275
+ raise NotImplementedError()
276
+
277
+ @property
278
+ def create_connection_profile(
279
+ self,
280
+ ) -> Callable[
281
+ [datastream.CreateConnectionProfileRequest],
282
+ Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
283
+ ]:
284
+ raise NotImplementedError()
285
+
286
+ @property
287
+ def update_connection_profile(
288
+ self,
289
+ ) -> Callable[
290
+ [datastream.UpdateConnectionProfileRequest],
291
+ Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
292
+ ]:
293
+ raise NotImplementedError()
294
+
295
+ @property
296
+ def delete_connection_profile(
297
+ self,
298
+ ) -> Callable[
299
+ [datastream.DeleteConnectionProfileRequest],
300
+ Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
301
+ ]:
302
+ raise NotImplementedError()
303
+
304
+ @property
305
+ def discover_connection_profile(
306
+ self,
307
+ ) -> Callable[
308
+ [datastream.DiscoverConnectionProfileRequest],
309
+ Union[
310
+ datastream.DiscoverConnectionProfileResponse,
311
+ Awaitable[datastream.DiscoverConnectionProfileResponse],
312
+ ],
313
+ ]:
314
+ raise NotImplementedError()
315
+
316
+ @property
317
+ def list_streams(
318
+ self,
319
+ ) -> Callable[
320
+ [datastream.ListStreamsRequest],
321
+ Union[
322
+ datastream.ListStreamsResponse, Awaitable[datastream.ListStreamsResponse]
323
+ ],
324
+ ]:
325
+ raise NotImplementedError()
326
+
327
+ @property
328
+ def get_stream(
329
+ self,
330
+ ) -> Callable[
331
+ [datastream.GetStreamRequest],
332
+ Union[datastream_resources.Stream, Awaitable[datastream_resources.Stream]],
333
+ ]:
334
+ raise NotImplementedError()
335
+
336
+ @property
337
+ def create_stream(
338
+ self,
339
+ ) -> Callable[
340
+ [datastream.CreateStreamRequest],
341
+ Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
342
+ ]:
343
+ raise NotImplementedError()
344
+
345
+ @property
346
+ def update_stream(
347
+ self,
348
+ ) -> Callable[
349
+ [datastream.UpdateStreamRequest],
350
+ Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
351
+ ]:
352
+ raise NotImplementedError()
353
+
354
+ @property
355
+ def delete_stream(
356
+ self,
357
+ ) -> Callable[
358
+ [datastream.DeleteStreamRequest],
359
+ Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
360
+ ]:
361
+ raise NotImplementedError()
362
+
363
+ @property
364
+ def fetch_errors(
365
+ self,
366
+ ) -> Callable[
367
+ [datastream.FetchErrorsRequest],
368
+ Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
369
+ ]:
370
+ raise NotImplementedError()
371
+
372
+ @property
373
+ def fetch_static_ips(
374
+ self,
375
+ ) -> Callable[
376
+ [datastream.FetchStaticIpsRequest],
377
+ Union[
378
+ datastream.FetchStaticIpsResponse,
379
+ Awaitable[datastream.FetchStaticIpsResponse],
380
+ ],
381
+ ]:
382
+ raise NotImplementedError()
383
+
384
+ @property
385
+ def create_private_connection(
386
+ self,
387
+ ) -> Callable[
388
+ [datastream.CreatePrivateConnectionRequest],
389
+ Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
390
+ ]:
391
+ raise NotImplementedError()
392
+
393
+ @property
394
+ def get_private_connection(
395
+ self,
396
+ ) -> Callable[
397
+ [datastream.GetPrivateConnectionRequest],
398
+ Union[
399
+ datastream_resources.PrivateConnection,
400
+ Awaitable[datastream_resources.PrivateConnection],
401
+ ],
402
+ ]:
403
+ raise NotImplementedError()
404
+
405
+ @property
406
+ def list_private_connections(
407
+ self,
408
+ ) -> Callable[
409
+ [datastream.ListPrivateConnectionsRequest],
410
+ Union[
411
+ datastream.ListPrivateConnectionsResponse,
412
+ Awaitable[datastream.ListPrivateConnectionsResponse],
413
+ ],
414
+ ]:
415
+ raise NotImplementedError()
416
+
417
+ @property
418
+ def delete_private_connection(
419
+ self,
420
+ ) -> Callable[
421
+ [datastream.DeletePrivateConnectionRequest],
422
+ Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
423
+ ]:
424
+ raise NotImplementedError()
425
+
426
+ @property
427
+ def create_route(
428
+ self,
429
+ ) -> Callable[
430
+ [datastream.CreateRouteRequest],
431
+ Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
432
+ ]:
433
+ raise NotImplementedError()
434
+
435
+ @property
436
+ def get_route(
437
+ self,
438
+ ) -> Callable[
439
+ [datastream.GetRouteRequest],
440
+ Union[datastream_resources.Route, Awaitable[datastream_resources.Route]],
441
+ ]:
442
+ raise NotImplementedError()
443
+
444
+ @property
445
+ def list_routes(
446
+ self,
447
+ ) -> Callable[
448
+ [datastream.ListRoutesRequest],
449
+ Union[datastream.ListRoutesResponse, Awaitable[datastream.ListRoutesResponse]],
450
+ ]:
451
+ raise NotImplementedError()
452
+
453
+ @property
454
+ def delete_route(
455
+ self,
456
+ ) -> Callable[
457
+ [datastream.DeleteRouteRequest],
458
+ Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
459
+ ]:
460
+ raise NotImplementedError()
461
+
462
+ @property
463
+ def kind(self) -> str:
464
+ raise NotImplementedError()
465
+
466
+
467
+ __all__ = ("DatastreamTransport",)