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

from ydb._grpc.v3.draft.protos import ydb_keyvalue_pb2 as draft_dot_protos_dot_ydb__keyvalue__pb2


class KeyValueServiceStub(object):
    """KeyValue tablets provide a simple key-value storage in a low-overhead and easy-to-shoot-your-leg manner.
    To use KeyValue tablets in an efficient way one must be familiar with the design of both the KeyValue tablet
    and the Distributed Storage underneath it.

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.CreateVolume = channel.unary_unary(
                '/Ydb.KeyValue.V1.KeyValueService/CreateVolume',
                request_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.CreateVolumeRequest.SerializeToString,
                response_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.CreateVolumeResponse.FromString,
                )
        self.DropVolume = channel.unary_unary(
                '/Ydb.KeyValue.V1.KeyValueService/DropVolume',
                request_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.DropVolumeRequest.SerializeToString,
                response_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.DropVolumeResponse.FromString,
                )
        self.AlterVolume = channel.unary_unary(
                '/Ydb.KeyValue.V1.KeyValueService/AlterVolume',
                request_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.AlterVolumeRequest.SerializeToString,
                response_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.AlterVolumeResponse.FromString,
                )
        self.DescribeVolume = channel.unary_unary(
                '/Ydb.KeyValue.V1.KeyValueService/DescribeVolume',
                request_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.DescribeVolumeRequest.SerializeToString,
                response_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.DescribeVolumeResponse.FromString,
                )
        self.ListLocalPartitions = channel.unary_unary(
                '/Ydb.KeyValue.V1.KeyValueService/ListLocalPartitions',
                request_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ListLocalPartitionsRequest.SerializeToString,
                response_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ListLocalPartitionsResponse.FromString,
                )
        self.AcquireLock = channel.unary_unary(
                '/Ydb.KeyValue.V1.KeyValueService/AcquireLock',
                request_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.AcquireLockRequest.SerializeToString,
                response_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.AcquireLockResponse.FromString,
                )
        self.ExecuteTransaction = channel.unary_unary(
                '/Ydb.KeyValue.V1.KeyValueService/ExecuteTransaction',
                request_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ExecuteTransactionRequest.SerializeToString,
                response_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ExecuteTransactionResponse.FromString,
                )
        self.Read = channel.unary_unary(
                '/Ydb.KeyValue.V1.KeyValueService/Read',
                request_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ReadRequest.SerializeToString,
                response_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ReadResponse.FromString,
                )
        self.ReadRange = channel.unary_unary(
                '/Ydb.KeyValue.V1.KeyValueService/ReadRange',
                request_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ReadRangeRequest.SerializeToString,
                response_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ReadRangeResponse.FromString,
                )
        self.ListRange = channel.unary_unary(
                '/Ydb.KeyValue.V1.KeyValueService/ListRange',
                request_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ListRangeRequest.SerializeToString,
                response_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ListRangeResponse.FromString,
                )
        self.GetStorageChannelStatus = channel.unary_unary(
                '/Ydb.KeyValue.V1.KeyValueService/GetStorageChannelStatus',
                request_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.GetStorageChannelStatusRequest.SerializeToString,
                response_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.GetStorageChannelStatusResponse.FromString,
                )


class KeyValueServiceServicer(object):
    """KeyValue tablets provide a simple key-value storage in a low-overhead and easy-to-shoot-your-leg manner.
    To use KeyValue tablets in an efficient way one must be familiar with the design of both the KeyValue tablet
    and the Distributed Storage underneath it.

    """

    def CreateVolume(self, request, context):
        """Create a volume by path and partition count
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DropVolume(self, request, context):
        """Drop the volume by path
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AlterVolume(self, request, context):
        """Alter the volume by path
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DescribeVolume(self, request, context):
        """Describe the volume by path
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListLocalPartitions(self, request, context):
        """List partitions of a volume at the local node.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AcquireLock(self, request, context):
        """Acquire an exclusive lock for the partition.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ExecuteTransaction(self, request, context):
        """Perform list of commands to modify the state of the partition as an atomic transaction.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Read(self, request, context):
        """Read the value stored in the item with the key specified.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ReadRange(self, request, context):
        """Read items with keys in the specified range.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListRange(self, request, context):
        """List keys and metadata of items with keys in the specified range.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetStorageChannelStatus(self, request, context):
        """Get storage channel status of the partition.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_KeyValueServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'CreateVolume': grpc.unary_unary_rpc_method_handler(
                    servicer.CreateVolume,
                    request_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.CreateVolumeRequest.FromString,
                    response_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.CreateVolumeResponse.SerializeToString,
            ),
            'DropVolume': grpc.unary_unary_rpc_method_handler(
                    servicer.DropVolume,
                    request_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.DropVolumeRequest.FromString,
                    response_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.DropVolumeResponse.SerializeToString,
            ),
            'AlterVolume': grpc.unary_unary_rpc_method_handler(
                    servicer.AlterVolume,
                    request_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.AlterVolumeRequest.FromString,
                    response_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.AlterVolumeResponse.SerializeToString,
            ),
            'DescribeVolume': grpc.unary_unary_rpc_method_handler(
                    servicer.DescribeVolume,
                    request_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.DescribeVolumeRequest.FromString,
                    response_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.DescribeVolumeResponse.SerializeToString,
            ),
            'ListLocalPartitions': grpc.unary_unary_rpc_method_handler(
                    servicer.ListLocalPartitions,
                    request_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ListLocalPartitionsRequest.FromString,
                    response_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ListLocalPartitionsResponse.SerializeToString,
            ),
            'AcquireLock': grpc.unary_unary_rpc_method_handler(
                    servicer.AcquireLock,
                    request_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.AcquireLockRequest.FromString,
                    response_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.AcquireLockResponse.SerializeToString,
            ),
            'ExecuteTransaction': grpc.unary_unary_rpc_method_handler(
                    servicer.ExecuteTransaction,
                    request_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ExecuteTransactionRequest.FromString,
                    response_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ExecuteTransactionResponse.SerializeToString,
            ),
            'Read': grpc.unary_unary_rpc_method_handler(
                    servicer.Read,
                    request_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ReadRequest.FromString,
                    response_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ReadResponse.SerializeToString,
            ),
            'ReadRange': grpc.unary_unary_rpc_method_handler(
                    servicer.ReadRange,
                    request_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ReadRangeRequest.FromString,
                    response_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ReadRangeResponse.SerializeToString,
            ),
            'ListRange': grpc.unary_unary_rpc_method_handler(
                    servicer.ListRange,
                    request_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ListRangeRequest.FromString,
                    response_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.ListRangeResponse.SerializeToString,
            ),
            'GetStorageChannelStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.GetStorageChannelStatus,
                    request_deserializer=draft_dot_protos_dot_ydb__keyvalue__pb2.GetStorageChannelStatusRequest.FromString,
                    response_serializer=draft_dot_protos_dot_ydb__keyvalue__pb2.GetStorageChannelStatusResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'Ydb.KeyValue.V1.KeyValueService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class KeyValueService(object):
    """KeyValue tablets provide a simple key-value storage in a low-overhead and easy-to-shoot-your-leg manner.
    To use KeyValue tablets in an efficient way one must be familiar with the design of both the KeyValue tablet
    and the Distributed Storage underneath it.

    """

    @staticmethod
    def CreateVolume(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, '/Ydb.KeyValue.V1.KeyValueService/CreateVolume',
            draft_dot_protos_dot_ydb__keyvalue__pb2.CreateVolumeRequest.SerializeToString,
            draft_dot_protos_dot_ydb__keyvalue__pb2.CreateVolumeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DropVolume(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, '/Ydb.KeyValue.V1.KeyValueService/DropVolume',
            draft_dot_protos_dot_ydb__keyvalue__pb2.DropVolumeRequest.SerializeToString,
            draft_dot_protos_dot_ydb__keyvalue__pb2.DropVolumeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def AlterVolume(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, '/Ydb.KeyValue.V1.KeyValueService/AlterVolume',
            draft_dot_protos_dot_ydb__keyvalue__pb2.AlterVolumeRequest.SerializeToString,
            draft_dot_protos_dot_ydb__keyvalue__pb2.AlterVolumeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def DescribeVolume(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, '/Ydb.KeyValue.V1.KeyValueService/DescribeVolume',
            draft_dot_protos_dot_ydb__keyvalue__pb2.DescribeVolumeRequest.SerializeToString,
            draft_dot_protos_dot_ydb__keyvalue__pb2.DescribeVolumeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListLocalPartitions(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, '/Ydb.KeyValue.V1.KeyValueService/ListLocalPartitions',
            draft_dot_protos_dot_ydb__keyvalue__pb2.ListLocalPartitionsRequest.SerializeToString,
            draft_dot_protos_dot_ydb__keyvalue__pb2.ListLocalPartitionsResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def AcquireLock(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, '/Ydb.KeyValue.V1.KeyValueService/AcquireLock',
            draft_dot_protos_dot_ydb__keyvalue__pb2.AcquireLockRequest.SerializeToString,
            draft_dot_protos_dot_ydb__keyvalue__pb2.AcquireLockResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ExecuteTransaction(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, '/Ydb.KeyValue.V1.KeyValueService/ExecuteTransaction',
            draft_dot_protos_dot_ydb__keyvalue__pb2.ExecuteTransactionRequest.SerializeToString,
            draft_dot_protos_dot_ydb__keyvalue__pb2.ExecuteTransactionResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Read(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, '/Ydb.KeyValue.V1.KeyValueService/Read',
            draft_dot_protos_dot_ydb__keyvalue__pb2.ReadRequest.SerializeToString,
            draft_dot_protos_dot_ydb__keyvalue__pb2.ReadResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ReadRange(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, '/Ydb.KeyValue.V1.KeyValueService/ReadRange',
            draft_dot_protos_dot_ydb__keyvalue__pb2.ReadRangeRequest.SerializeToString,
            draft_dot_protos_dot_ydb__keyvalue__pb2.ReadRangeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def ListRange(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, '/Ydb.KeyValue.V1.KeyValueService/ListRange',
            draft_dot_protos_dot_ydb__keyvalue__pb2.ListRangeRequest.SerializeToString,
            draft_dot_protos_dot_ydb__keyvalue__pb2.ListRangeResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetStorageChannelStatus(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, '/Ydb.KeyValue.V1.KeyValueService/GetStorageChannelStatus',
            draft_dot_protos_dot_ydb__keyvalue__pb2.GetStorageChannelStatusRequest.SerializeToString,
            draft_dot_protos_dot_ydb__keyvalue__pb2.GetStorageChannelStatusResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
