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

from . import yggdrasil_pb2 as yggdrasil__pb2


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.Register = channel.unary_unary(
                '/yggdrasil.Dispatcher/Register',
                request_serializer=yggdrasil__pb2.RegistrationRequest.SerializeToString,
                response_deserializer=yggdrasil__pb2.RegistrationResponse.FromString,
                )
        self.Send = channel.unary_unary(
                '/yggdrasil.Dispatcher/Send',
                request_serializer=yggdrasil__pb2.Data.SerializeToString,
                response_deserializer=yggdrasil__pb2.Receipt.FromString,
                )


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

    def Register(self, request, context):
        """Register is called by a worker to indicate it is ready and capable of
        handling the specified type of work.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Send(self, request, context):
        """Send is called by a worker to send data to the dispatcher.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_DispatcherServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Register': grpc.unary_unary_rpc_method_handler(
                    servicer.Register,
                    request_deserializer=yggdrasil__pb2.RegistrationRequest.FromString,
                    response_serializer=yggdrasil__pb2.RegistrationResponse.SerializeToString,
            ),
            'Send': grpc.unary_unary_rpc_method_handler(
                    servicer.Send,
                    request_deserializer=yggdrasil__pb2.Data.FromString,
                    response_serializer=yggdrasil__pb2.Receipt.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'yggdrasil.Dispatcher', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def Register(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, '/yggdrasil.Dispatcher/Register',
            yggdrasil__pb2.RegistrationRequest.SerializeToString,
            yggdrasil__pb2.RegistrationResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Send(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, '/yggdrasil.Dispatcher/Send',
            yggdrasil__pb2.Data.SerializeToString,
            yggdrasil__pb2.Receipt.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)


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

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

        Args:
            channel: A grpc.Channel.
        """
        self.Send = channel.unary_unary(
                '/yggdrasil.Worker/Send',
                request_serializer=yggdrasil__pb2.Data.SerializeToString,
                response_deserializer=yggdrasil__pb2.Receipt.FromString,
                )


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

    def Send(self, request, context):
        """Send is called by the dispatcher to send data to a worker.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_WorkerServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Send': grpc.unary_unary_rpc_method_handler(
                    servicer.Send,
                    request_deserializer=yggdrasil__pb2.Data.FromString,
                    response_serializer=yggdrasil__pb2.Receipt.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'yggdrasil.Worker', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


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

    @staticmethod
    def Send(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, '/yggdrasil.Worker/Send',
            yggdrasil__pb2.Data.SerializeToString,
            yggdrasil__pb2.Receipt.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
