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

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

import empty_pb2
import consensus_pb2
import node_pb2
import gossiping_pb2


class GossipServiceBase(abc.ABC):

    @abc.abstractmethod
    async def NewBlocks(self, stream: 'grpclib.server.Stream[gossiping_pb2.NewBlocksRequest, gossiping_pb2.NewBlocksResponse]') -> None:
        pass

    @abc.abstractmethod
    async def NewDeploys(self, stream: 'grpclib.server.Stream[gossiping_pb2.NewDeploysRequest, gossiping_pb2.NewDeploysResponse]') -> None:
        pass

    @abc.abstractmethod
    async def StreamAncestorBlockSummaries(self, stream: 'grpclib.server.Stream[gossiping_pb2.StreamAncestorBlockSummariesRequest, consensus_pb2.BlockSummary]') -> None:
        pass

    @abc.abstractmethod
    async def StreamLatestMessages(self, stream: 'grpclib.server.Stream[gossiping_pb2.StreamLatestMessagesRequest, consensus_pb2.Block.Justification]') -> None:
        pass

    @abc.abstractmethod
    async def StreamBlockSummaries(self, stream: 'grpclib.server.Stream[gossiping_pb2.StreamBlockSummariesRequest, consensus_pb2.BlockSummary]') -> None:
        pass

    @abc.abstractmethod
    async def StreamDeploySummaries(self, stream: 'grpclib.server.Stream[gossiping_pb2.StreamDeploySummariesRequest, consensus_pb2.DeploySummary]') -> None:
        pass

    @abc.abstractmethod
    async def GetBlockChunked(self, stream: 'grpclib.server.Stream[gossiping_pb2.GetBlockChunkedRequest, gossiping_pb2.Chunk]') -> None:
        pass

    @abc.abstractmethod
    async def StreamDeploysChunked(self, stream: 'grpclib.server.Stream[gossiping_pb2.StreamDeploysChunkedRequest, gossiping_pb2.Chunk]') -> None:
        pass

    @abc.abstractmethod
    async def GetGenesisCandidate(self, stream: 'grpclib.server.Stream[gossiping_pb2.GetGenesisCandidateRequest, consensus_pb2.GenesisCandidate]') -> None:
        pass

    @abc.abstractmethod
    async def AddApproval(self, stream: 'grpclib.server.Stream[gossiping_pb2.AddApprovalRequest, empty_pb2.Empty]') -> None:
        pass

    @abc.abstractmethod
    async def StreamDagSliceBlockSummaries(self, stream: 'grpclib.server.Stream[gossiping_pb2.StreamDagSliceBlockSummariesRequest, consensus_pb2.BlockSummary]') -> None:
        pass

    def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
        return {
            '/io.casperlabs.comm.gossiping.GossipService/NewBlocks': grpclib.const.Handler(
                self.NewBlocks,
                grpclib.const.Cardinality.UNARY_UNARY,
                gossiping_pb2.NewBlocksRequest,
                gossiping_pb2.NewBlocksResponse,
            ),
            '/io.casperlabs.comm.gossiping.GossipService/NewDeploys': grpclib.const.Handler(
                self.NewDeploys,
                grpclib.const.Cardinality.UNARY_UNARY,
                gossiping_pb2.NewDeploysRequest,
                gossiping_pb2.NewDeploysResponse,
            ),
            '/io.casperlabs.comm.gossiping.GossipService/StreamAncestorBlockSummaries': grpclib.const.Handler(
                self.StreamAncestorBlockSummaries,
                grpclib.const.Cardinality.UNARY_STREAM,
                gossiping_pb2.StreamAncestorBlockSummariesRequest,
                consensus_pb2.BlockSummary,
            ),
            '/io.casperlabs.comm.gossiping.GossipService/StreamLatestMessages': grpclib.const.Handler(
                self.StreamLatestMessages,
                grpclib.const.Cardinality.UNARY_STREAM,
                gossiping_pb2.StreamLatestMessagesRequest,
                consensus_pb2.Block.Justification,
            ),
            '/io.casperlabs.comm.gossiping.GossipService/StreamBlockSummaries': grpclib.const.Handler(
                self.StreamBlockSummaries,
                grpclib.const.Cardinality.UNARY_STREAM,
                gossiping_pb2.StreamBlockSummariesRequest,
                consensus_pb2.BlockSummary,
            ),
            '/io.casperlabs.comm.gossiping.GossipService/StreamDeploySummaries': grpclib.const.Handler(
                self.StreamDeploySummaries,
                grpclib.const.Cardinality.UNARY_STREAM,
                gossiping_pb2.StreamDeploySummariesRequest,
                consensus_pb2.DeploySummary,
            ),
            '/io.casperlabs.comm.gossiping.GossipService/GetBlockChunked': grpclib.const.Handler(
                self.GetBlockChunked,
                grpclib.const.Cardinality.UNARY_STREAM,
                gossiping_pb2.GetBlockChunkedRequest,
                gossiping_pb2.Chunk,
            ),
            '/io.casperlabs.comm.gossiping.GossipService/StreamDeploysChunked': grpclib.const.Handler(
                self.StreamDeploysChunked,
                grpclib.const.Cardinality.UNARY_STREAM,
                gossiping_pb2.StreamDeploysChunkedRequest,
                gossiping_pb2.Chunk,
            ),
            '/io.casperlabs.comm.gossiping.GossipService/GetGenesisCandidate': grpclib.const.Handler(
                self.GetGenesisCandidate,
                grpclib.const.Cardinality.UNARY_UNARY,
                gossiping_pb2.GetGenesisCandidateRequest,
                consensus_pb2.GenesisCandidate,
            ),
            '/io.casperlabs.comm.gossiping.GossipService/AddApproval': grpclib.const.Handler(
                self.AddApproval,
                grpclib.const.Cardinality.UNARY_UNARY,
                gossiping_pb2.AddApprovalRequest,
                empty_pb2.Empty,
            ),
            '/io.casperlabs.comm.gossiping.GossipService/StreamDagSliceBlockSummaries': grpclib.const.Handler(
                self.StreamDagSliceBlockSummaries,
                grpclib.const.Cardinality.UNARY_STREAM,
                gossiping_pb2.StreamDagSliceBlockSummariesRequest,
                consensus_pb2.BlockSummary,
            ),
        }


