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

from deepproto.proto.poll.v1 import poll_pb2 as deepproto_dot_proto_dot_poll_dot_v1_dot_poll__pb2


class PollConfigStub(object):
    """This is how the application agent should request the config of the tracepoints.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.poll = channel.unary_unary(
                '/deepproto.proto.poll.v1.PollConfig/poll',
                request_serializer=deepproto_dot_proto_dot_poll_dot_v1_dot_poll__pb2.PollRequest.SerializeToString,
                response_deserializer=deepproto_dot_proto_dot_poll_dot_v1_dot_poll__pb2.PollResponse.FromString,
                )


class PollConfigServicer(object):
    """This is how the application agent should request the config of the tracepoints.
    """

    def poll(self, request, context):
        """Call this function as often as is required to ensure config is up to date.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_PollConfigServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'poll': grpc.unary_unary_rpc_method_handler(
                    servicer.poll,
                    request_deserializer=deepproto_dot_proto_dot_poll_dot_v1_dot_poll__pb2.PollRequest.FromString,
                    response_serializer=deepproto_dot_proto_dot_poll_dot_v1_dot_poll__pb2.PollResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'deepproto.proto.poll.v1.PollConfig', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class PollConfig(object):
    """This is how the application agent should request the config of the tracepoints.
    """

    @staticmethod
    def poll(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, '/deepproto.proto.poll.v1.PollConfig/poll',
            deepproto_dot_proto_dot_poll_dot_v1_dot_poll__pb2.PollRequest.SerializeToString,
            deepproto_dot_proto_dot_poll_dot_v1_dot_poll__pb2.PollResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
