Skip to content

Commit 209936e

Browse files
[PW-7640] generate Configuration Service (Balance Platform) (#212)
* generate balance platform * delete the partial header * add Configuration service (Balance platform) * generate balance platform v1 * fix unit tests * Update Adyen/__init__.py Co-authored-by: Michael Paul <michael@michaelpaul.com.br> * change name to balance platform --------- Co-authored-by: Michael Paul <michael@michaelpaul.com.br>
1 parent 10ae92a commit 209936e

23 files changed

+665
-4
lines changed

Adyen/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
AdyenLegalEntityManagementApi,
2626
AdyenDataProtectionApi,
2727
AdyenTransfersApi,
28-
AdyenStoredValueApi
28+
AdyenStoredValueApi,
29+
AdyenBalancePlatformApi
2930
)
3031

3132
from .httpclient import HTTPClient
@@ -45,6 +46,7 @@ def __init__(self, **kwargs):
4546
self.dataProtection = AdyenDataProtectionApi(client=self.client)
4647
self.transfers = AdyenTransfersApi(client=self.client)
4748
self.storedValue = AdyenStoredValueApi(client=self.client)
49+
self.balancePlatform = AdyenBalancePlatformApi(client=self.client)
4850

4951

5052
_base_adyen_obj = Adyen()
@@ -59,4 +61,4 @@ def __init__(self, **kwargs):
5961
dataProtection = _base_adyen_obj.dataProtection
6062
transfers = _base_adyen_obj.transfers
6163
storedValue = _base_adyen_obj.storedValue
62-
64+
balancePlatform = _base_adyen_obj.balancePlatform

Adyen/client.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ def __init__(
9494
api_legal_entity_management_version=None,
9595
api_data_protection_version=None,
9696
api_transfers_version=None,
97-
api_stored_value_version=None
97+
api_stored_value_version=None,
98+
api_balance_platform_version=None
9899
):
99100
self.username = username
100101
self.password = password
@@ -126,6 +127,7 @@ def __init__(
126127
self.api_data_protection_version = api_data_protection_version or settings.API_DATA_PROTECION_VERSION
127128
self.api_transfers_version = api_transfers_version or settings.API_TRANSFERS_VERSION
128129
self.api_stored_value_version = api_stored_value_version or settings.API_STORED_VALUE_VERSION
130+
self.api_balance_platform_version = api_balance_platform_version or settings.API_BALANCE_PLATFORM_VERSION
129131

130132
def _determine_base_url_and_version(self, platform, service):
131133

@@ -191,6 +193,13 @@ def _determine_base_url_and_version(self, platform, service):
191193
'base_url': {
192194
'live': settings.BASE_LEGAL_ENTITY_MANAGEMENT_URL.format(platform),
193195
'test': settings.BASE_LEGAL_ENTITY_MANAGEMENT_URL.format(platform)
196+
},
197+
},
198+
'balancePlatform': {
199+
'version': self.api_balance_platform_version,
200+
'base_url': {
201+
'live': settings.BASE_CONFIGURATION_URL.format(platform),
202+
'test': settings.BASE_CONFIGURATION_URL.format(platform)
194203
}
195204
},
196205
'dataProtection': {
@@ -215,6 +224,7 @@ def _determine_base_url_and_version(self, platform, service):
215224
}
216225
}
217226
}
227+
218228
version = versions_and_urls[service]['version']
219229
base_url = versions_and_urls[service]['base_url'][platform]
220230
# Match urls that require a live prefix and do not have one

