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

import Command_pb2 as Command__pb2
import Event_pb2 as Event__pb2
import worm_pb2 as worm__pb2


class WormServiceStub(object):
  """service definition.
  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.IssueCommand = channel.unary_unary(
        '/WormService/IssueCommand',
        request_serializer=Command__pb2.Command.SerializeToString,
        response_deserializer=worm__pb2.Response.FromString,
        )
    self.Subscribe = channel.unary_stream(
        '/WormService/Subscribe',
        request_serializer=worm__pb2.Subscription.SerializeToString,
        response_deserializer=Event__pb2.Event.FromString,
        )


class WormServiceServicer(object):
  """service definition.
  """

  def IssueCommand(self, request, context):
    """Issue a Command
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Subscribe(self, request, context):
    """Subscribe, receive Events
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_WormServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'IssueCommand': grpc.unary_unary_rpc_method_handler(
          servicer.IssueCommand,
          request_deserializer=Command__pb2.Command.FromString,
          response_serializer=worm__pb2.Response.SerializeToString,
      ),
      'Subscribe': grpc.unary_stream_rpc_method_handler(
          servicer.Subscribe,
          request_deserializer=worm__pb2.Subscription.FromString,
          response_serializer=Event__pb2.Event.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'WormService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
