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

import giskard.ml_worker.generated.ml_worker_pb2 as ml__worker__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.getInfo = channel.unary_unary(
                '/worker.MLWorker/getInfo',
                request_serializer=ml__worker__pb2.MLWorkerInfoRequest.SerializeToString,
                response_deserializer=ml__worker__pb2.MLWorkerInfo.FromString,
                )
        self.runTest = channel.unary_unary(
                '/worker.MLWorker/runTest',
                request_serializer=ml__worker__pb2.RunTestRequest.SerializeToString,
                response_deserializer=ml__worker__pb2.TestResultMessage.FromString,
                )
        self.runModel = channel.unary_unary(
                '/worker.MLWorker/runModel',
                request_serializer=ml__worker__pb2.RunModelRequest.SerializeToString,
                response_deserializer=ml__worker__pb2.RunModelResponse.FromString,
                )
        self.runModelForDataFrame = channel.unary_unary(
                '/worker.MLWorker/runModelForDataFrame',
                request_serializer=ml__worker__pb2.RunModelForDataFrameRequest.SerializeToString,
                response_deserializer=ml__worker__pb2.RunModelForDataFrameResponse.FromString,
                )
        self.explain = channel.unary_unary(
                '/worker.MLWorker/explain',
                request_serializer=ml__worker__pb2.ExplainRequest.SerializeToString,
                response_deserializer=ml__worker__pb2.ExplainResponse.FromString,
                )
        self.explainText = channel.unary_unary(
                '/worker.MLWorker/explainText',
                request_serializer=ml__worker__pb2.ExplainTextRequest.SerializeToString,
                response_deserializer=ml__worker__pb2.ExplainTextResponse.FromString,
                )
        self.echo = channel.unary_unary(
                '/worker.MLWorker/echo',
                request_serializer=ml__worker__pb2.EchoMsg.SerializeToString,
                response_deserializer=ml__worker__pb2.EchoMsg.FromString,
                )
        self.upload = channel.stream_unary(
                '/worker.MLWorker/upload',
                request_serializer=ml__worker__pb2.FileUploadRequest.SerializeToString,
                response_deserializer=ml__worker__pb2.UploadStatus.FromString,
                )


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

    def getInfo(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 runTest(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 runModel(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 runModelForDataFrame(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 explain(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 explainText(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 echo(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 upload(self, request_iterator, 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_MLWorkerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'getInfo': grpc.unary_unary_rpc_method_handler(
                    servicer.getInfo,
                    request_deserializer=ml__worker__pb2.MLWorkerInfoRequest.FromString,
                    response_serializer=ml__worker__pb2.MLWorkerInfo.SerializeToString,
            ),
            'runTest': grpc.unary_unary_rpc_method_handler(
                    servicer.runTest,
                    request_deserializer=ml__worker__pb2.RunTestRequest.FromString,
                    response_serializer=ml__worker__pb2.TestResultMessage.SerializeToString,
            ),
            'runModel': grpc.unary_unary_rpc_method_handler(
                    servicer.runModel,
                    request_deserializer=ml__worker__pb2.RunModelRequest.FromString,
                    response_serializer=ml__worker__pb2.RunModelResponse.SerializeToString,
            ),
            'runModelForDataFrame': grpc.unary_unary_rpc_method_handler(
                    servicer.runModelForDataFrame,
                    request_deserializer=ml__worker__pb2.RunModelForDataFrameRequest.FromString,
                    response_serializer=ml__worker__pb2.RunModelForDataFrameResponse.SerializeToString,
            ),
            'explain': grpc.unary_unary_rpc_method_handler(
                    servicer.explain,
                    request_deserializer=ml__worker__pb2.ExplainRequest.FromString,
                    response_serializer=ml__worker__pb2.ExplainResponse.SerializeToString,
            ),
            'explainText': grpc.unary_unary_rpc_method_handler(
                    servicer.explainText,
                    request_deserializer=ml__worker__pb2.ExplainTextRequest.FromString,
                    response_serializer=ml__worker__pb2.ExplainTextResponse.SerializeToString,
            ),
            'echo': grpc.unary_unary_rpc_method_handler(
                    servicer.echo,
                    request_deserializer=ml__worker__pb2.EchoMsg.FromString,
                    response_serializer=ml__worker__pb2.EchoMsg.SerializeToString,
            ),
            'upload': grpc.stream_unary_rpc_method_handler(
                    servicer.upload,
                    request_deserializer=ml__worker__pb2.FileUploadRequest.FromString,
                    response_serializer=ml__worker__pb2.UploadStatus.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'worker.MLWorker', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def getInfo(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, '/worker.MLWorker/getInfo',
            ml__worker__pb2.MLWorkerInfoRequest.SerializeToString,
            ml__worker__pb2.MLWorkerInfo.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def runTest(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, '/worker.MLWorker/runTest',
            ml__worker__pb2.RunTestRequest.SerializeToString,
            ml__worker__pb2.TestResultMessage.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def runModel(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, '/worker.MLWorker/runModel',
            ml__worker__pb2.RunModelRequest.SerializeToString,
            ml__worker__pb2.RunModelResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def runModelForDataFrame(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, '/worker.MLWorker/runModelForDataFrame',
            ml__worker__pb2.RunModelForDataFrameRequest.SerializeToString,
            ml__worker__pb2.RunModelForDataFrameResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def explain(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, '/worker.MLWorker/explain',
            ml__worker__pb2.ExplainRequest.SerializeToString,
            ml__worker__pb2.ExplainResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def explainText(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, '/worker.MLWorker/explainText',
            ml__worker__pb2.ExplainTextRequest.SerializeToString,
            ml__worker__pb2.ExplainTextResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def echo(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, '/worker.MLWorker/echo',
            ml__worker__pb2.EchoMsg.SerializeToString,
            ml__worker__pb2.EchoMsg.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def upload(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, '/worker.MLWorker/upload',
            ml__worker__pb2.FileUploadRequest.SerializeToString,
            ml__worker__pb2.UploadStatus.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
