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

import fed_grpc_pb2 as fed__grpc__pb2

GRPC_GENERATED_VERSION = '1.66.1'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in fed_grpc_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.sendChunk = channel.stream_unary(
                '/main.FederatedService/sendChunk',
                request_serializer=fed__grpc__pb2.ChunkData.SerializeToString,
                response_deserializer=fed__grpc__pb2.Response.FromString,
                _registered_method=True)
        self.clientRegister = channel.unary_unary(
                '/main.FederatedService/clientRegister',
                request_serializer=fed__grpc__pb2.registerArgs.SerializeToString,
                response_deserializer=fed__grpc__pb2.registerOut.FromString,
                _registered_method=True)
        self.startLearning = channel.unary_unary(
                '/main.FederatedService/startLearning',
                request_serializer=fed__grpc__pb2.void.SerializeToString,
                response_deserializer=fed__grpc__pb2.weightList.FromString,
                _registered_method=True)
        self.getSampleSize = channel.unary_unary(
                '/main.FederatedService/getSampleSize',
                request_serializer=fed__grpc__pb2.void.SerializeToString,
                response_deserializer=fed__grpc__pb2.sampleSize.FromString,
                _registered_method=True)
        self.modelValidation = channel.unary_unary(
                '/main.FederatedService/modelValidation',
                request_serializer=fed__grpc__pb2.weightList.SerializeToString,
                response_deserializer=fed__grpc__pb2.accuracy.FromString,
                _registered_method=True)
        self.killClient = channel.unary_unary(
                '/main.FederatedService/killClient',
                request_serializer=fed__grpc__pb2.void.SerializeToString,
                response_deserializer=fed__grpc__pb2.void.FromString,
                _registered_method=True)
        self.sendRound = channel.unary_unary(
                '/main.FederatedService/sendRound',
                request_serializer=fed__grpc__pb2.currentRound.SerializeToString,
                response_deserializer=fed__grpc__pb2.void.FromString,
                _registered_method=True)
        self.sendEncryptedData = channel.unary_unary(
                '/main.FederatedService/sendEncryptedData',
                request_serializer=fed__grpc__pb2.EncryptionArgs.SerializeToString,
                response_deserializer=fed__grpc__pb2.Response.FromString,
                _registered_method=True)
        self.receiveEncryptedData = channel.unary_unary(
                '/main.FederatedService/receiveEncryptedData',
                request_serializer=fed__grpc__pb2.EncryptionArgs.SerializeToString,
                response_deserializer=fed__grpc__pb2.Response.FromString,
                _registered_method=True)


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

    def sendChunk(self, request_iterator, context):
        """Streaming RPC สำหรับการส่งข้อมูลขนาดใหญ่จากไคลเอนต์ไปยังเซิร์ฟเวอร์
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def clientRegister(self, request, context):
        """RPC สำหรับการลงทะเบียน client
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def startLearning(self, request, context):
        """RPC เพื่อเริ่มการเรียนรู้ และส่งกลับรายการ weights
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def getSampleSize(self, request, context):
        """RPC เพื่อรับขนาดตัวอย่างจากเซิร์ฟเวอร์
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def modelValidation(self, request, context):
        """RPC สำหรับการตรวจสอบความถูกต้องของโมเดล (validation)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def killClient(self, request, context):
        """RPC เพื่อหยุด client
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def sendRound(self, request, context):
        """RPC เพื่อส่งรอบปัจจุบัน
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def sendEncryptedData(self, request, context):
        """RPC สำหรับส่งข้อมูลที่เข้ารหัสจาก client ไปยัง server
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def receiveEncryptedData(self, request, context):
        """RPC สำหรับรับข้อมูลที่เข้ารหัสจาก server
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_FederatedServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'sendChunk': grpc.stream_unary_rpc_method_handler(
                    servicer.sendChunk,
                    request_deserializer=fed__grpc__pb2.ChunkData.FromString,
                    response_serializer=fed__grpc__pb2.Response.SerializeToString,
            ),
            'clientRegister': grpc.unary_unary_rpc_method_handler(
                    servicer.clientRegister,
                    request_deserializer=fed__grpc__pb2.registerArgs.FromString,
                    response_serializer=fed__grpc__pb2.registerOut.SerializeToString,
            ),
            'startLearning': grpc.unary_unary_rpc_method_handler(
                    servicer.startLearning,
                    request_deserializer=fed__grpc__pb2.void.FromString,
                    response_serializer=fed__grpc__pb2.weightList.SerializeToString,
            ),
            'getSampleSize': grpc.unary_unary_rpc_method_handler(
                    servicer.getSampleSize,
                    request_deserializer=fed__grpc__pb2.void.FromString,
                    response_serializer=fed__grpc__pb2.sampleSize.SerializeToString,
            ),
            'modelValidation': grpc.unary_unary_rpc_method_handler(
                    servicer.modelValidation,
                    request_deserializer=fed__grpc__pb2.weightList.FromString,
                    response_serializer=fed__grpc__pb2.accuracy.SerializeToString,
            ),
            'killClient': grpc.unary_unary_rpc_method_handler(
                    servicer.killClient,
                    request_deserializer=fed__grpc__pb2.void.FromString,
                    response_serializer=fed__grpc__pb2.void.SerializeToString,
            ),
            'sendRound': grpc.unary_unary_rpc_method_handler(
                    servicer.sendRound,
                    request_deserializer=fed__grpc__pb2.currentRound.FromString,
                    response_serializer=fed__grpc__pb2.void.SerializeToString,
            ),
            'sendEncryptedData': grpc.unary_unary_rpc_method_handler(
                    servicer.sendEncryptedData,
                    request_deserializer=fed__grpc__pb2.EncryptionArgs.FromString,
                    response_serializer=fed__grpc__pb2.Response.SerializeToString,
            ),
            'receiveEncryptedData': grpc.unary_unary_rpc_method_handler(
                    servicer.receiveEncryptedData,
                    request_deserializer=fed__grpc__pb2.EncryptionArgs.FromString,
                    response_serializer=fed__grpc__pb2.Response.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'main.FederatedService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('main.FederatedService', rpc_method_handlers)


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

    @staticmethod
    def sendChunk(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,
            '/main.FederatedService/sendChunk',
            fed__grpc__pb2.ChunkData.SerializeToString,
            fed__grpc__pb2.Response.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def clientRegister(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,
            '/main.FederatedService/clientRegister',
            fed__grpc__pb2.registerArgs.SerializeToString,
            fed__grpc__pb2.registerOut.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def startLearning(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,
            '/main.FederatedService/startLearning',
            fed__grpc__pb2.void.SerializeToString,
            fed__grpc__pb2.weightList.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def getSampleSize(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,
            '/main.FederatedService/getSampleSize',
            fed__grpc__pb2.void.SerializeToString,
            fed__grpc__pb2.sampleSize.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def modelValidation(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,
            '/main.FederatedService/modelValidation',
            fed__grpc__pb2.weightList.SerializeToString,
            fed__grpc__pb2.accuracy.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def killClient(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,
            '/main.FederatedService/killClient',
            fed__grpc__pb2.void.SerializeToString,
            fed__grpc__pb2.void.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def sendRound(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,
            '/main.FederatedService/sendRound',
            fed__grpc__pb2.currentRound.SerializeToString,
            fed__grpc__pb2.void.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def sendEncryptedData(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,
            '/main.FederatedService/sendEncryptedData',
            fed__grpc__pb2.EncryptionArgs.SerializeToString,
            fed__grpc__pb2.Response.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def receiveEncryptedData(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,
            '/main.FederatedService/receiveEncryptedData',
            fed__grpc__pb2.EncryptionArgs.SerializeToString,
            fed__grpc__pb2.Response.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