class GossipServiceStub:

    def __init__(self, channel: grpclib.client.Channel) -> None:
        self.NewBlocks = grpclib.client.UnaryUnaryMethod(
            channel,
            '/io.casperlabs.comm.gossiping.GossipService/NewBlocks',
            gossiping_pb2.NewBlocksRequest,
            gossiping_pb2.NewBlocksResponse,
        )
        self.NewDeploys = grpclib.client.UnaryUnaryMethod(
            channel,
            '/io.casperlabs.comm.gossiping.GossipService/NewDeploys',
            gossiping_pb2.NewDeploysRequest,
            gossiping_pb2.NewDeploysResponse,
        )
        self.StreamAncestorBlockSummaries = grpclib.client.UnaryStreamMethod(
            channel,
            '/io.casperlabs.comm.gossiping.GossipService/StreamAncestorBlockSummaries',
            gossiping_pb2.StreamAncestorBlockSummariesRequest,
            consensus_pb2.BlockSummary,
        )
        self.StreamLatestMessages = grpclib.client.UnaryStreamMethod(
            channel,
            '/io.casperlabs.comm.gossiping.GossipService/StreamLatestMessages',
            gossiping_pb2.StreamLatestMessagesRequest,
            consensus_pb2.Block.Justification,
        )
        self.StreamBlockSummaries = grpclib.client.UnaryStreamMethod(
            channel,
            '/io.casperlabs.comm.gossiping.GossipService/StreamBlockSummaries',
            gossiping_pb2.StreamBlockSummariesRequest,
            consensus_pb2.BlockSummary,
        )
        self.StreamDeploySummaries = grpclib.client.UnaryStreamMethod(
            channel,
            '/io.casperlabs.comm.gossiping.GossipService/StreamDeploySummaries',
            gossiping_pb2.StreamDeploySummariesRequest,
            consensus_pb2.DeploySummary,
        )
        self.GetBlockChunked = grpclib.client.UnaryStreamMethod(
            channel,
            '/io.casperlabs.comm.gossiping.GossipService/GetBlockChunked',
            gossiping_pb2.GetBlockChunkedRequest,
            gossiping_pb2.Chunk,
        )
        self.StreamDeploysChunked = grpclib.client.UnaryStreamMethod(
            channel,
            '/io.casperlabs.comm.gossiping.GossipService/StreamDeploysChunked',
            gossiping_pb2.StreamDeploysChunkedRequest,
            gossiping_pb2.Chunk,
        )
        self.GetGenesisCandidate = grpclib.client.UnaryUnaryMethod(
            channel,
            '/io.casperlabs.comm.gossiping.GossipService/GetGenesisCandidate',
            gossiping_pb2.GetGenesisCandidateRequest,
            consensus_pb2.GenesisCandidate,
        )
        self.AddApproval = grpclib.client.UnaryUnaryMethod(
            channel,
            '/io.casperlabs.comm.gossiping.GossipService/AddApproval',
            gossiping_pb2.AddApprovalRequest,
            empty_pb2.Empty,
        )
        self.StreamDagSliceBlockSummaries = grpclib.client.UnaryStreamMethod(
            channel,
            '/io.casperlabs.comm.gossiping.GossipService/StreamDagSliceBlockSummaries',
            gossiping_pb2.StreamDagSliceBlockSummariesRequest,
            consensus_pb2.BlockSummary,
        )
