Skip to content
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 Search API #992

Merged
merged 6 commits into from
Mar 17, 2022
Merged

Add support for Search API #992

merged 6 commits into from
Mar 17, 2022

Conversation

susindaran-stripe
Copy link
Contributor

@susindaran-stripe susindaran-stripe commented Aug 4, 2021

Notify

r? @richardm-stripe @dcr-stripe

Summary

Adds support for search_result objects returned by the Stripe API by adding a SearchResultObject class which can be extended by 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 the SearchResultObject object paginates by relying on a next_page token included in the response rather than using object IDs + starting_before/ending_after. Thus, only forward pagination is supported.

Test plan

Added unit tests.

@pakrym-stripe pakrym-stripe reopened this Mar 16, 2022
@pakrym-stripe
Copy link
Contributor

r? @dcr-stripe

Copy link
Contributor

@dcr-stripe dcr-stripe left a comment

Choose a reason for hiding this comment

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

LGTM - mainly just small nits.

PTAL @pakrym-stripe ?

lib/stripe/api_operations/search.rb Outdated Show resolved Hide resolved
lib/stripe/object_types.rb Show resolved Hide resolved
test/stripe/search_result_object_test.rb Outdated Show resolved Hide resolved
@pakrym-stripe
Copy link
Contributor

re-r? @dcr-stripe

@pakrym-stripe
Copy link
Contributor

pakrym-stripe commented Mar 17, 2022

PTAL @dcr-stripe ?

Copy link
Contributor

@dcr-stripe dcr-stripe left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@pakrym-stripe pakrym-stripe merged commit ba38dc9 into master Mar 17, 2022
@remi-stripe remi-stripe deleted the search-api-support branch September 28, 2023 23:07
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.

4 participants