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

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

from . import instance_pb2
from . import manager_pb2


class ManagerServiceBase(abc.ABC):

    @abc.abstractmethod
    async def list_devices(self, stream: 'grpclib.server.Stream[minknow.rpc.manager_pb2.ListDevicesRequest, minknow.rpc.manager_pb2.ListDevicesResponse]') -> None:
        pass

    @abc.abstractmethod
    async def get_version_info(self, stream: 'grpclib.server.Stream[minknow.rpc.manager_pb2.GetVersionInfoRequest, minknow.rpc.manager_pb2.GetVersionInfoResponse]') -> None:
        pass

    def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
        return {
            '/ont.rpc.manager.ManagerService/list_devices': grpclib.const.Handler(
                self.list_devices,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.manager_pb2.ListDevicesRequest,
                minknow.rpc.manager_pb2.ListDevicesResponse,
            ),
            '/ont.rpc.manager.ManagerService/get_version_info': grpclib.const.Handler(
                self.get_version_info,
                grpclib.const.Cardinality.UNARY_UNARY,
                minknow.rpc.manager_pb2.GetVersionInfoRequest,
                minknow.rpc.manager_pb2.GetVersionInfoResponse,
            ),
        }


class ManagerServiceStub:

    def __init__(self, channel: grpclib.client.Channel) -> None:
        self.list_devices = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.manager.ManagerService/list_devices',
            minknow.rpc.manager_pb2.ListDevicesRequest,
            minknow.rpc.manager_pb2.ListDevicesResponse,
        )
        self.get_version_info = grpclib.client.UnaryUnaryMethod(
            channel,
            '/ont.rpc.manager.ManagerService/get_version_info',
            minknow.rpc.manager_pb2.GetVersionInfoRequest,
            minknow.rpc.manager_pb2.GetVersionInfoResponse,
        )
