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

import bentoml.proto.deployment_pb2 as deployment__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
import bentoml.proto.repository_pb2 as repository__pb2
import bentoml.proto.yatai_service_pb2 as yatai__service__pb2


class YataiStub(object):
  """Yatai RPC Server

  A stateful service that provides a complete BentoML model management
  and model serving/deployment workflow

  It provides two sets of APIs:
  Bento Repository: Manages saved Bento files, and making them available
  for serving in production environments
  Serving Deployment: Deploys saved Bento to a varity of different cloud
  platforms, track deploym//ent status, set up logging
  monitoring for your model serving workloads, and
  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.HealthCheck = channel.unary_unary(
        '/bentoml.Yatai/HealthCheck',
        request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        response_deserializer=yatai__service__pb2.HealthCheckResponse.FromString,
        )
    self.GetYataiServiceVersion = channel.unary_unary(
        '/bentoml.Yatai/GetYataiServiceVersion',
        request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
        response_deserializer=yatai__service__pb2.GetYataiServiceVersionResponse.FromString,
        )
    self.ApplyDeployment = channel.unary_unary(
        '/bentoml.Yatai/ApplyDeployment',
        request_serializer=deployment__pb2.ApplyDeploymentRequest.SerializeToString,
        response_deserializer=deployment__pb2.ApplyDeploymentResponse.FromString,
        )
    self.DeleteDeployment = channel.unary_unary(
        '/bentoml.Yatai/DeleteDeployment',
        request_serializer=deployment__pb2.DeleteDeploymentRequest.SerializeToString,
        response_deserializer=deployment__pb2.DeleteDeploymentResponse.FromString,
        )
    self.GetDeployment = channel.unary_unary(
        '/bentoml.Yatai/GetDeployment',
        request_serializer=deployment__pb2.GetDeploymentRequest.SerializeToString,
        response_deserializer=deployment__pb2.GetDeploymentResponse.FromString,
        )
    self.DescribeDeployment = channel.unary_unary(
        '/bentoml.Yatai/DescribeDeployment',
        request_serializer=deployment__pb2.DescribeDeploymentRequest.SerializeToString,
        response_deserializer=deployment__pb2.DescribeDeploymentResponse.FromString,
        )
    self.ListDeployments = channel.unary_unary(
        '/bentoml.Yatai/ListDeployments',
        request_serializer=deployment__pb2.ListDeploymentsRequest.SerializeToString,
        response_deserializer=deployment__pb2.ListDeploymentsResponse.FromString,
        )
    self.AddBento = channel.unary_unary(
        '/bentoml.Yatai/AddBento',
        request_serializer=repository__pb2.AddBentoRequest.SerializeToString,
        response_deserializer=repository__pb2.AddBentoResponse.FromString,
        )
    self.UpdateBento = channel.unary_unary(
        '/bentoml.Yatai/UpdateBento',
        request_serializer=repository__pb2.UpdateBentoRequest.SerializeToString,
        response_deserializer=repository__pb2.UpdateBentoResponse.FromString,
        )
    self.GetBento = channel.unary_unary(
        '/bentoml.Yatai/GetBento',
        request_serializer=repository__pb2.GetBentoRequest.SerializeToString,
        response_deserializer=repository__pb2.GetBentoResponse.FromString,
        )
    self.DangerouslyDeleteBento = channel.unary_unary(
        '/bentoml.Yatai/DangerouslyDeleteBento',
        request_serializer=repository__pb2.DangerouslyDeleteBentoRequest.SerializeToString,
        response_deserializer=repository__pb2.DangerouslyDeleteBentoResponse.FromString,
        )
    self.ListBento = channel.unary_unary(
        '/bentoml.Yatai/ListBento',
        request_serializer=repository__pb2.ListBentoRequest.SerializeToString,
        response_deserializer=repository__pb2.ListBentoResponse.FromString,
        )


class YataiServicer(object):
  """Yatai RPC Server

  A stateful service that provides a complete BentoML model management
  and model serving/deployment workflow

  It provides two sets of APIs:
  Bento Repository: Manages saved Bento files, and making them available
  for serving in production environments
  Serving Deployment: Deploys saved Bento to a varity of different cloud
  platforms, track deploym//ent status, set up logging
  monitoring for your model serving workloads, and
  """

  def HealthCheck(self, request, context):
    """Health check ping endpoint
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetYataiServiceVersion(self, request, context):
    """Return current service version information
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def ApplyDeployment(self, request, context):
    """Create new or update existing deployment
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def DeleteDeployment(self, request, context):
    """Delete existing deployment
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetDeployment(self, request, context):
    """Get deployment specification (desired state)
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def DescribeDeployment(self, request, context):
    """Get deployment status (current state)
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def ListDeployments(self, request, context):
    """List active deployments, by default this will return all active deployments
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def AddBento(self, request, context):
    """Add new saved Bento to repository by providing the Bento name and version
    this will return an upload address that allows client to upload the bento files
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def UpdateBento(self, request, context):
    """RPC for updating a previously added Bento's information, including
    the BentoService's Metadata(apis, env, artifacts etc) and the upload status.
    Yatai server expects the client to use this RPC for notifying that, for a
    previously requested AddBento call, what's the uploading progress and when the
    upload is completed
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetBento(self, request, context):
    """Get a file path to the saved Bento files, path must be accessible form client
    machine either through HTTP, FTP, etc
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def DangerouslyDeleteBento(self, request, context):
    """Deleting the Bento files that was added to this Yatai server earlier, this may
    break existing deployments or create issues when doing deployment rollback
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def ListBento(self, request, context):
    """Get a list of Bento that are stored in current repository
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_YataiServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'HealthCheck': grpc.unary_unary_rpc_method_handler(
          servicer.HealthCheck,
          request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
          response_serializer=yatai__service__pb2.HealthCheckResponse.SerializeToString,
      ),
      'GetYataiServiceVersion': grpc.unary_unary_rpc_method_handler(
          servicer.GetYataiServiceVersion,
          request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
          response_serializer=yatai__service__pb2.GetYataiServiceVersionResponse.SerializeToString,
      ),
      'ApplyDeployment': grpc.unary_unary_rpc_method_handler(
          servicer.ApplyDeployment,
          request_deserializer=deployment__pb2.ApplyDeploymentRequest.FromString,
          response_serializer=deployment__pb2.ApplyDeploymentResponse.SerializeToString,
      ),
      'DeleteDeployment': grpc.unary_unary_rpc_method_handler(
          servicer.DeleteDeployment,
          request_deserializer=deployment__pb2.DeleteDeploymentRequest.FromString,
          response_serializer=deployment__pb2.DeleteDeploymentResponse.SerializeToString,
      ),
      'GetDeployment': grpc.unary_unary_rpc_method_handler(
          servicer.GetDeployment,
          request_deserializer=deployment__pb2.GetDeploymentRequest.FromString,
          response_serializer=deployment__pb2.GetDeploymentResponse.SerializeToString,
      ),
      'DescribeDeployment': grpc.unary_unary_rpc_method_handler(
          servicer.DescribeDeployment,
          request_deserializer=deployment__pb2.DescribeDeploymentRequest.FromString,
          response_serializer=deployment__pb2.DescribeDeploymentResponse.SerializeToString,
      ),
      'ListDeployments': grpc.unary_unary_rpc_method_handler(
          servicer.ListDeployments,
          request_deserializer=deployment__pb2.ListDeploymentsRequest.FromString,
          response_serializer=deployment__pb2.ListDeploymentsResponse.SerializeToString,
      ),
      'AddBento': grpc.unary_unary_rpc_method_handler(
          servicer.AddBento,
          request_deserializer=repository__pb2.AddBentoRequest.FromString,
          response_serializer=repository__pb2.AddBentoResponse.SerializeToString,
      ),
      'UpdateBento': grpc.unary_unary_rpc_method_handler(
          servicer.UpdateBento,
          request_deserializer=repository__pb2.UpdateBentoRequest.FromString,
          response_serializer=repository__pb2.UpdateBentoResponse.SerializeToString,
      ),
      'GetBento': grpc.unary_unary_rpc_method_handler(
          servicer.GetBento,
          request_deserializer=repository__pb2.GetBentoRequest.FromString,
          response_serializer=repository__pb2.GetBentoResponse.SerializeToString,
      ),
      'DangerouslyDeleteBento': grpc.unary_unary_rpc_method_handler(
          servicer.DangerouslyDeleteBento,
          request_deserializer=repository__pb2.DangerouslyDeleteBentoRequest.FromString,
          response_serializer=repository__pb2.DangerouslyDeleteBentoResponse.SerializeToString,
      ),
      'ListBento': grpc.unary_unary_rpc_method_handler(
          servicer.ListBento,
          request_deserializer=repository__pb2.ListBentoRequest.FromString,
          response_serializer=repository__pb2.ListBentoResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'bentoml.Yatai', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
