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

from speechly.config.v1 import model_api_pb2 as speechly_dot_config_dot_v1_dot_model__api__pb2


class ModelAPIStub(object):
  """Speechly Model API provides operations related to the on-device models.

  The service requires a Speechly token, which is obtained from Speechly Dashboard (https://speechly.com/dashboard).

  The token acts as a proxy for the user who has generated it,
  i.e. all operations are performed with that user as a subject.
  """

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

    Args:
      channel: A grpc.Channel.
    """
    self.DownloadModel = channel.unary_stream(
        '/speechly.config.v1.ModelAPI/DownloadModel',
        request_serializer=speechly_dot_config_dot_v1_dot_model__api__pb2.DownloadModelRequest.SerializeToString,
        response_deserializer=speechly_dot_config_dot_v1_dot_model__api__pb2.DownloadModelResponse.FromString,
        )
    self.ListBaseModels = channel.unary_unary(
        '/speechly.config.v1.ModelAPI/ListBaseModels',
        request_serializer=speechly_dot_config_dot_v1_dot_model__api__pb2.ListBaseModelsRequest.SerializeToString,
        response_deserializer=speechly_dot_config_dot_v1_dot_model__api__pb2.ListBaseModelsResponse.FromString,
        )
    self.ListLanguages = channel.unary_unary(
        '/speechly.config.v1.ModelAPI/ListLanguages',
        request_serializer=speechly_dot_config_dot_v1_dot_model__api__pb2.ListLanguagesRequest.SerializeToString,
        response_deserializer=speechly_dot_config_dot_v1_dot_model__api__pb2.ListLanguagesResponse.FromString,
        )


class ModelAPIServicer(object):
  """Speechly Model API provides operations related to the on-device models.

  The service requires a Speechly token, which is obtained from Speechly Dashboard (https://speechly.com/dashboard).

  The token acts as a proxy for the user who has generated it,
  i.e. all operations are performed with that user as a subject.
  """

  def DownloadModel(self, request, context):
    """Downloads a model bundle for on-device use.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def ListBaseModels(self, request, context):
    """List the base models available for use as basis in training.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def ListLanguages(self, request, context):
    """List supported languages.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_ModelAPIServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'DownloadModel': grpc.unary_stream_rpc_method_handler(
          servicer.DownloadModel,
          request_deserializer=speechly_dot_config_dot_v1_dot_model__api__pb2.DownloadModelRequest.FromString,
          response_serializer=speechly_dot_config_dot_v1_dot_model__api__pb2.DownloadModelResponse.SerializeToString,
      ),
      'ListBaseModels': grpc.unary_unary_rpc_method_handler(
          servicer.ListBaseModels,
          request_deserializer=speechly_dot_config_dot_v1_dot_model__api__pb2.ListBaseModelsRequest.FromString,
          response_serializer=speechly_dot_config_dot_v1_dot_model__api__pb2.ListBaseModelsResponse.SerializeToString,
      ),
      'ListLanguages': grpc.unary_unary_rpc_method_handler(
          servicer.ListLanguages,
          request_deserializer=speechly_dot_config_dot_v1_dot_model__api__pb2.ListLanguagesRequest.FromString,
          response_serializer=speechly_dot_config_dot_v1_dot_model__api__pb2.ListLanguagesResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'speechly.config.v1.ModelAPI', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
