# Generated by the Protocol Buffers compiler. DO NOT EDIT!
# source: minknow/rpc/protocol.proto
# plugin: grpclib.plugin.main
import abc
import typing

import grpclib.const
import grpclib.client
if typing.TYPE_CHECKING:
    import grpclib.server

from . import acquisition_pb2
from . import device_pb2
from . import rpc_options_pb2
import google.protobuf.timestamp_pb2
import google.protobuf.wrappers_pb2
from . import protocol_pb2


class ProtocolServiceBase(abc.ABC):

    @abc.abstractmethod
    async def start_protocol(self, stream: 'grpclib.server.Stream[minknow.rpc.protocol_pb2.StartProtocolRequest, minknow.rpc.protocol_pb2.StartProtocolResponse]') -> None:
        pass

    @abc.abstractmethod
    async def stop_protocol(self, stream: 'grpclib.server.Stream[minknow.rpc.protocol_pb2.StopProtocolRequest, minknow.rpc.protocol_pb2.StopProtocolResponse]') -> None:
        pass

    @abc.abstractmethod
    async def wait_for_finished(self, stream: 'grpclib.server.Stream[minknow.rpc.protocol_pb2.WaitForFinishedRequest, minknow.rpc.protocol_pb2.ProtocolRunInfo]') -> None:
        pass

    @abc.abstractmethod
    async def get_run_info(self, stream: 'grpclib.server.Stream[minknow.rpc.protocol_pb2.GetRunInfoRequest, minknow.rpc.protocol_pb2.ProtocolRunInfo]') -> None:
        pass

    @abc.abstractmethod
    async def list_protocol_runs(self, stream: 'grpclib.server.Stream[minknow.rpc.protocol_pb2.ListProtocolRunsRequest, minknow.rpc.protocol_pb2.ListProtocolRunsResponse]') -> None:
        pass

    @abc.abstractmethod
    async def get_current_protocol_run(self, stream: 'grpclib.server.Stream[minknow.rpc.protocol_pb2.GetCurrentProtocolRunRequest, minknow.rpc.protocol_pb2.ProtocolRunInfo]') -> None:
        pass

    @abc.abstractmethod
    async def watch_current_protocol_run(self, stream: 'grpclib.server.Stream[minknow.rpc.protocol_pb2.WatchCurrentProtocolRunRequest, minknow.rpc.protocol_pb2.ProtocolRunInfo]') -> None:
        pass

    @abc.abstractmethod
    async def list_protocols(self, stream: 'grpclib.server.Stream[minknow.rpc.protocol_pb2.ListProtocolsRequest, minknow.rpc.protocol_pb2.ListProtocolsResponse]') -> None:
        pass

    @abc.abstractmethod
    async def get_context_info(self, stream: 'grpclib.server.Stream[minknow.rpc.protocol_pb2.GetContextInfoRequest, minknow.rpc.protocol_pb2.GetContextInfoResponse]') -> None:
        pass

    @abc.abstractmethod
    async def set_context_info(self, stream: 'grpclib.server.Stream[minknow.rpc.protocol_pb2.SetContextInfoRequest, minknow.rpc.protocol_pb2.SetContextInfoResponse]') -> None:
        pass

    @abc.abstractmethod
    async def get_sample_id(self, stream: 'grpclib.server.Stream[minknow.rpc.protocol_pb2.GetSampleIdRequest, minknow.rpc.protocol_pb2.GetSampleIdResponse]') -> None:
        pass

    @abc.abstractmethod
    async def set_sample_id(self, stream: 'grpclib.server.Stream[minknow.rpc.protocol_pb2.SetSampleIdRequest, minknow.rpc.protocol_pb2.SetSampleIdResponse]') -> None:
        pass

    @abc.abstractmethod
    async def get_protocol_purpose(self, stream: 'grpclib.server.Stream[minknow.rpc.protocol_pb2.GetProtocolPurposeRequest, minknow.rpc.protocol_pb2.GetProtocolPurposeResponse]') -> None:
        pass

    @abc.abstractmethod
    async def set_protocol_purpose(self, stream: 'grpclib.server.Stream[minknow.rpc.protocol_pb2.SetProtocolPurposeRequest, minknow.rpc.protocol_pb2.SetProtocolPurposeResponse]') -> None:
        pass

    @abc.abstractmethod
    async def add_epi2me_workflow(self, stream: 'grpclib.server.Stream[minknow.rpc.protocol_pb2.AddEpi2meWorkflowRequest, minknow.rpc.protocol_pb2.AddEpi2meWorkflowResponse]') -> None:
        pass

    @abc.abstractmethod
    async def list_protocol_group_ids(self, stream: 'grpclib.server.Stream[minknow.rpc.protocol_pb2.ListProtocolGroupIdsRequest, minknow.rpc.protocol_pb2.ListProtocolGroupIdsResponse]') -> None:
        pass

    def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
        return {
            '/ont.rpc.protocol.ProtocolService/start_protocol': grpclib.const.Handler(
                self.start_protocol,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.protocol_pb2.StartProtocolRequest,
                minknow.rpc.protocol_pb2.StartProtocolResponse,
            ),
            '/ont.rpc.protocol.ProtocolService/stop_protocol': grpclib.const.Handler(
                self.stop_protocol,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.protocol_pb2.StopProtocolRequest,
                minknow.rpc.protocol_pb2.StopProtocolResponse,
            ),
            '/ont.rpc.protocol.ProtocolService/wait_for_finished': grpclib.const.Handler(
                self.wait_for_finished,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.protocol_pb2.WaitForFinishedRequest,
                minknow.rpc.protocol_pb2.ProtocolRunInfo,
            ),
            '/ont.rpc.protocol.ProtocolService/get_run_info': grpclib.const.Handler(
                self.get_run_info,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.protocol_pb2.GetRunInfoRequest,
                minknow.rpc.protocol_pb2.ProtocolRunInfo,
            ),
            '/ont.rpc.protocol.ProtocolService/list_protocol_runs': grpclib.const.Handler(
                self.list_protocol_runs,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.protocol_pb2.ListProtocolRunsRequest,
                minknow.rpc.protocol_pb2.ListProtocolRunsResponse,
            ),
            '/ont.rpc.protocol.ProtocolService/get_current_protocol_run': grpclib.const.Handler(
                self.get_current_protocol_run,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.protocol_pb2.GetCurrentProtocolRunRequest,
                minknow.rpc.protocol_pb2.ProtocolRunInfo,
            ),
            '/ont.rpc.protocol.ProtocolService/watch_current_protocol_run': grpclib.const.Handler(
                self.watch_current_protocol_run,
                grpclib.const.Cardinality.UNARY_STREAM,
                minknow.rpc.protocol_pb2.WatchCurrentProtocolRunRequest,
                minknow.rpc.protocol_pb2.ProtocolRunInfo,
            ),
            '/ont.rpc.protocol.ProtocolService/list_protocols': grpclib.const.Handler(
                self.list_protocols,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.protocol_pb2.ListProtocolsRequest,
                minknow.rpc.protocol_pb2.ListProtocolsResponse,
            ),
            '/ont.rpc.protocol.ProtocolService/get_context_info': grpclib.const.Handler(
                self.get_context_info,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.protocol_pb2.GetContextInfoRequest,
                minknow.rpc.protocol_pb2.GetContextInfoResponse,
            ),
            '/ont.rpc.protocol.ProtocolService/set_context_info': grpclib.const.Handler(
                self.set_context_info,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.protocol_pb2.SetContextInfoRequest,
                minknow.rpc.protocol_pb2.SetContextInfoResponse,
            ),
            '/ont.rpc.protocol.ProtocolService/get_sample_id': grpclib.const.Handler(
                self.get_sample_id,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.protocol_pb2.GetSampleIdRequest,
                minknow.rpc.protocol_pb2.GetSampleIdResponse,
            ),
            '/ont.rpc.protocol.ProtocolService/set_sample_id': grpclib.const.Handler(
                self.set_sample_id,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.protocol_pb2.SetSampleIdRequest,
                minknow.rpc.protocol_pb2.SetSampleIdResponse,
            ),
            '/ont.rpc.protocol.ProtocolService/get_protocol_purpose': grpclib.const.Handler(
                self.get_protocol_purpose,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.protocol_pb2.GetProtocolPurposeRequest,
                minknow.rpc.protocol_pb2.GetProtocolPurposeResponse,
            ),
            '/ont.rpc.protocol.ProtocolService/set_protocol_purpose': grpclib.const.Handler(
                self.set_protocol_purpose,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.protocol_pb2.SetProtocolPurposeRequest,
                minknow.rpc.protocol_pb2.SetProtocolPurposeResponse,
            ),
            '/ont.rpc.protocol.ProtocolService/add_epi2me_workflow': grpclib.const.Handler(
                self.add_epi2me_workflow,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.protocol_pb2.AddEpi2meWorkflowRequest,
                minknow.rpc.protocol_pb2.AddEpi2meWorkflowResponse,
            ),
            '/ont.rpc.protocol.ProtocolService/list_protocol_group_ids': grpclib.const.Handler(
                self.list_protocol_group_ids,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.protocol_pb2.ListProtocolGroupIdsRequest,
                minknow.rpc.protocol_pb2.ListProtocolGroupIdsResponse,
            ),
        }


