# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from ...server.v1 import search_pb2 as server_dot_v1_dot_search__pb2


class SearchStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.CreateOrUpdateIndex = channel.unary_unary(
                '/tigrisdata.search.v1.Search/CreateOrUpdateIndex',
                request_serializer=server_dot_v1_dot_search__pb2.CreateOrUpdateIndexRequest.SerializeToString,
                response_deserializer=server_dot_v1_dot_search__pb2.CreateOrUpdateIndexResponse.FromString,
                )
        self.GetIndex = channel.unary_unary(
                '/tigrisdata.search.v1.Search/GetIndex',
                request_serializer=server_dot_v1_dot_search__pb2.GetIndexRequest.SerializeToString,
                response_deserializer=server_dot_v1_dot_search__pb2.GetIndexResponse.FromString,
                )
        self.DeleteIndex = channel.unary_unary(
                '/tigrisdata.search.v1.Search/DeleteIndex',
                request_serializer=server_dot_v1_dot_search__pb2.DeleteIndexRequest.SerializeToString,
                response_deserializer=server_dot_v1_dot_search__pb2.DeleteIndexResponse.FromString,
                )
        self.ListIndexes = channel.unary_unary(
                '/tigrisdata.search.v1.Search/ListIndexes',
                request_serializer=server_dot_v1_dot_search__pb2.ListIndexesRequest.SerializeToString,
                response_deserializer=server_dot_v1_dot_search__pb2.ListIndexesResponse.FromString,
                )
        self.Get = channel.unary_unary(
                '/tigrisdata.search.v1.Search/Get',
                request_serializer=server_dot_v1_dot_search__pb2.GetDocumentRequest.SerializeToString,
                response_deserializer=server_dot_v1_dot_search__pb2.GetDocumentResponse.FromString,
                )
        self.CreateById = channel.unary_unary(
                '/tigrisdata.search.v1.Search/CreateById',
                request_serializer=server_dot_v1_dot_search__pb2.CreateByIdRequest.SerializeToString,
                response_deserializer=server_dot_v1_dot_search__pb2.CreateByIdResponse.FromString,
                )
        self.Create = channel.unary_unary(
                '/tigrisdata.search.v1.Search/Create',
                request_serializer=server_dot_v1_dot_search__pb2.CreateDocumentRequest.SerializeToString,
                response_deserializer=server_dot_v1_dot_search__pb2.CreateDocumentResponse.FromString,
                )
        self.CreateOrReplace = channel.unary_unary(
                '/tigrisdata.search.v1.Search/CreateOrReplace',
                request_serializer=server_dot_v1_dot_search__pb2.CreateOrReplaceDocumentRequest.SerializeToString,
                response_deserializer=server_dot_v1_dot_search__pb2.CreateOrReplaceDocumentResponse.FromString,
                )
        self.Update = channel.unary_unary(
                '/tigrisdata.search.v1.Search/Update',
                request_serializer=server_dot_v1_dot_search__pb2.UpdateDocumentRequest.SerializeToString,
                response_deserializer=server_dot_v1_dot_search__pb2.UpdateDocumentResponse.FromString,
                )
        self.Delete = channel.unary_unary(
                '/tigrisdata.search.v1.Search/Delete',
                request_serializer=server_dot_v1_dot_search__pb2.DeleteDocumentRequest.SerializeToString,
                response_deserializer=server_dot_v1_dot_search__pb2.DeleteDocumentResponse.FromString,
                )
        self.DeleteByQuery = channel.unary_unary(
                '/tigrisdata.search.v1.Search/DeleteByQuery',
                request_serializer=server_dot_v1_dot_search__pb2.DeleteByQueryRequest.SerializeToString,
                response_deserializer=server_dot_v1_dot_search__pb2.DeleteByQueryResponse.FromString,
                )
        self.Search = channel.unary_stream(
                '/tigrisdata.search.v1.Search/Search',
                request_serializer=server_dot_v1_dot_search__pb2.SearchIndexRequest.SerializeToString,
                response_deserializer=server_dot_v1_dot_search__pb2.SearchIndexResponse.FromString,
                )


