# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import importlib
  
try:
    grpc = importlib.import_module('grpc')
except ModuleNotFoundError:
    grpc = None

from mlboardclient.ml_serving_utils import predict_pb2 as predict__pb2


class PredictionServiceStub(object):
  """The prediction service definition.
  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.Predict = channel.unary_unary(
        '/tensorflow.serving.PredictionService/Predict',
        request_serializer=predict__pb2.PredictRequest.SerializeToString,
        response_deserializer=predict__pb2.PredictResponse.FromString,
        )
    self.PredictJSON = channel.unary_unary(
        '/tensorflow.serving.PredictionService/PredictJSON',
        request_serializer=predict__pb2.PredictJSONData.SerializeToString,
        response_deserializer=predict__pb2.PredictJSONData.FromString,
        )
    self.Test = channel.unary_unary(
        '/tensorflow.serving.PredictionService/Test',
        request_serializer=predict__pb2.TestRequest.SerializeToString,
        response_deserializer=predict__pb2.TestResponse.FromString,
        )


class PredictionServiceServicer(object):
  """The prediction service definition.
  """

  def Predict(self, request, context):
    """Sends a predict
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def PredictJSON(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 Test(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_PredictionServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Predict': grpc.unary_unary_rpc_method_handler(
          servicer.Predict,
          request_deserializer=predict__pb2.PredictRequest.FromString,
          response_serializer=predict__pb2.PredictResponse.SerializeToString,
      ),
      'PredictJSON': grpc.unary_unary_rpc_method_handler(
          servicer.PredictJSON,
          request_deserializer=predict__pb2.PredictJSONData.FromString,
          response_serializer=predict__pb2.PredictJSONData.SerializeToString,
      ),
      'Test': grpc.unary_unary_rpc_method_handler(
          servicer.Test,
          request_deserializer=predict__pb2.TestRequest.FromString,
          response_serializer=predict__pb2.TestResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'tensorflow.serving.PredictionService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
