"""
Users resource.
"""

from __future__ import annotations

from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
    from ..client.base import BaseClient


class UsersResource:
    """Resource for managing team users."""

    _BASE_PATH = "/v1/users"

    def __init__(self, client: "BaseClient") -> None:
        self._client = client

    def list(self) -> dict[str, Any]:
        """List team users."""
        return self._client._get(self._BASE_PATH)

    def get(self, user_id: str) -> dict[str, Any]:
        """Get a user by ID."""
        return self._client._get(f"{self._BASE_PATH}/{user_id}")

    # Async
    async def alist(self) -> dict[str, Any]:
        return await self._client._aget(self._BASE_PATH)

    async def aget(self, user_id: str) -> dict[str, Any]:
        return await self._client._aget(f"{self._BASE_PATH}/{user_id}")
