"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
"""

import abc
import collections.abc
import grpc
import grpc.aio
import typing
import yandex.cloud.ai.translate.v2.translation_service_pb2

_T = typing.TypeVar("_T")

class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): ...

class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext):  # type: ignore[misc, type-arg]
    ...

class TranslationServiceStub:
    """A set of methods for the Translate service.

    Make sure you send your [authentication](/docs/translate/api-ref/authentication) credentials in the `Authorization` header of each request.
    """

    def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ...
    Translate: grpc.UnaryUnaryMultiCallable[
        yandex.cloud.ai.translate.v2.translation_service_pb2.TranslateRequest,
        yandex.cloud.ai.translate.v2.translation_service_pb2.TranslateResponse,
    ]
    """Translates the text to the specified language."""

    DetectLanguage: grpc.UnaryUnaryMultiCallable[
        yandex.cloud.ai.translate.v2.translation_service_pb2.DetectLanguageRequest,
        yandex.cloud.ai.translate.v2.translation_service_pb2.DetectLanguageResponse,
    ]
    """Detects the language of the text."""

    ListLanguages: grpc.UnaryUnaryMultiCallable[
        yandex.cloud.ai.translate.v2.translation_service_pb2.ListLanguagesRequest,
        yandex.cloud.ai.translate.v2.translation_service_pb2.ListLanguagesResponse,
    ]
    """Retrieves the list of supported languages."""

class TranslationServiceAsyncStub:
    """A set of methods for the Translate service.

    Make sure you send your [authentication](/docs/translate/api-ref/authentication) credentials in the `Authorization` header of each request.
    """

    Translate: grpc.aio.UnaryUnaryMultiCallable[
        yandex.cloud.ai.translate.v2.translation_service_pb2.TranslateRequest,
        yandex.cloud.ai.translate.v2.translation_service_pb2.TranslateResponse,
    ]
    """Translates the text to the specified language."""

    DetectLanguage: grpc.aio.UnaryUnaryMultiCallable[
        yandex.cloud.ai.translate.v2.translation_service_pb2.DetectLanguageRequest,
        yandex.cloud.ai.translate.v2.translation_service_pb2.DetectLanguageResponse,
    ]
    """Detects the language of the text."""

    ListLanguages: grpc.aio.UnaryUnaryMultiCallable[
        yandex.cloud.ai.translate.v2.translation_service_pb2.ListLanguagesRequest,
        yandex.cloud.ai.translate.v2.translation_service_pb2.ListLanguagesResponse,
    ]
    """Retrieves the list of supported languages."""

class TranslationServiceServicer(metaclass=abc.ABCMeta):
    """A set of methods for the Translate service.

    Make sure you send your [authentication](/docs/translate/api-ref/authentication) credentials in the `Authorization` header of each request.
    """

    @abc.abstractmethod
    def Translate(
        self,
        request: yandex.cloud.ai.translate.v2.translation_service_pb2.TranslateRequest,
        context: _ServicerContext,
    ) -> typing.Union[yandex.cloud.ai.translate.v2.translation_service_pb2.TranslateResponse, collections.abc.Awaitable[yandex.cloud.ai.translate.v2.translation_service_pb2.TranslateResponse]]:
        """Translates the text to the specified language."""

    @abc.abstractmethod
    def DetectLanguage(
        self,
        request: yandex.cloud.ai.translate.v2.translation_service_pb2.DetectLanguageRequest,
        context: _ServicerContext,
    ) -> typing.Union[yandex.cloud.ai.translate.v2.translation_service_pb2.DetectLanguageResponse, collections.abc.Awaitable[yandex.cloud.ai.translate.v2.translation_service_pb2.DetectLanguageResponse]]:
        """Detects the language of the text."""

    @abc.abstractmethod
    def ListLanguages(
        self,
        request: yandex.cloud.ai.translate.v2.translation_service_pb2.ListLanguagesRequest,
        context: _ServicerContext,
    ) -> typing.Union[yandex.cloud.ai.translate.v2.translation_service_pb2.ListLanguagesResponse, collections.abc.Awaitable[yandex.cloud.ai.translate.v2.translation_service_pb2.ListLanguagesResponse]]:
        """Retrieves the list of supported languages."""

def add_TranslationServiceServicer_to_server(servicer: TranslationServiceServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ...
