1616from collections import OrderedDict
1717import os
1818import 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+ )
2031
2132from google .api_core import client_options as client_options_lib
2233from google .api_core import exceptions as core_exceptions
@@ -55,7 +66,7 @@ class LookupServiceClientMeta(type):
5566
5667 def get_transport_class (
5768 cls ,
58- label : str = None ,
69+ label : Optional [ str ] = None ,
5970 ) -> Type [LookupServiceTransport ]:
6071 """Returns an appropriate transport class.
6172
@@ -358,8 +369,8 @@ def __init__(
358369 self ,
359370 * ,
360371 credentials : Optional [ga_credentials .Credentials ] = None ,
361- transport : Union [str , LookupServiceTransport , None ] = None ,
362- client_options : Optional [client_options_lib .ClientOptions ] = None ,
372+ transport : Optional [ Union [str , LookupServiceTransport ] ] = None ,
373+ client_options : Optional [Union [ client_options_lib .ClientOptions , dict ] ] = None ,
363374 client_info : gapic_v1 .client_info .ClientInfo = DEFAULT_CLIENT_INFO ,
364375 ) -> None :
365376 """Instantiates the lookup service client.
@@ -373,7 +384,7 @@ def __init__(
373384 transport (Union[str, LookupServiceTransport]): The
374385 transport to use. If set to None, a transport is chosen
375386 automatically.
376- client_options (google.api_core.client_options.ClientOptions): Custom options for the
387+ client_options (Optional[Union[ google.api_core.client_options.ClientOptions, dict]] ): Custom options for the
377388 client. It won't take effect if a ``transport`` instance is provided.
378389 (1) The ``api_endpoint`` property can be used to override the
379390 default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
@@ -403,6 +414,7 @@ def __init__(
403414 client_options = client_options_lib .from_dict (client_options )
404415 if client_options is None :
405416 client_options = client_options_lib .ClientOptions ()
417+ client_options = cast (client_options_lib .ClientOptions , client_options )
406418
407419 api_endpoint , client_cert_source_func = self .get_mtls_endpoint_and_cert_source (
408420 client_options
@@ -455,10 +467,10 @@ def __init__(
455467
456468 def resolve_service (
457469 self ,
458- request : Union [lookup_service .ResolveServiceRequest , dict ] = None ,
470+ request : Optional [ Union [lookup_service .ResolveServiceRequest , dict ] ] = None ,
459471 * ,
460472 retry : OptionalRetry = gapic_v1 .method .DEFAULT ,
461- timeout : float = None ,
473+ timeout : Optional [ float ] = None ,
462474 metadata : Sequence [Tuple [str , str ]] = (),
463475 ) -> lookup_service .ResolveServiceResponse :
464476 r"""Returns a [service][google.cloud.servicedirectory.v1.Service]
0 commit comments