macadmins / jamf-pro-sdk-python

A client library for the Jamf Pro APIs and webhooks.
https://macadmins.github.io/jamf-pro-sdk-python/
MIT License
48 stars 10 forks source link

Add `end_page` arg to Pro API Paginator #8

Closed brysontyrrell closed 1 year ago

brysontyrrell commented 1 year ago

This adds an optional end_page argument to the Pro API Paginator allowing for limiting pages returned, or selecting a range of pages in an operation.

This example has a full result of 10 pages (0-9). This paginator will skip pages 0-3, return pages 4-7, and stop.

paginator = Paginator(
    api_client=client.pro_api,
    resource_path="v1/computers-inventory",
    page_size=100,
    start_page=4,
    end_page=7
)