swh.core.api.classes module

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

Bases: Generic[swh.core.api.classes.TResult, swh.core.api.classes.TToken]

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

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

Consume the paginated result and stream the page results

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

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