# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from suanpan.services import common_pb2 as common__pb2


class CommonStub(object):
    # missing associated documentation comment in .proto file
    pass

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

    Args:
      channel: A grpc.Channel.
    """
        self.predict = channel.unary_unary(
            "/common.Common/predict",
            request_serializer=common__pb2.Request.SerializeToString,
            response_deserializer=common__pb2.Response.FromString,  # pylint: disable=e1101
        )
        self.predictAsync = channel.unary_unary(
            "/common.Common/predictAsync",
            request_serializer=common__pb2.Request.SerializeToString,
            response_deserializer=common__pb2.Response.FromString,  # pylint: disable=e1101
        )


class CommonServicer(object):
    # missing associated documentation comment in .proto file
    pass

    def predict(self, request, context):
        # missing associated documentation comment in .proto file
        pass
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")

    def predictAsync(self, request, context):
        # missing associated documentation comment in .proto file
        pass
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details("Method not implemented!")
        raise NotImplementedError("Method not implemented!")


def add_CommonServicer_to_server(servicer, server):
    rpc_method_handlers = {
        "predict": grpc.unary_unary_rpc_method_handler(
            servicer.predict,
            request_deserializer=common__pb2.Request.FromString,  # pylint: disable=e1101
            response_serializer=common__pb2.Response.SerializeToString,
        ),
        "predictAsync": grpc.unary_unary_rpc_method_handler(
            servicer.predictAsync,
            request_deserializer=common__pb2.Request.FromString,  # pylint: disable=e1101
            response_serializer=common__pb2.Response.SerializeToString,
        ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
        "common.Common", rpc_method_handlers
    )
    server.add_generic_rpc_handlers((generic_handler,))
