You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(python): add support for offset, cursor, link and page based pagination (#95)
Since many APIs use different pagination strategies, and this change ensures the SDK can handle them flexibly. This commit adds support for offset, link, page, and cursor-based pagination types in the core library, including relevant unit tests for each type.
|[`CursorPagination`](apimatic_core/pagination/strategies/cursor_pagination.py)| This class manages the extraction and injection of cursor values between API requests and responses, enabling seamless traversal of paginated data. It validates required pointers, updates the request builder with the appropriate cursor, and applies a metadata wrapper to paged responses. |
103
+
|[`LinkPagination`](apimatic_core/pagination/strategies/link_pagination.py)| This class updates the request builder with query parameters from the next page link and applies a metadata wrapper to the paged response. |
104
+
|[`OffsetPagination`](apimatic_core/pagination/strategies/offset_pagination.py)| This class manages pagination by updating an offset parameter in the request builder, allowing sequential retrieval of paginated data. It extracts and updates the offset based on a configurable JSON pointer and applies a metadata wrapper to each page response. |
105
+
|[`PagePagination`](apimatic_core/pagination/strategies/page_pagination.py)| This class manages pagination by updating the request builder with the appropriate page number, using a JSON pointer to identify the pagination parameter. It also applies a metadata wrapper to each paged response, including the current page number. |
106
+
|[`PaginatedData`](apimatic_core/pagination/paginated_data.py)| Provides methods to iterate over items and pages, fetch next pages using defined pagination strategies, and access the latest HTTP response and request builder. Supports independent iterators for concurrent traversals. |
0 commit comments