google-cloud-video-transcoder 1.15.1__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 (26) hide show
  1. google/cloud/video/transcoder/__init__.py +93 -0
  2. google/cloud/video/transcoder/gapic_version.py +16 -0
  3. google/cloud/video/transcoder/py.typed +2 -0
  4. google/cloud/video/transcoder_v1/__init__.py +91 -0
  5. google/cloud/video/transcoder_v1/gapic_metadata.json +148 -0
  6. google/cloud/video/transcoder_v1/gapic_version.py +16 -0
  7. google/cloud/video/transcoder_v1/py.typed +2 -0
  8. google/cloud/video/transcoder_v1/services/__init__.py +15 -0
  9. google/cloud/video/transcoder_v1/services/transcoder_service/__init__.py +22 -0
  10. google/cloud/video/transcoder_v1/services/transcoder_service/async_client.py +1242 -0
  11. google/cloud/video/transcoder_v1/services/transcoder_service/client.py +1669 -0
  12. google/cloud/video/transcoder_v1/services/transcoder_service/pagers.py +353 -0
  13. google/cloud/video/transcoder_v1/services/transcoder_service/transports/__init__.py +36 -0
  14. google/cloud/video/transcoder_v1/services/transcoder_service/transports/base.py +260 -0
  15. google/cloud/video/transcoder_v1/services/transcoder_service/transports/grpc.py +542 -0
  16. google/cloud/video/transcoder_v1/services/transcoder_service/transports/grpc_asyncio.py +605 -0
  17. google/cloud/video/transcoder_v1/services/transcoder_service/transports/rest.py +1709 -0
  18. google/cloud/video/transcoder_v1/services/transcoder_service/transports/rest_base.py +490 -0
  19. google/cloud/video/transcoder_v1/types/__init__.py +80 -0
  20. google/cloud/video/transcoder_v1/types/resources.py +2534 -0
  21. google/cloud/video/transcoder_v1/types/services.py +326 -0
  22. google_cloud_video_transcoder-1.15.1.dist-info/LICENSE +202 -0
  23. google_cloud_video_transcoder-1.15.1.dist-info/METADATA +228 -0
  24. google_cloud_video_transcoder-1.15.1.dist-info/RECORD +26 -0
  25. google_cloud_video_transcoder-1.15.1.dist-info/WHEEL +5 -0
  26. google_cloud_video_transcoder-1.15.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,490 @@
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.protobuf import empty_pb2 # type: ignore
22
+ from google.protobuf import json_format
23
+
24
+ from google.cloud.video.transcoder_v1.types import resources, services
25
+
26
+ from .base import DEFAULT_CLIENT_INFO, TranscoderServiceTransport
27
+
28
+
29
+ class _BaseTranscoderServiceRestTransport(TranscoderServiceTransport):
30
+ """Base REST backend transport for TranscoderService.
31
+
32
+ Note: This class is not meant to be used directly. Use its sync and
33
+ async sub-classes instead.
34
+
35
+ This class defines the same methods as the primary client, so the
36
+ primary client can load the underlying transport implementation
37
+ and call it.
38
+
39
+ It sends JSON representations of protocol buffers over HTTP/1.1
40
+ """
41
+
42
+ def __init__(
43
+ self,
44
+ *,
45
+ host: str = "transcoder.googleapis.com",
46
+ credentials: Optional[Any] = None,
47
+ client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
48
+ always_use_jwt_access: Optional[bool] = False,
49
+ url_scheme: str = "https",
50
+ api_audience: Optional[str] = None,
51
+ ) -> None:
52
+ """Instantiate the transport.
53
+ Args:
54
+ host (Optional[str]):
55
+ The hostname to connect to (default: 'transcoder.googleapis.com').
56
+ credentials (Optional[Any]): The
57
+ authorization credentials to attach to requests. These
58
+ credentials identify the application to the service; if none
59
+ are specified, the client will attempt to ascertain the
60
+ credentials from the environment.
61
+ client_info (google.api_core.gapic_v1.client_info.ClientInfo):
62
+ The client info used to send a user-agent string along with
63
+ API requests. If ``None``, then default info will be used.
64
+ Generally, you only need to set this if you are developing
65
+ your own client library.
66
+ always_use_jwt_access (Optional[bool]): Whether self signed JWT should
67
+ be used for service account credentials.
68
+ url_scheme: the protocol scheme for the API endpoint. Normally
69
+ "https", but for testing or local servers,
70
+ "http" can be specified.
71
+ """
72
+ # Run the base constructor
73
+ maybe_url_match = re.match("^(?P<scheme>http(?:s)?://)?(?P<host>.*)$", host)
74
+ if maybe_url_match is None:
75
+ raise ValueError(
76
+ f"Unexpected hostname structure: {host}"
77
+ ) # pragma: NO COVER
78
+
79
+ url_match_items = maybe_url_match.groupdict()
80
+
81
+ host = f"{url_scheme}://{host}" if not url_match_items["scheme"] else host
82
+
83
+ super().__init__(
84
+ host=host,
85
+ credentials=credentials,
86
+ client_info=client_info,
87
+ always_use_jwt_access=always_use_jwt_access,
88
+ api_audience=api_audience,
89
+ )
90
+
91
+ class _BaseCreateJob:
92
+ def __hash__(self): # pragma: NO COVER
93
+ return NotImplementedError("__hash__ must be implemented.")
94
+
95
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
96
+
97
+ @classmethod
98
+ def _get_unset_required_fields(cls, message_dict):
99
+ return {
100
+ k: v
101
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
102
+ if k not in message_dict
103
+ }
104
+
105
+ @staticmethod
106
+ def _get_http_options():
107
+ http_options: List[Dict[str, str]] = [
108
+ {
109
+ "method": "post",
110
+ "uri": "/v1/{parent=projects/*/locations/*}/jobs",
111
+ "body": "job",
112
+ },
113
+ ]
114
+ return http_options
115
+
116
+ @staticmethod
117
+ def _get_transcoded_request(http_options, request):
118
+ pb_request = services.CreateJobRequest.pb(request)
119
+ transcoded_request = path_template.transcode(http_options, pb_request)
120
+ return transcoded_request
121
+
122
+ @staticmethod
123
+ def _get_request_body_json(transcoded_request):
124
+ # Jsonify the request body
125
+
126
+ body = json_format.MessageToJson(
127
+ transcoded_request["body"], use_integers_for_enums=True
128
+ )
129
+ return body
130
+
131
+ @staticmethod
132
+ def _get_query_params_json(transcoded_request):
133
+ query_params = json.loads(
134
+ json_format.MessageToJson(
135
+ transcoded_request["query_params"],
136
+ use_integers_for_enums=True,
137
+ )
138
+ )
139
+ query_params.update(
140
+ _BaseTranscoderServiceRestTransport._BaseCreateJob._get_unset_required_fields(
141
+ query_params
142
+ )
143
+ )
144
+
145
+ query_params["$alt"] = "json;enum-encoding=int"
146
+ return query_params
147
+
148
+ class _BaseCreateJobTemplate:
149
+ def __hash__(self): # pragma: NO COVER
150
+ return NotImplementedError("__hash__ must be implemented.")
151
+
152
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {
153
+ "jobTemplateId": "",
154
+ }
155
+
156
+ @classmethod
157
+ def _get_unset_required_fields(cls, message_dict):
158
+ return {
159
+ k: v
160
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
161
+ if k not in message_dict
162
+ }
163
+
164
+ @staticmethod
165
+ def _get_http_options():
166
+ http_options: List[Dict[str, str]] = [
167
+ {
168
+ "method": "post",
169
+ "uri": "/v1/{parent=projects/*/locations/*}/jobTemplates",
170
+ "body": "job_template",
171
+ },
172
+ ]
173
+ return http_options
174
+
175
+ @staticmethod
176
+ def _get_transcoded_request(http_options, request):
177
+ pb_request = services.CreateJobTemplateRequest.pb(request)
178
+ transcoded_request = path_template.transcode(http_options, pb_request)
179
+ return transcoded_request
180
+
181
+ @staticmethod
182
+ def _get_request_body_json(transcoded_request):
183
+ # Jsonify the request body
184
+
185
+ body = json_format.MessageToJson(
186
+ transcoded_request["body"], use_integers_for_enums=True
187
+ )
188
+ return body
189
+
190
+ @staticmethod
191
+ def _get_query_params_json(transcoded_request):
192
+ query_params = json.loads(
193
+ json_format.MessageToJson(
194
+ transcoded_request["query_params"],
195
+ use_integers_for_enums=True,
196
+ )
197
+ )
198
+ query_params.update(
199
+ _BaseTranscoderServiceRestTransport._BaseCreateJobTemplate._get_unset_required_fields(
200
+ query_params
201
+ )
202
+ )
203
+
204
+ query_params["$alt"] = "json;enum-encoding=int"
205
+ return query_params
206
+
207
+ class _BaseDeleteJob:
208
+ def __hash__(self): # pragma: NO COVER
209
+ return NotImplementedError("__hash__ must be implemented.")
210
+
211
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
212
+
213
+ @classmethod
214
+ def _get_unset_required_fields(cls, message_dict):
215
+ return {
216
+ k: v
217
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
218
+ if k not in message_dict
219
+ }
220
+
221
+ @staticmethod
222
+ def _get_http_options():
223
+ http_options: List[Dict[str, str]] = [
224
+ {
225
+ "method": "delete",
226
+ "uri": "/v1/{name=projects/*/locations/*/jobs/*}",
227
+ },
228
+ ]
229
+ return http_options
230
+
231
+ @staticmethod
232
+ def _get_transcoded_request(http_options, request):
233
+ pb_request = services.DeleteJobRequest.pb(request)
234
+ transcoded_request = path_template.transcode(http_options, pb_request)
235
+ return transcoded_request
236
+
237
+ @staticmethod
238
+ def _get_query_params_json(transcoded_request):
239
+ query_params = json.loads(
240
+ json_format.MessageToJson(
241
+ transcoded_request["query_params"],
242
+ use_integers_for_enums=True,
243
+ )
244
+ )
245
+ query_params.update(
246
+ _BaseTranscoderServiceRestTransport._BaseDeleteJob._get_unset_required_fields(
247
+ query_params
248
+ )
249
+ )
250
+
251
+ query_params["$alt"] = "json;enum-encoding=int"
252
+ return query_params
253
+
254
+ class _BaseDeleteJobTemplate:
255
+ def __hash__(self): # pragma: NO COVER
256
+ return NotImplementedError("__hash__ must be implemented.")
257
+
258
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
259
+
260
+ @classmethod
261
+ def _get_unset_required_fields(cls, message_dict):
262
+ return {
263
+ k: v
264
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
265
+ if k not in message_dict
266
+ }
267
+
268
+ @staticmethod
269
+ def _get_http_options():
270
+ http_options: List[Dict[str, str]] = [
271
+ {
272
+ "method": "delete",
273
+ "uri": "/v1/{name=projects/*/locations/*/jobTemplates/*}",
274
+ },
275
+ ]
276
+ return http_options
277
+
278
+ @staticmethod
279
+ def _get_transcoded_request(http_options, request):
280
+ pb_request = services.DeleteJobTemplateRequest.pb(request)
281
+ transcoded_request = path_template.transcode(http_options, pb_request)
282
+ return transcoded_request
283
+
284
+ @staticmethod
285
+ def _get_query_params_json(transcoded_request):
286
+ query_params = json.loads(
287
+ json_format.MessageToJson(
288
+ transcoded_request["query_params"],
289
+ use_integers_for_enums=True,
290
+ )
291
+ )
292
+ query_params.update(
293
+ _BaseTranscoderServiceRestTransport._BaseDeleteJobTemplate._get_unset_required_fields(
294
+ query_params
295
+ )
296
+ )
297
+
298
+ query_params["$alt"] = "json;enum-encoding=int"
299
+ return query_params
300
+
301
+ class _BaseGetJob:
302
+ def __hash__(self): # pragma: NO COVER
303
+ return NotImplementedError("__hash__ must be implemented.")
304
+
305
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
306
+
307
+ @classmethod
308
+ def _get_unset_required_fields(cls, message_dict):
309
+ return {
310
+ k: v
311
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
312
+ if k not in message_dict
313
+ }
314
+
315
+ @staticmethod
316
+ def _get_http_options():
317
+ http_options: List[Dict[str, str]] = [
318
+ {
319
+ "method": "get",
320
+ "uri": "/v1/{name=projects/*/locations/*/jobs/*}",
321
+ },
322
+ ]
323
+ return http_options
324
+
325
+ @staticmethod
326
+ def _get_transcoded_request(http_options, request):
327
+ pb_request = services.GetJobRequest.pb(request)
328
+ transcoded_request = path_template.transcode(http_options, pb_request)
329
+ return transcoded_request
330
+
331
+ @staticmethod
332
+ def _get_query_params_json(transcoded_request):
333
+ query_params = json.loads(
334
+ json_format.MessageToJson(
335
+ transcoded_request["query_params"],
336
+ use_integers_for_enums=True,
337
+ )
338
+ )
339
+ query_params.update(
340
+ _BaseTranscoderServiceRestTransport._BaseGetJob._get_unset_required_fields(
341
+ query_params
342
+ )
343
+ )
344
+
345
+ query_params["$alt"] = "json;enum-encoding=int"
346
+ return query_params
347
+
348
+ class _BaseGetJobTemplate:
349
+ def __hash__(self): # pragma: NO COVER
350
+ return NotImplementedError("__hash__ must be implemented.")
351
+
352
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
353
+
354
+ @classmethod
355
+ def _get_unset_required_fields(cls, message_dict):
356
+ return {
357
+ k: v
358
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
359
+ if k not in message_dict
360
+ }
361
+
362
+ @staticmethod
363
+ def _get_http_options():
364
+ http_options: List[Dict[str, str]] = [
365
+ {
366
+ "method": "get",
367
+ "uri": "/v1/{name=projects/*/locations/*/jobTemplates/*}",
368
+ },
369
+ ]
370
+ return http_options
371
+
372
+ @staticmethod
373
+ def _get_transcoded_request(http_options, request):
374
+ pb_request = services.GetJobTemplateRequest.pb(request)
375
+ transcoded_request = path_template.transcode(http_options, pb_request)
376
+ return transcoded_request
377
+
378
+ @staticmethod
379
+ def _get_query_params_json(transcoded_request):
380
+ query_params = json.loads(
381
+ json_format.MessageToJson(
382
+ transcoded_request["query_params"],
383
+ use_integers_for_enums=True,
384
+ )
385
+ )
386
+ query_params.update(
387
+ _BaseTranscoderServiceRestTransport._BaseGetJobTemplate._get_unset_required_fields(
388
+ query_params
389
+ )
390
+ )
391
+
392
+ query_params["$alt"] = "json;enum-encoding=int"
393
+ return query_params
394
+
395
+ class _BaseListJobs:
396
+ def __hash__(self): # pragma: NO COVER
397
+ return NotImplementedError("__hash__ must be implemented.")
398
+
399
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
400
+
401
+ @classmethod
402
+ def _get_unset_required_fields(cls, message_dict):
403
+ return {
404
+ k: v
405
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
406
+ if k not in message_dict
407
+ }
408
+
409
+ @staticmethod
410
+ def _get_http_options():
411
+ http_options: List[Dict[str, str]] = [
412
+ {
413
+ "method": "get",
414
+ "uri": "/v1/{parent=projects/*/locations/*}/jobs",
415
+ },
416
+ ]
417
+ return http_options
418
+
419
+ @staticmethod
420
+ def _get_transcoded_request(http_options, request):
421
+ pb_request = services.ListJobsRequest.pb(request)
422
+ transcoded_request = path_template.transcode(http_options, pb_request)
423
+ return transcoded_request
424
+
425
+ @staticmethod
426
+ def _get_query_params_json(transcoded_request):
427
+ query_params = json.loads(
428
+ json_format.MessageToJson(
429
+ transcoded_request["query_params"],
430
+ use_integers_for_enums=True,
431
+ )
432
+ )
433
+ query_params.update(
434
+ _BaseTranscoderServiceRestTransport._BaseListJobs._get_unset_required_fields(
435
+ query_params
436
+ )
437
+ )
438
+
439
+ query_params["$alt"] = "json;enum-encoding=int"
440
+ return query_params
441
+
442
+ class _BaseListJobTemplates:
443
+ def __hash__(self): # pragma: NO COVER
444
+ return NotImplementedError("__hash__ must be implemented.")
445
+
446
+ __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {}
447
+
448
+ @classmethod
449
+ def _get_unset_required_fields(cls, message_dict):
450
+ return {
451
+ k: v
452
+ for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items()
453
+ if k not in message_dict
454
+ }
455
+
456
+ @staticmethod
457
+ def _get_http_options():
458
+ http_options: List[Dict[str, str]] = [
459
+ {
460
+ "method": "get",
461
+ "uri": "/v1/{parent=projects/*/locations/*}/jobTemplates",
462
+ },
463
+ ]
464
+ return http_options
465
+
466
+ @staticmethod
467
+ def _get_transcoded_request(http_options, request):
468
+ pb_request = services.ListJobTemplatesRequest.pb(request)
469
+ transcoded_request = path_template.transcode(http_options, pb_request)
470
+ return transcoded_request
471
+
472
+ @staticmethod
473
+ def _get_query_params_json(transcoded_request):
474
+ query_params = json.loads(
475
+ json_format.MessageToJson(
476
+ transcoded_request["query_params"],
477
+ use_integers_for_enums=True,
478
+ )
479
+ )
480
+ query_params.update(
481
+ _BaseTranscoderServiceRestTransport._BaseListJobTemplates._get_unset_required_fields(
482
+ query_params
483
+ )
484
+ )
485
+
486
+ query_params["$alt"] = "json;enum-encoding=int"
487
+ return query_params
488
+
489
+
490
+ __all__ = ("_BaseTranscoderServiceRestTransport",)
@@ -0,0 +1,80 @@
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 .resources import (
17
+ AdBreak,
18
+ AudioStream,
19
+ EditAtom,
20
+ ElementaryStream,
21
+ Encryption,
22
+ Input,
23
+ Job,
24
+ JobConfig,
25
+ JobTemplate,
26
+ Manifest,
27
+ MuxStream,
28
+ Output,
29
+ Overlay,
30
+ PreprocessingConfig,
31
+ PubsubDestination,
32
+ SegmentSettings,
33
+ SpriteSheet,
34
+ TextStream,
35
+ VideoStream,
36
+ )
37
+ from .services import (
38
+ CreateJobRequest,
39
+ CreateJobTemplateRequest,
40
+ DeleteJobRequest,
41
+ DeleteJobTemplateRequest,
42
+ GetJobRequest,
43
+ GetJobTemplateRequest,
44
+ ListJobsRequest,
45
+ ListJobsResponse,
46
+ ListJobTemplatesRequest,
47
+ ListJobTemplatesResponse,
48
+ )
49
+
50
+ __all__ = (
51
+ "AdBreak",
52
+ "AudioStream",
53
+ "EditAtom",
54
+ "ElementaryStream",
55
+ "Encryption",
56
+ "Input",
57
+ "Job",
58
+ "JobConfig",
59
+ "JobTemplate",
60
+ "Manifest",
61
+ "MuxStream",
62
+ "Output",
63
+ "Overlay",
64
+ "PreprocessingConfig",
65
+ "PubsubDestination",
66
+ "SegmentSettings",
67
+ "SpriteSheet",
68
+ "TextStream",
69
+ "VideoStream",
70
+ "CreateJobRequest",
71
+ "CreateJobTemplateRequest",
72
+ "DeleteJobRequest",
73
+ "DeleteJobTemplateRequest",
74
+ "GetJobRequest",
75
+ "GetJobTemplateRequest",
76
+ "ListJobsRequest",
77
+ "ListJobsResponse",
78
+ "ListJobTemplatesRequest",
79
+ "ListJobTemplatesResponse",
80
+ )