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

from capsule8.api.v0 import capsulator_service_pb2 as capsule8_dot_api_dot_v0_dot_capsulator__service__pb2


class CapsulatorServiceStub(object):
  """
  Capsule8 Capsulator API

  The Capsulator API is used by platform clients to view the current state
  of all connected capsulators and for capsulators to report their current
  state.

  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.ListCapsulators = channel.unary_unary(
        '/capsule8.api.v0.CapsulatorService/ListCapsulators',
        request_serializer=capsule8_dot_api_dot_v0_dot_capsulator__service__pb2.ListCapsulatorsRequest.SerializeToString,
        response_deserializer=capsule8_dot_api_dot_v0_dot_capsulator__service__pb2.ListCapsulatorsResponse.FromString,
        )
    self.CreateCapsulator = channel.stream_stream(
        '/capsule8.api.v0.CapsulatorService/CreateCapsulator',
        request_serializer=capsule8_dot_api_dot_v0_dot_capsulator__service__pb2.CreateCapsulatorRequest.SerializeToString,
        response_deserializer=capsule8_dot_api_dot_v0_dot_capsulator__service__pb2.CreateCapsulatorResponse.FromString,
        )


class CapsulatorServiceServicer(object):
  """
  Capsule8 Capsulator API

  The Capsulator API is used by platform clients to view the current state
  of all connected capsulators and for capsulators to report their current
  state.

  """

  def ListCapsulators(self, request, context):
    """Lists all active capsulators connected to the platform
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def CreateCapsulator(self, request_iterator, context):
    """Persistent client (capsulator) -> server (c8 platform) stream of
    capsulator metadata. The stream itself serves as a liveness check.
    It is meant to manage the liveness of a single capsulator.
    The first request establishes that the capsulator is alive and subsequent requests
    update any metadata for that capsulator.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_CapsulatorServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'ListCapsulators': grpc.unary_unary_rpc_method_handler(
          servicer.ListCapsulators,
          request_deserializer=capsule8_dot_api_dot_v0_dot_capsulator__service__pb2.ListCapsulatorsRequest.FromString,
          response_serializer=capsule8_dot_api_dot_v0_dot_capsulator__service__pb2.ListCapsulatorsResponse.SerializeToString,
      ),
      'CreateCapsulator': grpc.stream_stream_rpc_method_handler(
          servicer.CreateCapsulator,
          request_deserializer=capsule8_dot_api_dot_v0_dot_capsulator__service__pb2.CreateCapsulatorRequest.FromString,
          response_serializer=capsule8_dot_api_dot_v0_dot_capsulator__service__pb2.CreateCapsulatorResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'capsule8.api.v0.CapsulatorService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
