1919from distutils import util
2020import os
2121import re
22- from typing import Callable , Dict , Sequence , Tuple , Type , Union
22+ from typing import Callable , Dict , Optional , Sequence , Tuple , Type , Union
2323import pkg_resources
2424
25- import google .api_core . client_options as ClientOptions # type: ignore
25+ from google .api_core import client_options as client_options_lib # type: ignore
2626from google .api_core import exceptions # type: ignore
2727from google .api_core import gapic_v1 # type: ignore
2828from google .api_core import retry as retries # type: ignore
3232from google .auth .exceptions import MutualTLSChannelError # type: ignore
3333from google .oauth2 import service_account # type: ignore
3434
35- from google .api_core import operation as ga_operation
36- from google .api_core import operation
37- from google .api_core import operation_async
35+ from google .api_core import operation as ga_operation # type: ignore
36+ from google .api_core import operation_async # type: ignore
3837from google .cloud .firestore_admin_v1 .services .firestore_admin import pagers
3938from google .cloud .firestore_admin_v1 .types import field
4039from google .cloud .firestore_admin_v1 .types import field as gfa_field
@@ -176,9 +175,9 @@ def parse_index_path(path: str) -> Dict[str, str]:
176175 def __init__ (
177176 self ,
178177 * ,
179- credentials : credentials .Credentials = None ,
180- transport : Union [str , FirestoreAdminTransport ] = None ,
181- client_options : ClientOptions = None ,
178+ credentials : Optional [ credentials .Credentials ] = None ,
179+ transport : Union [str , FirestoreAdminTransport , None ] = None ,
180+ client_options : Optional [ client_options_lib . ClientOptions ] = None ,
182181 client_info : gapic_v1 .client_info .ClientInfo = DEFAULT_CLIENT_INFO ,
183182 ) -> None :
184183 """Instantiate the firestore admin client.
@@ -192,8 +191,8 @@ def __init__(
192191 transport (Union[str, ~.FirestoreAdminTransport]): The
193192 transport to use. If set to None, a transport is chosen
194193 automatically.
195- client_options (ClientOptions): Custom options for the client. It
196- won't take effect if a ``transport`` instance is provided.
194+ client_options (client_options_lib. ClientOptions): Custom options for the
195+ client. It won't take effect if a ``transport`` instance is provided.
197196 (1) The ``api_endpoint`` property can be used to override the
198197 default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
199198 environment variable can also be used to override the endpoint:
@@ -219,9 +218,9 @@ def __init__(
219218 creation failed for any reason.
220219 """
221220 if isinstance (client_options , dict ):
222- client_options = ClientOptions .from_dict (client_options )
221+ client_options = client_options_lib .from_dict (client_options )
223222 if client_options is None :
224- client_options = ClientOptions .ClientOptions ()
223+ client_options = client_options_lib .ClientOptions ()
225224
226225 # Create SSL credentials for mutual TLS if needed.
227226 use_client_cert = bool (
@@ -378,7 +377,7 @@ def create_index(
378377 response = rpc (request , retry = retry , timeout = timeout , metadata = metadata ,)
379378
380379 # Wrap the response in an operation future.
381- response = operation .from_gapic (
380+ response = ga_operation .from_gapic (
382381 response ,
383382 self ._transport .operations_client ,
384383 gfa_index .Index ,
@@ -780,7 +779,7 @@ def update_field(
780779 response = rpc (request , retry = retry , timeout = timeout , metadata = metadata ,)
781780
782781 # Wrap the response in an operation future.
783- response = operation .from_gapic (
782+ response = ga_operation .from_gapic (
784783 response ,
785784 self ._transport .operations_client ,
786785 gfa_field .Field ,
@@ -964,7 +963,7 @@ def export_documents(
964963 response = rpc (request , retry = retry , timeout = timeout , metadata = metadata ,)
965964
966965 # Wrap the response in an operation future.
967- response = operation .from_gapic (
966+ response = ga_operation .from_gapic (
968967 response ,
969968 self ._transport .operations_client ,
970969 gfa_operation .ExportDocumentsResponse ,
@@ -1066,7 +1065,7 @@ def import_documents(
10661065 response = rpc (request , retry = retry , timeout = timeout , metadata = metadata ,)
10671066
10681067 # Wrap the response in an operation future.
1069- response = operation .from_gapic (
1068+ response = ga_operation .from_gapic (
10701069 response ,
10711070 self ._transport .operations_client ,
10721071 empty .Empty ,
0 commit comments