# 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 analytics.v1 import analytics_pb2 as analytics_dot_v1_dot_analytics__pb2

GRPC_GENERATED_VERSION = '1.78.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},'
        + ' but the generated code in analytics/v1/analytics_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 AnalyticsServiceStub(object):
    """AnalyticsService handles link analytics
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetStats = channel.unary_unary(
                '/analytics.v1.AnalyticsService/GetStats',
                request_serializer=analytics_dot_v1_dot_analytics__pb2.GetStatsRequest.SerializeToString,
                response_deserializer=analytics_dot_v1_dot_analytics__pb2.GetStatsResponse.FromString,
                _registered_method=True)
        self.GetTimeseries = channel.unary_unary(
                '/analytics.v1.AnalyticsService/GetTimeseries',
                request_serializer=analytics_dot_v1_dot_analytics__pb2.GetTimeseriesRequest.SerializeToString,
                response_deserializer=analytics_dot_v1_dot_analytics__pb2.GetTimeseriesResponse.FromString,
                _registered_method=True)
        self.GetPlatforms = channel.unary_unary(
                '/analytics.v1.AnalyticsService/GetPlatforms',
                request_serializer=analytics_dot_v1_dot_analytics__pb2.GetPlatformsRequest.SerializeToString,
                response_deserializer=analytics_dot_v1_dot_analytics__pb2.GetPlatformsResponse.FromString,
                _registered_method=True)
        self.GetCountries = channel.unary_unary(
                '/analytics.v1.AnalyticsService/GetCountries',
                request_serializer=analytics_dot_v1_dot_analytics__pb2.GetCountriesRequest.SerializeToString,
                response_deserializer=analytics_dot_v1_dot_analytics__pb2.GetCountriesResponse.FromString,
                _registered_method=True)
        self.GetReferrers = channel.unary_unary(
                '/analytics.v1.AnalyticsService/GetReferrers',
                request_serializer=analytics_dot_v1_dot_analytics__pb2.GetReferrersRequest.SerializeToString,
                response_deserializer=analytics_dot_v1_dot_analytics__pb2.GetReferrersResponse.FromString,
                _registered_method=True)


class AnalyticsServiceServicer(object):
    """AnalyticsService handles link analytics
    """

    def GetStats(self, request, context):
        """Get overview statistics for a link
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetTimeseries(self, request, context):
        """Get click data over time
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetPlatforms(self, request, context):
        """Get breakdown by platform
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetCountries(self, request, context):
        """Get breakdown by country
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetReferrers(self, request, context):
        """Get top referrers
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_AnalyticsServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetStats': grpc.unary_unary_rpc_method_handler(
                    servicer.GetStats,
                    request_deserializer=analytics_dot_v1_dot_analytics__pb2.GetStatsRequest.FromString,
                    response_serializer=analytics_dot_v1_dot_analytics__pb2.GetStatsResponse.SerializeToString,
            ),
            'GetTimeseries': grpc.unary_unary_rpc_method_handler(
                    servicer.GetTimeseries,
                    request_deserializer=analytics_dot_v1_dot_analytics__pb2.GetTimeseriesRequest.FromString,
                    response_serializer=analytics_dot_v1_dot_analytics__pb2.GetTimeseriesResponse.SerializeToString,
            ),
            'GetPlatforms': grpc.unary_unary_rpc_method_handler(
                    servicer.GetPlatforms,
                    request_deserializer=analytics_dot_v1_dot_analytics__pb2.GetPlatformsRequest.FromString,
                    response_serializer=analytics_dot_v1_dot_analytics__pb2.GetPlatformsResponse.SerializeToString,
            ),
            'GetCountries': grpc.unary_unary_rpc_method_handler(
                    servicer.GetCountries,
                    request_deserializer=analytics_dot_v1_dot_analytics__pb2.GetCountriesRequest.FromString,
                    response_serializer=analytics_dot_v1_dot_analytics__pb2.GetCountriesResponse.SerializeToString,
            ),
            'GetReferrers': grpc.unary_unary_rpc_method_handler(
                    servicer.GetReferrers,
                    request_deserializer=analytics_dot_v1_dot_analytics__pb2.GetReferrersRequest.FromString,
                    response_serializer=analytics_dot_v1_dot_analytics__pb2.GetReferrersResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'analytics.v1.AnalyticsService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('analytics.v1.AnalyticsService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class AnalyticsService(object):
    """AnalyticsService handles link analytics
    """

    @staticmethod
    def GetStats(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,
            '/analytics.v1.AnalyticsService/GetStats',
            analytics_dot_v1_dot_analytics__pb2.GetStatsRequest.SerializeToString,
            analytics_dot_v1_dot_analytics__pb2.GetStatsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetTimeseries(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,
            '/analytics.v1.AnalyticsService/GetTimeseries',
            analytics_dot_v1_dot_analytics__pb2.GetTimeseriesRequest.SerializeToString,
            analytics_dot_v1_dot_analytics__pb2.GetTimeseriesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetPlatforms(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,
            '/analytics.v1.AnalyticsService/GetPlatforms',
            analytics_dot_v1_dot_analytics__pb2.GetPlatformsRequest.SerializeToString,
            analytics_dot_v1_dot_analytics__pb2.GetPlatformsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetCountries(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,
            '/analytics.v1.AnalyticsService/GetCountries',
            analytics_dot_v1_dot_analytics__pb2.GetCountriesRequest.SerializeToString,
            analytics_dot_v1_dot_analytics__pb2.GetCountriesResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetReferrers(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,
            '/analytics.v1.AnalyticsService/GetReferrers',
            analytics_dot_v1_dot_analytics__pb2.GetReferrersRequest.SerializeToString,
            analytics_dot_v1_dot_analytics__pb2.GetReferrersResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
