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,1591 @@
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 # type: ignore
17
+ import re
18
+ from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
19
+
20
+ from google.api_core import gapic_v1, path_template
21
+ from google.cloud.location import locations_pb2 # type: ignore
22
+ from google.iam.v1 import iam_policy_pb2 # type: ignore
23
+ from google.iam.v1 import policy_pb2 # type: ignore
24
+ from google.longrunning import operations_pb2 # type: ignore
25
+ from google.protobuf import json_format
26
+
27
+ from google.cloud.datastream_v1.types import datastream, datastream_resources
28
+
29
+ from .base import DEFAULT_CLIENT_INFO, DatastreamTransport
30
+
31
+
32
+ class _BaseDatastreamRestTransport(DatastreamTransport):
33
+ """Base REST backend transport for Datastream.
34
+
35
+ Note: This class is not meant to be used directly. Use its sync and
36
+ async sub-classes instead.
37
+
38
+ This class defines the same methods as the primary client, so the
39
+ primary client can load the underlying transport implementation
40
+ and call it.
41
+
42
+ It sends JSON representations of protocol buffers over HTTP/1.1
43
+ """
44
+
45
+ def __init__(
46
+ self,
47
+ *,
48
+ host: str = "datastream.googleapis.com",
49
+ credentials: Optional[Any] = None,
50
+ client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
51
+ always_use_jwt_access: Optional[bool] = False,
52
+ url_scheme: str = "https",
53
+ api_audience: Optional[str] = None,
54
+ ) -> None:
55
+ """Instantiate the transport.
56
+ Args:
57
+ host (Optional[str]):
58
+ The hostname to connect to (default: 'datastream.googleapis.com').
59
+ credentials (Optional[Any]): The
60
+ authorization credentials to attach to requests. These
61
+ credentials identify the application to the service; if none
62
+ are specified, the client will attempt to ascertain the
63
+ credentials from the environment.
64
+ client_info (google.api_core.gapic_v1.client_info.ClientInfo):
65
+ The client info used to send a user-agent string along with
66
+ API requests. If ``None``, then default info will be used.
67
+ Generally, you only need to set this if you are developing
68
+ your own client library.
69
+ always_use_jwt_access (Optional[bool]): Whether self signed JWT should
70
+ be used for service account credentials.
71
+ url_scheme: the protocol scheme for the API endpoint. Normally
72
+ "https", but for testing or local servers,
73
+ "http" can be specified.
74
+ """
75
+ # Run the base constructor
76
+ maybe_url_match = re.match("^(?P<scheme>http(?:s)?://)?(?P<host>.*)$", host)
77
+ if maybe_url_match is None:
78
+ raise ValueError(
79
+ f"Unexpected hostname structure: {host}"
80
+ ) # pragma: NO COVER
81
+
82
+ url_match_items = maybe_url_match.groupdict()
83
+
84
+ host = f"{url_scheme}://{host}" if not url_match_items["scheme"] else host
85
+
86
+ super().__init__(
87
+ host=host,
88
+ credentials=credentials,
89
+ client_info=client_info,
90
+ always_use_jwt_access=always_use_jwt_access,
91
+ api_audience=api_audience,
92
+ )
93
+
94
+ class _BaseCreateConnectionProfile:
95
+ def __hash__(self): # pragma: NO COVER
96
+ return NotImplementedError("__hash__ must be implemented.")
97
+
98
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {
99
+ "connectionProfileId": "",
100
+ }
101
+
102
+ @classmethod
103
+ def _get_unset_required_fields(cls, message_dict):
104
+ return {
105
+ k: v
106
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
107
+ if k not in message_dict
108
+ }
109
+
110
+ @staticmethod
111
+ def _get_http_options():
112
+ http_options: List[Dict[str, str]] = [
113
+ {
114
+ "method": "post",
115
+ "uri": "/v1/{parent=projects/*/locations/*}/connectionProfiles",
116
+ "body": "connection_profile",
117
+ },
118
+ ]
119
+ return http_options
120
+
121
+ @staticmethod
122
+ def _get_transcoded_request(http_options, request):
123
+ pb_request = datastream.CreateConnectionProfileRequest.pb(request)
124
+ transcoded_request = path_template.transcode(http_options, pb_request)
125
+ return transcoded_request
126
+
127
+ @staticmethod
128
+ def _get_request_body_json(transcoded_request):
129
+ # Jsonify the request body
130
+
131
+ body = json_format.MessageToJson(
132
+ transcoded_request["body"], use_integers_for_enums=True
133
+ )
134
+ return body
135
+
136
+ @staticmethod
137
+ def _get_query_params_json(transcoded_request):
138
+ query_params = json.loads(
139
+ json_format.MessageToJson(
140
+ transcoded_request["query_params"],
141
+ use_integers_for_enums=True,
142
+ )
143
+ )
144
+ query_params.update(
145
+ _BaseDatastreamRestTransport._BaseCreateConnectionProfile._get_unset_required_fields(
146
+ query_params
147
+ )
148
+ )
149
+
150
+ query_params["$alt"] = "json;enum-encoding=int"
151
+ return query_params
152
+
153
+ class _BaseCreatePrivateConnection:
154
+ def __hash__(self): # pragma: NO COVER
155
+ return NotImplementedError("__hash__ must be implemented.")
156
+
157
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {
158
+ "privateConnectionId": "",
159
+ }
160
+
161
+ @classmethod
162
+ def _get_unset_required_fields(cls, message_dict):
163
+ return {
164
+ k: v
165
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
166
+ if k not in message_dict
167
+ }
168
+
169
+ @staticmethod
170
+ def _get_http_options():
171
+ http_options: List[Dict[str, str]] = [
172
+ {
173
+ "method": "post",
174
+ "uri": "/v1/{parent=projects/*/locations/*}/privateConnections",
175
+ "body": "private_connection",
176
+ },
177
+ ]
178
+ return http_options
179
+
180
+ @staticmethod
181
+ def _get_transcoded_request(http_options, request):
182
+ pb_request = datastream.CreatePrivateConnectionRequest.pb(request)
183
+ transcoded_request = path_template.transcode(http_options, pb_request)
184
+ return transcoded_request
185
+
186
+ @staticmethod
187
+ def _get_request_body_json(transcoded_request):
188
+ # Jsonify the request body
189
+
190
+ body = json_format.MessageToJson(
191
+ transcoded_request["body"], use_integers_for_enums=True
192
+ )
193
+ return body
194
+
195
+ @staticmethod
196
+ def _get_query_params_json(transcoded_request):
197
+ query_params = json.loads(
198
+ json_format.MessageToJson(
199
+ transcoded_request["query_params"],
200
+ use_integers_for_enums=True,
201
+ )
202
+ )
203
+ query_params.update(
204
+ _BaseDatastreamRestTransport._BaseCreatePrivateConnection._get_unset_required_fields(
205
+ query_params
206
+ )
207
+ )
208
+
209
+ query_params["$alt"] = "json;enum-encoding=int"
210
+ return query_params
211
+
212
+ class _BaseCreateRoute:
213
+ def __hash__(self): # pragma: NO COVER
214
+ return NotImplementedError("__hash__ must be implemented.")
215
+
216
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {
217
+ "routeId": "",
218
+ }
219
+
220
+ @classmethod
221
+ def _get_unset_required_fields(cls, message_dict):
222
+ return {
223
+ k: v
224
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
225
+ if k not in message_dict
226
+ }
227
+
228
+ @staticmethod
229
+ def _get_http_options():
230
+ http_options: List[Dict[str, str]] = [
231
+ {
232
+ "method": "post",
233
+ "uri": "/v1/{parent=projects/*/locations/*/privateConnections/*}/routes",
234
+ "body": "route",
235
+ },
236
+ ]
237
+ return http_options
238
+
239
+ @staticmethod
240
+ def _get_transcoded_request(http_options, request):
241
+ pb_request = datastream.CreateRouteRequest.pb(request)
242
+ transcoded_request = path_template.transcode(http_options, pb_request)
243
+ return transcoded_request
244
+
245
+ @staticmethod
246
+ def _get_request_body_json(transcoded_request):
247
+ # Jsonify the request body
248
+
249
+ body = json_format.MessageToJson(
250
+ transcoded_request["body"], use_integers_for_enums=True
251
+ )
252
+ return body
253
+
254
+ @staticmethod
255
+ def _get_query_params_json(transcoded_request):
256
+ query_params = json.loads(
257
+ json_format.MessageToJson(
258
+ transcoded_request["query_params"],
259
+ use_integers_for_enums=True,
260
+ )
261
+ )
262
+ query_params.update(
263
+ _BaseDatastreamRestTransport._BaseCreateRoute._get_unset_required_fields(
264
+ query_params
265
+ )
266
+ )
267
+
268
+ query_params["$alt"] = "json;enum-encoding=int"
269
+ return query_params
270
+
271
+ class _BaseCreateStream:
272
+ def __hash__(self): # pragma: NO COVER
273
+ return NotImplementedError("__hash__ must be implemented.")
274
+
275
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {
276
+ "streamId": "",
277
+ }
278
+
279
+ @classmethod
280
+ def _get_unset_required_fields(cls, message_dict):
281
+ return {
282
+ k: v
283
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
284
+ if k not in message_dict
285
+ }
286
+
287
+ @staticmethod
288
+ def _get_http_options():
289
+ http_options: List[Dict[str, str]] = [
290
+ {
291
+ "method": "post",
292
+ "uri": "/v1/{parent=projects/*/locations/*}/streams",
293
+ "body": "stream",
294
+ },
295
+ ]
296
+ return http_options
297
+
298
+ @staticmethod
299
+ def _get_transcoded_request(http_options, request):
300
+ pb_request = datastream.CreateStreamRequest.pb(request)
301
+ transcoded_request = path_template.transcode(http_options, pb_request)
302
+ return transcoded_request
303
+
304
+ @staticmethod
305
+ def _get_request_body_json(transcoded_request):
306
+ # Jsonify the request body
307
+
308
+ body = json_format.MessageToJson(
309
+ transcoded_request["body"], use_integers_for_enums=True
310
+ )
311
+ return body
312
+
313
+ @staticmethod
314
+ def _get_query_params_json(transcoded_request):
315
+ query_params = json.loads(
316
+ json_format.MessageToJson(
317
+ transcoded_request["query_params"],
318
+ use_integers_for_enums=True,
319
+ )
320
+ )
321
+ query_params.update(
322
+ _BaseDatastreamRestTransport._BaseCreateStream._get_unset_required_fields(
323
+ query_params
324
+ )
325
+ )
326
+
327
+ query_params["$alt"] = "json;enum-encoding=int"
328
+ return query_params
329
+
330
+ class _BaseDeleteConnectionProfile:
331
+ def __hash__(self): # pragma: NO COVER
332
+ return NotImplementedError("__hash__ must be implemented.")
333
+
334
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
335
+
336
+ @classmethod
337
+ def _get_unset_required_fields(cls, message_dict):
338
+ return {
339
+ k: v
340
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
341
+ if k not in message_dict
342
+ }
343
+
344
+ @staticmethod
345
+ def _get_http_options():
346
+ http_options: List[Dict[str, str]] = [
347
+ {
348
+ "method": "delete",
349
+ "uri": "/v1/{name=projects/*/locations/*/connectionProfiles/*}",
350
+ },
351
+ ]
352
+ return http_options
353
+
354
+ @staticmethod
355
+ def _get_transcoded_request(http_options, request):
356
+ pb_request = datastream.DeleteConnectionProfileRequest.pb(request)
357
+ transcoded_request = path_template.transcode(http_options, pb_request)
358
+ return transcoded_request
359
+
360
+ @staticmethod
361
+ def _get_query_params_json(transcoded_request):
362
+ query_params = json.loads(
363
+ json_format.MessageToJson(
364
+ transcoded_request["query_params"],
365
+ use_integers_for_enums=True,
366
+ )
367
+ )
368
+ query_params.update(
369
+ _BaseDatastreamRestTransport._BaseDeleteConnectionProfile._get_unset_required_fields(
370
+ query_params
371
+ )
372
+ )
373
+
374
+ query_params["$alt"] = "json;enum-encoding=int"
375
+ return query_params
376
+
377
+ class _BaseDeletePrivateConnection:
378
+ def __hash__(self): # pragma: NO COVER
379
+ return NotImplementedError("__hash__ must be implemented.")
380
+
381
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
382
+
383
+ @classmethod
384
+ def _get_unset_required_fields(cls, message_dict):
385
+ return {
386
+ k: v
387
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
388
+ if k not in message_dict
389
+ }
390
+
391
+ @staticmethod
392
+ def _get_http_options():
393
+ http_options: List[Dict[str, str]] = [
394
+ {
395
+ "method": "delete",
396
+ "uri": "/v1/{name=projects/*/locations/*/privateConnections/*}",
397
+ },
398
+ ]
399
+ return http_options
400
+
401
+ @staticmethod
402
+ def _get_transcoded_request(http_options, request):
403
+ pb_request = datastream.DeletePrivateConnectionRequest.pb(request)
404
+ transcoded_request = path_template.transcode(http_options, pb_request)
405
+ return transcoded_request
406
+
407
+ @staticmethod
408
+ def _get_query_params_json(transcoded_request):
409
+ query_params = json.loads(
410
+ json_format.MessageToJson(
411
+ transcoded_request["query_params"],
412
+ use_integers_for_enums=True,
413
+ )
414
+ )
415
+ query_params.update(
416
+ _BaseDatastreamRestTransport._BaseDeletePrivateConnection._get_unset_required_fields(
417
+ query_params
418
+ )
419
+ )
420
+
421
+ query_params["$alt"] = "json;enum-encoding=int"
422
+ return query_params
423
+
424
+ class _BaseDeleteRoute:
425
+ def __hash__(self): # pragma: NO COVER
426
+ return NotImplementedError("__hash__ must be implemented.")
427
+
428
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
429
+
430
+ @classmethod
431
+ def _get_unset_required_fields(cls, message_dict):
432
+ return {
433
+ k: v
434
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
435
+ if k not in message_dict
436
+ }
437
+
438
+ @staticmethod
439
+ def _get_http_options():
440
+ http_options: List[Dict[str, str]] = [
441
+ {
442
+ "method": "delete",
443
+ "uri": "/v1/{name=projects/*/locations/*/privateConnections/*/routes/*}",
444
+ },
445
+ ]
446
+ return http_options
447
+
448
+ @staticmethod
449
+ def _get_transcoded_request(http_options, request):
450
+ pb_request = datastream.DeleteRouteRequest.pb(request)
451
+ transcoded_request = path_template.transcode(http_options, pb_request)
452
+ return transcoded_request
453
+
454
+ @staticmethod
455
+ def _get_query_params_json(transcoded_request):
456
+ query_params = json.loads(
457
+ json_format.MessageToJson(
458
+ transcoded_request["query_params"],
459
+ use_integers_for_enums=True,
460
+ )
461
+ )
462
+ query_params.update(
463
+ _BaseDatastreamRestTransport._BaseDeleteRoute._get_unset_required_fields(
464
+ query_params
465
+ )
466
+ )
467
+
468
+ query_params["$alt"] = "json;enum-encoding=int"
469
+ return query_params
470
+
471
+ class _BaseDeleteStream:
472
+ def __hash__(self): # pragma: NO COVER
473
+ return NotImplementedError("__hash__ must be implemented.")
474
+
475
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
476
+
477
+ @classmethod
478
+ def _get_unset_required_fields(cls, message_dict):
479
+ return {
480
+ k: v
481
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
482
+ if k not in message_dict
483
+ }
484
+
485
+ @staticmethod
486
+ def _get_http_options():
487
+ http_options: List[Dict[str, str]] = [
488
+ {
489
+ "method": "delete",
490
+ "uri": "/v1/{name=projects/*/locations/*/streams/*}",
491
+ },
492
+ ]
493
+ return http_options
494
+
495
+ @staticmethod
496
+ def _get_transcoded_request(http_options, request):
497
+ pb_request = datastream.DeleteStreamRequest.pb(request)
498
+ transcoded_request = path_template.transcode(http_options, pb_request)
499
+ return transcoded_request
500
+
501
+ @staticmethod
502
+ def _get_query_params_json(transcoded_request):
503
+ query_params = json.loads(
504
+ json_format.MessageToJson(
505
+ transcoded_request["query_params"],
506
+ use_integers_for_enums=True,
507
+ )
508
+ )
509
+ query_params.update(
510
+ _BaseDatastreamRestTransport._BaseDeleteStream._get_unset_required_fields(
511
+ query_params
512
+ )
513
+ )
514
+
515
+ query_params["$alt"] = "json;enum-encoding=int"
516
+ return query_params
517
+
518
+ class _BaseDiscoverConnectionProfile:
519
+ def __hash__(self): # pragma: NO COVER
520
+ return NotImplementedError("__hash__ must be implemented.")
521
+
522
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
523
+
524
+ @classmethod
525
+ def _get_unset_required_fields(cls, message_dict):
526
+ return {
527
+ k: v
528
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
529
+ if k not in message_dict
530
+ }
531
+
532
+ @staticmethod
533
+ def _get_http_options():
534
+ http_options: List[Dict[str, str]] = [
535
+ {
536
+ "method": "post",
537
+ "uri": "/v1/{parent=projects/*/locations/*}/connectionProfiles:discover",
538
+ "body": "*",
539
+ },
540
+ ]
541
+ return http_options
542
+
543
+ @staticmethod
544
+ def _get_transcoded_request(http_options, request):
545
+ pb_request = datastream.DiscoverConnectionProfileRequest.pb(request)
546
+ transcoded_request = path_template.transcode(http_options, pb_request)
547
+ return transcoded_request
548
+
549
+ @staticmethod
550
+ def _get_request_body_json(transcoded_request):
551
+ # Jsonify the request body
552
+
553
+ body = json_format.MessageToJson(
554
+ transcoded_request["body"], use_integers_for_enums=True
555
+ )
556
+ return body
557
+
558
+ @staticmethod
559
+ def _get_query_params_json(transcoded_request):
560
+ query_params = json.loads(
561
+ json_format.MessageToJson(
562
+ transcoded_request["query_params"],
563
+ use_integers_for_enums=True,
564
+ )
565
+ )
566
+ query_params.update(
567
+ _BaseDatastreamRestTransport._BaseDiscoverConnectionProfile._get_unset_required_fields(
568
+ query_params
569
+ )
570
+ )
571
+
572
+ query_params["$alt"] = "json;enum-encoding=int"
573
+ return query_params
574
+
575
+ class _BaseFetchStaticIps:
576
+ def __hash__(self): # pragma: NO COVER
577
+ return NotImplementedError("__hash__ must be implemented.")
578
+
579
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
580
+
581
+ @classmethod
582
+ def _get_unset_required_fields(cls, message_dict):
583
+ return {
584
+ k: v
585
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
586
+ if k not in message_dict
587
+ }
588
+
589
+ @staticmethod
590
+ def _get_http_options():
591
+ http_options: List[Dict[str, str]] = [
592
+ {
593
+ "method": "get",
594
+ "uri": "/v1/{name=projects/*/locations/*}:fetchStaticIps",
595
+ },
596
+ ]
597
+ return http_options
598
+
599
+ @staticmethod
600
+ def _get_transcoded_request(http_options, request):
601
+ pb_request = datastream.FetchStaticIpsRequest.pb(request)
602
+ transcoded_request = path_template.transcode(http_options, pb_request)
603
+ return transcoded_request
604
+
605
+ @staticmethod
606
+ def _get_query_params_json(transcoded_request):
607
+ query_params = json.loads(
608
+ json_format.MessageToJson(
609
+ transcoded_request["query_params"],
610
+ use_integers_for_enums=True,
611
+ )
612
+ )
613
+ query_params.update(
614
+ _BaseDatastreamRestTransport._BaseFetchStaticIps._get_unset_required_fields(
615
+ query_params
616
+ )
617
+ )
618
+
619
+ query_params["$alt"] = "json;enum-encoding=int"
620
+ return query_params
621
+
622
+ class _BaseGetConnectionProfile:
623
+ def __hash__(self): # pragma: NO COVER
624
+ return NotImplementedError("__hash__ must be implemented.")
625
+
626
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
627
+
628
+ @classmethod
629
+ def _get_unset_required_fields(cls, message_dict):
630
+ return {
631
+ k: v
632
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
633
+ if k not in message_dict
634
+ }
635
+
636
+ @staticmethod
637
+ def _get_http_options():
638
+ http_options: List[Dict[str, str]] = [
639
+ {
640
+ "method": "get",
641
+ "uri": "/v1/{name=projects/*/locations/*/connectionProfiles/*}",
642
+ },
643
+ ]
644
+ return http_options
645
+
646
+ @staticmethod
647
+ def _get_transcoded_request(http_options, request):
648
+ pb_request = datastream.GetConnectionProfileRequest.pb(request)
649
+ transcoded_request = path_template.transcode(http_options, pb_request)
650
+ return transcoded_request
651
+
652
+ @staticmethod
653
+ def _get_query_params_json(transcoded_request):
654
+ query_params = json.loads(
655
+ json_format.MessageToJson(
656
+ transcoded_request["query_params"],
657
+ use_integers_for_enums=True,
658
+ )
659
+ )
660
+ query_params.update(
661
+ _BaseDatastreamRestTransport._BaseGetConnectionProfile._get_unset_required_fields(
662
+ query_params
663
+ )
664
+ )
665
+
666
+ query_params["$alt"] = "json;enum-encoding=int"
667
+ return query_params
668
+
669
+ class _BaseGetPrivateConnection:
670
+ def __hash__(self): # pragma: NO COVER
671
+ return NotImplementedError("__hash__ must be implemented.")
672
+
673
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
674
+
675
+ @classmethod
676
+ def _get_unset_required_fields(cls, message_dict):
677
+ return {
678
+ k: v
679
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
680
+ if k not in message_dict
681
+ }
682
+
683
+ @staticmethod
684
+ def _get_http_options():
685
+ http_options: List[Dict[str, str]] = [
686
+ {
687
+ "method": "get",
688
+ "uri": "/v1/{name=projects/*/locations/*/privateConnections/*}",
689
+ },
690
+ ]
691
+ return http_options
692
+
693
+ @staticmethod
694
+ def _get_transcoded_request(http_options, request):
695
+ pb_request = datastream.GetPrivateConnectionRequest.pb(request)
696
+ transcoded_request = path_template.transcode(http_options, pb_request)
697
+ return transcoded_request
698
+
699
+ @staticmethod
700
+ def _get_query_params_json(transcoded_request):
701
+ query_params = json.loads(
702
+ json_format.MessageToJson(
703
+ transcoded_request["query_params"],
704
+ use_integers_for_enums=True,
705
+ )
706
+ )
707
+ query_params.update(
708
+ _BaseDatastreamRestTransport._BaseGetPrivateConnection._get_unset_required_fields(
709
+ query_params
710
+ )
711
+ )
712
+
713
+ query_params["$alt"] = "json;enum-encoding=int"
714
+ return query_params
715
+
716
+ class _BaseGetRoute:
717
+ def __hash__(self): # pragma: NO COVER
718
+ return NotImplementedError("__hash__ must be implemented.")
719
+
720
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
721
+
722
+ @classmethod
723
+ def _get_unset_required_fields(cls, message_dict):
724
+ return {
725
+ k: v
726
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
727
+ if k not in message_dict
728
+ }
729
+
730
+ @staticmethod
731
+ def _get_http_options():
732
+ http_options: List[Dict[str, str]] = [
733
+ {
734
+ "method": "get",
735
+ "uri": "/v1/{name=projects/*/locations/*/privateConnections/*/routes/*}",
736
+ },
737
+ ]
738
+ return http_options
739
+
740
+ @staticmethod
741
+ def _get_transcoded_request(http_options, request):
742
+ pb_request = datastream.GetRouteRequest.pb(request)
743
+ transcoded_request = path_template.transcode(http_options, pb_request)
744
+ return transcoded_request
745
+
746
+ @staticmethod
747
+ def _get_query_params_json(transcoded_request):
748
+ query_params = json.loads(
749
+ json_format.MessageToJson(
750
+ transcoded_request["query_params"],
751
+ use_integers_for_enums=True,
752
+ )
753
+ )
754
+ query_params.update(
755
+ _BaseDatastreamRestTransport._BaseGetRoute._get_unset_required_fields(
756
+ query_params
757
+ )
758
+ )
759
+
760
+ query_params["$alt"] = "json;enum-encoding=int"
761
+ return query_params
762
+
763
+ class _BaseGetStream:
764
+ def __hash__(self): # pragma: NO COVER
765
+ return NotImplementedError("__hash__ must be implemented.")
766
+
767
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
768
+
769
+ @classmethod
770
+ def _get_unset_required_fields(cls, message_dict):
771
+ return {
772
+ k: v
773
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
774
+ if k not in message_dict
775
+ }
776
+
777
+ @staticmethod
778
+ def _get_http_options():
779
+ http_options: List[Dict[str, str]] = [
780
+ {
781
+ "method": "get",
782
+ "uri": "/v1/{name=projects/*/locations/*/streams/*}",
783
+ },
784
+ ]
785
+ return http_options
786
+
787
+ @staticmethod
788
+ def _get_transcoded_request(http_options, request):
789
+ pb_request = datastream.GetStreamRequest.pb(request)
790
+ transcoded_request = path_template.transcode(http_options, pb_request)
791
+ return transcoded_request
792
+
793
+ @staticmethod
794
+ def _get_query_params_json(transcoded_request):
795
+ query_params = json.loads(
796
+ json_format.MessageToJson(
797
+ transcoded_request["query_params"],
798
+ use_integers_for_enums=True,
799
+ )
800
+ )
801
+ query_params.update(
802
+ _BaseDatastreamRestTransport._BaseGetStream._get_unset_required_fields(
803
+ query_params
804
+ )
805
+ )
806
+
807
+ query_params["$alt"] = "json;enum-encoding=int"
808
+ return query_params
809
+
810
+ class _BaseGetStreamObject:
811
+ def __hash__(self): # pragma: NO COVER
812
+ return NotImplementedError("__hash__ must be implemented.")
813
+
814
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
815
+
816
+ @classmethod
817
+ def _get_unset_required_fields(cls, message_dict):
818
+ return {
819
+ k: v
820
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
821
+ if k not in message_dict
822
+ }
823
+
824
+ @staticmethod
825
+ def _get_http_options():
826
+ http_options: List[Dict[str, str]] = [
827
+ {
828
+ "method": "get",
829
+ "uri": "/v1/{name=projects/*/locations/*/streams/*/objects/*}",
830
+ },
831
+ ]
832
+ return http_options
833
+
834
+ @staticmethod
835
+ def _get_transcoded_request(http_options, request):
836
+ pb_request = datastream.GetStreamObjectRequest.pb(request)
837
+ transcoded_request = path_template.transcode(http_options, pb_request)
838
+ return transcoded_request
839
+
840
+ @staticmethod
841
+ def _get_query_params_json(transcoded_request):
842
+ query_params = json.loads(
843
+ json_format.MessageToJson(
844
+ transcoded_request["query_params"],
845
+ use_integers_for_enums=True,
846
+ )
847
+ )
848
+ query_params.update(
849
+ _BaseDatastreamRestTransport._BaseGetStreamObject._get_unset_required_fields(
850
+ query_params
851
+ )
852
+ )
853
+
854
+ query_params["$alt"] = "json;enum-encoding=int"
855
+ return query_params
856
+
857
+ class _BaseListConnectionProfiles:
858
+ def __hash__(self): # pragma: NO COVER
859
+ return NotImplementedError("__hash__ must be implemented.")
860
+
861
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
862
+
863
+ @classmethod
864
+ def _get_unset_required_fields(cls, message_dict):
865
+ return {
866
+ k: v
867
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
868
+ if k not in message_dict
869
+ }
870
+
871
+ @staticmethod
872
+ def _get_http_options():
873
+ http_options: List[Dict[str, str]] = [
874
+ {
875
+ "method": "get",
876
+ "uri": "/v1/{parent=projects/*/locations/*}/connectionProfiles",
877
+ },
878
+ ]
879
+ return http_options
880
+
881
+ @staticmethod
882
+ def _get_transcoded_request(http_options, request):
883
+ pb_request = datastream.ListConnectionProfilesRequest.pb(request)
884
+ transcoded_request = path_template.transcode(http_options, pb_request)
885
+ return transcoded_request
886
+
887
+ @staticmethod
888
+ def _get_query_params_json(transcoded_request):
889
+ query_params = json.loads(
890
+ json_format.MessageToJson(
891
+ transcoded_request["query_params"],
892
+ use_integers_for_enums=True,
893
+ )
894
+ )
895
+ query_params.update(
896
+ _BaseDatastreamRestTransport._BaseListConnectionProfiles._get_unset_required_fields(
897
+ query_params
898
+ )
899
+ )
900
+
901
+ query_params["$alt"] = "json;enum-encoding=int"
902
+ return query_params
903
+
904
+ class _BaseListPrivateConnections:
905
+ def __hash__(self): # pragma: NO COVER
906
+ return NotImplementedError("__hash__ must be implemented.")
907
+
908
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
909
+
910
+ @classmethod
911
+ def _get_unset_required_fields(cls, message_dict):
912
+ return {
913
+ k: v
914
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
915
+ if k not in message_dict
916
+ }
917
+
918
+ @staticmethod
919
+ def _get_http_options():
920
+ http_options: List[Dict[str, str]] = [
921
+ {
922
+ "method": "get",
923
+ "uri": "/v1/{parent=projects/*/locations/*}/privateConnections",
924
+ },
925
+ ]
926
+ return http_options
927
+
928
+ @staticmethod
929
+ def _get_transcoded_request(http_options, request):
930
+ pb_request = datastream.ListPrivateConnectionsRequest.pb(request)
931
+ transcoded_request = path_template.transcode(http_options, pb_request)
932
+ return transcoded_request
933
+
934
+ @staticmethod
935
+ def _get_query_params_json(transcoded_request):
936
+ query_params = json.loads(
937
+ json_format.MessageToJson(
938
+ transcoded_request["query_params"],
939
+ use_integers_for_enums=True,
940
+ )
941
+ )
942
+ query_params.update(
943
+ _BaseDatastreamRestTransport._BaseListPrivateConnections._get_unset_required_fields(
944
+ query_params
945
+ )
946
+ )
947
+
948
+ query_params["$alt"] = "json;enum-encoding=int"
949
+ return query_params
950
+
951
+ class _BaseListRoutes:
952
+ def __hash__(self): # pragma: NO COVER
953
+ return NotImplementedError("__hash__ must be implemented.")
954
+
955
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
956
+
957
+ @classmethod
958
+ def _get_unset_required_fields(cls, message_dict):
959
+ return {
960
+ k: v
961
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
962
+ if k not in message_dict
963
+ }
964
+
965
+ @staticmethod
966
+ def _get_http_options():
967
+ http_options: List[Dict[str, str]] = [
968
+ {
969
+ "method": "get",
970
+ "uri": "/v1/{parent=projects/*/locations/*/privateConnections/*}/routes",
971
+ },
972
+ ]
973
+ return http_options
974
+
975
+ @staticmethod
976
+ def _get_transcoded_request(http_options, request):
977
+ pb_request = datastream.ListRoutesRequest.pb(request)
978
+ transcoded_request = path_template.transcode(http_options, pb_request)
979
+ return transcoded_request
980
+
981
+ @staticmethod
982
+ def _get_query_params_json(transcoded_request):
983
+ query_params = json.loads(
984
+ json_format.MessageToJson(
985
+ transcoded_request["query_params"],
986
+ use_integers_for_enums=True,
987
+ )
988
+ )
989
+ query_params.update(
990
+ _BaseDatastreamRestTransport._BaseListRoutes._get_unset_required_fields(
991
+ query_params
992
+ )
993
+ )
994
+
995
+ query_params["$alt"] = "json;enum-encoding=int"
996
+ return query_params
997
+
998
+ class _BaseListStreamObjects:
999
+ def __hash__(self): # pragma: NO COVER
1000
+ return NotImplementedError("__hash__ must be implemented.")
1001
+
1002
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
1003
+
1004
+ @classmethod
1005
+ def _get_unset_required_fields(cls, message_dict):
1006
+ return {
1007
+ k: v
1008
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
1009
+ if k not in message_dict
1010
+ }
1011
+
1012
+ @staticmethod
1013
+ def _get_http_options():
1014
+ http_options: List[Dict[str, str]] = [
1015
+ {
1016
+ "method": "get",
1017
+ "uri": "/v1/{parent=projects/*/locations/*/streams/*}/objects",
1018
+ },
1019
+ ]
1020
+ return http_options
1021
+
1022
+ @staticmethod
1023
+ def _get_transcoded_request(http_options, request):
1024
+ pb_request = datastream.ListStreamObjectsRequest.pb(request)
1025
+ transcoded_request = path_template.transcode(http_options, pb_request)
1026
+ return transcoded_request
1027
+
1028
+ @staticmethod
1029
+ def _get_query_params_json(transcoded_request):
1030
+ query_params = json.loads(
1031
+ json_format.MessageToJson(
1032
+ transcoded_request["query_params"],
1033
+ use_integers_for_enums=True,
1034
+ )
1035
+ )
1036
+ query_params.update(
1037
+ _BaseDatastreamRestTransport._BaseListStreamObjects._get_unset_required_fields(
1038
+ query_params
1039
+ )
1040
+ )
1041
+
1042
+ query_params["$alt"] = "json;enum-encoding=int"
1043
+ return query_params
1044
+
1045
+ class _BaseListStreams:
1046
+ def __hash__(self): # pragma: NO COVER
1047
+ return NotImplementedError("__hash__ must be implemented.")
1048
+
1049
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
1050
+
1051
+ @classmethod
1052
+ def _get_unset_required_fields(cls, message_dict):
1053
+ return {
1054
+ k: v
1055
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
1056
+ if k not in message_dict
1057
+ }
1058
+
1059
+ @staticmethod
1060
+ def _get_http_options():
1061
+ http_options: List[Dict[str, str]] = [
1062
+ {
1063
+ "method": "get",
1064
+ "uri": "/v1/{parent=projects/*/locations/*}/streams",
1065
+ },
1066
+ ]
1067
+ return http_options
1068
+
1069
+ @staticmethod
1070
+ def _get_transcoded_request(http_options, request):
1071
+ pb_request = datastream.ListStreamsRequest.pb(request)
1072
+ transcoded_request = path_template.transcode(http_options, pb_request)
1073
+ return transcoded_request
1074
+
1075
+ @staticmethod
1076
+ def _get_query_params_json(transcoded_request):
1077
+ query_params = json.loads(
1078
+ json_format.MessageToJson(
1079
+ transcoded_request["query_params"],
1080
+ use_integers_for_enums=True,
1081
+ )
1082
+ )
1083
+ query_params.update(
1084
+ _BaseDatastreamRestTransport._BaseListStreams._get_unset_required_fields(
1085
+ query_params
1086
+ )
1087
+ )
1088
+
1089
+ query_params["$alt"] = "json;enum-encoding=int"
1090
+ return query_params
1091
+
1092
+ class _BaseLookupStreamObject:
1093
+ def __hash__(self): # pragma: NO COVER
1094
+ return NotImplementedError("__hash__ must be implemented.")
1095
+
1096
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
1097
+
1098
+ @classmethod
1099
+ def _get_unset_required_fields(cls, message_dict):
1100
+ return {
1101
+ k: v
1102
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
1103
+ if k not in message_dict
1104
+ }
1105
+
1106
+ @staticmethod
1107
+ def _get_http_options():
1108
+ http_options: List[Dict[str, str]] = [
1109
+ {
1110
+ "method": "post",
1111
+ "uri": "/v1/{parent=projects/*/locations/*/streams/*}/objects:lookup",
1112
+ "body": "*",
1113
+ },
1114
+ ]
1115
+ return http_options
1116
+
1117
+ @staticmethod
1118
+ def _get_transcoded_request(http_options, request):
1119
+ pb_request = datastream.LookupStreamObjectRequest.pb(request)
1120
+ transcoded_request = path_template.transcode(http_options, pb_request)
1121
+ return transcoded_request
1122
+
1123
+ @staticmethod
1124
+ def _get_request_body_json(transcoded_request):
1125
+ # Jsonify the request body
1126
+
1127
+ body = json_format.MessageToJson(
1128
+ transcoded_request["body"], use_integers_for_enums=True
1129
+ )
1130
+ return body
1131
+
1132
+ @staticmethod
1133
+ def _get_query_params_json(transcoded_request):
1134
+ query_params = json.loads(
1135
+ json_format.MessageToJson(
1136
+ transcoded_request["query_params"],
1137
+ use_integers_for_enums=True,
1138
+ )
1139
+ )
1140
+ query_params.update(
1141
+ _BaseDatastreamRestTransport._BaseLookupStreamObject._get_unset_required_fields(
1142
+ query_params
1143
+ )
1144
+ )
1145
+
1146
+ query_params["$alt"] = "json;enum-encoding=int"
1147
+ return query_params
1148
+
1149
+ class _BaseRunStream:
1150
+ def __hash__(self): # pragma: NO COVER
1151
+ return NotImplementedError("__hash__ must be implemented.")
1152
+
1153
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
1154
+
1155
+ @classmethod
1156
+ def _get_unset_required_fields(cls, message_dict):
1157
+ return {
1158
+ k: v
1159
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
1160
+ if k not in message_dict
1161
+ }
1162
+
1163
+ @staticmethod
1164
+ def _get_http_options():
1165
+ http_options: List[Dict[str, str]] = [
1166
+ {
1167
+ "method": "post",
1168
+ "uri": "/v1/{name=projects/*/locations/*/streams/*}:run",
1169
+ "body": "*",
1170
+ },
1171
+ ]
1172
+ return http_options
1173
+
1174
+ @staticmethod
1175
+ def _get_transcoded_request(http_options, request):
1176
+ pb_request = datastream.RunStreamRequest.pb(request)
1177
+ transcoded_request = path_template.transcode(http_options, pb_request)
1178
+ return transcoded_request
1179
+
1180
+ @staticmethod
1181
+ def _get_request_body_json(transcoded_request):
1182
+ # Jsonify the request body
1183
+
1184
+ body = json_format.MessageToJson(
1185
+ transcoded_request["body"], use_integers_for_enums=True
1186
+ )
1187
+ return body
1188
+
1189
+ @staticmethod
1190
+ def _get_query_params_json(transcoded_request):
1191
+ query_params = json.loads(
1192
+ json_format.MessageToJson(
1193
+ transcoded_request["query_params"],
1194
+ use_integers_for_enums=True,
1195
+ )
1196
+ )
1197
+ query_params.update(
1198
+ _BaseDatastreamRestTransport._BaseRunStream._get_unset_required_fields(
1199
+ query_params
1200
+ )
1201
+ )
1202
+
1203
+ query_params["$alt"] = "json;enum-encoding=int"
1204
+ return query_params
1205
+
1206
+ class _BaseStartBackfillJob:
1207
+ def __hash__(self): # pragma: NO COVER
1208
+ return NotImplementedError("__hash__ must be implemented.")
1209
+
1210
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
1211
+
1212
+ @classmethod
1213
+ def _get_unset_required_fields(cls, message_dict):
1214
+ return {
1215
+ k: v
1216
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
1217
+ if k not in message_dict
1218
+ }
1219
+
1220
+ @staticmethod
1221
+ def _get_http_options():
1222
+ http_options: List[Dict[str, str]] = [
1223
+ {
1224
+ "method": "post",
1225
+ "uri": "/v1/{object_=projects/*/locations/*/streams/*/objects/*}:startBackfillJob",
1226
+ "body": "*",
1227
+ },
1228
+ ]
1229
+ return http_options
1230
+
1231
+ @staticmethod
1232
+ def _get_transcoded_request(http_options, request):
1233
+ pb_request = datastream.StartBackfillJobRequest.pb(request)
1234
+ transcoded_request = path_template.transcode(http_options, pb_request)
1235
+ return transcoded_request
1236
+
1237
+ @staticmethod
1238
+ def _get_request_body_json(transcoded_request):
1239
+ # Jsonify the request body
1240
+
1241
+ body = json_format.MessageToJson(
1242
+ transcoded_request["body"], use_integers_for_enums=True
1243
+ )
1244
+ return body
1245
+
1246
+ @staticmethod
1247
+ def _get_query_params_json(transcoded_request):
1248
+ query_params = json.loads(
1249
+ json_format.MessageToJson(
1250
+ transcoded_request["query_params"],
1251
+ use_integers_for_enums=True,
1252
+ )
1253
+ )
1254
+ query_params.update(
1255
+ _BaseDatastreamRestTransport._BaseStartBackfillJob._get_unset_required_fields(
1256
+ query_params
1257
+ )
1258
+ )
1259
+
1260
+ query_params["$alt"] = "json;enum-encoding=int"
1261
+ return query_params
1262
+
1263
+ class _BaseStopBackfillJob:
1264
+ def __hash__(self): # pragma: NO COVER
1265
+ return NotImplementedError("__hash__ must be implemented.")
1266
+
1267
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
1268
+
1269
+ @classmethod
1270
+ def _get_unset_required_fields(cls, message_dict):
1271
+ return {
1272
+ k: v
1273
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
1274
+ if k not in message_dict
1275
+ }
1276
+
1277
+ @staticmethod
1278
+ def _get_http_options():
1279
+ http_options: List[Dict[str, str]] = [
1280
+ {
1281
+ "method": "post",
1282
+ "uri": "/v1/{object_=projects/*/locations/*/streams/*/objects/*}:stopBackfillJob",
1283
+ "body": "*",
1284
+ },
1285
+ ]
1286
+ return http_options
1287
+
1288
+ @staticmethod
1289
+ def _get_transcoded_request(http_options, request):
1290
+ pb_request = datastream.StopBackfillJobRequest.pb(request)
1291
+ transcoded_request = path_template.transcode(http_options, pb_request)
1292
+ return transcoded_request
1293
+
1294
+ @staticmethod
1295
+ def _get_request_body_json(transcoded_request):
1296
+ # Jsonify the request body
1297
+
1298
+ body = json_format.MessageToJson(
1299
+ transcoded_request["body"], use_integers_for_enums=True
1300
+ )
1301
+ return body
1302
+
1303
+ @staticmethod
1304
+ def _get_query_params_json(transcoded_request):
1305
+ query_params = json.loads(
1306
+ json_format.MessageToJson(
1307
+ transcoded_request["query_params"],
1308
+ use_integers_for_enums=True,
1309
+ )
1310
+ )
1311
+ query_params.update(
1312
+ _BaseDatastreamRestTransport._BaseStopBackfillJob._get_unset_required_fields(
1313
+ query_params
1314
+ )
1315
+ )
1316
+
1317
+ query_params["$alt"] = "json;enum-encoding=int"
1318
+ return query_params
1319
+
1320
+ class _BaseUpdateConnectionProfile:
1321
+ def __hash__(self): # pragma: NO COVER
1322
+ return NotImplementedError("__hash__ must be implemented.")
1323
+
1324
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
1325
+
1326
+ @classmethod
1327
+ def _get_unset_required_fields(cls, message_dict):
1328
+ return {
1329
+ k: v
1330
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
1331
+ if k not in message_dict
1332
+ }
1333
+
1334
+ @staticmethod
1335
+ def _get_http_options():
1336
+ http_options: List[Dict[str, str]] = [
1337
+ {
1338
+ "method": "patch",
1339
+ "uri": "/v1/{connection_profile.name=projects/*/locations/*/connectionProfiles/*}",
1340
+ "body": "connection_profile",
1341
+ },
1342
+ ]
1343
+ return http_options
1344
+
1345
+ @staticmethod
1346
+ def _get_transcoded_request(http_options, request):
1347
+ pb_request = datastream.UpdateConnectionProfileRequest.pb(request)
1348
+ transcoded_request = path_template.transcode(http_options, pb_request)
1349
+ return transcoded_request
1350
+
1351
+ @staticmethod
1352
+ def _get_request_body_json(transcoded_request):
1353
+ # Jsonify the request body
1354
+
1355
+ body = json_format.MessageToJson(
1356
+ transcoded_request["body"], use_integers_for_enums=True
1357
+ )
1358
+ return body
1359
+
1360
+ @staticmethod
1361
+ def _get_query_params_json(transcoded_request):
1362
+ query_params = json.loads(
1363
+ json_format.MessageToJson(
1364
+ transcoded_request["query_params"],
1365
+ use_integers_for_enums=True,
1366
+ )
1367
+ )
1368
+ query_params.update(
1369
+ _BaseDatastreamRestTransport._BaseUpdateConnectionProfile._get_unset_required_fields(
1370
+ query_params
1371
+ )
1372
+ )
1373
+
1374
+ query_params["$alt"] = "json;enum-encoding=int"
1375
+ return query_params
1376
+
1377
+ class _BaseUpdateStream:
1378
+ def __hash__(self): # pragma: NO COVER
1379
+ return NotImplementedError("__hash__ must be implemented.")
1380
+
1381
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
1382
+
1383
+ @classmethod
1384
+ def _get_unset_required_fields(cls, message_dict):
1385
+ return {
1386
+ k: v
1387
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
1388
+ if k not in message_dict
1389
+ }
1390
+
1391
+ @staticmethod
1392
+ def _get_http_options():
1393
+ http_options: List[Dict[str, str]] = [
1394
+ {
1395
+ "method": "patch",
1396
+ "uri": "/v1/{stream.name=projects/*/locations/*/streams/*}",
1397
+ "body": "stream",
1398
+ },
1399
+ ]
1400
+ return http_options
1401
+
1402
+ @staticmethod
1403
+ def _get_transcoded_request(http_options, request):
1404
+ pb_request = datastream.UpdateStreamRequest.pb(request)
1405
+ transcoded_request = path_template.transcode(http_options, pb_request)
1406
+ return transcoded_request
1407
+
1408
+ @staticmethod
1409
+ def _get_request_body_json(transcoded_request):
1410
+ # Jsonify the request body
1411
+
1412
+ body = json_format.MessageToJson(
1413
+ transcoded_request["body"], use_integers_for_enums=True
1414
+ )
1415
+ return body
1416
+
1417
+ @staticmethod
1418
+ def _get_query_params_json(transcoded_request):
1419
+ query_params = json.loads(
1420
+ json_format.MessageToJson(
1421
+ transcoded_request["query_params"],
1422
+ use_integers_for_enums=True,
1423
+ )
1424
+ )
1425
+ query_params.update(
1426
+ _BaseDatastreamRestTransport._BaseUpdateStream._get_unset_required_fields(
1427
+ query_params
1428
+ )
1429
+ )
1430
+
1431
+ query_params["$alt"] = "json;enum-encoding=int"
1432
+ return query_params
1433
+
1434
+ class _BaseGetLocation:
1435
+ def __hash__(self): # pragma: NO COVER
1436
+ return NotImplementedError("__hash__ must be implemented.")
1437
+
1438
+ @staticmethod
1439
+ def _get_http_options():
1440
+ http_options: List[Dict[str, str]] = [
1441
+ {
1442
+ "method": "get",
1443
+ "uri": "/v1/{name=projects/*/locations/*}",
1444
+ },
1445
+ ]
1446
+ return http_options
1447
+
1448
+ @staticmethod
1449
+ def _get_transcoded_request(http_options, request):
1450
+ request_kwargs = json_format.MessageToDict(request)
1451
+ transcoded_request = path_template.transcode(http_options, **request_kwargs)
1452
+ return transcoded_request
1453
+
1454
+ @staticmethod
1455
+ def _get_query_params_json(transcoded_request):
1456
+ query_params = json.loads(json.dumps(transcoded_request["query_params"]))
1457
+ return query_params
1458
+
1459
+ class _BaseListLocations:
1460
+ def __hash__(self): # pragma: NO COVER
1461
+ return NotImplementedError("__hash__ must be implemented.")
1462
+
1463
+ @staticmethod
1464
+ def _get_http_options():
1465
+ http_options: List[Dict[str, str]] = [
1466
+ {
1467
+ "method": "get",
1468
+ "uri": "/v1/{name=projects/*}/locations",
1469
+ },
1470
+ ]
1471
+ return http_options
1472
+
1473
+ @staticmethod
1474
+ def _get_transcoded_request(http_options, request):
1475
+ request_kwargs = json_format.MessageToDict(request)
1476
+ transcoded_request = path_template.transcode(http_options, **request_kwargs)
1477
+ return transcoded_request
1478
+
1479
+ @staticmethod
1480
+ def _get_query_params_json(transcoded_request):
1481
+ query_params = json.loads(json.dumps(transcoded_request["query_params"]))
1482
+ return query_params
1483
+
1484
+ class _BaseCancelOperation:
1485
+ def __hash__(self): # pragma: NO COVER
1486
+ return NotImplementedError("__hash__ must be implemented.")
1487
+
1488
+ @staticmethod
1489
+ def _get_http_options():
1490
+ http_options: List[Dict[str, str]] = [
1491
+ {
1492
+ "method": "post",
1493
+ "uri": "/v1/{name=projects/*/locations/*/operations/*}:cancel",
1494
+ "body": "*",
1495
+ },
1496
+ ]
1497
+ return http_options
1498
+
1499
+ @staticmethod
1500
+ def _get_transcoded_request(http_options, request):
1501
+ request_kwargs = json_format.MessageToDict(request)
1502
+ transcoded_request = path_template.transcode(http_options, **request_kwargs)
1503
+ return transcoded_request
1504
+
1505
+ @staticmethod
1506
+ def _get_request_body_json(transcoded_request):
1507
+ body = json.dumps(transcoded_request["body"])
1508
+ return body
1509
+
1510
+ @staticmethod
1511
+ def _get_query_params_json(transcoded_request):
1512
+ query_params = json.loads(json.dumps(transcoded_request["query_params"]))
1513
+ return query_params
1514
+
1515
+ class _BaseDeleteOperation:
1516
+ def __hash__(self): # pragma: NO COVER
1517
+ return NotImplementedError("__hash__ must be implemented.")
1518
+
1519
+ @staticmethod
1520
+ def _get_http_options():
1521
+ http_options: List[Dict[str, str]] = [
1522
+ {
1523
+ "method": "delete",
1524
+ "uri": "/v1/{name=projects/*/locations/*/operations/*}",
1525
+ },
1526
+ ]
1527
+ return http_options
1528
+
1529
+ @staticmethod
1530
+ def _get_transcoded_request(http_options, request):
1531
+ request_kwargs = json_format.MessageToDict(request)
1532
+ transcoded_request = path_template.transcode(http_options, **request_kwargs)
1533
+ return transcoded_request
1534
+
1535
+ @staticmethod
1536
+ def _get_query_params_json(transcoded_request):
1537
+ query_params = json.loads(json.dumps(transcoded_request["query_params"]))
1538
+ return query_params
1539
+
1540
+ class _BaseGetOperation:
1541
+ def __hash__(self): # pragma: NO COVER
1542
+ return NotImplementedError("__hash__ must be implemented.")
1543
+
1544
+ @staticmethod
1545
+ def _get_http_options():
1546
+ http_options: List[Dict[str, str]] = [
1547
+ {
1548
+ "method": "get",
1549
+ "uri": "/v1/{name=projects/*/locations/*/operations/*}",
1550
+ },
1551
+ ]
1552
+ return http_options
1553
+
1554
+ @staticmethod
1555
+ def _get_transcoded_request(http_options, request):
1556
+ request_kwargs = json_format.MessageToDict(request)
1557
+ transcoded_request = path_template.transcode(http_options, **request_kwargs)
1558
+ return transcoded_request
1559
+
1560
+ @staticmethod
1561
+ def _get_query_params_json(transcoded_request):
1562
+ query_params = json.loads(json.dumps(transcoded_request["query_params"]))
1563
+ return query_params
1564
+
1565
+ class _BaseListOperations:
1566
+ def __hash__(self): # pragma: NO COVER
1567
+ return NotImplementedError("__hash__ must be implemented.")
1568
+
1569
+ @staticmethod
1570
+ def _get_http_options():
1571
+ http_options: List[Dict[str, str]] = [
1572
+ {
1573
+ "method": "get",
1574
+ "uri": "/v1/{name=projects/*/locations/*}/operations",
1575
+ },
1576
+ ]
1577
+ return http_options
1578
+
1579
+ @staticmethod
1580
+ def _get_transcoded_request(http_options, request):
1581
+ request_kwargs = json_format.MessageToDict(request)
1582
+ transcoded_request = path_template.transcode(http_options, **request_kwargs)
1583
+ return transcoded_request
1584
+
1585
+ @staticmethod
1586
+ def _get_query_params_json(transcoded_request):
1587
+ query_params = json.loads(json.dumps(transcoded_request["query_params"]))
1588
+ return query_params
1589
+
1590
+
1591
+ __all__ = ("_BaseDatastreamRestTransport",)