# 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 yandex.cloud.searchapi.v2 import wordstat_service_pb2 as yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2

GRPC_GENERATED_VERSION = '1.70.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 yandex/cloud/searchapi/v2/wordstat_service_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 WordstatServiceStub(object):
    """A set of methods for viewing statistics on search queries to Yandex.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.GetTop = channel.unary_unary(
                '/yandex.cloud.searchapi.v2.WordstatService/GetTop',
                request_serializer=yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetTopRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetTopResponse.FromString,
                _registered_method=True)
        self.GetDynamics = channel.unary_unary(
                '/yandex.cloud.searchapi.v2.WordstatService/GetDynamics',
                request_serializer=yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetDynamicsRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetDynamicsResponse.FromString,
                _registered_method=True)
        self.GetRegionsDistribution = channel.unary_unary(
                '/yandex.cloud.searchapi.v2.WordstatService/GetRegionsDistribution',
                request_serializer=yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetRegionsDistributionRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetRegionsDistributionResponse.FromString,
                _registered_method=True)
        self.GetRegionsTree = channel.unary_unary(
                '/yandex.cloud.searchapi.v2.WordstatService/GetRegionsTree',
                request_serializer=yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetRegionsTreeRequest.SerializeToString,
                response_deserializer=yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetRegionsTreeResponse.FromString,
                _registered_method=True)


class WordstatServiceServicer(object):
    """A set of methods for viewing statistics on search queries to Yandex.
    """

    def GetTop(self, request, context):
        """The method returns the last 30 days data about popular queries containing the specified keyword and queries that are similar to the specified one.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetDynamics(self, request, context):
        """The method returns the frequency of queries over time for a given keyword.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetRegionsDistribution(self, request, context):
        """The method returns the distribution of the number of queries containing the given keyword globally by region for the last 30 days.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetRegionsTree(self, request, context):
        """The method method returns a tree of Wordstat-supported regions.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_WordstatServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'GetTop': grpc.unary_unary_rpc_method_handler(
                    servicer.GetTop,
                    request_deserializer=yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetTopRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetTopResponse.SerializeToString,
            ),
            'GetDynamics': grpc.unary_unary_rpc_method_handler(
                    servicer.GetDynamics,
                    request_deserializer=yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetDynamicsRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetDynamicsResponse.SerializeToString,
            ),
            'GetRegionsDistribution': grpc.unary_unary_rpc_method_handler(
                    servicer.GetRegionsDistribution,
                    request_deserializer=yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetRegionsDistributionRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetRegionsDistributionResponse.SerializeToString,
            ),
            'GetRegionsTree': grpc.unary_unary_rpc_method_handler(
                    servicer.GetRegionsTree,
                    request_deserializer=yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetRegionsTreeRequest.FromString,
                    response_serializer=yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetRegionsTreeResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'yandex.cloud.searchapi.v2.WordstatService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))
    server.add_registered_method_handlers('yandex.cloud.searchapi.v2.WordstatService', rpc_method_handlers)


 # This class is part of an EXPERIMENTAL API.
class WordstatService(object):
    """A set of methods for viewing statistics on search queries to Yandex.
    """

    @staticmethod
    def GetTop(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,
            '/yandex.cloud.searchapi.v2.WordstatService/GetTop',
            yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetTopRequest.SerializeToString,
            yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetTopResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetDynamics(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,
            '/yandex.cloud.searchapi.v2.WordstatService/GetDynamics',
            yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetDynamicsRequest.SerializeToString,
            yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetDynamicsResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetRegionsDistribution(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,
            '/yandex.cloud.searchapi.v2.WordstatService/GetRegionsDistribution',
            yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetRegionsDistributionRequest.SerializeToString,
            yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetRegionsDistributionResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)

    @staticmethod
    def GetRegionsTree(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,
            '/yandex.cloud.searchapi.v2.WordstatService/GetRegionsTree',
            yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetRegionsTreeRequest.SerializeToString,
            yandex_dot_cloud_dot_searchapi_dot_v2_dot_wordstat__service__pb2.GetRegionsTreeResponse.FromString,
            options,
            channel_credentials,
            insecure,
            call_credentials,
            compression,
            wait_for_ready,
            timeout,
            metadata,
            _registered_method=True)
