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

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

import node_pb2
import kademlia_pb2


class KademliaServiceBase(abc.ABC):

    @abc.abstractmethod
    async def Ping(self, stream: 'grpclib.server.Stream[kademlia_pb2.PingRequest, kademlia_pb2.PingResponse]') -> None:
        pass

    @abc.abstractmethod
    async def Lookup(self, stream: 'grpclib.server.Stream[kademlia_pb2.LookupRequest, kademlia_pb2.LookupResponse]') -> None:
        pass

    def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
        return {
            '/io.casperlabs.comm.discovery.KademliaService/Ping': grpclib.const.Handler(
                self.Ping,
                grpclib.const.Cardinality.UNARY_UNARY,
                kademlia_pb2.PingRequest,
                kademlia_pb2.PingResponse,
            ),
            '/io.casperlabs.comm.discovery.KademliaService/Lookup': grpclib.const.Handler(
                self.Lookup,
                grpclib.const.Cardinality.UNARY_UNARY,
                kademlia_pb2.LookupRequest,
                kademlia_pb2.LookupResponse,
            ),
        }


class KademliaServiceStub:

    def __init__(self, channel: grpclib.client.Channel) -> None:
        self.Ping = grpclib.client.UnaryUnaryMethod(
            channel,
            '/io.casperlabs.comm.discovery.KademliaService/Ping',
            kademlia_pb2.PingRequest,
            kademlia_pb2.PingResponse,
        )
        self.Lookup = grpclib.client.UnaryUnaryMethod(
            channel,
            '/io.casperlabs.comm.discovery.KademliaService/Lookup',
            kademlia_pb2.LookupRequest,
            kademlia_pb2.LookupResponse,
        )
