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

from flwr.proto import fab_pb2 as flwr_dot_proto_dot_fab__pb2
from flwr.proto import fleet_pb2 as flwr_dot_proto_dot_fleet__pb2
from flwr.proto import heartbeat_pb2 as flwr_dot_proto_dot_heartbeat__pb2
from flwr.proto import message_pb2 as flwr_dot_proto_dot_message__pb2
from flwr.proto import run_pb2 as flwr_dot_proto_dot_run__pb2

GRPC_GENERATED_VERSION = '1.70.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 flwr/proto/fleet_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 FleetStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.RegisterNode = channel.unary_unary(
                '/flwr.proto.Fleet/RegisterNode',
                request_serializer=flwr_dot_proto_dot_fleet__pb2.RegisterNodeFleetRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_fleet__pb2.RegisterNodeFleetResponse.FromString,
                _registered_method=True)
        self.ActivateNode = channel.unary_unary(
                '/flwr.proto.Fleet/ActivateNode',
                request_serializer=flwr_dot_proto_dot_fleet__pb2.ActivateNodeRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_fleet__pb2.ActivateNodeResponse.FromString,
                _registered_method=True)
        self.DeactivateNode = channel.unary_unary(
                '/flwr.proto.Fleet/DeactivateNode',
                request_serializer=flwr_dot_proto_dot_fleet__pb2.DeactivateNodeRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_fleet__pb2.DeactivateNodeResponse.FromString,
                _registered_method=True)
        self.UnregisterNode = channel.unary_unary(
                '/flwr.proto.Fleet/UnregisterNode',
                request_serializer=flwr_dot_proto_dot_fleet__pb2.UnregisterNodeFleetRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_fleet__pb2.UnregisterNodeFleetResponse.FromString,
                _registered_method=True)
        self.SendNodeHeartbeat = channel.unary_unary(
                '/flwr.proto.Fleet/SendNodeHeartbeat',
                request_serializer=flwr_dot_proto_dot_heartbeat__pb2.SendNodeHeartbeatRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_heartbeat__pb2.SendNodeHeartbeatResponse.FromString,
                _registered_method=True)
        self.PullMessages = channel.unary_unary(
                '/flwr.proto.Fleet/PullMessages',
                request_serializer=flwr_dot_proto_dot_fleet__pb2.PullMessagesRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_fleet__pb2.PullMessagesResponse.FromString,
                _registered_method=True)
        self.PushMessages = channel.unary_unary(
                '/flwr.proto.Fleet/PushMessages',
                request_serializer=flwr_dot_proto_dot_fleet__pb2.PushMessagesRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_fleet__pb2.PushMessagesResponse.FromString,
                _registered_method=True)
        self.GetRun = channel.unary_unary(
                '/flwr.proto.Fleet/GetRun',
                request_serializer=flwr_dot_proto_dot_run__pb2.GetRunRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_run__pb2.GetRunResponse.FromString,
                _registered_method=True)
        self.GetFab = channel.unary_unary(
                '/flwr.proto.Fleet/GetFab',
                request_serializer=flwr_dot_proto_dot_fab__pb2.GetFabRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_fab__pb2.GetFabResponse.FromString,
                _registered_method=True)
        self.PushObject = channel.unary_unary(
                '/flwr.proto.Fleet/PushObject',
                request_serializer=flwr_dot_proto_dot_message__pb2.PushObjectRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_message__pb2.PushObjectResponse.FromString,
                _registered_method=True)
        self.PullObject = channel.unary_unary(
                '/flwr.proto.Fleet/PullObject',
                request_serializer=flwr_dot_proto_dot_message__pb2.PullObjectRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_message__pb2.PullObjectResponse.FromString,
                _registered_method=True)
        self.ConfirmMessageReceived = channel.unary_unary(
                '/flwr.proto.Fleet/ConfirmMessageReceived',
                request_serializer=flwr_dot_proto_dot_message__pb2.ConfirmMessageReceivedRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_message__pb2.ConfirmMessageReceivedResponse.FromString,
                _registered_method=True)


