kittycad.pagination.AsyncPageIterator

class kittycad.pagination.AsyncPageIterator(page_fetcher, initial_kwargs, item_type=None)[source][source]

Bases: object

Asynchronous iterator for paginated API responses.

Provides OpenAI-style async auto-pagination that handles page tokens automatically.

Initialize the async page iterator.

Parameters:
  • page_fetcher (Callable[..., Any]) – Async function to fetch a page (e.g., client.api_calls.list_api_calls)

  • initial_kwargs (Dict[str, Any]) – Initial arguments for the first request

  • item_type (Optional[Type[TypeVar(T, bound= BaseModel)]]) – Type of items being paginated