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

from capsule8.api.v0 import telemetry_service_pb2 as capsule8_dot_api_dot_v0_dot_telemetry__service__pb2


class TelemetryServiceStub(object):
  """
  Capsule8 Telemetry API

  The Telemetry API allows you to subscribe to streams of live and
  historical Events from Capsule8 Sensors.


  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.GetEvents = channel.unary_stream(
        '/capsule8.api.v0.TelemetryService/GetEvents',
        request_serializer=capsule8_dot_api_dot_v0_dot_telemetry__service__pb2.GetEventsRequest.SerializeToString,
        response_deserializer=capsule8_dot_api_dot_v0_dot_telemetry__service__pb2.GetEventsResponse.FromString,
        )


class TelemetryServiceServicer(object):
  """
  Capsule8 Telemetry API

  The Telemetry API allows you to subscribe to streams of live and
  historical Events from Capsule8 Sensors.


  """

  def GetEvents(self, request, context):
    """Opens a new stream of telemetry events
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_TelemetryServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'GetEvents': grpc.unary_stream_rpc_method_handler(
          servicer.GetEvents,
          request_deserializer=capsule8_dot_api_dot_v0_dot_telemetry__service__pb2.GetEventsRequest.FromString,
          response_serializer=capsule8_dot_api_dot_v0_dot_telemetry__service__pb2.GetEventsResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'capsule8.api.v0.TelemetryService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
