PagerDuty / pdpyras

Low-level PagerDuty REST/Events API client for Python
MIT License
129 stars 29 forks source link

Support for cursor-based pagination #42

Closed Deconstrained closed 2 years ago

Deconstrained commented 3 years ago

There's no way to handle this new type of pagination currently except with a custom implementation.

Moreover, iter_all was written during a time when nearly all API index endpoints followed the same pattern: of alternating IDs and resource names in the path. The only endpoint that currently supports cursor pagination is the newer audit trail API that breaks from this pattern.

There will need to be some kind of generalization of iteration that can encompass this new scenario (which breaks away from the pattern that was once ubiquitous) and does what's needed to support cursor-based pagination.