"""
Type annotations for aiobotocore.response module.

Copyright 2025 Vlad Emelianov
"""

import asyncio
from types import TracebackType
from typing import IO, Any, AsyncIterator, TypeVar

import wrapt  # type: ignore
from aiobotocore import parsers as parsers
from botocore.exceptions import ReadTimeoutError
from botocore.model import OperationModel
from requests.models import Response

_R = TypeVar("_R")

class AioReadTimeoutError(ReadTimeoutError, asyncio.TimeoutError): ...

class StreamingBody(wrapt.ObjectProxy):  # type: ignore
    def __init__(self, raw_stream: IO[bytes], content_length: int) -> None: ...
    async def __aenter__(self: _R) -> _R: ...
    async def __aexit__(
        self,
        exc_type: type[BaseException] | None,
        exc_val: BaseException | None,
        tb: TracebackType | None,
    ) -> None: ...
    def tell(self) -> int: ...
    def readable(self) -> bool: ...
    async def read(self, amt: int | None = ...) -> bytes: ...
    async def readlines(self) -> list[bytes]: ...
    def __aiter__(self) -> AsyncIterator[bytes]: ...
    async def __anext__(self) -> bytes: ...
    anext: Any
    def iter_lines(self, chunk_size: int = ..., keepends: bool = ...) -> AsyncIterator[bytes]: ...
    def iter_chunks(self, chunk_size: int = ...) -> AsyncIterator[bytes]: ...

async def get_response(
    operation_model: OperationModel, http_response: Response
) -> tuple[Response, Any]: ...
