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

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

from . import rpc_options_pb2
import google.protobuf.wrappers_pb2
from . import device_pb2


class DeviceServiceBase(abc.ABC):

    @abc.abstractmethod
    async def get_device_info(self, stream: 'grpclib.server.Stream[minknow.rpc.device_pb2.GetDeviceInfoRequest, minknow.rpc.device_pb2.GetDeviceInfoResponse]') -> None:
        pass

    @abc.abstractmethod
    async def get_device_state(self, stream: 'grpclib.server.Stream[minknow.rpc.device_pb2.GetDeviceStateRequest, minknow.rpc.device_pb2.GetDeviceStateResponse]') -> None:
        pass

    @abc.abstractmethod
    async def stream_device_state(self, stream: 'grpclib.server.Stream[minknow.rpc.device_pb2.StreamDeviceStateRequest, minknow.rpc.device_pb2.GetDeviceStateResponse]') -> None:
        pass

    @abc.abstractmethod
    async def get_flow_cell_info(self, stream: 'grpclib.server.Stream[minknow.rpc.device_pb2.GetFlowCellInfoRequest, minknow.rpc.device_pb2.GetFlowCellInfoResponse]') -> None:
        pass

    @abc.abstractmethod
    async def stream_flow_cell_info(self, stream: 'grpclib.server.Stream[minknow.rpc.device_pb2.StreamFlowCellInfoRequest, minknow.rpc.device_pb2.GetFlowCellInfoResponse]') -> None:
        pass

    @abc.abstractmethod
    async def set_user_specified_flow_cell_id(self, stream: 'grpclib.server.Stream[minknow.rpc.device_pb2.SetUserSpecifiedFlowCellIdRequest, minknow.rpc.device_pb2.SetUserSpecifiedFlowCellIdResponse]') -> None:
        pass

    @abc.abstractmethod
    async def set_user_specified_product_code(self, stream: 'grpclib.server.Stream[minknow.rpc.device_pb2.SetUserSpecifiedProductCodeRequest, minknow.rpc.device_pb2.SetUserSpecifiedProductCodeResponse]') -> None:
        pass

    @abc.abstractmethod
    async def get_channels_layout(self, stream: 'grpclib.server.Stream[minknow.rpc.device_pb2.GetChannelsLayoutRequest, minknow.rpc.device_pb2.GetChannelsLayoutResponse]') -> None:
        pass

    def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
        return {
            '/ont.rpc.device.DeviceService/get_device_info': grpclib.const.Handler(
                self.get_device_info,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.device_pb2.GetDeviceInfoRequest,
                minknow.rpc.device_pb2.GetDeviceInfoResponse,
            ),
            '/ont.rpc.device.DeviceService/get_device_state': grpclib.const.Handler(
                self.get_device_state,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.device_pb2.GetDeviceStateRequest,
                minknow.rpc.device_pb2.GetDeviceStateResponse,
            ),
            '/ont.rpc.device.DeviceService/stream_device_state': grpclib.const.Handler(
                self.stream_device_state,
                grpclib.const.Cardinality.UNARY_STREAM,
                minknow.rpc.device_pb2.StreamDeviceStateRequest,
                minknow.rpc.device_pb2.GetDeviceStateResponse,
            ),
            '/ont.rpc.device.DeviceService/get_flow_cell_info': grpclib.const.Handler(
                self.get_flow_cell_info,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.device_pb2.GetFlowCellInfoRequest,
                minknow.rpc.device_pb2.GetFlowCellInfoResponse,
            ),
            '/ont.rpc.device.DeviceService/stream_flow_cell_info': grpclib.const.Handler(
                self.stream_flow_cell_info,
                grpclib.const.Cardinality.UNARY_STREAM,
                minknow.rpc.device_pb2.StreamFlowCellInfoRequest,
                minknow.rpc.device_pb2.GetFlowCellInfoResponse,
            ),
            '/ont.rpc.device.DeviceService/set_user_specified_flow_cell_id': grpclib.const.Handler(
                self.set_user_specified_flow_cell_id,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.device_pb2.SetUserSpecifiedFlowCellIdRequest,
                minknow.rpc.device_pb2.SetUserSpecifiedFlowCellIdResponse,
            ),
            '/ont.rpc.device.DeviceService/set_user_specified_product_code': grpclib.const.Handler(
                self.set_user_specified_product_code,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.device_pb2.SetUserSpecifiedProductCodeRequest,
                minknow.rpc.device_pb2.SetUserSpecifiedProductCodeResponse,
            ),
            '/ont.rpc.device.DeviceService/get_channels_layout': grpclib.const.Handler(
                self.get_channels_layout,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.device_pb2.GetChannelsLayoutRequest,
                minknow.rpc.device_pb2.GetChannelsLayoutResponse,
            ),
        }


class DeviceServiceStub:

    def __init__(self, channel: grpclib.client.Channel) -> None:
        self.get_device_info = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.device.DeviceService/get_device_info',
            minknow.rpc.device_pb2.GetDeviceInfoRequest,
            minknow.rpc.device_pb2.GetDeviceInfoResponse,
        )
        self.get_device_state = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.device.DeviceService/get_device_state',
            minknow.rpc.device_pb2.GetDeviceStateRequest,
            minknow.rpc.device_pb2.GetDeviceStateResponse,
        )
        self.stream_device_state = grpclib.client.UnaryStreamMethod(
            channel,
            '/ont.rpc.device.DeviceService/stream_device_state',
            minknow.rpc.device_pb2.StreamDeviceStateRequest,
            minknow.rpc.device_pb2.GetDeviceStateResponse,
        )
        self.get_flow_cell_info = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.device.DeviceService/get_flow_cell_info',
            minknow.rpc.device_pb2.GetFlowCellInfoRequest,
            minknow.rpc.device_pb2.GetFlowCellInfoResponse,
        )
        self.stream_flow_cell_info = grpclib.client.UnaryStreamMethod(
            channel,
            '/ont.rpc.device.DeviceService/stream_flow_cell_info',
            minknow.rpc.device_pb2.StreamFlowCellInfoRequest,
            minknow.rpc.device_pb2.GetFlowCellInfoResponse,
        )
        self.set_user_specified_flow_cell_id = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.device.DeviceService/set_user_specified_flow_cell_id',
            minknow.rpc.device_pb2.SetUserSpecifiedFlowCellIdRequest,
            minknow.rpc.device_pb2.SetUserSpecifiedFlowCellIdResponse,
        )
        self.set_user_specified_product_code = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.device.DeviceService/set_user_specified_product_code',
            minknow.rpc.device_pb2.SetUserSpecifiedProductCodeRequest,
            minknow.rpc.device_pb2.SetUserSpecifiedProductCodeResponse,
        )
        self.get_channels_layout = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.device.DeviceService/get_channels_layout',
            minknow.rpc.device_pb2.GetChannelsLayoutRequest,
            minknow.rpc.device_pb2.GetChannelsLayoutResponse,
        )
