# 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 openfl.experimental.workflow.protocols import director_pb2 as openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2

GRPC_GENERATED_VERSION = '1.65.5'
GRPC_VERSION = grpc.__version__
EXPECTED_ERROR_RELEASE = '1.66.0'
SCHEDULED_RELEASE_DATE = 'August 6, 2024'
_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:
    warnings.warn(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in openfl/experimental/workflow/protocols/director_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}.'
        + f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
        + f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
        RuntimeWarning
    )


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.EnvoyConnectionRequest = channel.unary_unary(
                '/openfl.experimental.workflow.director.Director/EnvoyConnectionRequest',
                request_serializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.SendConnectionRequest.SerializeToString,
                response_deserializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.RequestAccepted.FromString,
                _registered_method=True)
        self.WaitExperiment = channel.unary_unary(
                '/openfl.experimental.workflow.director.Director/WaitExperiment',
                request_serializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.WaitExperimentRequest.SerializeToString,
                response_deserializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.WaitExperimentResponse.FromString,
                _registered_method=True)
        self.GetExperimentData = channel.unary_stream(
                '/openfl.experimental.workflow.director.Director/GetExperimentData',
                request_serializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetExperimentDataRequest.SerializeToString,
                response_deserializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.ExperimentData.FromString,
                _registered_method=True)
        self.UpdateEnvoyStatus = channel.unary_unary(
                '/openfl.experimental.workflow.director.Director/UpdateEnvoyStatus',
                request_serializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.UpdateEnvoyStatusRequest.SerializeToString,
                response_deserializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.UpdateEnvoyStatusResponse.FromString,
                _registered_method=True)
        self.SetNewExperiment = channel.stream_unary(
                '/openfl.experimental.workflow.director.Director/SetNewExperiment',
                request_serializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.ExperimentInfo.SerializeToString,
                response_deserializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.SetNewExperimentResponse.FromString,
                _registered_method=True)
        self.GetEnvoys = channel.unary_unary(
                '/openfl.experimental.workflow.director.Director/GetEnvoys',
                request_serializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetEnvoysRequest.SerializeToString,
                response_deserializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetEnvoysResponse.FromString,
                _registered_method=True)
        self.GetFlowState = channel.unary_unary(
                '/openfl.experimental.workflow.director.Director/GetFlowState',
                request_serializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetFlowStateRequest.SerializeToString,
                response_deserializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetFlowStateResponse.FromString,
                _registered_method=True)
        self.ConnectRuntime = channel.unary_unary(
                '/openfl.experimental.workflow.director.Director/ConnectRuntime',
                request_serializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.SendRuntimeRequest.SerializeToString,
                response_deserializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.RuntimeRequestResponse.FromString,
                _registered_method=True)
        self.GetExperimentStdout = channel.unary_stream(
                '/openfl.experimental.workflow.director.Director/GetExperimentStdout',
                request_serializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetExperimentStdoutRequest.SerializeToString,
                response_deserializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetExperimentStdoutResponse.FromString,
                _registered_method=True)


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

    def EnvoyConnectionRequest(self, request, context):
        """Envoy RPCs
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def WaitExperiment(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 GetExperimentData(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 UpdateEnvoyStatus(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 SetNewExperiment(self, request_iterator, context):
        """Runtime RPCs
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetEnvoys(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 GetFlowState(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 ConnectRuntime(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 GetExperimentStdout(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 add_DirectorServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'EnvoyConnectionRequest': grpc.unary_unary_rpc_method_handler(
                    servicer.EnvoyConnectionRequest,
                    request_deserializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.SendConnectionRequest.FromString,
                    response_serializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.RequestAccepted.SerializeToString,
            ),
            'WaitExperiment': grpc.unary_unary_rpc_method_handler(
                    servicer.WaitExperiment,
                    request_deserializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.WaitExperimentRequest.FromString,
                    response_serializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.WaitExperimentResponse.SerializeToString,
            ),
            'GetExperimentData': grpc.unary_stream_rpc_method_handler(
                    servicer.GetExperimentData,
                    request_deserializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetExperimentDataRequest.FromString,
                    response_serializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.ExperimentData.SerializeToString,
            ),
            'UpdateEnvoyStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.UpdateEnvoyStatus,
                    request_deserializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.UpdateEnvoyStatusRequest.FromString,
                    response_serializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.UpdateEnvoyStatusResponse.SerializeToString,
            ),
            'SetNewExperiment': grpc.stream_unary_rpc_method_handler(
                    servicer.SetNewExperiment,
                    request_deserializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.ExperimentInfo.FromString,
                    response_serializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.SetNewExperimentResponse.SerializeToString,
            ),
            'GetEnvoys': grpc.unary_unary_rpc_method_handler(
                    servicer.GetEnvoys,
                    request_deserializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetEnvoysRequest.FromString,
                    response_serializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetEnvoysResponse.SerializeToString,
            ),
            'GetFlowState': grpc.unary_unary_rpc_method_handler(
                    servicer.GetFlowState,
                    request_deserializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetFlowStateRequest.FromString,
                    response_serializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetFlowStateResponse.SerializeToString,
            ),
            'ConnectRuntime': grpc.unary_unary_rpc_method_handler(
                    servicer.ConnectRuntime,
                    request_deserializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.SendRuntimeRequest.FromString,
                    response_serializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.RuntimeRequestResponse.SerializeToString,
            ),
            'GetExperimentStdout': grpc.unary_stream_rpc_method_handler(
                    servicer.GetExperimentStdout,
                    request_deserializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetExperimentStdoutRequest.FromString,
                    response_serializer=openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetExperimentStdoutResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'openfl.experimental.workflow.director.Director', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('openfl.experimental.workflow.director.Director', rpc_method_handlers)


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

    @staticmethod
    def EnvoyConnectionRequest(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,
            '/openfl.experimental.workflow.director.Director/EnvoyConnectionRequest',
            openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.SendConnectionRequest.SerializeToString,
            openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.RequestAccepted.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def WaitExperiment(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,
            '/openfl.experimental.workflow.director.Director/WaitExperiment',
            openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.WaitExperimentRequest.SerializeToString,
            openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.WaitExperimentResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetExperimentData(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,
            '/openfl.experimental.workflow.director.Director/GetExperimentData',
            openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetExperimentDataRequest.SerializeToString,
            openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.ExperimentData.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def UpdateEnvoyStatus(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,
            '/openfl.experimental.workflow.director.Director/UpdateEnvoyStatus',
            openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.UpdateEnvoyStatusRequest.SerializeToString,
            openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.UpdateEnvoyStatusResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def SetNewExperiment(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_unary(
            request_iterator,
            target,
            '/openfl.experimental.workflow.director.Director/SetNewExperiment',
            openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.ExperimentInfo.SerializeToString,
            openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.SetNewExperimentResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetEnvoys(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,
            '/openfl.experimental.workflow.director.Director/GetEnvoys',
            openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetEnvoysRequest.SerializeToString,
            openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetEnvoysResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetFlowState(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,
            '/openfl.experimental.workflow.director.Director/GetFlowState',
            openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetFlowStateRequest.SerializeToString,
            openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetFlowStateResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ConnectRuntime(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,
            '/openfl.experimental.workflow.director.Director/ConnectRuntime',
            openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.SendRuntimeRequest.SerializeToString,
            openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.RuntimeRequestResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetExperimentStdout(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,
            '/openfl.experimental.workflow.director.Director/GetExperimentStdout',
            openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetExperimentStdoutRequest.SerializeToString,
            openfl_dot_experimental_dot_workflow_dot_protocols_dot_director__pb2.GetExperimentStdoutResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
