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

import EventHub_pb2 as EventHub__pb2


class PublisherStub(object):
  """Publisher service definition
  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.send = channel.stream_stream(
        '/predix.eventhub.Publisher/send',
        request_serializer=EventHub__pb2.PublishRequest.SerializeToString,
        response_deserializer=EventHub__pb2.PublishResponse.FromString,
        )


class PublisherServicer(object):
  """Publisher service definition
  """

  def send(self, request_iterator, context):
    """Send message to topic. Topic name will be in URI
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_PublisherServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'send': grpc.stream_stream_rpc_method_handler(
          servicer.send,
          request_deserializer=EventHub__pb2.PublishRequest.FromString,
          response_serializer=EventHub__pb2.PublishResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'predix.eventhub.Publisher', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))


class SubscriberStub(object):
  """Subscriber service definition
  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.receive = channel.unary_stream(
        '/predix.eventhub.Subscriber/receive',
        request_serializer=EventHub__pb2.SubscriptionRequest.SerializeToString,
        response_deserializer=EventHub__pb2.Message.FromString,
        )
    self.receiveWithAcks = channel.stream_stream(
        '/predix.eventhub.Subscriber/receiveWithAcks',
        request_serializer=EventHub__pb2.SubscriptionResponse.SerializeToString,
        response_deserializer=EventHub__pb2.Message.FromString,
        )
    self.subscribe = channel.stream_stream(
        '/predix.eventhub.Subscriber/subscribe',
        request_serializer=EventHub__pb2.SubscriptionAcks.SerializeToString,
        response_deserializer=EventHub__pb2.SubscriptionMessage.FromString,
        )


class SubscriberServicer(object):
  """Subscriber service definition
  """

  def receive(self, request, context):
    """Receive message from a topic, as a subscriber
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def receiveWithAcks(self, request_iterator, 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_iterator, 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_SubscriberServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'receive': grpc.unary_stream_rpc_method_handler(
          servicer.receive,
          request_deserializer=EventHub__pb2.SubscriptionRequest.FromString,
          response_serializer=EventHub__pb2.Message.SerializeToString,
      ),
      'receiveWithAcks': grpc.stream_stream_rpc_method_handler(
          servicer.receiveWithAcks,
          request_deserializer=EventHub__pb2.SubscriptionResponse.FromString,
          response_serializer=EventHub__pb2.Message.SerializeToString,
      ),
      'subscribe': grpc.stream_stream_rpc_method_handler(
          servicer.subscribe,
          request_deserializer=EventHub__pb2.SubscriptionAcks.FromString,
          response_serializer=EventHub__pb2.SubscriptionMessage.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'predix.eventhub.Subscriber', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
