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

from lofar_sid.interface.opah import grafana_apiv3_pb2 as lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2

GRPC_GENERATED_VERSION = '1.71.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

try:
    from grpc._utilities import first_version_is_lower
    _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
except ImportError:
    _version_not_supported = True

if _version_not_supported:
    raise RuntimeError(
        f'The grpc package installed is at version {GRPC_VERSION},'
        + f' but the generated code in lofar_sid/interface/opah/grafana_apiv3_pb2_grpc.py depends on'
        + f' grpcio>={GRPC_GENERATED_VERSION}.'
        + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
        + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
    )


class GrafanaQueryAPIStub(object):
    """The GrafanaQueryAPI definition.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.ListDimensionKeys = channel.unary_unary(
                '/grafanav3.GrafanaQueryAPI/ListDimensionKeys',
                request_serializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.ListDimensionKeysRequest.SerializeToString,
                response_deserializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.ListDimensionKeysResponse.FromString,
                _registered_method=True)
        self.ListDimensionValues = channel.unary_unary(
                '/grafanav3.GrafanaQueryAPI/ListDimensionValues',
                request_serializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.ListDimensionValuesRequest.SerializeToString,
                response_deserializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.ListDimensionValuesResponse.FromString,
                _registered_method=True)
        self.ListMetrics = channel.unary_unary(
                '/grafanav3.GrafanaQueryAPI/ListMetrics',
                request_serializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.ListMetricsRequest.SerializeToString,
                response_deserializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.ListMetricsResponse.FromString,
                _registered_method=True)
        self.GetQueryOptions = channel.unary_unary(
                '/grafanav3.GrafanaQueryAPI/GetQueryOptions',
                request_serializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetOptionsRequest.SerializeToString,
                response_deserializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetOptionsResponse.FromString,
                _registered_method=True)
        self.GetMetricValue = channel.unary_unary(
                '/grafanav3.GrafanaQueryAPI/GetMetricValue',
                request_serializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetMetricValueRequest.SerializeToString,
                response_deserializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetMetricValueResponse.FromString,
                _registered_method=True)
        self.GetMetricHistory = channel.unary_unary(
                '/grafanav3.GrafanaQueryAPI/GetMetricHistory',
                request_serializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetMetricHistoryRequest.SerializeToString,
                response_deserializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetMetricHistoryResponse.FromString,
                _registered_method=True)
        self.GetMetricAggregate = channel.unary_unary(
                '/grafanav3.GrafanaQueryAPI/GetMetricAggregate',
                request_serializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetMetricAggregateRequest.SerializeToString,
                response_deserializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetMetricAggregateResponse.FromString,
                _registered_method=True)


class GrafanaQueryAPIServicer(object):
    """The GrafanaQueryAPI definition.
    """

    def ListDimensionKeys(self, request, context):
        """Returns a list of all available dimensions
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListDimensionValues(self, request, context):
        """Returns a list of all dimension values for a certain dimension
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def ListMetrics(self, request, context):
        """Returns all metrics from the system
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetQueryOptions(self, request, context):
        """Gets the options for the specified query type
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetMetricValue(self, request, context):
        """Gets the last known value for one or more metrics
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetMetricHistory(self, request, context):
        """Gets the history for one or more metrics
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetMetricAggregate(self, request, context):
        """Gets the history for one or more metrics
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_GrafanaQueryAPIServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ListDimensionKeys': grpc.unary_unary_rpc_method_handler(
                    servicer.ListDimensionKeys,
                    request_deserializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.ListDimensionKeysRequest.FromString,
                    response_serializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.ListDimensionKeysResponse.SerializeToString,
            ),
            'ListDimensionValues': grpc.unary_unary_rpc_method_handler(
                    servicer.ListDimensionValues,
                    request_deserializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.ListDimensionValuesRequest.FromString,
                    response_serializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.ListDimensionValuesResponse.SerializeToString,
            ),
            'ListMetrics': grpc.unary_unary_rpc_method_handler(
                    servicer.ListMetrics,
                    request_deserializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.ListMetricsRequest.FromString,
                    response_serializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.ListMetricsResponse.SerializeToString,
            ),
            'GetQueryOptions': grpc.unary_unary_rpc_method_handler(
                    servicer.GetQueryOptions,
                    request_deserializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetOptionsRequest.FromString,
                    response_serializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetOptionsResponse.SerializeToString,
            ),
            'GetMetricValue': grpc.unary_unary_rpc_method_handler(
                    servicer.GetMetricValue,
                    request_deserializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetMetricValueRequest.FromString,
                    response_serializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetMetricValueResponse.SerializeToString,
            ),
            'GetMetricHistory': grpc.unary_unary_rpc_method_handler(
                    servicer.GetMetricHistory,
                    request_deserializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetMetricHistoryRequest.FromString,
                    response_serializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetMetricHistoryResponse.SerializeToString,
            ),
            'GetMetricAggregate': grpc.unary_unary_rpc_method_handler(
                    servicer.GetMetricAggregate,
                    request_deserializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetMetricAggregateRequest.FromString,
                    response_serializer=lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetMetricAggregateResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'grafanav3.GrafanaQueryAPI', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('grafanav3.GrafanaQueryAPI', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class GrafanaQueryAPI(object):
    """The GrafanaQueryAPI definition.
    """

    @staticmethod
    def ListDimensionKeys(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,
            '/grafanav3.GrafanaQueryAPI/ListDimensionKeys',
            lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.ListDimensionKeysRequest.SerializeToString,
            lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.ListDimensionKeysResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListDimensionValues(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,
            '/grafanav3.GrafanaQueryAPI/ListDimensionValues',
            lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.ListDimensionValuesRequest.SerializeToString,
            lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.ListDimensionValuesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def ListMetrics(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,
            '/grafanav3.GrafanaQueryAPI/ListMetrics',
            lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.ListMetricsRequest.SerializeToString,
            lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.ListMetricsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetQueryOptions(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,
            '/grafanav3.GrafanaQueryAPI/GetQueryOptions',
            lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetOptionsRequest.SerializeToString,
            lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetOptionsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetMetricValue(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,
            '/grafanav3.GrafanaQueryAPI/GetMetricValue',
            lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetMetricValueRequest.SerializeToString,
            lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetMetricValueResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetMetricHistory(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,
            '/grafanav3.GrafanaQueryAPI/GetMetricHistory',
            lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetMetricHistoryRequest.SerializeToString,
            lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetMetricHistoryResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetMetricAggregate(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,
            '/grafanav3.GrafanaQueryAPI/GetMetricAggregate',
            lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetMetricAggregateRequest.SerializeToString,
            lofar__sid_dot_interface_dot_opah_dot_grafana__apiv3__pb2.GetMetricAggregateResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
