# Generated by smithplates HTTP codegen. Do not edit.

from __future__ import annotations

from urllib.parse import quote

import httpx
from generated.chat_api_client.chat_api.client.client_response import parse_client_response
from generated.chat_api_client.chat_api.client.operation_bindings import OPERATION_HTTP_BINDINGS
from generated.example.room_list_output import RoomListOutput
from pydantic import Field  # noqa: F401


def _encode_path_label(value: object, *, greedy: bool = False) -> str:
    return quote(str(value), safe="/" if greedy else "")


class RoomsApiClient:
    def __init__(self, client: httpx.AsyncClient, base_url: str) -> None:
        self._client = client
        self._base_url = base_url.rstrip("/")

    async def list_rooms(
        self,
    ) -> RoomListOutput:
        headers: dict[str, str] | None = None

        request_url = f"{self._base_url}/rooms"
        response = await self._client.request(
            "GET",
            request_url,
            headers=headers,
        )
        return parse_client_response(
            response,
            OPERATION_HTTP_BINDINGS["list_rooms"],
        )
