PageIterator Class

Return an iterator of pages.

Constructor

PageIterator(get_next: Callable[[str | None], ResponseType], extract_data: Callable[[ResponseType], Tuple[str, Iterable[ReturnType]]], continuation_token: str | None = None)

Parameters

Name Description
get_next
Required

Callable that take the continuation token and return a HTTP response

extract_data
Required

Callable that take an HTTP response and return a tuple continuation token, list of ReturnType

continuation_token
str

The continuation token needed by get_next

Default value: None

Methods

next

Get the next page in the iterator.

next

Get the next page in the iterator.

next() -> Iterator[ReturnType]

Returns

Type Description
<xref:iterator>[<xref:ReturnType>]

An iterator of objects in the next page.

Exceptions

Type Description

If there are no more pages to return.

If the request to get the next page fails.