Adyen/services/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
from .dataProtection import AdyenDataProtectionApi
1111
from .transfers import AdyenTransfersApi
1212
from .storedValue import AdyenStoredValueApi
13+
from .balancePlatform import AdyenBalancePlatformApi
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from ..base import AdyenServiceBase
2+
from .account_holders_api import AccountHoldersApi
3+
from .balance_accounts_api import BalanceAccountsApi
4+
from .bank_account_validation_api import BankAccountValidationApi
5+
from .documents_api import DocumentsApi
6+
from .legal_entities_api import LegalEntitiesApi
7+
from .payment_instrument_groups_api import PaymentInstrumentGroupsApi
8+
from .payment_instruments_api import PaymentInstrumentsApi
9+
from .platform_api import PlatformApi
10+
from .transaction_rules_api import TransactionRulesApi
11+
from .transfer_instruments_api import TransferInstrumentsApi
12+
13+
14+
class AdyenBalancePlatformApi(AdyenServiceBase):
15+
"""NOTE: This class is auto generated by OpenAPI Generator
16+
Ref: https://openapi-generator.tech
17+
18+
Do not edit the class manually.
19+
"""
20+
21+
def __init__(self, client=None):
22+
super(AdyenBalancePlatformApi, self).__init__(client=client)
23+
self.account_holders_api = AccountHoldersApi(client=client)
24+
self.balance_accounts_api = BalanceAccountsApi(client=client)
25+
self.bank_account_validation_api = BankAccountValidationApi(client=client)
26+
self.documents_api = DocumentsApi(client=client)
27+
self.legal_entities_api = LegalEntitiesApi(client=client)
28+
self.payment_instrument_groups_api = PaymentInstrumentGroupsApi(client=client)
29+
self.payment_instruments_api = PaymentInstrumentsApi(client=client)
30+
self.platform_api = PlatformApi(client=client)
31+
self.transaction_rules_api = TransactionRulesApi(client=client)
32+
self.transfer_instruments_api = TransferInstrumentsApi(client=client)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
from ..base import AdyenServiceBase
2+
3+
4+
class AccountHoldersApi(AdyenServiceBase):
5+
"""NOTE: This class is auto generated by OpenAPI Generator
6+
Ref: https://openapi-generator.tech
7+
8+
Do not edit the class manually.
9+
"""
10+
11+
def __init__(self, client=None):
12+
super(AccountHoldersApi, self).__init__(client=client)
13+
self.service = "balancePlatform"
14+
15+
def get_account_holder(self, id, idempotency_key=None, **kwargs):
16+
"""
17+
Get an account holder
18+
"""
19+
endpoint = f"/accountHolders/{id}"
20+
method = "GET"
21+
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)
22+
23+
def get_all_balance_accounts_of_account_holder(self, id, idempotency_key=None, **kwargs):
24+
"""
25+
Get all balance accounts of an account holder
26+
"""
27+
endpoint = f"/accountHolders/{id}/balanceAccounts"
28+
method = "GET"
29+
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)
30+
31+
def update_account_holder(self, request, id, idempotency_key=None, **kwargs):
32+
"""
33+
Update an account holder
34+
"""
35+
endpoint = f"/accountHolders/{id}"
36+
method = "PATCH"
37+
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
38+
39+
def create_account_holder(self, request, idempotency_key=None, **kwargs):
40+
"""
41+
Create an account holder
42+
"""
43+
endpoint = f"/accountHolders"
44+
method = "POST"
45+
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
46+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
from ..base import AdyenServiceBase
2+
3+
4+
class BalanceAccountsApi(AdyenServiceBase):
5+
"""NOTE: This class is auto generated by OpenAPI Generator
6+
Ref: https://openapi-generator.tech
7+
8+
Do not edit the class manually.
9+
"""
10+
11+
def __init__(self, client=None):
12+
super(BalanceAccountsApi, self).__init__(client=client)
13+
self.service = "balancePlatform"
14+
15+
def get_balance_account(self, id, idempotency_key=None, **kwargs):
16+
"""
17+
Get a balance account
18+
"""
19+
endpoint = f"/balanceAccounts/{id}"
20+
method = "GET"
21+
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)
22+
23+
def get_all_payment_instruments_for_balance_account(self, id, idempotency_key=None, **kwargs):
24+
"""
25+
Get all payment instruments for a balance account
26+
"""
27+
endpoint = f"/balanceAccounts/{id}/paymentInstruments"
28+
method = "GET"
29+
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)
30+
31+
def update_balance_account(self, request, id, idempotency_key=None, **kwargs):
32+
"""
33+
Update a balance account
34+
"""
35+
endpoint = f"/balanceAccounts/{id}"
36+
method = "PATCH"
37+
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
38+
39+
def create_balance_account(self, request, idempotency_key=None, **kwargs):
40+
"""
41+
Create a balance account
42+
"""
43+
endpoint = f"/balanceAccounts"
44+
method = "POST"
45+
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
46+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from ..base import AdyenServiceBase
2+
3+
4+
class BankAccountValidationApi(AdyenServiceBase):
5+
"""NOTE: This class is auto generated by OpenAPI Generator
6+
Ref: https://openapi-generator.tech
7+
8+
Do not edit the class manually.
9+
"""
10+
11+
def __init__(self, client=None):
12+
super(BankAccountValidationApi, self).__init__(client=client)
13+
self.service = "balancePlatform"
14+
15+
def validate_bank_account_identification(self, request, idempotency_key=None, **kwargs):
16+
"""
17+
Validate a bank account
18+
"""
19+
endpoint = f"/validateBankAccountIdentification"
20+
method = "POST"
21+
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
22+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
from ..base import AdyenServiceBase
2+
3+
4+
class DocumentsApi(AdyenServiceBase):
5+
"""NOTE: This class is auto generated by OpenAPI Generator
6+
Ref: https://openapi-generator.tech
7+
8+
Do not edit the class manually.
9+
"""
10+
11+
def __init__(self, client=None):
12+
super(DocumentsApi, self).__init__(client=client)
13+
self.service = "balancePlatform"
14+
15+
def delete_document(self, id, idempotency_key=None, **kwargs):
16+
"""
17+
Delete a document
18+
"""
19+
endpoint = f"/documents/{id}"
20+
method = "DELETE"
21+
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)
22+
23+
def get_document(self, id, idempotency_key=None, **kwargs):
24+
"""
25+
Get a document
26+
"""
27+
endpoint = f"/documents/{id}"
28+
method = "GET"
29+
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)
30+
31+
def update_document(self, request, id, idempotency_key=None, **kwargs):
32+
"""
33+
Update a document
34+
"""
35+
endpoint = f"/documents/{id}"
36+
method = "PATCH"
37+
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
38+
39+
def upload_document_for_verification_checks(self, request, idempotency_key=None, **kwargs):
40+
"""
41+
Upload a document for verification checks
42+
"""
43+
endpoint = f"/documents"
44+
method = "POST"
45+
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
46+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
from ..base import AdyenServiceBase
2+
3+
4+
class LegalEntitiesApi(AdyenServiceBase):
5+
"""NOTE: This class is auto generated by OpenAPI Generator
6+
Ref: https://openapi-generator.tech
7+
8+
Do not edit the class manually.
9+
"""
10+
11+
def __init__(self, client=None):
12+
super(LegalEntitiesApi, self).__init__(client=client)
13+
self.service = "balancePlatform"
14+
15+
def get_legal_entity(self, id, idempotency_key=None, **kwargs):
16+
"""
17+
Get a legal entity
18+
"""
19+
endpoint = f"/legalEntities/{id}"
20+
method = "GET"
21+
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)
22+
23+
def update_legal_entity(self, request, id, idempotency_key=None, **kwargs):
24+
"""
25+
Update a legal entity
26+
"""
27+
endpoint = f"/legalEntities/{id}"
28+
method = "PATCH"
29+
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
30+
31+
def create_legal_entity(self, request, idempotency_key=None, **kwargs):
32+
"""
33+
Create a legal entity
34+
"""
35+
endpoint = f"/legalEntities"
36+
method = "POST"
37+
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
38+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
from ..base import AdyenServiceBase
2+
3+
4+
class PaymentInstrumentGroupsApi(AdyenServiceBase):
5+
"""NOTE: This class is auto generated by OpenAPI Generator
6+
Ref: https://openapi-generator.tech
7+
8+
Do not edit the class manually.
9+
"""
10+
11+
def __init__(self, client=None):
12+
super(PaymentInstrumentGroupsApi, self).__init__(client=client)
13+
self.service = "balancePlatform"
14+
15+
def get_payment_instrument_group(self, id, idempotency_key=None, **kwargs):
16+
"""
17+
Get a payment instrument group
18+
"""
19+
endpoint = f"/paymentInstrumentGroups/{id}"
20+
method = "GET"
21+
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)
22+
23+
def get_all_transaction_rules_for_payment_instrument_group(self, id, idempotency_key=None, **kwargs):
24+
"""
25+
Get all transaction rules for a payment instrument group
26+
"""
27+
endpoint = f"/paymentInstrumentGroups/{id}/transactionRules"
28+
method = "GET"
29+
return self.client.call_adyen_api(None, self.service, method, endpoint, idempotency_key, **kwargs)
30+
31+
def create_payment_instrument_group(self, request, idempotency_key=None, **kwargs):
32+
"""
33+
Create a payment instrument group
34+
"""
35+
endpoint = f"/paymentInstrumentGroups"
36+
method = "POST"
37+
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
38+

0 commit comments

Comments
 (0)