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

from capsule8.api.v0 import event_service_pb2 as capsule8_dot_api_dot_v0_dot_event__service__pb2


class EventServiceStub(object):
  """
  Capsule8 Events API

  The Events API is used by end users to create and retrieve events

  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.CreateEvent = channel.unary_unary(
        '/capsule8.api.v0.EventService/CreateEvent',
        request_serializer=capsule8_dot_api_dot_v0_dot_event__service__pb2.CreateEventRequest.SerializeToString,
        response_deserializer=capsule8_dot_api_dot_v0_dot_event__service__pb2.CreateEventResponse.FromString,
        )
    self.WatchEvents = channel.unary_stream(
        '/capsule8.api.v0.EventService/WatchEvents',
        request_serializer=capsule8_dot_api_dot_v0_dot_event__service__pb2.WatchEventsRequest.SerializeToString,
        response_deserializer=capsule8_dot_api_dot_v0_dot_event__service__pb2.WatchEventsResponse.FromString,
        )


class EventServiceServicer(object):
  """
  Capsule8 Events API

  The Events API is used by end users to create and retrieve events

  """

  def CreateEvent(self, request, context):
    """Create a new event 
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def WatchEvents(self, request, context):
    """Get an event stream
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_EventServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'CreateEvent': grpc.unary_unary_rpc_method_handler(
          servicer.CreateEvent,
          request_deserializer=capsule8_dot_api_dot_v0_dot_event__service__pb2.CreateEventRequest.FromString,
          response_serializer=capsule8_dot_api_dot_v0_dot_event__service__pb2.CreateEventResponse.SerializeToString,
      ),
      'WatchEvents': grpc.unary_stream_rpc_method_handler(
          servicer.WatchEvents,
          request_deserializer=capsule8_dot_api_dot_v0_dot_event__service__pb2.WatchEventsRequest.FromString,
          response_serializer=capsule8_dot_api_dot_v0_dot_event__service__pb2.WatchEventsResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'capsule8.api.v0.EventService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
