-
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
custom_method
decorator for defining static methods for custom API requests
#547
Conversation
5c91e7f
to
2eb4116
Compare
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.
Left one question, but this looking great!
ptal @ob-stripe
2eb4116
to
5402272
Compare
bd2d74d
to
d085b71
Compare
5402272
to
4d4da70
Compare
@ob-stripe I added all custom methods and tests and rebased on the latest branch for deletion |
d8c301c
to
91f7806
Compare
custom_method
decorator for defining static methods for custom API requestscustom_method
decorator for defining static methods for custom API requests
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.
LGTM
91f7806
to
ef13b48
Compare
Released as 2.24.0. |
r? @brandur-stripe @remi-stripe
cc @stripe/api-libraries
This is similar to stripe/stripe-ruby#754. This PR defines a new
custom_method
decorator that can be applied to resource classes to automatically define class methods for custom (non-CRUDL) API requests.The decorator checks if a method with the target name already exists, and if so it uses the new decorator
util.class_method_variant
from #543 to avoid overwriting the existing method (that we assume to be an instance method).