class ProtocolServiceStub:

    def __init__(self, channel: grpclib.client.Channel) -> None:
        self.start_protocol = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.protocol.ProtocolService/start_protocol',
            minknow.rpc.protocol_pb2.StartProtocolRequest,
            minknow.rpc.protocol_pb2.StartProtocolResponse,
        )
        self.stop_protocol = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.protocol.ProtocolService/stop_protocol',
            minknow.rpc.protocol_pb2.StopProtocolRequest,
            minknow.rpc.protocol_pb2.StopProtocolResponse,
        )
        self.wait_for_finished = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.protocol.ProtocolService/wait_for_finished',
            minknow.rpc.protocol_pb2.WaitForFinishedRequest,
            minknow.rpc.protocol_pb2.ProtocolRunInfo,
        )
        self.get_run_info = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.protocol.ProtocolService/get_run_info',
            minknow.rpc.protocol_pb2.GetRunInfoRequest,
            minknow.rpc.protocol_pb2.ProtocolRunInfo,
        )
        self.list_protocol_runs = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.protocol.ProtocolService/list_protocol_runs',
            minknow.rpc.protocol_pb2.ListProtocolRunsRequest,
            minknow.rpc.protocol_pb2.ListProtocolRunsResponse,
        )
        self.get_current_protocol_run = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.protocol.ProtocolService/get_current_protocol_run',
            minknow.rpc.protocol_pb2.GetCurrentProtocolRunRequest,
            minknow.rpc.protocol_pb2.ProtocolRunInfo,
        )
        self.watch_current_protocol_run = grpclib.client.UnaryStreamMethod(
            channel,
            '/ont.rpc.protocol.ProtocolService/watch_current_protocol_run',
            minknow.rpc.protocol_pb2.WatchCurrentProtocolRunRequest,
            minknow.rpc.protocol_pb2.ProtocolRunInfo,
        )
        self.list_protocols = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.protocol.ProtocolService/list_protocols',
            minknow.rpc.protocol_pb2.ListProtocolsRequest,
            minknow.rpc.protocol_pb2.ListProtocolsResponse,
        )
        self.get_context_info = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.protocol.ProtocolService/get_context_info',
            minknow.rpc.protocol_pb2.GetContextInfoRequest,
            minknow.rpc.protocol_pb2.GetContextInfoResponse,
        )
        self.set_context_info = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.protocol.ProtocolService/set_context_info',
            minknow.rpc.protocol_pb2.SetContextInfoRequest,
            minknow.rpc.protocol_pb2.SetContextInfoResponse,
        )
        self.get_sample_id = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.protocol.ProtocolService/get_sample_id',
            minknow.rpc.protocol_pb2.GetSampleIdRequest,
            minknow.rpc.protocol_pb2.GetSampleIdResponse,
        )
        self.set_sample_id = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.protocol.ProtocolService/set_sample_id',
            minknow.rpc.protocol_pb2.SetSampleIdRequest,
            minknow.rpc.protocol_pb2.SetSampleIdResponse,
        )
        self.get_protocol_purpose = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.protocol.ProtocolService/get_protocol_purpose',
            minknow.rpc.protocol_pb2.GetProtocolPurposeRequest,
            minknow.rpc.protocol_pb2.GetProtocolPurposeResponse,
        )
        self.set_protocol_purpose = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.protocol.ProtocolService/set_protocol_purpose',
            minknow.rpc.protocol_pb2.SetProtocolPurposeRequest,
            minknow.rpc.protocol_pb2.SetProtocolPurposeResponse,
        )
        self.add_epi2me_workflow = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.protocol.ProtocolService/add_epi2me_workflow',
            minknow.rpc.protocol_pb2.AddEpi2meWorkflowRequest,
            minknow.rpc.protocol_pb2.AddEpi2meWorkflowResponse,
        )
        self.list_protocol_group_ids = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.protocol.ProtocolService/list_protocol_group_ids',
            minknow.rpc.protocol_pb2.ListProtocolGroupIdsRequest,
            minknow.rpc.protocol_pb2.ListProtocolGroupIdsResponse,
        )
