Skip to content

Add auto-pagination for search #2031

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

Merged
merged 2 commits into from
Apr 18, 2025
Merged

Conversation

mbroshi-stripe
Copy link
Contributor

Why?

This is a follow-up to #2027 in which we laid the groundwork for cleaner List pagination for V1 services. This PR does the same for Search pagination.

What?

  • Adds an unexported (i.e., internal-only) type v1SearchList with an All method for pagination. This is not currently used anywhere, but will be leveraged by stripe.Client in a subsequent PR.
  • Also made a minor simplification to iter.go that I noticed while re-implementing the same logic in search_iter.go. That is, I replaced new(T) with nil when calling yield on an error.

See Also

@mbroshi-stripe mbroshi-stripe requested a review from a team as a code owner April 17, 2025 00:50
@mbroshi-stripe mbroshi-stripe requested review from xavdid-stripe and removed request for a team April 17, 2025 00:50
Copy link
Member

@xavdid-stripe xavdid-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had some nits about comments but nothing blocking. Also there's a lint failure that's blocking the merge

@mbroshi-stripe mbroshi-stripe merged commit 0bc8520 into master Apr 18, 2025
10 checks passed
@mbroshi-stripe mbroshi-stripe deleted the mbroshi/v1-search-pagination branch April 18, 2025 01:16
mbroshi-stripe added a commit that referenced this pull request Apr 18, 2025
* Add auto-pagination for search (#2031)

* Add auto-pagination for search

* Respond to feedback and fix lint

* Add more stripe refs (#2022)

* Add more stripe refs

* Return a string not enum for stripe.String
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.

2 participants