# 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 Common_pb2 as common_dot_Common__pb2
from ..event import Event_pb2 as event_dot_Event__pb2


class EventServiceStub(object):
    """Missing associated documentation comment in .proto file."""

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

        Args:
            channel: A grpc.Channel.
        """
        self.collect = channel.stream_unary(
                '/skywalking.v3.EventService/collect',
                request_serializer=event_dot_Event__pb2.Event.SerializeToString,
                response_deserializer=common_dot_Common__pb2.Commands.FromString,
                )


class EventServiceServicer(object):
    """Missing associated documentation comment in .proto file."""

    def collect(self, request_iterator, context):
        """When reporting an event, you typically call the collect function twice, one for starting of the event and the other one for ending of the event, with the same UUID.
        There are also cases where you have both start time and end time already, for example, when exporting events from a 3rd-party system,
        the start time and end time are already known so that you can call the collect function only once.
        """
        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 = {
            'collect': grpc.stream_unary_rpc_method_handler(
                    servicer.collect,
                    request_deserializer=event_dot_Event__pb2.Event.FromString,
                    response_serializer=common_dot_Common__pb2.Commands.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'skywalking.v3.EventService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class EventService(object):
    """Missing associated documentation comment in .proto file."""

    @staticmethod
    def collect(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_unary(request_iterator, target, '/skywalking.v3.EventService/collect',
            event_dot_Event__pb2.Event.SerializeToString,
            common_dot_Common__pb2.Commands.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
