-
Notifications
You must be signed in to change notification settings - Fork 436
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
Add support for SearchResult. #777
Conversation
Can you please add a test similar to https://github.com/stripe/stripe-python/blob/master/tests/api_resources/abstract/test_listable_api_resource.py that exercises the SearchableAPIResource? |
Good catch - thank you! Added. PTAL @pakrym-stripe |
{"object": "charge", "name": "curly"}, | ||
], | ||
"url": "/v1/charges", | ||
"has_more": False, |
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.
Is it possible to add a second page here?
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.
Done!
PTAL again @pakrym-stripe for the multi-page test? |
Notify
r? @pakrym-stripe
Summary
Adds support for
search_result
objects returned by the Stripe API, including adding aSearchResultObject
class and aSearchableAPIResource
class which can be added to resources to support invoking search APIs.This behaves similarly to
ListObject
in that they both wrap around a list of objects and provide pagination. However theSearchResultObject
object paginates by relying on anext_page
token included in the response rather than using object IDs +starting_before
/ending_after
. Thus, only forward pagination is supportedThis was branched from #730.
Test plan
Added unit tests. We'll want to add some more rigorous tests once stripe-mock has been updated to include at least one API that returns this resource.