# 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
from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2


class MasterStub(object):
    """Missing associated documentation comment in .proto file"""

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

        Args:
            channel: A grpc.Channel.
        """
        self.get_task = channel.unary_unary(
                '/proto.Master/get_task',
                request_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.GetTaskRequest.SerializeToString,
                response_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.Task.FromString,
                )
        self.report_evaluation_metrics = channel.unary_unary(
                '/proto.Master/report_evaluation_metrics',
                request_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.ReportEvaluationMetricsRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.report_task_result = channel.unary_unary(
                '/proto.Master/report_task_result',
                request_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.ReportTaskResultRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.report_version = channel.unary_unary(
                '/proto.Master/report_version',
                request_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.ReportVersionRequest.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )


class MasterServicer(object):
    """Missing associated documentation comment in .proto file"""

    def get_task(self, request, context):
        """Missing associated documentation comment in .proto file"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def report_evaluation_metrics(self, request, context):
        """Missing associated documentation comment in .proto file"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def report_task_result(self, request, context):
        """Missing associated documentation comment in .proto file"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def report_version(self, request, context):
        """Missing associated documentation comment in .proto file"""
        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 = {
            'get_task': grpc.unary_unary_rpc_method_handler(
                    servicer.get_task,
                    request_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.GetTaskRequest.FromString,
                    response_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.Task.SerializeToString,
            ),
            'report_evaluation_metrics': grpc.unary_unary_rpc_method_handler(
                    servicer.report_evaluation_metrics,
                    request_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.ReportEvaluationMetricsRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'report_task_result': grpc.unary_unary_rpc_method_handler(
                    servicer.report_task_result,
                    request_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.ReportTaskResultRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'report_version': grpc.unary_unary_rpc_method_handler(
                    servicer.report_version,
                    request_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.ReportVersionRequest.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'proto.Master', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Master(object):
    """Missing associated documentation comment in .proto file"""

    @staticmethod
    def get_task(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/proto.Master/get_task',
            elasticdl_dot_proto_dot_elasticdl__pb2.GetTaskRequest.SerializeToString,
            elasticdl_dot_proto_dot_elasticdl__pb2.Task.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def report_evaluation_metrics(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/proto.Master/report_evaluation_metrics',
            elasticdl_dot_proto_dot_elasticdl__pb2.ReportEvaluationMetricsRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def report_task_result(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/proto.Master/report_task_result',
            elasticdl_dot_proto_dot_elasticdl__pb2.ReportTaskResultRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def report_version(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/proto.Master/report_version',
            elasticdl_dot_proto_dot_elasticdl__pb2.ReportVersionRequest.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)


class PserverStub(object):
    """PS service
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.push_model = channel.unary_unary(
                '/proto.Pserver/push_model',
                request_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.Model.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.push_embedding_table_infos = channel.unary_unary(
                '/proto.Pserver/push_embedding_table_infos',
                request_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.Model.SerializeToString,
                response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                )
        self.pull_dense_parameters = channel.unary_unary(
                '/proto.Pserver/pull_dense_parameters',
                request_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.PullDenseParametersRequest.SerializeToString,
                response_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.PullDenseParametersResponse.FromString,
                )
        self.pull_embedding_vectors = channel.unary_unary(
                '/proto.Pserver/pull_embedding_vectors',
                request_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.PullEmbeddingVectorsRequest.SerializeToString,
                response_deserializer=tensorflow_dot_core_dot_framework_dot_tensor__pb2.TensorProto.FromString,
                )
        self.push_gradients = channel.unary_unary(
                '/proto.Pserver/push_gradients',
                request_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.PushGradientsRequest.SerializeToString,
                response_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.PushGradientsResponse.FromString,
                )


class PserverServicer(object):
    """PS service
    """

    def push_model(self, request, context):
        """Missing associated documentation comment in .proto file"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def push_embedding_table_infos(self, request, context):
        """Missing associated documentation comment in .proto file"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def pull_dense_parameters(self, request, context):
        """Missing associated documentation comment in .proto file"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def pull_embedding_vectors(self, request, context):
        """Missing associated documentation comment in .proto file"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def push_gradients(self, request, context):
        """Missing associated documentation comment in .proto file"""
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_PserverServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'push_model': grpc.unary_unary_rpc_method_handler(
                    servicer.push_model,
                    request_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.Model.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'push_embedding_table_infos': grpc.unary_unary_rpc_method_handler(
                    servicer.push_embedding_table_infos,
                    request_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.Model.FromString,
                    response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ),
            'pull_dense_parameters': grpc.unary_unary_rpc_method_handler(
                    servicer.pull_dense_parameters,
                    request_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.PullDenseParametersRequest.FromString,
                    response_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.PullDenseParametersResponse.SerializeToString,
            ),
            'pull_embedding_vectors': grpc.unary_unary_rpc_method_handler(
                    servicer.pull_embedding_vectors,
                    request_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.PullEmbeddingVectorsRequest.FromString,
                    response_serializer=tensorflow_dot_core_dot_framework_dot_tensor__pb2.TensorProto.SerializeToString,
            ),
            'push_gradients': grpc.unary_unary_rpc_method_handler(
                    servicer.push_gradients,
                    request_deserializer=elasticdl_dot_proto_dot_elasticdl__pb2.PushGradientsRequest.FromString,
                    response_serializer=elasticdl_dot_proto_dot_elasticdl__pb2.PushGradientsResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'proto.Pserver', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Pserver(object):
    """PS service
    """

    @staticmethod
    def push_model(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/proto.Pserver/push_model',
            elasticdl_dot_proto_dot_elasticdl__pb2.Model.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def push_embedding_table_infos(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/proto.Pserver/push_embedding_table_infos',
            elasticdl_dot_proto_dot_elasticdl__pb2.Model.SerializeToString,
            google_dot_protobuf_dot_empty__pb2.Empty.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def pull_dense_parameters(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/proto.Pserver/pull_dense_parameters',
            elasticdl_dot_proto_dot_elasticdl__pb2.PullDenseParametersRequest.SerializeToString,
            elasticdl_dot_proto_dot_elasticdl__pb2.PullDenseParametersResponse.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def pull_embedding_vectors(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/proto.Pserver/pull_embedding_vectors',
            elasticdl_dot_proto_dot_elasticdl__pb2.PullEmbeddingVectorsRequest.SerializeToString,
            tensorflow_dot_core_dot_framework_dot_tensor__pb2.TensorProto.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def push_gradients(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/proto.Pserver/push_gradients',
            elasticdl_dot_proto_dot_elasticdl__pb2.PushGradientsRequest.SerializeToString,
            elasticdl_dot_proto_dot_elasticdl__pb2.PushGradientsResponse.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)