class FleetServicer(object):
    """Missing associated documentation comment in .proto file."""

    def RegisterNode(self, request, context):
        """Register Node
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ActivateNode(self, request, context):
        """Activate Node
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def DeactivateNode(self, request, context):
        """Deactivate Node
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def UnregisterNode(self, request, context):
        """Unregister Node
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SendNodeHeartbeat(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PullMessages(self, request, context):
        """Retrieve one or more messages, if possible

        HTTP API path: /api/v1/fleet/pull-messages
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PushMessages(self, request, context):
        """Complete one or more messages, if possible

        HTTP API path: /api/v1/fleet/push-messages
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetRun(self, request, context):
        """Missing associated documentation comment in .proto file."""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

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

    def PushObject(self, request, context):
        """Push Object
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PullObject(self, request, context):
        """Pull Object
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ConfirmMessageReceived(self, request, context):
        """Confirm Message Received
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_FleetServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'RegisterNode': grpc.unary_unary_rpc_method_handler(
                    servicer.RegisterNode,
                    request_deserializer=flwr_dot_proto_dot_fleet__pb2.RegisterNodeFleetRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_fleet__pb2.RegisterNodeFleetResponse.SerializeToString,
            ),
            'ActivateNode': grpc.unary_unary_rpc_method_handler(
                    servicer.ActivateNode,
                    request_deserializer=flwr_dot_proto_dot_fleet__pb2.ActivateNodeRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_fleet__pb2.ActivateNodeResponse.SerializeToString,
            ),
            'DeactivateNode': grpc.unary_unary_rpc_method_handler(
                    servicer.DeactivateNode,
                    request_deserializer=flwr_dot_proto_dot_fleet__pb2.DeactivateNodeRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_fleet__pb2.DeactivateNodeResponse.SerializeToString,
            ),
            'UnregisterNode': grpc.unary_unary_rpc_method_handler(
                    servicer.UnregisterNode,
                    request_deserializer=flwr_dot_proto_dot_fleet__pb2.UnregisterNodeFleetRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_fleet__pb2.UnregisterNodeFleetResponse.SerializeToString,
            ),
            'SendNodeHeartbeat': grpc.unary_unary_rpc_method_handler(
                    servicer.SendNodeHeartbeat,
                    request_deserializer=flwr_dot_proto_dot_heartbeat__pb2.SendNodeHeartbeatRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_heartbeat__pb2.SendNodeHeartbeatResponse.SerializeToString,
            ),
            'PullMessages': grpc.unary_unary_rpc_method_handler(
                    servicer.PullMessages,
                    request_deserializer=flwr_dot_proto_dot_fleet__pb2.PullMessagesRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_fleet__pb2.PullMessagesResponse.SerializeToString,
            ),
            'PushMessages': grpc.unary_unary_rpc_method_handler(
                    servicer.PushMessages,
                    request_deserializer=flwr_dot_proto_dot_fleet__pb2.PushMessagesRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_fleet__pb2.PushMessagesResponse.SerializeToString,
            ),
            'GetRun': grpc.unary_unary_rpc_method_handler(
                    servicer.GetRun,
                    request_deserializer=flwr_dot_proto_dot_run__pb2.GetRunRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_run__pb2.GetRunResponse.SerializeToString,
            ),
            'GetFab': grpc.unary_unary_rpc_method_handler(
                    servicer.GetFab,
                    request_deserializer=flwr_dot_proto_dot_fab__pb2.GetFabRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_fab__pb2.GetFabResponse.SerializeToString,
            ),
            'PushObject': grpc.unary_unary_rpc_method_handler(
                    servicer.PushObject,
                    request_deserializer=flwr_dot_proto_dot_message__pb2.PushObjectRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_message__pb2.PushObjectResponse.SerializeToString,
            ),
            'PullObject': grpc.unary_unary_rpc_method_handler(
                    servicer.PullObject,
                    request_deserializer=flwr_dot_proto_dot_message__pb2.PullObjectRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_message__pb2.PullObjectResponse.SerializeToString,
            ),
            'ConfirmMessageReceived': grpc.unary_unary_rpc_method_handler(
                    servicer.ConfirmMessageReceived,
                    request_deserializer=flwr_dot_proto_dot_message__pb2.ConfirmMessageReceivedRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_message__pb2.ConfirmMessageReceivedResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'flwr.proto.Fleet', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('flwr.proto.Fleet', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class Fleet(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def RegisterNode(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,
            '/flwr.proto.Fleet/RegisterNode',
            flwr_dot_proto_dot_fleet__pb2.RegisterNodeFleetRequest.SerializeToString,
            flwr_dot_proto_dot_fleet__pb2.RegisterNodeFleetResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ActivateNode(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,
            '/flwr.proto.Fleet/ActivateNode',
            flwr_dot_proto_dot_fleet__pb2.ActivateNodeRequest.SerializeToString,
            flwr_dot_proto_dot_fleet__pb2.ActivateNodeResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def DeactivateNode(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,
            '/flwr.proto.Fleet/DeactivateNode',
            flwr_dot_proto_dot_fleet__pb2.DeactivateNodeRequest.SerializeToString,
            flwr_dot_proto_dot_fleet__pb2.DeactivateNodeResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UnregisterNode(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,
            '/flwr.proto.Fleet/UnregisterNode',
            flwr_dot_proto_dot_fleet__pb2.UnregisterNodeFleetRequest.SerializeToString,
            flwr_dot_proto_dot_fleet__pb2.UnregisterNodeFleetResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SendNodeHeartbeat(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,
            '/flwr.proto.Fleet/SendNodeHeartbeat',
            flwr_dot_proto_dot_heartbeat__pb2.SendNodeHeartbeatRequest.SerializeToString,
            flwr_dot_proto_dot_heartbeat__pb2.SendNodeHeartbeatResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PullMessages(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,
            '/flwr.proto.Fleet/PullMessages',
            flwr_dot_proto_dot_fleet__pb2.PullMessagesRequest.SerializeToString,
            flwr_dot_proto_dot_fleet__pb2.PullMessagesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PushMessages(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,
            '/flwr.proto.Fleet/PushMessages',
            flwr_dot_proto_dot_fleet__pb2.PushMessagesRequest.SerializeToString,
            flwr_dot_proto_dot_fleet__pb2.PushMessagesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetRun(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,
            '/flwr.proto.Fleet/GetRun',
            flwr_dot_proto_dot_run__pb2.GetRunRequest.SerializeToString,
            flwr_dot_proto_dot_run__pb2.GetRunResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetFab(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,
            '/flwr.proto.Fleet/GetFab',
            flwr_dot_proto_dot_fab__pb2.GetFabRequest.SerializeToString,
            flwr_dot_proto_dot_fab__pb2.GetFabResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PushObject(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,
            '/flwr.proto.Fleet/PushObject',
            flwr_dot_proto_dot_message__pb2.PushObjectRequest.SerializeToString,
            flwr_dot_proto_dot_message__pb2.PushObjectResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PullObject(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,
            '/flwr.proto.Fleet/PullObject',
            flwr_dot_proto_dot_message__pb2.PullObjectRequest.SerializeToString,
            flwr_dot_proto_dot_message__pb2.PullObjectResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ConfirmMessageReceived(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,
            '/flwr.proto.Fleet/ConfirmMessageReceived',
            flwr_dot_proto_dot_message__pb2.ConfirmMessageReceivedRequest.SerializeToString,
            flwr_dot_proto_dot_message__pb2.ConfirmMessageReceivedResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
