Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pip-log.txt
.nox
.cache
.pytest_cache
.pytype


# Mac
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
from google.auth import credentials # type: ignore
from google.oauth2 import service_account # type: ignore

from google.api_core import operation as ga_operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.api_core import operation as ga_operation
from google.api_core import operation_async
from google.cloud.firestore_admin_v1.services.firestore_admin import pagers
from google.cloud.firestore_admin_v1.types import field
from google.cloud.firestore_admin_v1.types import field as gfa_field
Expand All @@ -39,7 +39,7 @@
from google.cloud.firestore_admin_v1.types import operation as gfa_operation
from google.protobuf import empty_pb2 as empty # type: ignore

from .transports.base import FirestoreAdminTransport
from .transports.base import FirestoreAdminTransport, DEFAULT_CLIENT_INFO
from .transports.grpc_asyncio import FirestoreAdminGrpcAsyncIOTransport
from .client import FirestoreAdminClient

Expand All @@ -54,10 +54,10 @@ class FirestoreAdminAsyncClient:
DEFAULT_ENDPOINT = FirestoreAdminClient.DEFAULT_ENDPOINT
DEFAULT_MTLS_ENDPOINT = FirestoreAdminClient.DEFAULT_MTLS_ENDPOINT

field_path = staticmethod(FirestoreAdminClient.field_path)

index_path = staticmethod(FirestoreAdminClient.index_path)

field_path = staticmethod(FirestoreAdminClient.field_path)

from_service_account_file = FirestoreAdminClient.from_service_account_file
from_service_account_json = from_service_account_file

Expand All @@ -71,6 +71,7 @@ def __init__(
credentials: credentials.Credentials = None,
transport: Union[str, FirestoreAdminTransport] = "grpc_asyncio",
client_options: ClientOptions = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiate the firestore admin client.

Expand Down Expand Up @@ -103,7 +104,10 @@ def __init__(
"""

self._client = FirestoreAdminClient(
credentials=credentials, transport=transport, client_options=client_options,
credentials=credentials,
transport=transport,
client_options=client_options,
client_info=client_info,
)

async def create_index(
Expand Down Expand Up @@ -179,7 +183,7 @@ async def create_index(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.create_index,
default_timeout=None,
client_info=_client_info,
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
Expand Down Expand Up @@ -261,7 +265,7 @@ async def list_indexes(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.list_indexes,
default_timeout=None,
client_info=_client_info,
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
Expand Down Expand Up @@ -339,7 +343,7 @@ async def get_index(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.get_index,
default_timeout=None,
client_info=_client_info,
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
Expand Down Expand Up @@ -404,7 +408,7 @@ async def delete_index(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.delete_index,
default_timeout=None,
client_info=_client_info,
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
Expand Down Expand Up @@ -477,7 +481,7 @@ async def get_field(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.get_field,
default_timeout=None,
client_info=_client_info,
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
Expand Down Expand Up @@ -569,7 +573,7 @@ async def update_field(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.update_field,
default_timeout=None,
client_info=_client_info,
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
Expand Down Expand Up @@ -660,7 +664,7 @@ async def list_fields(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.list_fields,
default_timeout=None,
client_info=_client_info,
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
Expand Down Expand Up @@ -751,7 +755,7 @@ async def export_documents(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.export_documents,
default_timeout=None,
client_info=_client_info,
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
Expand Down Expand Up @@ -851,7 +855,7 @@ async def import_documents(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.import_documents,
default_timeout=None,
client_info=_client_info,
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
Expand All @@ -876,11 +880,11 @@ async def import_documents(


try:
_client_info = gapic_v1.client_info.ClientInfo(
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution("google-cloud-firestore",).version,
)
except pkg_resources.DistributionNotFound:
_client_info = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()


__all__ = ("FirestoreAdminAsyncClient",)
Loading