# 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


class EventStreamServiceStub(object):
    """docs:start:event_stream_service
    EventStreamService: streams events to registered subscribers
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Subscribe = channel.unary_stream(
                '/angzarr.EventStreamService/Subscribe',
                request_serializer=angzarr_dot_types__pb2.EventStreamFilter.SerializeToString,
                response_deserializer=angzarr_dot_types__pb2.EventBook.FromString,
                _registered_method=True)


class EventStreamServiceServicer(object):
    """docs:start:event_stream_service
    EventStreamService: streams events to registered subscribers
    """

    def Subscribe(self, request, context):
        """Subscribe to events matching correlation ID (required)
        Returns INVALID_ARGUMENT if correlation_id is empty
        REST: Server-Sent Events (SSE) stream
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_EventStreamServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Subscribe': grpc.unary_stream_rpc_method_handler(
                    servicer.Subscribe,
                    request_deserializer=angzarr_dot_types__pb2.EventStreamFilter.FromString,
                    response_serializer=angzarr_dot_types__pb2.EventBook.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'angzarr.EventStreamService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('angzarr.EventStreamService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class EventStreamService(object):
    """docs:start:event_stream_service
    EventStreamService: streams events to registered subscribers
    """

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