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

import aft_pb2 as aft__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.StartTransaction = channel.unary_unary(
                '/aft.Aft/StartTransaction',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=aft__pb2.TransactionTag.FromString,
                )
        self.Write = channel.unary_unary(
                '/aft.Aft/Write',
                request_serializer=aft__pb2.AftKeyRequest.SerializeToString,
                response_deserializer=aft__pb2.AftKeyRequest.FromString,
                )
        self.Read = channel.unary_unary(
                '/aft.Aft/Read',
                request_serializer=aft__pb2.AftKeyRequest.SerializeToString,
                response_deserializer=aft__pb2.AftKeyRequest.FromString,
                )
        self.CommitTransaction = channel.unary_unary(
                '/aft.Aft/CommitTransaction',
                request_serializer=aft__pb2.TransactionTag.SerializeToString,
                response_deserializer=aft__pb2.TransactionTag.FromString,
                )
        self.AbortTransaction = channel.unary_unary(
                '/aft.Aft/AbortTransaction',
                request_serializer=aft__pb2.TransactionTag.SerializeToString,
                response_deserializer=aft__pb2.TransactionTag.FromString,
                )


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

    def StartTransaction(self, request, context):
        """Starts a new transaction in the system and returns a unique transaction
        ID. The updates made in the context of this transaction will not be
        persisted until CommitTransaction is called.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Write(self, request, context):
        """Tentatively write a value or batch of values to the storage engine. These
        writes will not be committed until CommitTransaction is called. If
        AbortTransaction is called, these writes will be dropped.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Read(self, request, context):
        """Retrieve a value from the storage engine.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CommitTransaction(self, request, context):
        """Commits buffered writes to the storage engine. The commit is not
        guaranteed to succeed and may depend on the isolation mechanisms being
        used in order to determine whether the transactions updates and reads are
        valid.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AbortTransaction(self, request, context):
        """Aborts all of the updates made by this transaction. The buffered updates
        will be dropped, and the transaction in the underlying engine will be
        closed.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AftServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'StartTransaction': grpc.unary_unary_rpc_method_handler(
                    servicer.StartTransaction,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=aft__pb2.TransactionTag.SerializeToString,
            ),
            'Write': grpc.unary_unary_rpc_method_handler(
                    servicer.Write,
                    request_deserializer=aft__pb2.AftKeyRequest.FromString,
                    response_serializer=aft__pb2.AftKeyRequest.SerializeToString,
            ),
            'Read': grpc.unary_unary_rpc_method_handler(
                    servicer.Read,
                    request_deserializer=aft__pb2.AftKeyRequest.FromString,
                    response_serializer=aft__pb2.AftKeyRequest.SerializeToString,
            ),
            'CommitTransaction': grpc.unary_unary_rpc_method_handler(
                    servicer.CommitTransaction,
                    request_deserializer=aft__pb2.TransactionTag.FromString,
                    response_serializer=aft__pb2.TransactionTag.SerializeToString,
            ),
            'AbortTransaction': grpc.unary_unary_rpc_method_handler(
                    servicer.AbortTransaction,
                    request_deserializer=aft__pb2.TransactionTag.FromString,
                    response_serializer=aft__pb2.TransactionTag.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'aft.Aft', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def StartTransaction(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, '/aft.Aft/StartTransaction',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            aft__pb2.TransactionTag.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Write(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, '/aft.Aft/Write',
            aft__pb2.AftKeyRequest.SerializeToString,
            aft__pb2.AftKeyRequest.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, '/aft.Aft/Read',
            aft__pb2.AftKeyRequest.SerializeToString,
            aft__pb2.AftKeyRequest.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @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, '/aft.Aft/CommitTransaction',
            aft__pb2.TransactionTag.SerializeToString,
            aft__pb2.TransactionTag.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @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, '/aft.Aft/AbortTransaction',
            aft__pb2.TransactionTag.SerializeToString,
            aft__pb2.TransactionTag.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
