Load All Pages Decorator
- util.load_all_pages(next_token_param='NextToken', use_rate_limit_header: bool = False, extras: Optional[dict] = None)
Load all pages if a next token is returned
- Parameters
throttle_by_seconds – float
next_token_param – str | The param amazon expects to hold the next token
use_rate_limit_header – if the function should try to use amazon’s rate limit header
extras – additional data to be sent with NextToken, e.g dict(QueryType=’NEXT_TOKEN’) for FulfillmentInbound
- Returns
Transforms the function in a generator, returning all pages
The example below will load all pages, transforming the decorated function to a generator:
@load_all_pages()
def get_orders(**kwargs):
return Orders().get_orders(**kwargs)