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

from minknow.rpc import protocol_pb2 as minknow_dot_rpc_dot_protocol__pb2


class ProtocolServiceStub(object):
  # missing associated documentation comment in .proto file
  pass

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

    Args:
      channel: A grpc.Channel.
    """
    self.start_protocol = channel.unary_unary(
        '/ont.rpc.protocol.ProtocolService/start_protocol',
        request_serializer=minknow_dot_rpc_dot_protocol__pb2.StartProtocolRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_protocol__pb2.StartProtocolResponse.FromString,
        )
    self.stop_protocol = channel.unary_unary(
        '/ont.rpc.protocol.ProtocolService/stop_protocol',
        request_serializer=minknow_dot_rpc_dot_protocol__pb2.StopProtocolRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_protocol__pb2.StopProtocolResponse.FromString,
        )
    self.wait_for_finished = channel.unary_unary(
        '/ont.rpc.protocol.ProtocolService/wait_for_finished',
        request_serializer=minknow_dot_rpc_dot_protocol__pb2.WaitForFinishedRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_protocol__pb2.ProtocolRunInfo.FromString,
        )
    self.get_run_info = channel.unary_unary(
        '/ont.rpc.protocol.ProtocolService/get_run_info',
        request_serializer=minknow_dot_rpc_dot_protocol__pb2.GetRunInfoRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_protocol__pb2.ProtocolRunInfo.FromString,
        )
    self.list_protocol_runs = channel.unary_unary(
        '/ont.rpc.protocol.ProtocolService/list_protocol_runs',
        request_serializer=minknow_dot_rpc_dot_protocol__pb2.ListProtocolRunsRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_protocol__pb2.ListProtocolRunsResponse.FromString,
        )
    self.get_current_protocol_run = channel.unary_unary(
        '/ont.rpc.protocol.ProtocolService/get_current_protocol_run',
        request_serializer=minknow_dot_rpc_dot_protocol__pb2.GetCurrentProtocolRunRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_protocol__pb2.ProtocolRunInfo.FromString,
        )
    self.watch_current_protocol_run = channel.unary_stream(
        '/ont.rpc.protocol.ProtocolService/watch_current_protocol_run',
        request_serializer=minknow_dot_rpc_dot_protocol__pb2.WatchCurrentProtocolRunRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_protocol__pb2.ProtocolRunInfo.FromString,
        )
    self.list_protocols = channel.unary_unary(
        '/ont.rpc.protocol.ProtocolService/list_protocols',
        request_serializer=minknow_dot_rpc_dot_protocol__pb2.ListProtocolsRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_protocol__pb2.ListProtocolsResponse.FromString,
        )
    self.get_context_info = channel.unary_unary(
        '/ont.rpc.protocol.ProtocolService/get_context_info',
        request_serializer=minknow_dot_rpc_dot_protocol__pb2.GetContextInfoRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_protocol__pb2.GetContextInfoResponse.FromString,
        )
    self.set_context_info = channel.unary_unary(
        '/ont.rpc.protocol.ProtocolService/set_context_info',
        request_serializer=minknow_dot_rpc_dot_protocol__pb2.SetContextInfoRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_protocol__pb2.SetContextInfoResponse.FromString,
        )
    self.get_sample_id = channel.unary_unary(
        '/ont.rpc.protocol.ProtocolService/get_sample_id',
        request_serializer=minknow_dot_rpc_dot_protocol__pb2.GetSampleIdRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_protocol__pb2.GetSampleIdResponse.FromString,
        )
    self.set_sample_id = channel.unary_unary(
        '/ont.rpc.protocol.ProtocolService/set_sample_id',
        request_serializer=minknow_dot_rpc_dot_protocol__pb2.SetSampleIdRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_protocol__pb2.SetSampleIdResponse.FromString,
        )
    self.get_protocol_purpose = channel.unary_unary(
        '/ont.rpc.protocol.ProtocolService/get_protocol_purpose',
        request_serializer=minknow_dot_rpc_dot_protocol__pb2.GetProtocolPurposeRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_protocol__pb2.GetProtocolPurposeResponse.FromString,
        )
    self.set_protocol_purpose = channel.unary_unary(
        '/ont.rpc.protocol.ProtocolService/set_protocol_purpose',
        request_serializer=minknow_dot_rpc_dot_protocol__pb2.SetProtocolPurposeRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_protocol__pb2.SetProtocolPurposeResponse.FromString,
        )
    self.add_epi2me_workflow = channel.unary_unary(
        '/ont.rpc.protocol.ProtocolService/add_epi2me_workflow',
        request_serializer=minknow_dot_rpc_dot_protocol__pb2.AddEpi2meWorkflowRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_protocol__pb2.AddEpi2meWorkflowResponse.FromString,
        )
    self.list_protocol_group_ids = channel.unary_unary(
        '/ont.rpc.protocol.ProtocolService/list_protocol_group_ids',
        request_serializer=minknow_dot_rpc_dot_protocol__pb2.ListProtocolGroupIdsRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_protocol__pb2.ListProtocolGroupIdsResponse.FromString,
        )


class ProtocolServiceServicer(object):
  # missing associated documentation comment in .proto file
  pass

  def start_protocol(self, request, context):
    """Initiates a python instance that runs the script specified by the `path` argument.
    `list_protocols` will give back a list of protocol scripts that can be started by this call
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def stop_protocol(self, request, context):
    """Stops the currently running protocol script instance.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def wait_for_finished(self, request, context):
    """Wait for a protocol run to finish.

    The call blocks until the run with the given run ID has finished (or returns immediately if
    it had already finished) and returns information about the protocol run.

    If no run has been started with the provided run ID (or no run ID is given), an error is
    returned.

    If NOTIFY_BEFORE_TERMINATION is specified for state, the protocol end time is an estimate, including
    the allowed timeout.

    Since 1.10
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def get_run_info(self, request, context):
    """Gets information about a protocol run.

    If no run ID is provided, information about the most recently started protocol run is
    provided.

    Since 1.10
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def list_protocol_runs(self, request, context):
    """List previously started protocol run ids (including any current protocol), in order of starting.

    The returned object can be used to find protocol information with get_run_info.

    Since 1.11
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def get_current_protocol_run(self, request, context):
    """Returns the name and run id of the currently running protocol.

    Will fail with FAILED_PRECONDITION if there is no protocol running

    Since 1.11
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def watch_current_protocol_run(self, request, context):
    """Returns current protocol run info and streams any changes to the current protocol

    This call can be made even if there is no current protocol running. In this case, the next streamed
    response will be the start of a new protocol instance and you will receive updates for that protocol
    until it finishes

    If a protocol finishes this stream will still continue to run and you will be notified when a new protocol starts

    Since 1.12
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def list_protocols(self, request, context):
    """Gives back a list that contains info about each possible protocol script minknow is aware of.
    This will most likely be used to retrieve a suitable protocol script that can be passed on to `start_protocol`

    Since 1.10
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def get_context_info(self, request, context):
    """Returns string-to-string map of the context tags

    Since 1.11
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def set_context_info(self, request, context):
    """Store context tags as arbitary string-to-string map

    Since 1.11
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def get_sample_id(self, request, context):
    """Sample id is a value set from the GUI that is defined by the user to identify an experiment.
    This call gets this value
    Deprecated: The sample_id is provided in the ProtocolRunUserInfo

    Since 1.11
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def set_sample_id(self, request, context):
    """Sets the sample id. Refer to get_sample_id for what sample id is used for
    Deprecated: The sample_id should be set in the request when a protocol starts ( start_protocol() )

    Since 1.11
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def get_protocol_purpose(self, request, context):
    """Value set by protocol scripts to define the purpose of the script. Gets this value

    Since 1.11
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def set_protocol_purpose(self, request, context):
    """Sets the protocol purpose. See also get_protocol_purpose

    Since 1.11
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def add_epi2me_workflow(self, request, context):
    """Links an epi2me workflow reference to a run id.

    Since 1.15
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def list_protocol_group_ids(self, request, context):
    """List all used protocol group ids used in any previous protocol on the box.

    Since 3.2
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_ProtocolServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'start_protocol': grpc.unary_unary_rpc_method_handler(
          servicer.start_protocol,
          request_deserializer=minknow_dot_rpc_dot_protocol__pb2.StartProtocolRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_protocol__pb2.StartProtocolResponse.SerializeToString,
      ),
      'stop_protocol': grpc.unary_unary_rpc_method_handler(
          servicer.stop_protocol,
          request_deserializer=minknow_dot_rpc_dot_protocol__pb2.StopProtocolRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_protocol__pb2.StopProtocolResponse.SerializeToString,
      ),
      'wait_for_finished': grpc.unary_unary_rpc_method_handler(
          servicer.wait_for_finished,
          request_deserializer=minknow_dot_rpc_dot_protocol__pb2.WaitForFinishedRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_protocol__pb2.ProtocolRunInfo.SerializeToString,
      ),
      'get_run_info': grpc.unary_unary_rpc_method_handler(
          servicer.get_run_info,
          request_deserializer=minknow_dot_rpc_dot_protocol__pb2.GetRunInfoRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_protocol__pb2.ProtocolRunInfo.SerializeToString,
      ),
      'list_protocol_runs': grpc.unary_unary_rpc_method_handler(
          servicer.list_protocol_runs,
          request_deserializer=minknow_dot_rpc_dot_protocol__pb2.ListProtocolRunsRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_protocol__pb2.ListProtocolRunsResponse.SerializeToString,
      ),
      'get_current_protocol_run': grpc.unary_unary_rpc_method_handler(
          servicer.get_current_protocol_run,
          request_deserializer=minknow_dot_rpc_dot_protocol__pb2.GetCurrentProtocolRunRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_protocol__pb2.ProtocolRunInfo.SerializeToString,
      ),
      'watch_current_protocol_run': grpc.unary_stream_rpc_method_handler(
          servicer.watch_current_protocol_run,
          request_deserializer=minknow_dot_rpc_dot_protocol__pb2.WatchCurrentProtocolRunRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_protocol__pb2.ProtocolRunInfo.SerializeToString,
      ),
      'list_protocols': grpc.unary_unary_rpc_method_handler(
          servicer.list_protocols,
          request_deserializer=minknow_dot_rpc_dot_protocol__pb2.ListProtocolsRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_protocol__pb2.ListProtocolsResponse.SerializeToString,
      ),
      'get_context_info': grpc.unary_unary_rpc_method_handler(
          servicer.get_context_info,
          request_deserializer=minknow_dot_rpc_dot_protocol__pb2.GetContextInfoRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_protocol__pb2.GetContextInfoResponse.SerializeToString,
      ),
      'set_context_info': grpc.unary_unary_rpc_method_handler(
          servicer.set_context_info,
          request_deserializer=minknow_dot_rpc_dot_protocol__pb2.SetContextInfoRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_protocol__pb2.SetContextInfoResponse.SerializeToString,
      ),
      'get_sample_id': grpc.unary_unary_rpc_method_handler(
          servicer.get_sample_id,
          request_deserializer=minknow_dot_rpc_dot_protocol__pb2.GetSampleIdRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_protocol__pb2.GetSampleIdResponse.SerializeToString,
      ),
      'set_sample_id': grpc.unary_unary_rpc_method_handler(
          servicer.set_sample_id,
          request_deserializer=minknow_dot_rpc_dot_protocol__pb2.SetSampleIdRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_protocol__pb2.SetSampleIdResponse.SerializeToString,
      ),
      'get_protocol_purpose': grpc.unary_unary_rpc_method_handler(
          servicer.get_protocol_purpose,
          request_deserializer=minknow_dot_rpc_dot_protocol__pb2.GetProtocolPurposeRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_protocol__pb2.GetProtocolPurposeResponse.SerializeToString,
      ),
      'set_protocol_purpose': grpc.unary_unary_rpc_method_handler(
          servicer.set_protocol_purpose,
          request_deserializer=minknow_dot_rpc_dot_protocol__pb2.SetProtocolPurposeRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_protocol__pb2.SetProtocolPurposeResponse.SerializeToString,
      ),
      'add_epi2me_workflow': grpc.unary_unary_rpc_method_handler(
          servicer.add_epi2me_workflow,
          request_deserializer=minknow_dot_rpc_dot_protocol__pb2.AddEpi2meWorkflowRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_protocol__pb2.AddEpi2meWorkflowResponse.SerializeToString,
      ),
      'list_protocol_group_ids': grpc.unary_unary_rpc_method_handler(
          servicer.list_protocol_group_ids,
          request_deserializer=minknow_dot_rpc_dot_protocol__pb2.ListProtocolGroupIdsRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_protocol__pb2.ListProtocolGroupIdsResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'ont.rpc.protocol.ProtocolService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
