"""API client methods for Grukk messages."""

from __future__ import annotations

from typing import Any

from peon_mcp.common.base_client import BaseAPIClient


class GrukkMessageClient(BaseAPIClient):
    """Grukk message API client methods."""

    async def get_grukk_messages(
        self,
        limit: int = 50,
        before: str | None = None,
    ) -> list[dict] | str:
        params: dict[str, Any] = {"limit": limit}
        if before is not None:
            params["before"] = before
        return await self._request(
            "GET", "/api/grukk/messages", params=params,
        )

    async def create_grukk_message(
        self,
        data: dict[str, Any],
    ) -> dict | str:
        return await self._request(
            "POST", "/api/grukk/messages", json=data,
        )

    async def get_pending_grukk_messages(self) -> list[dict] | str:
        return await self._request(
            "GET", "/api/grukk/messages/pending",
        )
