-
Notifications
You must be signed in to change notification settings - Fork 47
[management] Code generation: update services and models #458
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 |
|---|---|---|
|
|
@@ -17,38 +17,31 @@ | |
| """ | ||
| Create a merchant account | ||
| """ | ||
| endpoint = self.baseUrl + "/merchants" | ||
| endpoint = self.baseUrl + f"/merchants" | ||
|
Check warning on line 20 in Adyen/services/management/account_merchant_level_api.py
|
||
|
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. |
||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| request, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
| return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) | ||
|
|
||
| def get_merchant_account(self, merchantId, idempotency_key=None, **kwargs): | ||
| """ | ||
| Get a merchant account | ||
| """ | ||
| endpoint = self.baseUrl + f"/merchants/{merchantId}" | ||
| 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 list_merchant_accounts(self, idempotency_key=None, **kwargs): | ||
| """ | ||
| Get a list of merchant accounts | ||
| """ | ||
| endpoint = self.baseUrl + "/merchants" | ||
| endpoint = self.baseUrl + f"/merchants" | ||
|
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. |
||
| 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 request_to_activate_merchant_account(self, merchantId, idempotency_key=None, **kwargs): | ||
| """ | ||
| Request to activate a merchant account | ||
| """ | ||
| endpoint = self.baseUrl + f"/merchants/{merchantId}/activate" | ||
| method = "POST" | ||
| 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) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,78 +17,63 @@ | |
| """ | ||
| Create a store | ||
| """ | ||
| endpoint = self.baseUrl + "/stores" | ||
| endpoint = self.baseUrl + f"/stores" | ||
|
Check warning on line 20 in Adyen/services/management/account_store_level_api.py
|
||
|
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. |
||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| request, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
| return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) | ||
|
|
||
| def create_store_by_merchant_id(self, request, merchantId, idempotency_key=None, **kwargs): | ||
| """ | ||
| Create a store | ||
| """ | ||
| endpoint = self.baseUrl + f"/merchants/{merchantId}/stores" | ||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| request, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
| return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) | ||
|
|
||
| def get_store(self, merchantId, storeId, idempotency_key=None, **kwargs): | ||
| """ | ||
| Get a store | ||
| """ | ||
| endpoint = self.baseUrl + f"/merchants/{merchantId}/stores/{storeId}" | ||
| 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_store_by_id(self, storeId, idempotency_key=None, **kwargs): | ||
| """ | ||
| Get a store | ||
| """ | ||
| endpoint = self.baseUrl + f"/stores/{storeId}" | ||
| 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 list_stores(self, idempotency_key=None, **kwargs): | ||
| """ | ||
| Get a list of stores | ||
| """ | ||
| endpoint = self.baseUrl + "/stores" | ||
| endpoint = self.baseUrl + f"/stores" | ||
|
Check warning on line 52 in Adyen/services/management/account_store_level_api.py
|
||
|
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. |
||
| 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 list_stores_by_merchant_id(self, merchantId, idempotency_key=None, **kwargs): | ||
| """ | ||
| Get a list of stores | ||
| """ | ||
| endpoint = self.baseUrl + f"/merchants/{merchantId}/stores" | ||
| 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 update_store(self, request, merchantId, storeId, idempotency_key=None, **kwargs): | ||
| """ | ||
| Update a store | ||
| """ | ||
| endpoint = self.baseUrl + f"/merchants/{merchantId}/stores/{storeId}" | ||
| method = "PATCH" | ||
| return self.client.call_adyen_api( | ||
| request, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
| return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs) | ||
|
|
||
| def update_store_by_id(self, request, storeId, idempotency_key=None, **kwargs): | ||
| """ | ||
| Update a store | ||
| """ | ||
| endpoint = self.baseUrl + f"/stores/{storeId}" | ||
| method = "PATCH" | ||
| return self.client.call_adyen_api( | ||
| request, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
| 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.
Using an f-string for a static string like
"/companies"is redundant. While not incorrect, a plain string is sufficient and slightly more efficient as it avoids unnecessary f-string processing.