# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import warnings

import consensus_pb2 as consensus__pb2

GRPC_GENERATED_VERSION = '1.71.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in consensus_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class ConsensusServiceStub(object):
    """Consensus Service - Manages multi-agent consensus and handoffs
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.BroadcastMessage = channel.unary_unary(
                '/omium.consensus.v1.ConsensusService/BroadcastMessage',
                request_serializer=consensus__pb2.BroadcastMessageRequest.SerializeToString,
                response_deserializer=consensus__pb2.BroadcastMessageResponse.FromString,
                _registered_method=True)
        self.AcknowledgeMessage = channel.unary_unary(
                '/omium.consensus.v1.ConsensusService/AcknowledgeMessage',
                request_serializer=consensus__pb2.AcknowledgeMessageRequest.SerializeToString,
                response_deserializer=consensus__pb2.AcknowledgeMessageResponse.FromString,
                _registered_method=True)
        self.GetConsensusStatus = channel.unary_unary(
                '/omium.consensus.v1.ConsensusService/GetConsensusStatus',
                request_serializer=consensus__pb2.GetConsensusStatusRequest.SerializeToString,
                response_deserializer=consensus__pb2.GetConsensusStatusResponse.FromString,
                _registered_method=True)
        self.ProposeHandoff = channel.unary_unary(
                '/omium.consensus.v1.ConsensusService/ProposeHandoff',
                request_serializer=consensus__pb2.ProposeHandoffRequest.SerializeToString,
                response_deserializer=consensus__pb2.ProposeHandoffResponse.FromString,
                _registered_method=True)
        self.VoteOnHandoff = channel.unary_unary(
                '/omium.consensus.v1.ConsensusService/VoteOnHandoff',
                request_serializer=consensus__pb2.VoteOnHandoffRequest.SerializeToString,
                response_deserializer=consensus__pb2.VoteOnHandoffResponse.FromString,
                _registered_method=True)


class ConsensusServiceServicer(object):
    """Consensus Service - Manages multi-agent consensus and handoffs
    """

    def BroadcastMessage(self, request, context):
        """Broadcast message to agents (with consensus)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def AcknowledgeMessage(self, request, context):
        """Acknowledge message receipt
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetConsensusStatus(self, request, context):
        """Get consensus status
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ProposeHandoff(self, request, context):
        """Propose handoff to next agent
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def VoteOnHandoff(self, request, context):
        """Vote on handoff proposal
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ConsensusServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'BroadcastMessage': grpc.unary_unary_rpc_method_handler(
                    servicer.BroadcastMessage,
                    request_deserializer=consensus__pb2.BroadcastMessageRequest.FromString,
                    response_serializer=consensus__pb2.BroadcastMessageResponse.SerializeToString,
            ),
            'AcknowledgeMessage': grpc.unary_unary_rpc_method_handler(
                    servicer.AcknowledgeMessage,
                    request_deserializer=consensus__pb2.AcknowledgeMessageRequest.FromString,
                    response_serializer=consensus__pb2.AcknowledgeMessageResponse.SerializeToString,
            ),
            'GetConsensusStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.GetConsensusStatus,
                    request_deserializer=consensus__pb2.GetConsensusStatusRequest.FromString,
                    response_serializer=consensus__pb2.GetConsensusStatusResponse.SerializeToString,
            ),
            'ProposeHandoff': grpc.unary_unary_rpc_method_handler(
                    servicer.ProposeHandoff,
                    request_deserializer=consensus__pb2.ProposeHandoffRequest.FromString,
                    response_serializer=consensus__pb2.ProposeHandoffResponse.SerializeToString,
            ),
            'VoteOnHandoff': grpc.unary_unary_rpc_method_handler(
                    servicer.VoteOnHandoff,
                    request_deserializer=consensus__pb2.VoteOnHandoffRequest.FromString,
                    response_serializer=consensus__pb2.VoteOnHandoffResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'omium.consensus.v1.ConsensusService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('omium.consensus.v1.ConsensusService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class ConsensusService(object):
    """Consensus Service - Manages multi-agent consensus and handoffs
    """

    @staticmethod
    def BroadcastMessage(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/omium.consensus.v1.ConsensusService/BroadcastMessage',
            consensus__pb2.BroadcastMessageRequest.SerializeToString,
            consensus__pb2.BroadcastMessageResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def AcknowledgeMessage(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/omium.consensus.v1.ConsensusService/AcknowledgeMessage',
            consensus__pb2.AcknowledgeMessageRequest.SerializeToString,
            consensus__pb2.AcknowledgeMessageResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetConsensusStatus(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/omium.consensus.v1.ConsensusService/GetConsensusStatus',
            consensus__pb2.GetConsensusStatusRequest.SerializeToString,
            consensus__pb2.GetConsensusStatusResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ProposeHandoff(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/omium.consensus.v1.ConsensusService/ProposeHandoff',
            consensus__pb2.ProposeHandoffRequest.SerializeToString,
            consensus__pb2.ProposeHandoffResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def VoteOnHandoff(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(
            request,
            target,
            '/omium.consensus.v1.ConsensusService/VoteOnHandoff',
            consensus__pb2.VoteOnHandoffRequest.SerializeToString,
            consensus__pb2.VoteOnHandoffResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
