"""Async Disposable inbox service."""

from typing import Any, Dict
from sed_sh.services.async_base import AsyncBaseService


class AsyncInboxService(AsyncBaseService):
    """Async service for managing disposable email inboxes."""

    async def create(self) -> Dict[str, Any]:
        """Create a new disposable inbox asynchronously."""
        return await self._request("POST", "/inbox", json={})

    async def list(self) -> Dict[str, Any]:
        """List all inboxes asynchronously."""
        return await self._request("GET", "/inbox")

    async def get_messages(self, inbox_code: str) -> Dict[str, Any]:
        """Get all messages for an inbox asynchronously."""
        return await self._request("GET", f"/inbox/{inbox_code}/messages")

    async def get_message(self, inbox_code: str, message_id: str) -> Dict[str, Any]:
        """Get details of a specific message asynchronously."""
        return await self._request("GET", f"/inbox/{inbox_code}/messages/{message_id}")

    async def delete_message(self, inbox_code: str, message_id: str) -> Dict[str, Any]:
        """Delete a specific message asynchronously."""
        return await self._request("DELETE", f"/inbox/{inbox_code}/messages/{message_id}")

    async def delete(self, inbox_code: str) -> Dict[str, Any]:
        """Delete an inbox asynchronously."""
        return await self._request("DELETE", f"/inbox/{inbox_code}")
