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

from elasticdl.proto import elasticdl_pb2 as elasticdl_dot_proto_dot_elasticdl__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2


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

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

    Args:
      channel: A grpc.Channel.
    """
    self.GetTask = channel.unary_unary(
        '/master.Master/GetTask',
        request_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.GetTaskRequest.SerializeToString,
        response_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.Task.FromString,
        )
    self.GetModel = channel.unary_unary(
        '/master.Master/GetModel',
        request_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.GetModelRequest.SerializeToString,
        response_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.Model.FromString,
        )
    self.ReportVariable = channel.unary_unary(
        '/master.Master/ReportVariable',
        request_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.ReportVariableRequest.SerializeToString,
        response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )
    self.ReportGradient = channel.unary_unary(
        '/master.Master/ReportGradient',
        request_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.ReportGradientRequest.SerializeToString,
        response_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.ReportGradientResponse.FromString,
        )
    self.ReportEvaluationMetrics = channel.unary_unary(
        '/master.Master/ReportEvaluationMetrics',
        request_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.ReportEvaluationMetricsRequest.SerializeToString,
        response_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.ReportEvaluationMetricsResponse.FromString,
        )
    self.ReportTaskResult = channel.unary_unary(
        '/master.Master/ReportTaskResult',
        request_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.ReportTaskResultRequest.SerializeToString,
        response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
        )


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

  def GetTask(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 GetModel(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 ReportVariable(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 ReportGradient(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 ReportEvaluationMetrics(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 ReportTaskResult(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_MasterServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'GetTask': grpc.unary_unary_rpc_method_handler(
          servicer.GetTask,
          request_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.GetTaskRequest.FromString,
          response_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.Task.SerializeToString,
      ),
      'GetModel': grpc.unary_unary_rpc_method_handler(
          servicer.GetModel,
          request_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.GetModelRequest.FromString,
          response_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.Model.SerializeToString,
      ),
      'ReportVariable': grpc.unary_unary_rpc_method_handler(
          servicer.ReportVariable,
          request_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.ReportVariableRequest.FromString,
          response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
      ),
      'ReportGradient': grpc.unary_unary_rpc_method_handler(
          servicer.ReportGradient,
          request_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.ReportGradientRequest.FromString,
          response_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.ReportGradientResponse.SerializeToString,
      ),
      'ReportEvaluationMetrics': grpc.unary_unary_rpc_method_handler(
          servicer.ReportEvaluationMetrics,
          request_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.ReportEvaluationMetricsRequest.FromString,
          response_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.ReportEvaluationMetricsResponse.SerializeToString,
      ),
      'ReportTaskResult': grpc.unary_unary_rpc_method_handler(
          servicer.ReportTaskResult,
          request_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.ReportTaskResultRequest.FromString,
          response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'master.Master', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
