1616from collections import OrderedDict
1717import os
1818import re
19- from typing import Dict , Mapping , Optional , Sequence , Tuple , Type , Union
19+ from typing import Dict , Mapping , Optional , Sequence , Tuple , Type , Union , cast
2020
2121from google .api_core import client_options as client_options_lib
2222from google .api_core import exceptions as core_exceptions
@@ -341,7 +341,7 @@ def __init__(
341341 * ,
342342 credentials : Optional [ga_credentials .Credentials ] = None ,
343343 transport : Union [str , ApiKeysTransport , None ] = None ,
344- client_options : Optional [client_options_lib .ClientOptions ] = None ,
344+ client_options : Optional [Union [ client_options_lib .ClientOptions , dict ] ] = None ,
345345 client_info : gapic_v1 .client_info .ClientInfo = DEFAULT_CLIENT_INFO ,
346346 ) -> None :
347347 """Instantiates the api keys client.
@@ -358,7 +358,7 @@ def __init__(
358358 NOTE: "rest" transport functionality is currently in a
359359 beta state (preview). We welcome your feedback via an
360360 issue in this library's source repository.
361- client_options (google.api_core.client_options.ClientOptions): Custom options for the
361+ client_options (Optional[Union[ google.api_core.client_options.ClientOptions, dict]] ): Custom options for the
362362 client. It won't take effect if a ``transport`` instance is provided.
363363 (1) The ``api_endpoint`` property can be used to override the
364364 default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
@@ -388,6 +388,7 @@ def __init__(
388388 client_options = client_options_lib .from_dict (client_options )
389389 if client_options is None :
390390 client_options = client_options_lib .ClientOptions ()
391+ client_options = cast (client_options_lib .ClientOptions , client_options )
391392
392393 api_endpoint , client_cert_source_func = self .get_mtls_endpoint_and_cert_source (
393394 client_options
0 commit comments