Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Adyen/services/balancePlatform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .balances_api import BalancesApi
from .bank_account_validation_api import BankAccountValidationApi
from .card_orders_api import CardOrdersApi
from .direct_debit_mandates_api import DirectDebitMandatesApi
from .grant_accounts_api import GrantAccountsApi
from .grant_offers_api import GrantOffersApi
from .manage_card_pin_api import ManageCardPINApi
Expand Down Expand Up @@ -36,6 +37,7 @@ def __init__(self, client=None):
self.balances_api = BalancesApi(client=client)
self.bank_account_validation_api = BankAccountValidationApi(client=client)
self.card_orders_api = CardOrdersApi(client=client)
self.direct_debit_mandates_api = DirectDebitMandatesApi(client=client)
self.grant_accounts_api = GrantAccountsApi(client=client)
self.grant_offers_api = GrantOffersApi(client=client)
self.manage_sca_devices_api = ManageSCADevicesApi(client=client)
Expand Down
10 changes: 10 additions & 0 deletions Adyen/services/balancePlatform/account_holders_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ def get_tax_form(self, id, idempotency_key=None, **kwargs):
None, self.service, method, endpoint, idempotency_key, **kwargs
)

def get_tax_form_summary(self, id, idempotency_key=None, **kwargs):
"""
Get summary of tax forms for an account holder
"""
endpoint = self.baseUrl + f"/accountHolders/{id}/taxFormSummary"
method = "GET"
return self.client.call_adyen_api(
None, self.service, method, endpoint, idempotency_key, **kwargs
)
Comment on lines +66 to +74
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The parameter id shadows the built-in Python function id(). To avoid potential bugs and improve code clarity, it's recommended by PEP 8 to use a different name, such as account_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.

Suggested change
def get_tax_form_summary(self, id, idempotency_key=None, **kwargs):
"""
Get summary of tax forms for an account holder
"""
endpoint = self.baseUrl + f"/accountHolders/{id}/taxFormSummary"
method = "GET"
return self.client.call_adyen_api(
None, self.service, method, endpoint, idempotency_key, **kwargs
)
def get_tax_form_summary(self, account_holder_id, idempotency_key=None, **kwargs):
"""
Get summary of tax forms for an account holder
"""
endpoint = self.baseUrl + f"/accountHolders/{account_holder_id}/taxFormSummary"
method = "GET"
return self.client.call_adyen_api(
None, self.service, method, endpoint, idempotency_key, **kwargs
)
References
  1. PEP 8, the style guide for Python code, recommends against using names that shadow built-ins. The name 'id' shadows the built-in id() function, which can lead to confusion and subtle bugs. (link)


def update_account_holder(self, request, id, idempotency_key=None, **kwargs):
"""
Update an account holder
Expand Down
54 changes: 54 additions & 0 deletions Adyen/services/balancePlatform/direct_debit_mandates_api.py
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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "mandateId" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0a2qiX92b9ayw1kdD9&open=AZ0a2qiX92b9ayw1kdD9&pullRequest=464
"""
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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "mandateId" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0a2qiX92b9ayw1kdD-&open=AZ0a2qiX92b9ayw1kdD-&pullRequest=464
"""
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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "mandateId" to match the regular expression ^[_a-z][a-z0-9_]*$.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0a2qiX92b9ayw1kdD_&open=AZ0a2qiX92b9ayw1kdD_&pullRequest=464
"""
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
)
Loading