16
16
from collections import OrderedDict
17
17
import os
18
18
import re
19
- from typing import Dict , Mapping , Optional , Sequence , Tuple , Type , Union
19
+ from typing import (
20
+ Dict ,
21
+ Mapping ,
22
+ MutableMapping ,
23
+ MutableSequence ,
24
+ Optional ,
25
+ Sequence ,
26
+ Tuple ,
27
+ Type ,
28
+ Union ,
29
+ cast ,
30
+ )
20
31
21
32
from google .api_core import client_options as client_options_lib
22
33
from google .api_core import exceptions as core_exceptions
@@ -59,7 +70,7 @@ class FlexTemplatesServiceClientMeta(type):
59
70
60
71
def get_transport_class (
61
72
cls ,
62
- label : str = None ,
73
+ label : Optional [ str ] = None ,
63
74
) -> Type [FlexTemplatesServiceTransport ]:
64
75
"""Returns an appropriate transport class.
65
76
@@ -314,8 +325,8 @@ def __init__(
314
325
self ,
315
326
* ,
316
327
credentials : Optional [ga_credentials .Credentials ] = None ,
317
- transport : Union [str , FlexTemplatesServiceTransport , None ] = None ,
318
- client_options : Optional [client_options_lib .ClientOptions ] = None ,
328
+ transport : Optional [ Union [str , FlexTemplatesServiceTransport ] ] = None ,
329
+ client_options : Optional [Union [ client_options_lib .ClientOptions , dict ] ] = None ,
319
330
client_info : gapic_v1 .client_info .ClientInfo = DEFAULT_CLIENT_INFO ,
320
331
) -> None :
321
332
"""Instantiates the flex templates service client.
@@ -332,7 +343,7 @@ def __init__(
332
343
NOTE: "rest" transport functionality is currently in a
333
344
beta state (preview). We welcome your feedback via an
334
345
issue in this library's source repository.
335
- client_options (google.api_core.client_options.ClientOptions): Custom options for the
346
+ client_options (Optional[Union[ google.api_core.client_options.ClientOptions, dict]] ): Custom options for the
336
347
client. It won't take effect if a ``transport`` instance is provided.
337
348
(1) The ``api_endpoint`` property can be used to override the
338
349
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
@@ -362,6 +373,7 @@ def __init__(
362
373
client_options = client_options_lib .from_dict (client_options )
363
374
if client_options is None :
364
375
client_options = client_options_lib .ClientOptions ()
376
+ client_options = cast (client_options_lib .ClientOptions , client_options )
365
377
366
378
api_endpoint , client_cert_source_func = self .get_mtls_endpoint_and_cert_source (
367
379
client_options
@@ -414,10 +426,10 @@ def __init__(
414
426
415
427
def launch_flex_template (
416
428
self ,
417
- request : Union [templates .LaunchFlexTemplateRequest , dict ] = None ,
429
+ request : Optional [ Union [templates .LaunchFlexTemplateRequest , dict ] ] = None ,
418
430
* ,
419
431
retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
420
- timeout : float = None ,
432
+ timeout : Optional [ float ] = None ,
421
433
metadata : Sequence [Tuple [str , str ]] = (),
422
434
) -> templates .LaunchFlexTemplateResponse :
423
435
r"""Launch a job with a FlexTemplate.
0 commit comments