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

from . import spymonk_pb2 as spymonk__pb2

GRPC_GENERATED_VERSION = '1.78.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + ' but the generated code in spymonk_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class SpyMonkDBStub(object):
    """============================================================================
    Client API Service
    ============================================================================

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.BeginTransaction = channel.unary_unary(
                '/spymonk.SpyMonkDB/BeginTransaction',
                request_serializer=spymonk__pb2.BeginTransactionRequest.SerializeToString,
                response_deserializer=spymonk__pb2.BeginTransactionResponse.FromString,
                _registered_method=True)
        self.CommitTransaction = channel.unary_unary(
                '/spymonk.SpyMonkDB/CommitTransaction',
                request_serializer=spymonk__pb2.CommitTransactionRequest.SerializeToString,
                response_deserializer=spymonk__pb2.CommitTransactionResponse.FromString,
                _registered_method=True)
        self.AbortTransaction = channel.unary_unary(
                '/spymonk.SpyMonkDB/AbortTransaction',
                request_serializer=spymonk__pb2.AbortTransactionRequest.SerializeToString,
                response_deserializer=spymonk__pb2.AbortTransactionResponse.FromString,
                _registered_method=True)
        self.Get = channel.unary_unary(
                '/spymonk.SpyMonkDB/Get',
                request_serializer=spymonk__pb2.GetRequest.SerializeToString,
                response_deserializer=spymonk__pb2.GetResponse.FromString,
                _registered_method=True)
        self.Put = channel.unary_unary(
                '/spymonk.SpyMonkDB/Put',
                request_serializer=spymonk__pb2.PutRequest.SerializeToString,
                response_deserializer=spymonk__pb2.PutResponse.FromString,
                _registered_method=True)
        self.Delete = channel.unary_unary(
                '/spymonk.SpyMonkDB/Delete',
                request_serializer=spymonk__pb2.DeleteRequest.SerializeToString,
                response_deserializer=spymonk__pb2.DeleteResponse.FromString,
                _registered_method=True)
        self.Scan = channel.unary_stream(
                '/spymonk.SpyMonkDB/Scan',
                request_serializer=spymonk__pb2.ScanRequest.SerializeToString,
                response_deserializer=spymonk__pb2.ScanResponse.FromString,
                _registered_method=True)
        self.ExecuteSQL = channel.unary_unary(
                '/spymonk.SpyMonkDB/ExecuteSQL',
                request_serializer=spymonk__pb2.ExecuteSQLRequest.SerializeToString,
                response_deserializer=spymonk__pb2.ExecuteSQLResponse.FromString,
                _registered_method=True)
        self.ExecuteQuery = channel.unary_stream(
                '/spymonk.SpyMonkDB/ExecuteQuery',
                request_serializer=spymonk__pb2.ExecuteQueryRequest.SerializeToString,
                response_deserializer=spymonk__pb2.QueryRow.FromString,
                _registered_method=True)
        self.BatchWrite = channel.unary_unary(
                '/spymonk.SpyMonkDB/BatchWrite',
                request_serializer=spymonk__pb2.BatchWriteRequest.SerializeToString,
                response_deserializer=spymonk__pb2.BatchWriteResponse.FromString,
                _registered_method=True)


class SpyMonkDBServicer(object):
    """============================================================================
    Client API Service
    ============================================================================

    """

    def BeginTransaction(self, request, context):
        """Transaction operations
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CommitTransaction(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 AbortTransaction(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):
        """Data operations
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Put(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 Delete(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 Scan(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 ExecuteSQL(self, request, context):
        """SQL operations
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ExecuteQuery(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 BatchWrite(self, request, context):
        """Batch operations
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_SpyMonkDBServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'BeginTransaction': grpc.unary_unary_rpc_method_handler(
                    servicer.BeginTransaction,
                    request_deserializer=spymonk__pb2.BeginTransactionRequest.FromString,
                    response_serializer=spymonk__pb2.BeginTransactionResponse.SerializeToString,
            ),
            'CommitTransaction': grpc.unary_unary_rpc_method_handler(
                    servicer.CommitTransaction,
                    request_deserializer=spymonk__pb2.CommitTransactionRequest.FromString,
                    response_serializer=spymonk__pb2.CommitTransactionResponse.SerializeToString,
            ),
            'AbortTransaction': grpc.unary_unary_rpc_method_handler(
                    servicer.AbortTransaction,
                    request_deserializer=spymonk__pb2.AbortTransactionRequest.FromString,
                    response_serializer=spymonk__pb2.AbortTransactionResponse.SerializeToString,
            ),
            'Get': grpc.unary_unary_rpc_method_handler(
                    servicer.Get,
                    request_deserializer=spymonk__pb2.GetRequest.FromString,
                    response_serializer=spymonk__pb2.GetResponse.SerializeToString,
            ),
            'Put': grpc.unary_unary_rpc_method_handler(
                    servicer.Put,
                    request_deserializer=spymonk__pb2.PutRequest.FromString,
                    response_serializer=spymonk__pb2.PutResponse.SerializeToString,
            ),
            'Delete': grpc.unary_unary_rpc_method_handler(
                    servicer.Delete,
                    request_deserializer=spymonk__pb2.DeleteRequest.FromString,
                    response_serializer=spymonk__pb2.DeleteResponse.SerializeToString,
            ),
            'Scan': grpc.unary_stream_rpc_method_handler(
                    servicer.Scan,
                    request_deserializer=spymonk__pb2.ScanRequest.FromString,
                    response_serializer=spymonk__pb2.ScanResponse.SerializeToString,
            ),
            'ExecuteSQL': grpc.unary_unary_rpc_method_handler(
                    servicer.ExecuteSQL,
                    request_deserializer=spymonk__pb2.ExecuteSQLRequest.FromString,
                    response_serializer=spymonk__pb2.ExecuteSQLResponse.SerializeToString,
            ),
            'ExecuteQuery': grpc.unary_stream_rpc_method_handler(
                    servicer.ExecuteQuery,
                    request_deserializer=spymonk__pb2.ExecuteQueryRequest.FromString,
                    response_serializer=spymonk__pb2.QueryRow.SerializeToString,
            ),
            'BatchWrite': grpc.unary_unary_rpc_method_handler(
                    servicer.BatchWrite,
                    request_deserializer=spymonk__pb2.BatchWriteRequest.FromString,
                    response_serializer=spymonk__pb2.BatchWriteResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'spymonk.SpyMonkDB', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('spymonk.SpyMonkDB', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class SpyMonkDB(object):
    """============================================================================
    Client API Service
    ============================================================================

    """

    @staticmethod
    def BeginTransaction(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,
            '/spymonk.SpyMonkDB/BeginTransaction',
            spymonk__pb2.BeginTransactionRequest.SerializeToString,
            spymonk__pb2.BeginTransactionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def CommitTransaction(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,
            '/spymonk.SpyMonkDB/CommitTransaction',
            spymonk__pb2.CommitTransactionRequest.SerializeToString,
            spymonk__pb2.CommitTransactionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def AbortTransaction(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,
            '/spymonk.SpyMonkDB/AbortTransaction',
            spymonk__pb2.AbortTransactionRequest.SerializeToString,
            spymonk__pb2.AbortTransactionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @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,
            '/spymonk.SpyMonkDB/Get',
            spymonk__pb2.GetRequest.SerializeToString,
            spymonk__pb2.GetResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Put(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,
            '/spymonk.SpyMonkDB/Put',
            spymonk__pb2.PutRequest.SerializeToString,
            spymonk__pb2.PutResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @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,
            '/spymonk.SpyMonkDB/Delete',
            spymonk__pb2.DeleteRequest.SerializeToString,
            spymonk__pb2.DeleteResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Scan(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,
            '/spymonk.SpyMonkDB/Scan',
            spymonk__pb2.ScanRequest.SerializeToString,
            spymonk__pb2.ScanResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ExecuteSQL(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,
            '/spymonk.SpyMonkDB/ExecuteSQL',
            spymonk__pb2.ExecuteSQLRequest.SerializeToString,
            spymonk__pb2.ExecuteSQLResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ExecuteQuery(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,
            '/spymonk.SpyMonkDB/ExecuteQuery',
            spymonk__pb2.ExecuteQueryRequest.SerializeToString,
            spymonk__pb2.QueryRow.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def BatchWrite(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,
            '/spymonk.SpyMonkDB/BatchWrite',
            spymonk__pb2.BatchWriteRequest.SerializeToString,
            spymonk__pb2.BatchWriteResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)


class ReplicationServiceStub(object):
    """============================================================================
    Replication Service (Server-to-Server)
    ============================================================================

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Prepare = channel.unary_unary(
                '/spymonk.ReplicationService/Prepare',
                request_serializer=spymonk__pb2.PrepareRequest.SerializeToString,
                response_deserializer=spymonk__pb2.PrepareResponse.FromString,
                _registered_method=True)
        self.Accept = channel.unary_unary(
                '/spymonk.ReplicationService/Accept',
                request_serializer=spymonk__pb2.AcceptRequest.SerializeToString,
                response_deserializer=spymonk__pb2.AcceptResponse.FromString,
                _registered_method=True)
        self.Commit = channel.unary_unary(
                '/spymonk.ReplicationService/Commit',
                request_serializer=spymonk__pb2.CommitRequest.SerializeToString,
                response_deserializer=spymonk__pb2.CommitResponse.FromString,
                _registered_method=True)
        self.AppendEntries = channel.unary_unary(
                '/spymonk.ReplicationService/AppendEntries',
                request_serializer=spymonk__pb2.AppendEntriesRequest.SerializeToString,
                response_deserializer=spymonk__pb2.AppendEntriesResponse.FromString,
                _registered_method=True)
        self.InstallSnapshot = channel.stream_unary(
                '/spymonk.ReplicationService/InstallSnapshot',
                request_serializer=spymonk__pb2.SnapshotChunk.SerializeToString,
                response_deserializer=spymonk__pb2.InstallSnapshotResponse.FromString,
                _registered_method=True)


class ReplicationServiceServicer(object):
    """============================================================================
    Replication Service (Server-to-Server)
    ============================================================================

    """

    def Prepare(self, request, context):
        """Paxos messages
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Accept(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 Commit(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 AppendEntries(self, request, context):
        """Log replication
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def InstallSnapshot(self, request_iterator, 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 add_ReplicationServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Prepare': grpc.unary_unary_rpc_method_handler(
                    servicer.Prepare,
                    request_deserializer=spymonk__pb2.PrepareRequest.FromString,
                    response_serializer=spymonk__pb2.PrepareResponse.SerializeToString,
            ),
            'Accept': grpc.unary_unary_rpc_method_handler(
                    servicer.Accept,
                    request_deserializer=spymonk__pb2.AcceptRequest.FromString,
                    response_serializer=spymonk__pb2.AcceptResponse.SerializeToString,
            ),
            'Commit': grpc.unary_unary_rpc_method_handler(
                    servicer.Commit,
                    request_deserializer=spymonk__pb2.CommitRequest.FromString,
                    response_serializer=spymonk__pb2.CommitResponse.SerializeToString,
            ),
            'AppendEntries': grpc.unary_unary_rpc_method_handler(
                    servicer.AppendEntries,
                    request_deserializer=spymonk__pb2.AppendEntriesRequest.FromString,
                    response_serializer=spymonk__pb2.AppendEntriesResponse.SerializeToString,
            ),
            'InstallSnapshot': grpc.stream_unary_rpc_method_handler(
                    servicer.InstallSnapshot,
                    request_deserializer=spymonk__pb2.SnapshotChunk.FromString,
                    response_serializer=spymonk__pb2.InstallSnapshotResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'spymonk.ReplicationService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('spymonk.ReplicationService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class ReplicationService(object):
    """============================================================================
    Replication Service (Server-to-Server)
    ============================================================================

    """

    @staticmethod
    def Prepare(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,
            '/spymonk.ReplicationService/Prepare',
            spymonk__pb2.PrepareRequest.SerializeToString,
            spymonk__pb2.PrepareResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Accept(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,
            '/spymonk.ReplicationService/Accept',
            spymonk__pb2.AcceptRequest.SerializeToString,
            spymonk__pb2.AcceptResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Commit(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,
            '/spymonk.ReplicationService/Commit',
            spymonk__pb2.CommitRequest.SerializeToString,
            spymonk__pb2.CommitResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def AppendEntries(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,
            '/spymonk.ReplicationService/AppendEntries',
            spymonk__pb2.AppendEntriesRequest.SerializeToString,
            spymonk__pb2.AppendEntriesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def InstallSnapshot(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_unary(
            request_iterator,
            target,
            '/spymonk.ReplicationService/InstallSnapshot',
            spymonk__pb2.SnapshotChunk.SerializeToString,
            spymonk__pb2.InstallSnapshotResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
