# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from google.cloud.firestore_admin_v1.proto import (
    field_pb2 as google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_field__pb2,
)
from google.cloud.firestore_admin_v1.proto import (
    firestore_admin_pb2 as google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2,
)
from google.cloud.firestore_admin_v1.proto import (
    index_pb2 as google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_index__pb2,
)
from google.longrunning import (
    operations_pb2 as google_dot_longrunning_dot_operations__pb2,
)
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2


class FirestoreAdminStub(object):
    """Operations are created by service `FirestoreAdmin`, but are accessed via
  service `google.longrunning.Operations`.
  """

    def __init__(self, channel):
        """Constructor.

    Args:
      channel: A grpc.Channel.
    """
        self.CreateIndex = channel.unary_unary(
            "/google.firestore.admin.v1.FirestoreAdmin/CreateIndex",
            request_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.CreateIndexRequest.SerializeToString,
            response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
        )
        self.ListIndexes = channel.unary_unary(
            "/google.firestore.admin.v1.FirestoreAdmin/ListIndexes",
            request_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ListIndexesRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ListIndexesResponse.FromString,
        )
        self.GetIndex = channel.unary_unary(
            "/google.firestore.admin.v1.FirestoreAdmin/GetIndex",
            request_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.GetIndexRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_index__pb2.Index.FromString,
        )
        self.DeleteIndex = channel.unary_unary(
            "/google.firestore.admin.v1.FirestoreAdmin/DeleteIndex",
            request_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.DeleteIndexRequest.SerializeToString,
            response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )
        self.GetField = channel.unary_unary(
            "/google.firestore.admin.v1.FirestoreAdmin/GetField",
            request_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.GetFieldRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_field__pb2.Field.FromString,
        )
        self.UpdateField = channel.unary_unary(
            "/google.firestore.admin.v1.FirestoreAdmin/UpdateField",
            request_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.UpdateFieldRequest.SerializeToString,
            response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
        )
        self.ListFields = channel.unary_unary(
            "/google.firestore.admin.v1.FirestoreAdmin/ListFields",
            request_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ListFieldsRequest.SerializeToString,
            response_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ListFieldsResponse.FromString,
        )
        self.ExportDocuments = channel.unary_unary(
            "/google.firestore.admin.v1.FirestoreAdmin/ExportDocuments",
            request_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ExportDocumentsRequest.SerializeToString,
            response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
        )
        self.ImportDocuments = channel.unary_unary(
            "/google.firestore.admin.v1.FirestoreAdmin/ImportDocuments",
            request_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ImportDocumentsRequest.SerializeToString,
            response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString,
        )


class FirestoreAdminServicer(object):
    """Operations are created by service `FirestoreAdmin`, but are accessed via
  service `google.longrunning.Operations`.
  """

    def CreateIndex(self, request, context):
        """Creates a composite index. This returns a [google.longrunning.Operation][google.longrunning.Operation]
    which may be used to track the status of the creation. The metadata for
    the operation will be the type [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata].
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ListIndexes(self, request, context):
        """Lists composite indexes.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def GetIndex(self, request, context):
        """Gets a composite index.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def DeleteIndex(self, request, context):
        """Deletes a composite index.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def GetField(self, request, context):
        """Gets the metadata and configuration for a Field.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def UpdateField(self, request, context):
        """Updates a field configuration. Currently, field updates apply only to
    single field index configuration. However, calls to
    [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField] should provide a field mask to avoid
    changing any configuration that the caller isn't aware of. The field mask
    should be specified as: `{ paths: "index_config" }`.

    This call returns a [google.longrunning.Operation][google.longrunning.Operation] which may be used to
    track the status of the field update. The metadata for
    the operation will be the type [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata].

    To configure the default field settings for the database, use
    the special `Field` with resource name:
    `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ListFields(self, request, context):
        """Lists the field configuration and metadata for this database.

    Currently, [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] only supports listing fields
    that have been explicitly overridden. To issue this query, call
    [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields] with the filter set to
    `indexConfig.usesAncestorConfig:false`.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ExportDocuments(self, request, context):
        """Exports a copy of all or a subset of documents from Google Cloud Firestore
    to another storage system, such as Google Cloud Storage. Recent updates to
    documents may not be reflected in the export. The export occurs in the
    background and its progress can be monitored and managed via the
    Operation resource that is created. The output of an export may only be
    used once the associated operation is done. If an export operation is
    cancelled before completion it may leave partial data behind in Google
    Cloud Storage.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def ImportDocuments(self, request, context):
        """Imports documents into Google Cloud Firestore. Existing documents with the
    same name are overwritten. The import occurs in the background and its
    progress can be monitored and managed via the Operation resource that is
    created. If an ImportDocuments operation is cancelled, it is possible
    that a subset of the data has already been imported to Cloud Firestore.
    """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_FirestoreAdminServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "CreateIndex": grpc.unary_unary_rpc_method_handler(
            servicer.CreateIndex,
            request_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.CreateIndexRequest.FromString,
            response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
        ),
        "ListIndexes": grpc.unary_unary_rpc_method_handler(
            servicer.ListIndexes,
            request_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ListIndexesRequest.FromString,
            response_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ListIndexesResponse.SerializeToString,
        ),
        "GetIndex": grpc.unary_unary_rpc_method_handler(
            servicer.GetIndex,
            request_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.GetIndexRequest.FromString,
            response_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_index__pb2.Index.SerializeToString,
        ),
        "DeleteIndex": grpc.unary_unary_rpc_method_handler(
            servicer.DeleteIndex,
            request_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.DeleteIndexRequest.FromString,
            response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        ),
        "GetField": grpc.unary_unary_rpc_method_handler(
            servicer.GetField,
            request_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.GetFieldRequest.FromString,
            response_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_field__pb2.Field.SerializeToString,
        ),
        "UpdateField": grpc.unary_unary_rpc_method_handler(
            servicer.UpdateField,
            request_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.UpdateFieldRequest.FromString,
            response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
        ),
        "ListFields": grpc.unary_unary_rpc_method_handler(
            servicer.ListFields,
            request_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ListFieldsRequest.FromString,
            response_serializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ListFieldsResponse.SerializeToString,
        ),
        "ExportDocuments": grpc.unary_unary_rpc_method_handler(
            servicer.ExportDocuments,
            request_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ExportDocumentsRequest.FromString,
            response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
        ),
        "ImportDocuments": grpc.unary_unary_rpc_method_handler(
            servicer.ImportDocuments,
            request_deserializer=google_dot_cloud_dot_firestore_dot_admin__v1_dot_proto_dot_firestore__admin__pb2.ImportDocumentsRequest.FromString,
            response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "google.firestore.admin.v1.FirestoreAdmin", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))
