# 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 control_pb2 as flwr_dot_proto_dot_control__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/control_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 ControlStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.StartRun = channel.unary_unary(
                '/flwr.proto.Control/StartRun',
                request_serializer=flwr_dot_proto_dot_control__pb2.StartRunRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_control__pb2.StartRunResponse.FromString,
                _registered_method=True)
        self.StopRun = channel.unary_unary(
                '/flwr.proto.Control/StopRun',
                request_serializer=flwr_dot_proto_dot_control__pb2.StopRunRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_control__pb2.StopRunResponse.FromString,
                _registered_method=True)
        self.StreamLogs = channel.unary_stream(
                '/flwr.proto.Control/StreamLogs',
                request_serializer=flwr_dot_proto_dot_control__pb2.StreamLogsRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_control__pb2.StreamLogsResponse.FromString,
                _registered_method=True)
        self.ListRuns = channel.unary_unary(
                '/flwr.proto.Control/ListRuns',
                request_serializer=flwr_dot_proto_dot_control__pb2.ListRunsRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_control__pb2.ListRunsResponse.FromString,
                _registered_method=True)
        self.GetLoginDetails = channel.unary_unary(
                '/flwr.proto.Control/GetLoginDetails',
                request_serializer=flwr_dot_proto_dot_control__pb2.GetLoginDetailsRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_control__pb2.GetLoginDetailsResponse.FromString,
                _registered_method=True)
        self.GetAuthTokens = channel.unary_unary(
                '/flwr.proto.Control/GetAuthTokens',
                request_serializer=flwr_dot_proto_dot_control__pb2.GetAuthTokensRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_control__pb2.GetAuthTokensResponse.FromString,
                _registered_method=True)
        self.PullArtifacts = channel.unary_unary(
                '/flwr.proto.Control/PullArtifacts',
                request_serializer=flwr_dot_proto_dot_control__pb2.PullArtifactsRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_control__pb2.PullArtifactsResponse.FromString,
                _registered_method=True)
        self.RegisterNode = channel.unary_unary(
                '/flwr.proto.Control/RegisterNode',
                request_serializer=flwr_dot_proto_dot_control__pb2.RegisterNodeRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_control__pb2.RegisterNodeResponse.FromString,
                _registered_method=True)
        self.UnregisterNode = channel.unary_unary(
                '/flwr.proto.Control/UnregisterNode',
                request_serializer=flwr_dot_proto_dot_control__pb2.UnregisterNodeRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_control__pb2.UnregisterNodeResponse.FromString,
                _registered_method=True)
        self.ListNodes = channel.unary_unary(
                '/flwr.proto.Control/ListNodes',
                request_serializer=flwr_dot_proto_dot_control__pb2.ListNodesRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_control__pb2.ListNodesResponse.FromString,
                _registered_method=True)
        self.ListFederations = channel.unary_unary(
                '/flwr.proto.Control/ListFederations',
                request_serializer=flwr_dot_proto_dot_control__pb2.ListFederationsRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_control__pb2.ListFederationsResponse.FromString,
                _registered_method=True)
        self.ShowFederation = channel.unary_unary(
                '/flwr.proto.Control/ShowFederation',
                request_serializer=flwr_dot_proto_dot_control__pb2.ShowFederationRequest.SerializeToString,
                response_deserializer=flwr_dot_proto_dot_control__pb2.ShowFederationResponse.FromString,
                _registered_method=True)


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

    def StartRun(self, request, context):
        """Start run upon request
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StopRun(self, request, context):
        """Stop run upon request
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def StreamLogs(self, request, context):
        """Start log stream upon request
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListRuns(self, request, context):
        """flwr ls command
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetLoginDetails(self, request, context):
        """Get login details upon request
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetAuthTokens(self, request, context):
        """Get auth tokens upon request
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def PullArtifacts(self, request, context):
        """Pull artifacts generated during a run (flwr pull)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

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

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

    def ListNodes(self, request, context):
        """List SuperNodes
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListFederations(self, request, context):
        """List Federations
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ShowFederation(self, request, context):
        """Show Federation
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_ControlServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'StartRun': grpc.unary_unary_rpc_method_handler(
                    servicer.StartRun,
                    request_deserializer=flwr_dot_proto_dot_control__pb2.StartRunRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_control__pb2.StartRunResponse.SerializeToString,
            ),
            'StopRun': grpc.unary_unary_rpc_method_handler(
                    servicer.StopRun,
                    request_deserializer=flwr_dot_proto_dot_control__pb2.StopRunRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_control__pb2.StopRunResponse.SerializeToString,
            ),
            'StreamLogs': grpc.unary_stream_rpc_method_handler(
                    servicer.StreamLogs,
                    request_deserializer=flwr_dot_proto_dot_control__pb2.StreamLogsRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_control__pb2.StreamLogsResponse.SerializeToString,
            ),
            'ListRuns': grpc.unary_unary_rpc_method_handler(
                    servicer.ListRuns,
                    request_deserializer=flwr_dot_proto_dot_control__pb2.ListRunsRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_control__pb2.ListRunsResponse.SerializeToString,
            ),
            'GetLoginDetails': grpc.unary_unary_rpc_method_handler(
                    servicer.GetLoginDetails,
                    request_deserializer=flwr_dot_proto_dot_control__pb2.GetLoginDetailsRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_control__pb2.GetLoginDetailsResponse.SerializeToString,
            ),
            'GetAuthTokens': grpc.unary_unary_rpc_method_handler(
                    servicer.GetAuthTokens,
                    request_deserializer=flwr_dot_proto_dot_control__pb2.GetAuthTokensRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_control__pb2.GetAuthTokensResponse.SerializeToString,
            ),
            'PullArtifacts': grpc.unary_unary_rpc_method_handler(
                    servicer.PullArtifacts,
                    request_deserializer=flwr_dot_proto_dot_control__pb2.PullArtifactsRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_control__pb2.PullArtifactsResponse.SerializeToString,
            ),
            'RegisterNode': grpc.unary_unary_rpc_method_handler(
                    servicer.RegisterNode,
                    request_deserializer=flwr_dot_proto_dot_control__pb2.RegisterNodeRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_control__pb2.RegisterNodeResponse.SerializeToString,
            ),
            'UnregisterNode': grpc.unary_unary_rpc_method_handler(
                    servicer.UnregisterNode,
                    request_deserializer=flwr_dot_proto_dot_control__pb2.UnregisterNodeRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_control__pb2.UnregisterNodeResponse.SerializeToString,
            ),
            'ListNodes': grpc.unary_unary_rpc_method_handler(
                    servicer.ListNodes,
                    request_deserializer=flwr_dot_proto_dot_control__pb2.ListNodesRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_control__pb2.ListNodesResponse.SerializeToString,
            ),
            'ListFederations': grpc.unary_unary_rpc_method_handler(
                    servicer.ListFederations,
                    request_deserializer=flwr_dot_proto_dot_control__pb2.ListFederationsRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_control__pb2.ListFederationsResponse.SerializeToString,
            ),
            'ShowFederation': grpc.unary_unary_rpc_method_handler(
                    servicer.ShowFederation,
                    request_deserializer=flwr_dot_proto_dot_control__pb2.ShowFederationRequest.FromString,
                    response_serializer=flwr_dot_proto_dot_control__pb2.ShowFederationResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'flwr.proto.Control', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('flwr.proto.Control', rpc_method_handlers)


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

    @staticmethod
    def StartRun(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.Control/StartRun',
            flwr_dot_proto_dot_control__pb2.StartRunRequest.SerializeToString,
            flwr_dot_proto_dot_control__pb2.StartRunResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StopRun(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.Control/StopRun',
            flwr_dot_proto_dot_control__pb2.StopRunRequest.SerializeToString,
            flwr_dot_proto_dot_control__pb2.StopRunResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def StreamLogs(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_stream(
            request,
            target,
            '/flwr.proto.Control/StreamLogs',
            flwr_dot_proto_dot_control__pb2.StreamLogsRequest.SerializeToString,
            flwr_dot_proto_dot_control__pb2.StreamLogsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListRuns(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.Control/ListRuns',
            flwr_dot_proto_dot_control__pb2.ListRunsRequest.SerializeToString,
            flwr_dot_proto_dot_control__pb2.ListRunsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetLoginDetails(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.Control/GetLoginDetails',
            flwr_dot_proto_dot_control__pb2.GetLoginDetailsRequest.SerializeToString,
            flwr_dot_proto_dot_control__pb2.GetLoginDetailsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetAuthTokens(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.Control/GetAuthTokens',
            flwr_dot_proto_dot_control__pb2.GetAuthTokensRequest.SerializeToString,
            flwr_dot_proto_dot_control__pb2.GetAuthTokensResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def PullArtifacts(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.Control/PullArtifacts',
            flwr_dot_proto_dot_control__pb2.PullArtifactsRequest.SerializeToString,
            flwr_dot_proto_dot_control__pb2.PullArtifactsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @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.Control/RegisterNode',
            flwr_dot_proto_dot_control__pb2.RegisterNodeRequest.SerializeToString,
            flwr_dot_proto_dot_control__pb2.RegisterNodeResponse.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.Control/UnregisterNode',
            flwr_dot_proto_dot_control__pb2.UnregisterNodeRequest.SerializeToString,
            flwr_dot_proto_dot_control__pb2.UnregisterNodeResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListNodes(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.Control/ListNodes',
            flwr_dot_proto_dot_control__pb2.ListNodesRequest.SerializeToString,
            flwr_dot_proto_dot_control__pb2.ListNodesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListFederations(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.Control/ListFederations',
            flwr_dot_proto_dot_control__pb2.ListFederationsRequest.SerializeToString,
            flwr_dot_proto_dot_control__pb2.ListFederationsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ShowFederation(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.Control/ShowFederation',
            flwr_dot_proto_dot_control__pb2.ShowFederationRequest.SerializeToString,
            flwr_dot_proto_dot_control__pb2.ShowFederationResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
