sinch.core.pagination module

class sinch.core.pagination.Paginator(sinch, endpoint, result: BM)[source]

Bases: ABC, Generic[BM]

Public interface for paginated list responses.

Use content(), next_page() and iterator() to traverse the result set without dealing with the underlying pagination scheme.

Parameters:

result (BM)

content() list[BM][source]

Return the items contained in the current page.

Returns:

The list of items in the current page.

Return type:

list[BM]

iterator() Iterator[BM][source]

Iterate over individual items across all pages, fetching each page on demand.

Returns:

An iterator over every item in the result set.

Return type:

Iterator[BM]

abstractmethod next_page()[source]

Advance to the next page of results.

Returns:

This paginator positioned on the next page, or None if there is no further page.

Return type:

Paginator | None