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

from angzarr_client.proto.angzarr import types_pb2 as angzarr_dot_types__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2


class EventQueryServiceStub(object):
    """EventQueryService: query interface for retrieving events
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetEventBook = channel.unary_unary(
                '/angzarr.EventQueryService/GetEventBook',
                request_serializer=angzarr_dot_types__pb2.Query.SerializeToString,
                response_deserializer=angzarr_dot_types__pb2.EventBook.FromString,
                _registered_method=True)
        self.GetEvents = channel.unary_stream(
                '/angzarr.EventQueryService/GetEvents',
                request_serializer=angzarr_dot_types__pb2.Query.SerializeToString,
                response_deserializer=angzarr_dot_types__pb2.EventBook.FromString,
                _registered_method=True)
        self.Synchronize = channel.stream_stream(
                '/angzarr.EventQueryService/Synchronize',
                request_serializer=angzarr_dot_types__pb2.Query.SerializeToString,
                response_deserializer=angzarr_dot_types__pb2.EventBook.FromString,
                _registered_method=True)
        self.GetAggregateRoots = channel.unary_stream(
                '/angzarr.EventQueryService/GetAggregateRoots',
                request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
                response_deserializer=angzarr_dot_types__pb2.AggregateRoot.FromString,
                _registered_method=True)


class EventQueryServiceServicer(object):
    """EventQueryService: query interface for retrieving events
    """

    def GetEventBook(self, request, context):
        """Get a single EventBook (unary) - use for explicit queries with gRPC tooling
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetEvents(self, request, context):
        """Stream EventBooks matching query - use for bulk retrieval (SSE)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def Synchronize(self, request_iterator, context):
        """Bidirectional sync - not exposed via REST (use gRPC directly)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetAggregateRoots(self, request, context):
        """List all aggregate roots (SSE)
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_EventQueryServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetEventBook': grpc.unary_unary_rpc_method_handler(
                    servicer.GetEventBook,
                    request_deserializer=angzarr_dot_types__pb2.Query.FromString,
                    response_serializer=angzarr_dot_types__pb2.EventBook.SerializeToString,
            ),
            'GetEvents': grpc.unary_stream_rpc_method_handler(
                    servicer.GetEvents,
                    request_deserializer=angzarr_dot_types__pb2.Query.FromString,
                    response_serializer=angzarr_dot_types__pb2.EventBook.SerializeToString,
            ),
            'Synchronize': grpc.stream_stream_rpc_method_handler(
                    servicer.Synchronize,
                    request_deserializer=angzarr_dot_types__pb2.Query.FromString,
                    response_serializer=angzarr_dot_types__pb2.EventBook.SerializeToString,
            ),
            'GetAggregateRoots': grpc.unary_stream_rpc_method_handler(
                    servicer.GetAggregateRoots,
                    request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
                    response_serializer=angzarr_dot_types__pb2.AggregateRoot.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'angzarr.EventQueryService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('angzarr.EventQueryService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class EventQueryService(object):
    """EventQueryService: query interface for retrieving events
    """

    @staticmethod
    def GetEventBook(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,
            '/angzarr.EventQueryService/GetEventBook',
            angzarr_dot_types__pb2.Query.SerializeToString,
            angzarr_dot_types__pb2.EventBook.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetEvents(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_stream(
            request,
            target,
            '/angzarr.EventQueryService/GetEvents',
            angzarr_dot_types__pb2.Query.SerializeToString,
            angzarr_dot_types__pb2.EventBook.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def Synchronize(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_stream(
            request_iterator,
            target,
            '/angzarr.EventQueryService/Synchronize',
            angzarr_dot_types__pb2.Query.SerializeToString,
            angzarr_dot_types__pb2.EventBook.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetAggregateRoots(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_stream(
            request,
            target,
            '/angzarr.EventQueryService/GetAggregateRoots',
            google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
            angzarr_dot_types__pb2.AggregateRoot.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
