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

from . import queue_pb2 as v1_dot_queue__pb2


class QueueStub(object):
    """The Nitric Queue Service contract
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Push = channel.unary_unary(
                '/nitric.v1.queue.Queue/Push',
                request_serializer=v1_dot_queue__pb2.PushRequest.SerializeToString,
                response_deserializer=v1_dot_queue__pb2.PushResponse.FromString,
                )
        self.Pop = channel.unary_unary(
                '/nitric.v1.queue.Queue/Pop',
                request_serializer=v1_dot_queue__pb2.PopRequest.SerializeToString,
                response_deserializer=v1_dot_queue__pb2.PopResponse.FromString,
                )


class QueueServicer(object):
    """The Nitric Queue Service contract
    """

    def Push(self, request, context):
        """Push event(s) to a queue
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Pop(self, request, context):
        """Pop event(s) off a queue
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_QueueServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Push': grpc.unary_unary_rpc_method_handler(
                    servicer.Push,
                    request_deserializer=v1_dot_queue__pb2.PushRequest.FromString,
                    response_serializer=v1_dot_queue__pb2.PushResponse.SerializeToString,
            ),
            'Pop': grpc.unary_unary_rpc_method_handler(
                    servicer.Pop,
                    request_deserializer=v1_dot_queue__pb2.PopRequest.FromString,
                    response_serializer=v1_dot_queue__pb2.PopResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'nitric.v1.queue.Queue', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Queue(object):
    """The Nitric Queue Service contract
    """

    @staticmethod
    def Push(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, '/nitric.v1.queue.Queue/Push',
            v1_dot_queue__pb2.PushRequest.SerializeToString,
            v1_dot_queue__pb2.PushResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def Pop(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, '/nitric.v1.queue.Queue/Pop',
            v1_dot_queue__pb2.PopRequest.SerializeToString,
            v1_dot_queue__pb2.PopResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
