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

from minknow.rpc import manager_pb2 as minknow_dot_rpc_dot_manager__pb2


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

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

    Args:
      channel: A grpc.Channel.
    """
    self.describe_host = channel.unary_unary(
        '/ont.rpc.manager.ManagerService/describe_host',
        request_serializer=minknow_dot_rpc_dot_manager__pb2.DescribeHostRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_manager__pb2.DescribeHostResponse.FromString,
        )
    self.list_devices = channel.unary_unary(
        '/ont.rpc.manager.ManagerService/list_devices',
        request_serializer=minknow_dot_rpc_dot_manager__pb2.ListDevicesRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_manager__pb2.ListDevicesResponse.FromString,
        )
    self.flow_cell_positions = channel.unary_stream(
        '/ont.rpc.manager.ManagerService/flow_cell_positions',
        request_serializer=minknow_dot_rpc_dot_manager__pb2.FlowCellPositionsRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_manager__pb2.FlowCellPositionsResponse.FromString,
        )
    self.watch_flow_cell_positions = channel.unary_stream(
        '/ont.rpc.manager.ManagerService/watch_flow_cell_positions',
        request_serializer=minknow_dot_rpc_dot_manager__pb2.WatchFlowCellPositionsRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_manager__pb2.WatchFlowCellPositionsResponse.FromString,
        )
    self.reset_position = channel.unary_unary(
        '/ont.rpc.manager.ManagerService/reset_position',
        request_serializer=minknow_dot_rpc_dot_manager__pb2.ResetPositionRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_manager__pb2.ResetPositionResponse.FromString,
        )
    self.basecaller_api = channel.unary_unary(
        '/ont.rpc.manager.ManagerService/basecaller_api',
        request_serializer=minknow_dot_rpc_dot_manager__pb2.BasecallerApiRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_manager__pb2.BasecallerApiResponse.FromString,
        )
    self.get_version_info = channel.unary_unary(
        '/ont.rpc.manager.ManagerService/get_version_info',
        request_serializer=minknow_dot_rpc_dot_manager__pb2.GetVersionInfoRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_manager__pb2.GetVersionInfoResponse.FromString,
        )
    self.list_protocol_output_dir_files = channel.unary_stream(
        '/ont.rpc.manager.ManagerService/list_protocol_output_dir_files',
        request_serializer=minknow_dot_rpc_dot_manager__pb2.ListProtocolOutputDirFilesRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_manager__pb2.ListProtocolOutputDirFilesResponse.FromString,
        )
    self.create_directory = channel.unary_unary(
        '/ont.rpc.manager.ManagerService/create_directory',
        request_serializer=minknow_dot_rpc_dot_manager__pb2.CreateDirectoryRequest.SerializeToString,
        response_deserializer=minknow_dot_rpc_dot_manager__pb2.CreateDirectoryResponse.FromString,
        )


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

  def describe_host(self, request, context):
    """Get information about the machine running MinKNOW.

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

  def list_devices(self, request, context):
    """List all devices attached to this machine.

    Devices will be in 1 of 3 states: active, pending, inactive. Will provide port information
    for any devices that are active

    DEPRECATED: use `flow_cell_positions` (or `watch_flow_cell_positions`) instead.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def flow_cell_positions(self, request, context):
    """List all known positions where flow cells can be inserted.

    Provides a snapshot of places where users can insert flow cells. It has a streamed response
    in case there are too many positions to fit into a single response, but normally there should
    only be a single response.

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

  def watch_flow_cell_positions(self, request, context):
    """Watch for changes in flow cell position availability and state.

    This is like flow_cell_positions, but updates are streamed as positions come and go (eg:
    MinIONs being plugged or unplugged), or their status otherwise changes.

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

  def reset_position(self, request, context):
    """Reset a flow cell position.

    If the hardware is in an error state or has been removed and the software is running, it will
    stop the software (causing the position to be forgotten if the hardware was removed).

    If the hardware is not in an error state
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def basecaller_api(self, request, context):
    """Get the connection information for the basecaller API.

    This is the service that implements the minknow.rpc.basecaller interface for basecalling
    reads files.

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

  def get_version_info(self, request, context):
    """Current version information includes:
    - Minknow version
    - Protocols version (i.e. Bream-4 version)
    - Configuration version (i.e. Wanda version)
    - Distribution version
    - Guppy version

    See also: instance.get_version_info which provides some similar information on a per instance basis.
    Since 3.3
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def list_protocol_output_dir_files(self, request, context):
    """Returns all the files that are within the protocol output dir specified in the user_conf - or a descendant of that directory
    if `path` is supplied in the request.

    INVALID_ARGUMENT will be returned if the `path` argument in the request is not a descendant of the protocol output directory

    NOT_FOUND will be returned if the path does not exist. 'The path' being either the protocol output directory if the `path` argument is not specified
    or a valid `path` argument is specified but does not exist.

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

  def create_directory(self, request, context):
    """Create a directory within the protocol output directory tree.

    Errors:
    INVALID_ARGUMENT will be returned if the parent path (where the directory is requested to
    be created) is not within the protocol output directory, or if invalid characters are
    in the requested directory name.

    FAILED_PRECONDITION will be returned if the parent path is not a directory.

    NOT_FOUND will be returned if the parent path does not exist.

    ALREADY_EXISTS will be returned if the directory exists and is not a directory (if the
    directory already exists, this is treated as success).

    The possible valid parent paths can be determined using list_protocol_output_dir_files().

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


