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

from ..common import events_common_pb2 as events__common__pb2


class EventsStub(object):
    """*
    Service for subscribing to events representing modifications to ArmoniK result and task data
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetEvents = channel.unary_stream(
                '/armonik.api.grpc.v1.events.Events/GetEvents',
                request_serializer=events__common__pb2.EventSubscriptionRequest.SerializeToString,
                response_deserializer=events__common__pb2.EventSubscriptionResponse.FromString,
                )


class EventsServicer(object):
    """*
    Service for subscribing to events representing modifications to ArmoniK result and task data
    """

    def GetEvents(self, request, context):
        """*
        Get events that represents updates of result and tasks data.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_EventsServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetEvents': grpc.unary_stream_rpc_method_handler(
                    servicer.GetEvents,
                    request_deserializer=events__common__pb2.EventSubscriptionRequest.FromString,
                    response_serializer=events__common__pb2.EventSubscriptionResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'armonik.api.grpc.v1.events.Events', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Events(object):
    """*
    Service for subscribing to events representing modifications to ArmoniK result and task data
    """

    @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, '/armonik.api.grpc.v1.events.Events/GetEvents',
            events__common__pb2.EventSubscriptionRequest.SerializeToString,
            events__common__pb2.EventSubscriptionResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
