-
Notifications
You must be signed in to change notification settings - Fork 47
[capital] Code generation: update services and models #454
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
base: main
Are you sure you want to change the base?
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,39 @@ | ||||||||||||||||||||||
| 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
+16
to
+20
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
Suggested change
|
||||||||||||||||||||||
| 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
+24
to
+28
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
Suggested change
|
||||||||||||||||||||||
| 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 + f"/dynamicOffers" | ||||||||||||||||||||||
|
Check warning on line 36 in Adyen/services/capital/dynamic_offers_api.py
|
||||||||||||||||||||||
| method = "GET" | ||||||||||||||||||||||
| return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,20 +15,17 @@ | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| def get_all_grant_offers(self, idempotency_key=None, **kwargs): | ||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||
| Get all available grant offers | ||||||||||||||||||||||||
| Get all available static offers | ||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||
| endpoint = self.baseUrl + "/grantOffers" | ||||||||||||||||||||||||
| endpoint = self.baseUrl + f"/grantOffers" | ||||||||||||||||||||||||
|
Check warning on line 20 in Adyen/services/capital/grant_offers_api.py
|
||||||||||||||||||||||||
| method = "GET" | ||||||||||||||||||||||||
| return self.client.call_adyen_api( | ||||||||||||||||||||||||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||
| return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| def get_grant_offer(self, id, idempotency_key=None, **kwargs): | ||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||
| Get the details of a grant offer | ||||||||||||||||||||||||
| Get the details of a static offer | ||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||
| endpoint = self.baseUrl + f"/grantOffers/{id}" | ||||||||||||||||||||||||
|
Comment on lines
24
to
28
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
Suggested change
|
||||||||||||||||||||||||
| method = "GET" | ||||||||||||||||||||||||
| return self.client.call_adyen_api( | ||||||||||||||||||||||||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||
| 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
baseUrlis hardcoded here and duplicated across other API classes in thecapitalservice (e.g.,GrantAccountsApi,GrantOffersApi,GrantsApi). This appears to be a pattern from the code generator. To improve maintainability and reduce redundancy, consider defining this URL as a constant in a shared location, likeAdyen/services/capital/__init__.py, and referencing it from all capital service API classes. This would centralize the configuration and make future updates easier.