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

import mindsdb.microservices_grpc.ml.common_pb2 as common__pb2
import mindsdb.microservices_grpc.ml.ml_pb2 as ml__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.Predict = channel.unary_unary(
                '/MLService/Predict',
                request_serializer=ml__pb2.PredictCall.SerializeToString,
                response_deserializer=common__pb2.Response.FromString,
                )
        self.Create = channel.unary_unary(
                '/MLService/Create',
                request_serializer=ml__pb2.CreateCall.SerializeToString,
                response_deserializer=common__pb2.StatusResponse.FromString,
                )
        self.Update = channel.unary_unary(
                '/MLService/Update',
                request_serializer=ml__pb2.UpdateCall.SerializeToString,
                response_deserializer=common__pb2.StatusResponse.FromString,
                )


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

    def Predict(self, request, context):
        """A simple RPC.

        Performs 'predict' request and returns the result

        wrapped into Response object
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Create(self, request, context):
        """A simple RPC.

        Performs 'learn' request and returns the result

        wrapped into Response object
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Update(self, request, context):
        """A simple RPC.

        Performs 'update' request and returns the result

        wrapped into Response object
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_MLServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Predict': grpc.unary_unary_rpc_method_handler(
                    servicer.Predict,
                    request_deserializer=ml__pb2.PredictCall.FromString,
                    response_serializer=common__pb2.Response.SerializeToString,
            ),
            'Create': grpc.unary_unary_rpc_method_handler(
                    servicer.Create,
                    request_deserializer=ml__pb2.CreateCall.FromString,
                    response_serializer=common__pb2.StatusResponse.SerializeToString,
            ),
            'Update': grpc.unary_unary_rpc_method_handler(
                    servicer.Update,
                    request_deserializer=ml__pb2.UpdateCall.FromString,
                    response_serializer=common__pb2.StatusResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'MLService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def Predict(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, '/MLService/Predict',
            ml__pb2.PredictCall.SerializeToString,
            common__pb2.Response.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Create(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, '/MLService/Create',
            ml__pb2.CreateCall.SerializeToString,
            common__pb2.StatusResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Update(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, '/MLService/Update',
            ml__pb2.UpdateCall.SerializeToString,
            common__pb2.StatusResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
