from typing import Any, NoReturn

from kombu.asynchronous.aws.sqs.message import AsyncMessage
from vine import promise

def list_first(rs: list[Any]) -> Any | None: ...

class AsyncQueue:
    connection: Any
    url: str | None
    message_class: type[AsyncMessage]
    visibility_timeout: int | None

    def __init__(
        self,
        connection: Any = ...,
        url: str | None = ...,
        message_class: type[AsyncMessage] = ...,
    ) -> None: ...
    def _NA(self, *args: Any, **kwargs: Any) -> NoReturn: ...
    def clear(self, *args: Any, **kwargs: Any) -> NoReturn: ...
    def count_slow(self, *args: Any, **kwargs: Any) -> NoReturn: ...
    def dump(self, *args: Any, **kwargs: Any) -> NoReturn: ...
    def load(self, *args: Any, **kwargs: Any) -> NoReturn: ...
    def load_from_file(self, *args: Any, **kwargs: Any) -> NoReturn: ...
    def load_from_filename(self, *args: Any, **kwargs: Any) -> NoReturn: ...
    def load_from_s3(self, *args: Any, **kwargs: Any) -> NoReturn: ...
    def save(self, *args: Any, **kwargs: Any) -> NoReturn: ...
    def save_to_file(self, *args: Any, **kwargs: Any) -> NoReturn: ...
    def save_to_filename(self, *args: Any, **kwargs: Any) -> NoReturn: ...
    def save_to_s3(self, *args: Any, **kwargs: Any) -> NoReturn: ...
    def get_attributes(self, attributes: str = ..., callback: Any = ...) -> promise: ...
    def set_attribute(
        self, attribute: str, value: Any, callback: Any = ...
    ) -> promise: ...
    def get_timeout(self, callback: Any = ...) -> promise: ...
    def _coerce_field_value(self, key: str, type: type, response: Any) -> Any: ...
    def set_timeout(self, visibility_timeout: int, callback: Any = ...) -> promise: ...
    def _on_timeout_set(self, visibility_timeout: int | None) -> int | None: ...
    def add_permission(
        self, label: str, aws_account_id: str, action_name: str, callback: Any = ...
    ) -> promise: ...
    def remove_permission(self, label: str, callback: Any = ...) -> promise: ...
    def read(
        self,
        visibility_timeout: int | None = ...,
        wait_time_seconds: int | None = ...,
        callback: Any = ...,
    ) -> promise: ...
    def write(
        self, message: Any, delay_seconds: int | None = ..., callback: Any = ...
    ) -> promise: ...
    def write_batch(self, messages: list[Any], callback: Any = ...) -> promise: ...
    def _on_message_sent(self, orig_message: Any, new_message: Any) -> Any: ...
    def get_messages(
        self,
        num_messages: int = ...,
        visibility_timeout: int | None = ...,
        attributes: Any = ...,
        wait_time_seconds: int | None = ...,
        callback: Any = ...,
    ) -> promise: ...
    def delete_message(self, message: Any, callback: Any = ...) -> promise: ...
    def delete_message_batch(
        self, messages: list[Any], callback: Any = ...
    ) -> promise: ...
    def change_message_visibility_batch(
        self, messages: list[Any], callback: Any = ...
    ) -> promise: ...
    def delete(self, callback: Any = ...) -> promise: ...
    def count(
        self, page_size: int = ..., vtimeout: int = ..., callback: Any = ...
    ) -> promise: ...
