31
31
from google .cloud .video .transcoder_v1beta1 .services .transcoder_service import pagers
32
32
from google .cloud .video .transcoder_v1beta1 .types import resources
33
33
from google .cloud .video .transcoder_v1beta1 .types import services
34
+ from google .protobuf import timestamp_pb2 as timestamp # type: ignore
34
35
35
36
from .transports .base import TranscoderServiceTransport , DEFAULT_CLIENT_INFO
36
37
from .transports .grpc_asyncio import TranscoderServiceGrpcAsyncIOTransport
@@ -52,13 +53,54 @@ class TranscoderServiceAsyncClient:
52
53
DEFAULT_ENDPOINT = TranscoderServiceClient .DEFAULT_ENDPOINT
53
54
DEFAULT_MTLS_ENDPOINT = TranscoderServiceClient .DEFAULT_MTLS_ENDPOINT
54
55
56
+ job_path = staticmethod (TranscoderServiceClient .job_path )
57
+ parse_job_path = staticmethod (TranscoderServiceClient .parse_job_path )
55
58
job_template_path = staticmethod (TranscoderServiceClient .job_template_path )
59
+ parse_job_template_path = staticmethod (
60
+ TranscoderServiceClient .parse_job_template_path
61
+ )
56
62
57
- job_path = staticmethod (TranscoderServiceClient .job_path )
63
+ common_billing_account_path = staticmethod (
64
+ TranscoderServiceClient .common_billing_account_path
65
+ )
66
+ parse_common_billing_account_path = staticmethod (
67
+ TranscoderServiceClient .parse_common_billing_account_path
68
+ )
69
+
70
+ common_folder_path = staticmethod (TranscoderServiceClient .common_folder_path )
71
+ parse_common_folder_path = staticmethod (
72
+ TranscoderServiceClient .parse_common_folder_path
73
+ )
74
+
75
+ common_organization_path = staticmethod (
76
+ TranscoderServiceClient .common_organization_path
77
+ )
78
+ parse_common_organization_path = staticmethod (
79
+ TranscoderServiceClient .parse_common_organization_path
80
+ )
81
+
82
+ common_project_path = staticmethod (TranscoderServiceClient .common_project_path )
83
+ parse_common_project_path = staticmethod (
84
+ TranscoderServiceClient .parse_common_project_path
85
+ )
86
+
87
+ common_location_path = staticmethod (TranscoderServiceClient .common_location_path )
88
+ parse_common_location_path = staticmethod (
89
+ TranscoderServiceClient .parse_common_location_path
90
+ )
58
91
59
92
from_service_account_file = TranscoderServiceClient .from_service_account_file
60
93
from_service_account_json = from_service_account_file
61
94
95
+ @property
96
+ def transport (self ) -> TranscoderServiceTransport :
97
+ """Return the transport used by the client instance.
98
+
99
+ Returns:
100
+ TranscoderServiceTransport: The transport used by the client instance.
101
+ """
102
+ return self ._client .transport
103
+
62
104
get_transport_class = functools .partial (
63
105
type (TranscoderServiceClient ).get_transport_class , type (TranscoderServiceClient )
64
106
)
@@ -85,16 +127,19 @@ def __init__(
85
127
client_options (ClientOptions): Custom options for the client. It
86
128
won't take effect if a ``transport`` instance is provided.
87
129
(1) The ``api_endpoint`` property can be used to override the
88
- default endpoint provided by the client. GOOGLE_API_USE_MTLS
130
+ default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
89
131
environment variable can also be used to override the endpoint:
90
132
"always" (always use the default mTLS endpoint), "never" (always
91
- use the default regular endpoint, this is the default value for
92
- the environment variable) and "auto" (auto switch to the default
93
- mTLS endpoint if client SSL credentials is present). However,
94
- the ``api_endpoint`` property takes precedence if provided.
95
- (2) The ``client_cert_source`` property is used to provide client
96
- SSL credentials for mutual TLS transport. If not provided, the
97
- default SSL credentials will be used if present.
133
+ use the default regular endpoint) and "auto" (auto switch to the
134
+ default mTLS endpoint if client certificate is present, this is
135
+ the default value). However, the ``api_endpoint`` property takes
136
+ precedence if provided.
137
+ (2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
138
+ is "true", then the ``client_cert_source`` property can be used
139
+ to provide client certificate for mutual TLS transport. If
140
+ not provided, the default SSL client certificate will be used if
141
+ present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not
142
+ set, no client certificate will be used.
98
143
99
144
Raises:
100
145
google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
@@ -150,7 +195,8 @@ async def create_job(
150
195
# Create or coerce a protobuf request object.
151
196
# Sanity check: If we got a request object, we should *not* have
152
197
# gotten any keyword arguments that map to the request.
153
- if request is not None and any ([parent , job ]):
198
+ has_flattened_params = any ([parent , job ])
199
+ if request is not None and has_flattened_params :
154
200
raise ValueError (
155
201
"If the `request` argument is set, then none of "
156
202
"the individual field arguments should be set."
@@ -226,7 +272,8 @@ async def list_jobs(
226
272
# Create or coerce a protobuf request object.
227
273
# Sanity check: If we got a request object, we should *not* have
228
274
# gotten any keyword arguments that map to the request.
229
- if request is not None and any ([parent ]):
275
+ has_flattened_params = any ([parent ])
276
+ if request is not None and has_flattened_params :
230
277
raise ValueError (
231
278
"If the `request` argument is set, then none of "
232
279
"the individual field arguments should be set."
@@ -301,7 +348,8 @@ async def get_job(
301
348
# Create or coerce a protobuf request object.
302
349
# Sanity check: If we got a request object, we should *not* have
303
350
# gotten any keyword arguments that map to the request.
304
- if request is not None and any ([name ]):
351
+ has_flattened_params = any ([name ])
352
+ if request is not None and has_flattened_params :
305
353
raise ValueError (
306
354
"If the `request` argument is set, then none of "
307
355
"the individual field arguments should be set."
@@ -366,7 +414,8 @@ async def delete_job(
366
414
# Create or coerce a protobuf request object.
367
415
# Sanity check: If we got a request object, we should *not* have
368
416
# gotten any keyword arguments that map to the request.
369
- if request is not None and any ([name ]):
417
+ has_flattened_params = any ([name ])
418
+ if request is not None and has_flattened_params :
370
419
raise ValueError (
371
420
"If the `request` argument is set, then none of "
372
421
"the individual field arguments should be set."
@@ -435,7 +484,8 @@ async def create_job_template(
435
484
resource name.
436
485
437
486
This value should be 4-63 characters, and valid
438
- characters are ``/[a-zA-Z0-9_-_]/``.
487
+ characters must match the regular expression
488
+ ``[a-zA-Z][a-zA-Z0-9_-]*``.
439
489
This corresponds to the ``job_template_id`` field
440
490
on the ``request`` instance; if ``request`` is provided, this
441
491
should not be set.
@@ -453,7 +503,8 @@ async def create_job_template(
453
503
# Create or coerce a protobuf request object.
454
504
# Sanity check: If we got a request object, we should *not* have
455
505
# gotten any keyword arguments that map to the request.
456
- if request is not None and any ([parent , job_template , job_template_id ]):
506
+ has_flattened_params = any ([parent , job_template , job_template_id ])
507
+ if request is not None and has_flattened_params :
457
508
raise ValueError (
458
509
"If the `request` argument is set, then none of "
459
510
"the individual field arguments should be set."
@@ -532,7 +583,8 @@ async def list_job_templates(
532
583
# Create or coerce a protobuf request object.
533
584
# Sanity check: If we got a request object, we should *not* have
534
585
# gotten any keyword arguments that map to the request.
535
- if request is not None and any ([parent ]):
586
+ has_flattened_params = any ([parent ])
587
+ if request is not None and has_flattened_params :
536
588
raise ValueError (
537
589
"If the `request` argument is set, then none of "
538
590
"the individual field arguments should be set."
@@ -608,7 +660,8 @@ async def get_job_template(
608
660
# Create or coerce a protobuf request object.
609
661
# Sanity check: If we got a request object, we should *not* have
610
662
# gotten any keyword arguments that map to the request.
611
- if request is not None and any ([name ]):
663
+ has_flattened_params = any ([name ])
664
+ if request is not None and has_flattened_params :
612
665
raise ValueError (
613
666
"If the `request` argument is set, then none of "
614
667
"the individual field arguments should be set."
@@ -673,7 +726,8 @@ async def delete_job_template(
673
726
# Create or coerce a protobuf request object.
674
727
# Sanity check: If we got a request object, we should *not* have
675
728
# gotten any keyword arguments that map to the request.
676
- if request is not None and any ([name ]):
729
+ has_flattened_params = any ([name ])
730
+ if request is not None and has_flattened_params :
677
731
raise ValueError (
678
732
"If the `request` argument is set, then none of "
679
733
"the individual field arguments should be set."
0 commit comments