"""
@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.ocr.v1.ocr_service_pb2
import yandex.cloud.operation.operation_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 TextRecognitionServiceStub:
    """A set of methods for the Vision OCR service."""

    def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ...
    Recognize: grpc.UnaryStreamMultiCallable[
        yandex.cloud.ai.ocr.v1.ocr_service_pb2.RecognizeTextRequest,
        yandex.cloud.ai.ocr.v1.ocr_service_pb2.RecognizeTextResponse,
    ]
    """To send the image for text recognition."""

class TextRecognitionServiceAsyncStub:
    """A set of methods for the Vision OCR service."""

    Recognize: grpc.aio.UnaryStreamMultiCallable[
        yandex.cloud.ai.ocr.v1.ocr_service_pb2.RecognizeTextRequest,
        yandex.cloud.ai.ocr.v1.ocr_service_pb2.RecognizeTextResponse,
    ]
    """To send the image for text recognition."""

class TextRecognitionServiceServicer(metaclass=abc.ABCMeta):
    """A set of methods for the Vision OCR service."""

    @abc.abstractmethod
    def Recognize(
        self,
        request: yandex.cloud.ai.ocr.v1.ocr_service_pb2.RecognizeTextRequest,
        context: _ServicerContext,
    ) -> typing.Union[collections.abc.Iterator[yandex.cloud.ai.ocr.v1.ocr_service_pb2.RecognizeTextResponse], collections.abc.AsyncIterator[yandex.cloud.ai.ocr.v1.ocr_service_pb2.RecognizeTextResponse]]:
        """To send the image for text recognition."""

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

class TextRecognitionAsyncServiceStub:
    """A set of methods for managing operations for asynchronous API requests."""

    def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ...
    Recognize: grpc.UnaryUnaryMultiCallable[
        yandex.cloud.ai.ocr.v1.ocr_service_pb2.RecognizeTextRequest,
        yandex.cloud.operation.operation_pb2.Operation,
    ]
    """To send the image for asynchronous text recognition."""

    GetRecognition: grpc.UnaryStreamMultiCallable[
        yandex.cloud.ai.ocr.v1.ocr_service_pb2.GetRecognitionRequest,
        yandex.cloud.ai.ocr.v1.ocr_service_pb2.RecognizeTextResponse,
    ]
    """To get recognition results."""

class TextRecognitionAsyncServiceAsyncStub:
    """A set of methods for managing operations for asynchronous API requests."""

    Recognize: grpc.aio.UnaryUnaryMultiCallable[
        yandex.cloud.ai.ocr.v1.ocr_service_pb2.RecognizeTextRequest,
        yandex.cloud.operation.operation_pb2.Operation,
    ]
    """To send the image for asynchronous text recognition."""

    GetRecognition: grpc.aio.UnaryStreamMultiCallable[
        yandex.cloud.ai.ocr.v1.ocr_service_pb2.GetRecognitionRequest,
        yandex.cloud.ai.ocr.v1.ocr_service_pb2.RecognizeTextResponse,
    ]
    """To get recognition results."""

class TextRecognitionAsyncServiceServicer(metaclass=abc.ABCMeta):
    """A set of methods for managing operations for asynchronous API requests."""

    @abc.abstractmethod
    def Recognize(
        self,
        request: yandex.cloud.ai.ocr.v1.ocr_service_pb2.RecognizeTextRequest,
        context: _ServicerContext,
    ) -> typing.Union[yandex.cloud.operation.operation_pb2.Operation, collections.abc.Awaitable[yandex.cloud.operation.operation_pb2.Operation]]:
        """To send the image for asynchronous text recognition."""

    @abc.abstractmethod
    def GetRecognition(
        self,
        request: yandex.cloud.ai.ocr.v1.ocr_service_pb2.GetRecognitionRequest,
        context: _ServicerContext,
    ) -> typing.Union[collections.abc.Iterator[yandex.cloud.ai.ocr.v1.ocr_service_pb2.RecognizeTextResponse], collections.abc.AsyncIterator[yandex.cloud.ai.ocr.v1.ocr_service_pb2.RecognizeTextResponse]]:
        """To get recognition results."""

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