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

from th2_grpc_lw_data_provider import queue_data_provider_pb2 as th2__grpc__lw__data__provider_dot_queue__data__provider__pb2


class QueueDataProviderStub(object):
    """*
    Service is used to request messages from DB and sent them to specified Queue
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.SearchMessageGroups = channel.unary_unary(
                '/th2.data_provider.lw.QueueDataProvider/SearchMessageGroups',
                request_serializer=th2__grpc__lw__data__provider_dot_queue__data__provider__pb2.MessageGroupsQueueSearchRequest.SerializeToString,
                response_deserializer=th2__grpc__lw__data__provider_dot_queue__data__provider__pb2.MessageLoadedStatistic.FromString,
                )
        self.SearchEvents = channel.unary_unary(
                '/th2.data_provider.lw.QueueDataProvider/SearchEvents',
                request_serializer=th2__grpc__lw__data__provider_dot_queue__data__provider__pb2.EventQueueSearchRequest.SerializeToString,
                response_deserializer=th2__grpc__lw__data__provider_dot_queue__data__provider__pb2.EventLoadedStatistic.FromString,
                )


class QueueDataProviderServicer(object):
    """*
    Service is used to request messages from DB and sent them to specified Queue
    """

    def SearchMessageGroups(self, request, context):
        """
        The messages are return within group batches
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SearchEvents(self, request, context):
        """
        Requesting events with the specified interval and sends them to queue
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_QueueDataProviderServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SearchMessageGroups': grpc.unary_unary_rpc_method_handler(
                    servicer.SearchMessageGroups,
                    request_deserializer=th2__grpc__lw__data__provider_dot_queue__data__provider__pb2.MessageGroupsQueueSearchRequest.FromString,
                    response_serializer=th2__grpc__lw__data__provider_dot_queue__data__provider__pb2.MessageLoadedStatistic.SerializeToString,
            ),
            'SearchEvents': grpc.unary_unary_rpc_method_handler(
                    servicer.SearchEvents,
                    request_deserializer=th2__grpc__lw__data__provider_dot_queue__data__provider__pb2.EventQueueSearchRequest.FromString,
                    response_serializer=th2__grpc__lw__data__provider_dot_queue__data__provider__pb2.EventLoadedStatistic.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'th2.data_provider.lw.QueueDataProvider', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class QueueDataProvider(object):
    """*
    Service is used to request messages from DB and sent them to specified Queue
    """

    @staticmethod
    def SearchMessageGroups(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, '/th2.data_provider.lw.QueueDataProvider/SearchMessageGroups',
            th2__grpc__lw__data__provider_dot_queue__data__provider__pb2.MessageGroupsQueueSearchRequest.SerializeToString,
            th2__grpc__lw__data__provider_dot_queue__data__provider__pb2.MessageLoadedStatistic.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SearchEvents(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, '/th2.data_provider.lw.QueueDataProvider/SearchEvents',
            th2__grpc__lw__data__provider_dot_queue__data__provider__pb2.EventQueueSearchRequest.SerializeToString,
            th2__grpc__lw__data__provider_dot_queue__data__provider__pb2.EventLoadedStatistic.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