class SearchServicer(object):
    """Missing associated documentation comment in .proto file."""

    def CreateOrUpdateIndex(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetIndex(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeleteIndex(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListIndexes(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Get(self, request, context):
        """Retrieves one or more documents by id. The response is an array of documents in the same order it is requests.
        A null is returned for the documents that are not found.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CreateById(self, request, context):
        """CreateById is used for indexing a single document. The API expects a single document. An "id" is optional
        and the server can automatically generate it for you in case it is missing. In cases an id is provided in
        the document and the document already exists then that document will not be indexed and an error is returned
        with HTTP status code 409.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Create(self, request, context):
        """Create is used for indexing a single or multiple documents. The API expects an array of documents.
        Each document is a JSON object. An "id" is optional and the server can automatically generate it for you in
        case it is missing. In cases when an id is provided in the document and the document already exists then that
        document will not be indexed and in the response there will be an error corresponding to that document id other
        documents will succeed. Returns an array of status indicating the status of each document.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CreateOrReplace(self, request, context):
        """Creates or replaces one or more documents. Each document is a JSON object. A document is replaced
        if it already exists. An "id" is generated automatically in case it is missing in the document. The
        document is created if "id" doesn't exists otherwise it is replaced. Returns an array of status indicating
        the status of each document.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Update(self, request, context):
        """Updates one or more documents by "id". Each document is required to have the
        "id" field in it. Returns an array of status indicating the status of each document. Each status
        has an error field that is set to null in case document is updated successfully otherwise the error
        field is set with a code and message.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Delete(self, request, context):
        """Delete one or more documents by id. Returns an array of status indicating the status of each document. Each status
        has an error field that is set to null in case document is deleted successfully otherwise it will non null with
        an error code and message.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeleteByQuery(self, request, context):
        """DeleteByQuery is used to delete documents that match the filter. A filter is required. To delete document by id,
        you can pass the filter as follows ```{"id": "test"}```. Returns a count of number of documents deleted.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Search(self, request, context):
        """Searches an index for the documents matching the query. A search can be a term search or a phrase search.
        Search API allows filtering the result set using filters as documented
        <a href="https://docs.tigrisdata.com/overview/query#specification-1" title="here">here</a>. You can also perform
        a faceted search by passing the fields in the facet parameter. You can find more detailed documentation of the
        Search API with multiple examples <a href="https://docs.tigrisdata.com/overview/search" title="here">here</a>.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_SearchServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CreateOrUpdateIndex': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateOrUpdateIndex,
                    request_deserializer=server_dot_v1_dot_search__pb2.CreateOrUpdateIndexRequest.FromString,
                    response_serializer=server_dot_v1_dot_search__pb2.CreateOrUpdateIndexResponse.SerializeToString,
            ),
            'GetIndex': grpc.unary_unary_rpc_method_handler(
                    servicer.GetIndex,
                    request_deserializer=server_dot_v1_dot_search__pb2.GetIndexRequest.FromString,
                    response_serializer=server_dot_v1_dot_search__pb2.GetIndexResponse.SerializeToString,
            ),
            'DeleteIndex': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteIndex,
                    request_deserializer=server_dot_v1_dot_search__pb2.DeleteIndexRequest.FromString,
                    response_serializer=server_dot_v1_dot_search__pb2.DeleteIndexResponse.SerializeToString,
            ),
            'ListIndexes': grpc.unary_unary_rpc_method_handler(
                    servicer.ListIndexes,
                    request_deserializer=server_dot_v1_dot_search__pb2.ListIndexesRequest.FromString,
                    response_serializer=server_dot_v1_dot_search__pb2.ListIndexesResponse.SerializeToString,
            ),
            'Get': grpc.unary_unary_rpc_method_handler(
                    servicer.Get,
                    request_deserializer=server_dot_v1_dot_search__pb2.GetDocumentRequest.FromString,
                    response_serializer=server_dot_v1_dot_search__pb2.GetDocumentResponse.SerializeToString,
            ),
            'CreateById': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateById,
                    request_deserializer=server_dot_v1_dot_search__pb2.CreateByIdRequest.FromString,
                    response_serializer=server_dot_v1_dot_search__pb2.CreateByIdResponse.SerializeToString,
            ),
            'Create': grpc.unary_unary_rpc_method_handler(
                    servicer.Create,
                    request_deserializer=server_dot_v1_dot_search__pb2.CreateDocumentRequest.FromString,
                    response_serializer=server_dot_v1_dot_search__pb2.CreateDocumentResponse.SerializeToString,
            ),
            'CreateOrReplace': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateOrReplace,
                    request_deserializer=server_dot_v1_dot_search__pb2.CreateOrReplaceDocumentRequest.FromString,
                    response_serializer=server_dot_v1_dot_search__pb2.CreateOrReplaceDocumentResponse.SerializeToString,
            ),
            'Update': grpc.unary_unary_rpc_method_handler(
                    servicer.Update,
                    request_deserializer=server_dot_v1_dot_search__pb2.UpdateDocumentRequest.FromString,
                    response_serializer=server_dot_v1_dot_search__pb2.UpdateDocumentResponse.SerializeToString,
            ),
            'Delete': grpc.unary_unary_rpc_method_handler(
                    servicer.Delete,
                    request_deserializer=server_dot_v1_dot_search__pb2.DeleteDocumentRequest.FromString,
                    response_serializer=server_dot_v1_dot_search__pb2.DeleteDocumentResponse.SerializeToString,
            ),
            'DeleteByQuery': grpc.unary_unary_rpc_method_handler(
                    servicer.DeleteByQuery,
                    request_deserializer=server_dot_v1_dot_search__pb2.DeleteByQueryRequest.FromString,
                    response_serializer=server_dot_v1_dot_search__pb2.DeleteByQueryResponse.SerializeToString,
            ),
            'Search': grpc.unary_stream_rpc_method_handler(
                    servicer.Search,
                    request_deserializer=server_dot_v1_dot_search__pb2.SearchIndexRequest.FromString,
                    response_serializer=server_dot_v1_dot_search__pb2.SearchIndexResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'tigrisdata.search.v1.Search', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Search(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def CreateOrUpdateIndex(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/tigrisdata.search.v1.Search/CreateOrUpdateIndex',
            server_dot_v1_dot_search__pb2.CreateOrUpdateIndexRequest.SerializeToString,
            server_dot_v1_dot_search__pb2.CreateOrUpdateIndexResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetIndex(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/tigrisdata.search.v1.Search/GetIndex',
            server_dot_v1_dot_search__pb2.GetIndexRequest.SerializeToString,
            server_dot_v1_dot_search__pb2.GetIndexResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DeleteIndex(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/tigrisdata.search.v1.Search/DeleteIndex',
            server_dot_v1_dot_search__pb2.DeleteIndexRequest.SerializeToString,
            server_dot_v1_dot_search__pb2.DeleteIndexResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListIndexes(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/tigrisdata.search.v1.Search/ListIndexes',
            server_dot_v1_dot_search__pb2.ListIndexesRequest.SerializeToString,
            server_dot_v1_dot_search__pb2.ListIndexesResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Get(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/tigrisdata.search.v1.Search/Get',
            server_dot_v1_dot_search__pb2.GetDocumentRequest.SerializeToString,
            server_dot_v1_dot_search__pb2.GetDocumentResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CreateById(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/tigrisdata.search.v1.Search/CreateById',
            server_dot_v1_dot_search__pb2.CreateByIdRequest.SerializeToString,
            server_dot_v1_dot_search__pb2.CreateByIdResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Create(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/tigrisdata.search.v1.Search/Create',
            server_dot_v1_dot_search__pb2.CreateDocumentRequest.SerializeToString,
            server_dot_v1_dot_search__pb2.CreateDocumentResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CreateOrReplace(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/tigrisdata.search.v1.Search/CreateOrReplace',
            server_dot_v1_dot_search__pb2.CreateOrReplaceDocumentRequest.SerializeToString,
            server_dot_v1_dot_search__pb2.CreateOrReplaceDocumentResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Update(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/tigrisdata.search.v1.Search/Update',
            server_dot_v1_dot_search__pb2.UpdateDocumentRequest.SerializeToString,
            server_dot_v1_dot_search__pb2.UpdateDocumentResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Delete(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/tigrisdata.search.v1.Search/Delete',
            server_dot_v1_dot_search__pb2.DeleteDocumentRequest.SerializeToString,
            server_dot_v1_dot_search__pb2.DeleteDocumentResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DeleteByQuery(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/tigrisdata.search.v1.Search/DeleteByQuery',
            server_dot_v1_dot_search__pb2.DeleteByQueryRequest.SerializeToString,
            server_dot_v1_dot_search__pb2.DeleteByQueryResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Search(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_stream(request, target, '/tigrisdata.search.v1.Search/Search',
            server_dot_v1_dot_search__pb2.SearchIndexRequest.SerializeToString,
            server_dot_v1_dot_search__pb2.SearchIndexResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
