Skip to content

feat: add pagination support with sync and async iterable paginators#126

Merged
asadali214 merged 25 commits into
mainfrom
feat/pagination-implementation
Jun 18, 2025
Merged

feat: add pagination support with sync and async iterable paginators#126
asadali214 merged 25 commits into
mainfrom
feat/pagination-implementation

Conversation

@hamzamahmood

Copy link
Copy Markdown
Collaborator

What

This PR adds support for

  1. CursorPagination
  2. LinkPagination
  3. NumberPagination
  4. OffsetPagination

And provides Paginator and AsyncPaginator with the ability to iterate over the pages and items of the paginated response.

Why

Previously, handling paginated responses required manual parsing and iteration, leading to verbose and error-prone code.

Type of change

Select multiple if applicable.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause a breaking change)
  • Tests (adds or updates tests)
  • Documentation (adds or updates documentation)
  • Refactor (style improvements, performance improvements, code refactoring)
  • Revert (reverts a commit)
  • CI/Build (adds or updates a script, change in external dependencies)

Checklist

  • My code follows the coding conventions
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added new unit tests

@hamzamahmood hamzamahmood self-assigned this Jun 10, 2025
@hamzamahmood
hamzamahmood requested a review from asadali214 June 13, 2025 10:02
@asadali214
asadali214 marked this pull request as ready for review June 16, 2025 13:41
Comment thread APIMatic.Core.Test/Pagination/AsyncPaginator.cs Outdated
Comment thread APIMatic.Core.Test/Pagination/Paginator.cs Outdated
Comment thread APIMatic.Core/APIMatic.Core.csproj Outdated
Comment thread APIMatic.Core/Request/RequestBuilder.cs Outdated
Comment thread APIMatic.Core/Pagination/PaginationContext.cs Outdated
Comment thread APIMatic.Core/Pagination/PaginatedResult.cs Outdated
Comment thread APIMatic.Core/Pagination/Paginator.cs
Comment thread APIMatic.Core/PaginationHandler.cs Outdated
Comment thread APIMatic.Core/ApiCall.cs Outdated
Comment thread APIMatic.Core/ApiCall.cs
Comment thread APIMatic.Core/Response/ResponseHandler.cs Outdated
@sonarqubecloud

Copy link
Copy Markdown

@asadali214
asadali214 merged commit 165b139 into main Jun 18, 2025
14 checks passed
@hamzamahmood
hamzamahmood deleted the feat/pagination-implementation branch June 18, 2025 09:06
@hamzamahmood
hamzamahmood removed the request for review from Shield-Jaguar June 18, 2025 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants