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

from . import federated_learning_pb2 as federated__learning__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetJob = channel.unary_unary(
                '/FederatedLearning/GetJob',
                request_serializer=federated__learning__pb2.JobRequest.SerializeToString,
                response_deserializer=federated__learning__pb2.JobResponse.FromString,
                )
        self.GetTensorRecord = channel.unary_unary(
                '/FederatedLearning/GetTensorRecord',
                request_serializer=federated__learning__pb2.TensorRequest.SerializeToString,
                response_deserializer=federated__learning__pb2.TensorRecord.FromString,
                )
        self.GetWeight = channel.unary_unary(
                '/FederatedLearning/GetWeight',
                request_serializer=federated__learning__pb2.WeightRequest.SerializeToString,
                response_deserializer=federated__learning__pb2.WeightResponse.FromString,
                )
        self.SendLearningResults = channel.stream_unary(
                '/FederatedLearning/SendLearningResults',
                request_serializer=federated__learning__pb2.DataBuffer.SerializeToString,
                response_deserializer=federated__learning__pb2.Acknowledgment.FromString,
                )


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

    def GetJob(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 GetTensorRecord(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 GetWeight(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 SendLearningResults(self, request_iterator, 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_FederatedLearningServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetJob': grpc.unary_unary_rpc_method_handler(
                    servicer.GetJob,
                    request_deserializer=federated__learning__pb2.JobRequest.FromString,
                    response_serializer=federated__learning__pb2.JobResponse.SerializeToString,
            ),
            'GetTensorRecord': grpc.unary_unary_rpc_method_handler(
                    servicer.GetTensorRecord,
                    request_deserializer=federated__learning__pb2.TensorRequest.FromString,
                    response_serializer=federated__learning__pb2.TensorRecord.SerializeToString,
            ),
            'GetWeight': grpc.unary_unary_rpc_method_handler(
                    servicer.GetWeight,
                    request_deserializer=federated__learning__pb2.WeightRequest.FromString,
                    response_serializer=federated__learning__pb2.WeightResponse.SerializeToString,
            ),
            'SendLearningResults': grpc.stream_unary_rpc_method_handler(
                    servicer.SendLearningResults,
                    request_deserializer=federated__learning__pb2.DataBuffer.FromString,
                    response_serializer=federated__learning__pb2.Acknowledgment.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'FederatedLearning', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def GetJob(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/FederatedLearning/GetJob',
            federated__learning__pb2.JobRequest.SerializeToString,
            federated__learning__pb2.JobResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetTensorRecord(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/FederatedLearning/GetTensorRecord',
            federated__learning__pb2.TensorRequest.SerializeToString,
            federated__learning__pb2.TensorRecord.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetWeight(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/FederatedLearning/GetWeight',
            federated__learning__pb2.WeightRequest.SerializeToString,
            federated__learning__pb2.WeightResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SendLearningResults(request_iterator,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.stream_unary(request_iterator, target, '/FederatedLearning/SendLearningResults',
            federated__learning__pb2.DataBuffer.SerializeToString,
            federated__learning__pb2.Acknowledgment.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
