# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
import grpc_ps.ps_service_pb2 as ps__service__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.ping = channel.unary_unary(
                '/ps_service.ParameterServer/ping',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=ps__service__pb2.Status.FromString,
                )
        self.register_model = channel.unary_unary(
                '/ps_service.ParameterServer/register_model',
                request_serializer=ps__service__pb2.RegisterRequest.SerializeToString,
                response_deserializer=ps__service__pb2.Status.FromString,
                )
        self.exist_model = channel.unary_unary(
                '/ps_service.ParameterServer/exist_model',
                request_serializer=ps__service__pb2.ExistRequest.SerializeToString,
                response_deserializer=ps__service__pb2.Status.FromString,
                )
        self.can_pull = channel.unary_unary(
                '/ps_service.ParameterServer/can_pull',
                request_serializer=ps__service__pb2.WorkerRequest.SerializeToString,
                response_deserializer=ps__service__pb2.Status.FromString,
                )
        self.can_push = channel.unary_unary(
                '/ps_service.ParameterServer/can_push',
                request_serializer=ps__service__pb2.WorkerRequest.SerializeToString,
                response_deserializer=ps__service__pb2.Status.FromString,
                )
        self.pull_model = channel.unary_unary(
                '/ps_service.ParameterServer/pull_model',
                request_serializer=ps__service__pb2.WorkerRequest.SerializeToString,
                response_deserializer=ps__service__pb2.Model.FromString,
                )
        self.push_grad = channel.unary_unary(
                '/ps_service.ParameterServer/push_grad',
                request_serializer=ps__service__pb2.Grad.SerializeToString,
                response_deserializer=ps__service__pb2.Status.FromString,
                )
        self.push_update = channel.unary_unary(
                '/ps_service.ParameterServer/push_update',
                request_serializer=ps__service__pb2.Update.SerializeToString,
                response_deserializer=ps__service__pb2.Status.FromString,
                )


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

    def ping(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 register_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 exist_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 can_pull(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 can_push(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_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_grad(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_update(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_ParameterServerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ping': grpc.unary_unary_rpc_method_handler(
                    servicer.ping,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=ps__service__pb2.Status.SerializeToString,
            ),
            'register_model': grpc.unary_unary_rpc_method_handler(
                    servicer.register_model,
                    request_deserializer=ps__service__pb2.RegisterRequest.FromString,
                    response_serializer=ps__service__pb2.Status.SerializeToString,
            ),
            'exist_model': grpc.unary_unary_rpc_method_handler(
                    servicer.exist_model,
                    request_deserializer=ps__service__pb2.ExistRequest.FromString,
                    response_serializer=ps__service__pb2.Status.SerializeToString,
            ),
            'can_pull': grpc.unary_unary_rpc_method_handler(
                    servicer.can_pull,
                    request_deserializer=ps__service__pb2.WorkerRequest.FromString,
                    response_serializer=ps__service__pb2.Status.SerializeToString,
            ),
            'can_push': grpc.unary_unary_rpc_method_handler(
                    servicer.can_push,
                    request_deserializer=ps__service__pb2.WorkerRequest.FromString,
                    response_serializer=ps__service__pb2.Status.SerializeToString,
            ),
            'pull_model': grpc.unary_unary_rpc_method_handler(
                    servicer.pull_model,
                    request_deserializer=ps__service__pb2.WorkerRequest.FromString,
                    response_serializer=ps__service__pb2.Model.SerializeToString,
            ),
            'push_grad': grpc.unary_unary_rpc_method_handler(
                    servicer.push_grad,
                    request_deserializer=ps__service__pb2.Grad.FromString,
                    response_serializer=ps__service__pb2.Status.SerializeToString,
            ),
            'push_update': grpc.unary_unary_rpc_method_handler(
                    servicer.push_update,
                    request_deserializer=ps__service__pb2.Update.FromString,
                    response_serializer=ps__service__pb2.Status.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'ps_service.ParameterServer', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def ping(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, '/ps_service.ParameterServer/ping',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            ps__service__pb2.Status.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def register_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, '/ps_service.ParameterServer/register_model',
            ps__service__pb2.RegisterRequest.SerializeToString,
            ps__service__pb2.Status.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def exist_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, '/ps_service.ParameterServer/exist_model',
            ps__service__pb2.ExistRequest.SerializeToString,
            ps__service__pb2.Status.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def can_pull(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, '/ps_service.ParameterServer/can_pull',
            ps__service__pb2.WorkerRequest.SerializeToString,
            ps__service__pb2.Status.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def can_push(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, '/ps_service.ParameterServer/can_push',
            ps__service__pb2.WorkerRequest.SerializeToString,
            ps__service__pb2.Status.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def pull_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, '/ps_service.ParameterServer/pull_model',
            ps__service__pb2.WorkerRequest.SerializeToString,
            ps__service__pb2.Model.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def push_grad(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, '/ps_service.ParameterServer/push_grad',
            ps__service__pb2.Grad.SerializeToString,
            ps__service__pb2.Status.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def push_update(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, '/ps_service.ParameterServer/push_update',
            ps__service__pb2.Update.SerializeToString,
            ps__service__pb2.Status.FromString,
            options, channel_credentials,
            call_credentials, compression, wait_for_ready, timeout, metadata)
