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

import bookkeeper.proto.kv_rpc_pb2 as kv__rpc__pb2


class TableServiceStub(object):
  # missing associated documentation comment in .proto file
  pass

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

    Args:
      channel: A grpc.Channel.
    """
    self.Range = channel.unary_unary(
        '/bookkeeper.proto.kv.rpc.TableService/Range',
        request_serializer=kv__rpc__pb2.RangeRequest.SerializeToString,
        response_deserializer=kv__rpc__pb2.RangeResponse.FromString,
        )
    self.Put = channel.unary_unary(
        '/bookkeeper.proto.kv.rpc.TableService/Put',
        request_serializer=kv__rpc__pb2.PutRequest.SerializeToString,
        response_deserializer=kv__rpc__pb2.PutResponse.FromString,
        )
    self.Delete = channel.unary_unary(
        '/bookkeeper.proto.kv.rpc.TableService/Delete',
        request_serializer=kv__rpc__pb2.DeleteRangeRequest.SerializeToString,
        response_deserializer=kv__rpc__pb2.DeleteRangeResponse.FromString,
        )
    self.Txn = channel.unary_unary(
        '/bookkeeper.proto.kv.rpc.TableService/Txn',
        request_serializer=kv__rpc__pb2.TxnRequest.SerializeToString,
        response_deserializer=kv__rpc__pb2.TxnResponse.FromString,
        )
    self.Increment = channel.unary_unary(
        '/bookkeeper.proto.kv.rpc.TableService/Increment',
        request_serializer=kv__rpc__pb2.IncrementRequest.SerializeToString,
        response_deserializer=kv__rpc__pb2.IncrementResponse.FromString,
        )


class TableServiceServicer(object):
  # missing associated documentation comment in .proto file
  pass

  def Range(self, request, context):
    """Range gets the keys in the range from the key-value store.
    NOT supported yet.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Put(self, request, context):
    """Put puts the given key into the key-value store.
    A put request increments the revision of the key-value store
    and generates one event in the event history.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Delete(self, request, context):
    """DeleteRange deletes the given range from the key-value store.
    A delete request increments the revision of the key-value store
    and generates a delete event in the event history for every deleted key.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Txn(self, request, context):
    """Txn processes multiple requests in a single transaction.
    A txn request increments the revision of the key-value store
    and generates events with the same revision for every completed request.
    It is not allowed to modify the same key several times within one txn.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Increment(self, request, context):
    """Increment increments the amount associated with the keys
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_TableServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Range': grpc.unary_unary_rpc_method_handler(
          servicer.Range,
          request_deserializer=kv__rpc__pb2.RangeRequest.FromString,
          response_serializer=kv__rpc__pb2.RangeResponse.SerializeToString,
      ),
      'Put': grpc.unary_unary_rpc_method_handler(
          servicer.Put,
          request_deserializer=kv__rpc__pb2.PutRequest.FromString,
          response_serializer=kv__rpc__pb2.PutResponse.SerializeToString,
      ),
      'Delete': grpc.unary_unary_rpc_method_handler(
          servicer.Delete,
          request_deserializer=kv__rpc__pb2.DeleteRangeRequest.FromString,
          response_serializer=kv__rpc__pb2.DeleteRangeResponse.SerializeToString,
      ),
      'Txn': grpc.unary_unary_rpc_method_handler(
          servicer.Txn,
          request_deserializer=kv__rpc__pb2.TxnRequest.FromString,
          response_serializer=kv__rpc__pb2.TxnResponse.SerializeToString,
      ),
      'Increment': grpc.unary_unary_rpc_method_handler(
          servicer.Increment,
          request_deserializer=kv__rpc__pb2.IncrementRequest.FromString,
          response_serializer=kv__rpc__pb2.IncrementResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'bookkeeper.proto.kv.rpc.TableService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
