-
Notifications
You must be signed in to change notification settings - Fork 47
[balanceplatform] Code generation: update services and models #464
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,54 @@ | ||
| from ..base import AdyenServiceBase | ||
|
|
||
|
|
||
| class DirectDebitMandatesApi(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 = "balancePlatform" | ||
| self.baseUrl = "https://balanceplatform-api-test.adyen.com/bcl/v2" | ||
|
|
||
| def cancel_mandate(self, mandateId, idempotency_key=None, **kwargs): | ||
|
Check warning on line 16 in Adyen/services/balancePlatform/direct_debit_mandates_api.py
|
||
| """ | ||
| Cancel a mandate | ||
| """ | ||
| endpoint = self.baseUrl + f"/mandates/{mandateId}/cancel" | ||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
|
|
||
| def get_list_of_mandates(self, idempotency_key=None, **kwargs): | ||
| """ | ||
| Get a list of mandates | ||
| """ | ||
| endpoint = self.baseUrl + "/mandates" | ||
| method = "GET" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
|
|
||
| def get_mandate_by_id(self, mandateId, idempotency_key=None, **kwargs): | ||
|
Check warning on line 36 in Adyen/services/balancePlatform/direct_debit_mandates_api.py
|
||
| """ | ||
| Get a specific mandate | ||
| """ | ||
| endpoint = self.baseUrl + f"/mandates/{mandateId}" | ||
| method = "GET" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
|
|
||
| def update_mandate(self, request, mandateId, idempotency_key=None, **kwargs): | ||
|
Check warning on line 46 in Adyen/services/balancePlatform/direct_debit_mandates_api.py
|
||
| """ | ||
| Amend a mandate | ||
| """ | ||
| endpoint = self.baseUrl + f"/mandates/{mandateId}" | ||
| method = "PATCH" | ||
| return self.client.call_adyen_api( | ||
| request, 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 parameter
idshadows the built-in Python functionid(). To avoid potential bugs and improve code clarity, it's recommended by PEP 8 to use a different name, such asaccount_holder_id. Since this is auto-generated code, this is a good opportunity to fix it in the generator to apply this good practice consistently across the codebase.References
id()function, which can lead to confusion and subtle bugs. (link)