Support cleaner pagination for V1 in stripe.Client #2027
Merged
+227
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why?
For V2 support, we offer pagination using Go's
iter.Seq2
interface, so iterating over V2 accounts looks like this:This compares to V1 where it looks like this:
With the new
stripe.Client
type in a future PR, we will be providing the former style pagination for both V1 and V2.This PR paves the way by introducing the mechanism for V1 to cleanly paginate in
List
methods.What?
v1List
with anAll
method for pagination. This is not currently used anywhere, but will be leveraged bystripe.Client
in a subsequent PR.See Also