swh.core.api.classes module

class swh.core.api.classes.PagedResult(results: ~typing.List[~swh.core.api.classes.TResult] = <factory>, next_page_token: ~typing.Optional[~swh.core.api.classes.TToken] = None)[source]

Bases: Generic[TResult, TToken]

Represents a page of results; with a token to get the next page

results: List[TResult]
next_page_token: Optional[TToken] = None
swh.core.api.classes.stream_results(f: Callable[[...], PagedResult[TResult, TToken]], *args, **kwargs) Iterable[TResult][source]

Consume the paginated result and stream the page results

swh.core.api.classes.stream_results_optional(f: Callable[[...], Optional[PagedResult[TResult, TToken]]], *args, **kwargs) Optional[Iterable[TResult]][source]

Like stream_results(), but for functions f that return an Optional.