# Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from . import federation_pb2 as federation__pb2


class AggregatorStub(object):
    """Copyright (C) 2020 Intel Corporation
    Licensed subject to the terms of the separately executed evaluation license agreement between Intel Corporation and you.

    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetTasks = channel.unary_unary(
                '/Aggregator/GetTasks',
                request_serializer=federation__pb2.TasksRequest.SerializeToString,
                response_deserializer=federation__pb2.TasksResponse.FromString,
                )
        self.GetAggregatedTensor = channel.unary_unary(
                '/Aggregator/GetAggregatedTensor',
                request_serializer=federation__pb2.TensorRequest.SerializeToString,
                response_deserializer=federation__pb2.TensorResponse.FromString,
                )
        self.SendLocalTaskResults = channel.stream_unary(
                '/Aggregator/SendLocalTaskResults',
                request_serializer=federation__pb2.DataStream.SerializeToString,
                response_deserializer=federation__pb2.Acknowledgement.FromString,
                )


class AggregatorServicer(object):
    """Copyright (C) 2020 Intel Corporation
    Licensed subject to the terms of the separately executed evaluation license agreement between Intel Corporation and you.

    """

    def GetTasks(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 GetAggregatedTensor(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 SendLocalTaskResults(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_AggregatorServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetTasks': grpc.unary_unary_rpc_method_handler(
                    servicer.GetTasks,
                    request_deserializer=federation__pb2.TasksRequest.FromString,
                    response_serializer=federation__pb2.TasksResponse.SerializeToString,
            ),
            'GetAggregatedTensor': grpc.unary_unary_rpc_method_handler(
                    servicer.GetAggregatedTensor,
                    request_deserializer=federation__pb2.TensorRequest.FromString,
                    response_serializer=federation__pb2.TensorResponse.SerializeToString,
            ),
            'SendLocalTaskResults': grpc.stream_unary_rpc_method_handler(
                    servicer.SendLocalTaskResults,
                    request_deserializer=federation__pb2.DataStream.FromString,
                    response_serializer=federation__pb2.Acknowledgement.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'Aggregator', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Aggregator(object):
    """Copyright (C) 2020 Intel Corporation
    Licensed subject to the terms of the separately executed evaluation license agreement between Intel Corporation and you.

    """

    @staticmethod
    def GetTasks(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, '/Aggregator/GetTasks',
            federation__pb2.TasksRequest.SerializeToString,
            federation__pb2.TasksResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetAggregatedTensor(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, '/Aggregator/GetAggregatedTensor',
            federation__pb2.TensorRequest.SerializeToString,
            federation__pb2.TensorResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SendLocalTaskResults(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, '/Aggregator/SendLocalTaskResults',
            federation__pb2.DataStream.SerializeToString,
            federation__pb2.Acknowledgement.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
