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

from . import rpc_pb2 as rpc__pb2


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

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

    Args:
      channel: A grpc.Channel.
    """
    self.RegisterToPublish = channel.unary_unary(
        '/rpc.Mesh/RegisterToPublish',
        request_serializer=rpc__pb2.PeerTopicInfo.SerializeToString,
        response_deserializer=rpc__pb2.Response.FromString,
        )
    self.Publish = channel.unary_unary(
        '/rpc.Mesh/Publish',
        request_serializer=rpc__pb2.PublishData.SerializeToString,
        response_deserializer=rpc__pb2.Response.FromString,
        )
    self.Subscribe = channel.unary_stream(
        '/rpc.Mesh/Subscribe',
        request_serializer=rpc__pb2.PeerTopicInfo.SerializeToString,
        response_deserializer=rpc__pb2.Data.FromString,
        )


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

  def RegisterToPublish(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Publish(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Subscribe(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_MeshServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'RegisterToPublish': grpc.unary_unary_rpc_method_handler(
          servicer.RegisterToPublish,
          request_deserializer=rpc__pb2.PeerTopicInfo.FromString,
          response_serializer=rpc__pb2.Response.SerializeToString,
      ),
      'Publish': grpc.unary_unary_rpc_method_handler(
          servicer.Publish,
          request_deserializer=rpc__pb2.PublishData.FromString,
          response_serializer=rpc__pb2.Response.SerializeToString,
      ),
      'Subscribe': grpc.unary_stream_rpc_method_handler(
          servicer.Subscribe,
          request_deserializer=rpc__pb2.PeerTopicInfo.FromString,
          response_serializer=rpc__pb2.Data.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'rpc.Mesh', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
