# Generated by smithplates HTTP codegen. Do not edit.

from __future__ import annotations

from urllib.parse import quote

import httpx
from generated.example.stream_list_output import StreamListOutput
from generated.stream_api_client.stream_api.client.client_response import parse_client_response
from generated.stream_api_client.stream_api.client.operation_bindings import OPERATION_HTTP_BINDINGS
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 StreamsApiClient:
    def __init__(self, client: httpx.AsyncClient, base_url: str) -> None:
        self._client = client
        self._base_url = base_url.rstrip("/")

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

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