def add_ManagerServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'describe_host': grpc.unary_unary_rpc_method_handler(
          servicer.describe_host,
          request_deserializer=minknow_dot_rpc_dot_manager__pb2.DescribeHostRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_manager__pb2.DescribeHostResponse.SerializeToString,
      ),
      'list_devices': grpc.unary_unary_rpc_method_handler(
          servicer.list_devices,
          request_deserializer=minknow_dot_rpc_dot_manager__pb2.ListDevicesRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_manager__pb2.ListDevicesResponse.SerializeToString,
      ),
      'flow_cell_positions': grpc.unary_stream_rpc_method_handler(
          servicer.flow_cell_positions,
          request_deserializer=minknow_dot_rpc_dot_manager__pb2.FlowCellPositionsRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_manager__pb2.FlowCellPositionsResponse.SerializeToString,
      ),
      'watch_flow_cell_positions': grpc.unary_stream_rpc_method_handler(
          servicer.watch_flow_cell_positions,
          request_deserializer=minknow_dot_rpc_dot_manager__pb2.WatchFlowCellPositionsRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_manager__pb2.WatchFlowCellPositionsResponse.SerializeToString,
      ),
      'reset_position': grpc.unary_unary_rpc_method_handler(
          servicer.reset_position,
          request_deserializer=minknow_dot_rpc_dot_manager__pb2.ResetPositionRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_manager__pb2.ResetPositionResponse.SerializeToString,
      ),
      'basecaller_api': grpc.unary_unary_rpc_method_handler(
          servicer.basecaller_api,
          request_deserializer=minknow_dot_rpc_dot_manager__pb2.BasecallerApiRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_manager__pb2.BasecallerApiResponse.SerializeToString,
      ),
      'get_version_info': grpc.unary_unary_rpc_method_handler(
          servicer.get_version_info,
          request_deserializer=minknow_dot_rpc_dot_manager__pb2.GetVersionInfoRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_manager__pb2.GetVersionInfoResponse.SerializeToString,
      ),
      'list_protocol_output_dir_files': grpc.unary_stream_rpc_method_handler(
          servicer.list_protocol_output_dir_files,
          request_deserializer=minknow_dot_rpc_dot_manager__pb2.ListProtocolOutputDirFilesRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_manager__pb2.ListProtocolOutputDirFilesResponse.SerializeToString,
      ),
      'create_directory': grpc.unary_unary_rpc_method_handler(
          servicer.create_directory,
          request_deserializer=minknow_dot_rpc_dot_manager__pb2.CreateDirectoryRequest.FromString,
          response_serializer=minknow_dot_rpc_dot_manager__pb2.CreateDirectoryResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'ont.rpc.manager.ManagerService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
