-
Notifications
You must be signed in to change notification settings - Fork 9
feat: Pagination support for list methods #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive pagination support to all list methods across the Resend Ruby SDK. The implementation includes a reusable pagination helper, query parameter validation, and consistent pagination parameters (limit
, after
, before
) for all list operations.
- Introduces
PaginationHelper
class to centralize pagination logic with URL encoding and parameter validation - Updates all list methods (
ApiKeys
,Audiences
,Broadcasts
,Contacts
,Domains
) to accept optional pagination parameters - Adds comprehensive test coverage for pagination functionality and example usage
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
lib/resend/pagination_helper.rb | New helper class for building paginated query strings with validation |
spec/pagination_spec.rb | Comprehensive test suite covering pagination helper and all list methods |
lib/resend/*.rb | Updates to list methods to accept pagination parameters |
lib/resend.rb | Adds CGI require and pagination helper import |
examples/*.rb | Adds pagination examples to demonstrate new functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one small comment on letting the API surface errors, wdyt? It seems like we didn't do that in the Go and Python SDKs.
… feat/optional-list-with-pagination
Summary by cubic
Adds optional pagination to all list methods in the Ruby SDK so you can pass limit, after, and before without building URLs yourself. Improves ergonomics and keeps methods backward-compatible.