-
Notifications
You must be signed in to change notification settings - Fork 47
[capital] Code generation: update services and models #465
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,46 @@ | ||||||||||||||||||||||||||
| from ..base import AdyenServiceBase | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| class DynamicOffersApi(AdyenServiceBase): | ||||||||||||||||||||||||||
| """NOTE: This class is auto generated by OpenAPI Generator | ||||||||||||||||||||||||||
| Ref: https://openapi-generator.tech | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Do not edit the class manually. | ||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| def __init__(self, client=None): | ||||||||||||||||||||||||||
| super().__init__(client=client) | ||||||||||||||||||||||||||
| self.service = "capital" | ||||||||||||||||||||||||||
| self.baseUrl = "https://balanceplatform-api-test.adyen.com/capital/v1" | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| def calculate_preliminary_offer_from_dynamic_offer( | ||||||||||||||||||||||||||
| self, request, id, idempotency_key=None, **kwargs | ||||||||||||||||||||||||||
| ): | ||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||
| Calculate a preliminary offer for a selected financing amount | ||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||
| endpoint = self.baseUrl + f"/dynamicOffers/{id}/calculate" | ||||||||||||||||||||||||||
|
Comment on lines
+17
to
+22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The parameter name
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good feedback, but not in socpe as this is generated code |
||||||||||||||||||||||||||
| method = "POST" | ||||||||||||||||||||||||||
| return self.client.call_adyen_api( | ||||||||||||||||||||||||||
| request, self.service, method, endpoint, idempotency_key, **kwargs | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| def create_static_offer_from_dynamic_offer(self, request, id, idempotency_key=None, **kwargs): | ||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||
| Create a static offer for a selected financing amount | ||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||
| endpoint = self.baseUrl + f"/dynamicOffers/{id}/grantOffer" | ||||||||||||||||||||||||||
|
Comment on lines
+28
to
+32
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The parameter name
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good feedback, but not in scope as generated code |
||||||||||||||||||||||||||
| method = "POST" | ||||||||||||||||||||||||||
| return self.client.call_adyen_api( | ||||||||||||||||||||||||||
| request, self.service, method, endpoint, idempotency_key, **kwargs | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| def get_all_dynamic_offers(self, idempotency_key=None, **kwargs): | ||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||
| Get all available dynamic offers | ||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||
| endpoint = self.baseUrl + "/dynamicOffers" | ||||||||||||||||||||||||||
| method = "GET" | ||||||||||||||||||||||||||
| return self.client.call_adyen_api( | ||||||||||||||||||||||||||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||
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.
The
serviceandbaseUrlattributes are hardcoded and duplicated across all API classes in thecapitalservice (DynamicOffersApi,GrantAccountsApi,GrantOffersApi,GrantsApi). This violates the DRY (Don't Repeat Yourself) principle and makes maintenance harder. To improve maintainability, consider defining these in a shared base class for all capital services or as constants in a shared module.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.
Good feedback, but not in scope of this PR as it's generated code. We can create a follow-up ticket internally