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

from grpc_helper.api import common_pb2 as grpc__helper_dot_api_dot_common__pb2
from grpc_helper.api import events_pb2 as grpc__helper_dot_api_dot_events__pb2


class EventServiceStub(object):
    """Event service
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.listen = channel.unary_stream(
                '/EventService/listen',
                request_serializer=grpc__helper_dot_api_dot_common__pb2.Filter.SerializeToString,
                response_deserializer=grpc__helper_dot_api_dot_events__pb2.EventStatus.FromString,
                )
        self.interrupt = channel.unary_unary(
                '/EventService/interrupt',
                request_serializer=grpc__helper_dot_api_dot_events__pb2.EventInterrupt.SerializeToString,
                response_deserializer=grpc__helper_dot_api_dot_common__pb2.ResultStatus.FromString,
                )
        self.send = channel.unary_unary(
                '/EventService/send',
                request_serializer=grpc__helper_dot_api_dot_events__pb2.Event.SerializeToString,
                response_deserializer=grpc__helper_dot_api_dot_common__pb2.ResultStatus.FromString,
                )


class EventServiceServicer(object):
    """Event service
    """

    def listen(self, request, context):
        """Listen to events
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def interrupt(self, request, context):
        """Interrupt listening
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def send(self, request, context):
        """Send event
        """
        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=grpc__helper_dot_api_dot_common__pb2.Filter.FromString,
                    response_serializer=grpc__helper_dot_api_dot_events__pb2.EventStatus.SerializeToString,
            ),
            'interrupt': grpc.unary_unary_rpc_method_handler(
                    servicer.interrupt,
                    request_deserializer=grpc__helper_dot_api_dot_events__pb2.EventInterrupt.FromString,
                    response_serializer=grpc__helper_dot_api_dot_common__pb2.ResultStatus.SerializeToString,
            ),
            'send': grpc.unary_unary_rpc_method_handler(
                    servicer.send,
                    request_deserializer=grpc__helper_dot_api_dot_events__pb2.Event.FromString,
                    response_serializer=grpc__helper_dot_api_dot_common__pb2.ResultStatus.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'EventService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class EventService(object):
    """Event service
    """

    @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, '/EventService/listen',
            grpc__helper_dot_api_dot_common__pb2.Filter.SerializeToString,
            grpc__helper_dot_api_dot_events__pb2.EventStatus.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def interrupt(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, '/EventService/interrupt',
            grpc__helper_dot_api_dot_events__pb2.EventInterrupt.SerializeToString,
            grpc__helper_dot_api_dot_common__pb2.ResultStatus.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def send(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, '/EventService/send',
            grpc__helper_dot_api_dot_events__pb2.Event.SerializeToString,
            grpc__helper_dot_api_dot_common__pb2.ResultStatus.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
