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

from agntcy.dir.events.v1 import event_service_pb2 as agntcy_dot_dir_dot_events_dot_v1_dot_event__service__pb2


class EventServiceStub(object):
    """EventService provides real-time event streaming for all system operations.
    Events are delivered from subscription time forward with no history or replay.
    This service enables external applications to react to system changes in real-time.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.Listen = channel.unary_stream(
                '/agntcy.dir.events.v1.EventService/Listen',
                request_serializer=agntcy_dot_dir_dot_events_dot_v1_dot_event__service__pb2.ListenRequest.SerializeToString,
                response_deserializer=agntcy_dot_dir_dot_events_dot_v1_dot_event__service__pb2.ListenResponse.FromString,
                _registered_method=True)


class EventServiceServicer(object):
    """EventService provides real-time event streaming for all system operations.
    Events are delivered from subscription time forward with no history or replay.
    This service enables external applications to react to system changes in real-time.
    """

    def Listen(self, request, context):
        """Listen establishes a streaming connection to receive events.
        Events are only delivered while the stream is active.
        On disconnect, missed events are not recoverable.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_EventServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'Listen': grpc.unary_stream_rpc_method_handler(
                    servicer.Listen,
                    request_deserializer=agntcy_dot_dir_dot_events_dot_v1_dot_event__service__pb2.ListenRequest.FromString,
                    response_serializer=agntcy_dot_dir_dot_events_dot_v1_dot_event__service__pb2.ListenResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'agntcy.dir.events.v1.EventService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('agntcy.dir.events.v1.EventService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class EventService(object):
    """EventService provides real-time event streaming for all system operations.
    Events are delivered from subscription time forward with no history or replay.
    This service enables external applications to react to system changes in real-time.
    """

    @staticmethod
    def Listen(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,
            '/agntcy.dir.events.v1.EventService/Listen',
            agntcy_dot_dir_dot_events_dot_v1_dot_event__service__pb2.ListenRequest.SerializeToString,
            agntcy_dot_dir_dot_events_dot_v1_dot_event__service__pb2.ListenResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
