Repository navigation
[management] Code generation: update services and models #497
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,34 @@ | ||
| from ..base import AdyenServiceBase | ||
|
|
||
|
|
||
| class ClientCertificatesCompanyLevelApi(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 = "management" | ||
| self.baseUrl = "https://management-test.adyen.com/v3" | ||
|
|
||
| def generate_client_certificate(self, request, companyId, idempotency_key=None, **kwargs): | ||
|
Check warning on line 16 in Adyen/services/management/client_certificates_company_level_api.py
|
||
| """ | ||
| Generate a client certificate | ||
| """ | ||
| endpoint = self.baseUrl + f"/companies/{companyId}/clientCertificates" | ||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| request, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
|
|
||
| def list_client_certificates(self, companyId, idempotency_key=None, **kwargs): | ||
|
Check warning on line 26 in Adyen/services/management/client_certificates_company_level_api.py
|
||
| """ | ||
| Retrieve all valid client certificates for this company | ||
| """ | ||
| endpoint = self.baseUrl + f"/companies/{companyId}/clientCertificates" | ||
| 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 |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| from ..base import AdyenServiceBase | ||
|
|
||
|
|
||
| class DonationCampaignsApi(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 = "management" | ||
| self.baseUrl = "https://management-test.adyen.com/v3" | ||
|
|
||
| def create_donation_campaign(self, request, companyId, idempotency_key=None, **kwargs): | ||
|
Check warning on line 16 in Adyen/services/management/donation_campaigns_api.py
|
||
| """ | ||
| Create a donation campaign | ||
| """ | ||
| endpoint = self.baseUrl + f"/companies/{companyId}/campaignManagement" | ||
|
poojah-adyen marked this conversation as resolved.
|
||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| request, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
|
|
||
| def delete_donation_campaign( | ||
| self, companyId, donationCampaignId, idempotency_key=None, **kwargs | ||
|
Check warning on line 27 in Adyen/services/management/donation_campaigns_api.py
|
||
| ): | ||
| """ | ||
| Delete a donation campaign | ||
| """ | ||
| endpoint = self.baseUrl + f"/companies/{companyId}/campaignManagement/{donationCampaignId}" | ||
|
poojah-adyen marked this conversation as resolved.
|
||
| method = "DELETE" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
|
|
||
| def list_donation_campaigns_for_account_holder( | ||
| self, companyId, accountHolderId, idempotency_key=None, **kwargs | ||
|
Check warning on line 39 in Adyen/services/management/donation_campaigns_api.py
|
||
| ): | ||
| """ | ||
| Get the donation campaigns for an account holder | ||
| """ | ||
| endpoint = ( | ||
| self.baseUrl | ||
| + f"/companies/{companyId}/campaignManagement/accountHolders/{accountHolderId}" | ||
| ) | ||
| method = "GET" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
|
|
||
| def list_nonprofits(self, request, companyId, idempotency_key=None, **kwargs): | ||
|
Check warning on line 53 in Adyen/services/management/donation_campaigns_api.py
|
||
| """ | ||
| Get a list of nonprofits | ||
| """ | ||
| endpoint = self.baseUrl + f"/companies/{companyId}/nonprofits" | ||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| request, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
|
|
||
| def update_donation_campaign( | ||
| self, request, companyId, donationCampaignId, idempotency_key=None, **kwargs | ||
|
Check warning on line 64 in Adyen/services/management/donation_campaigns_api.py
|
||
| ): | ||
| """ | ||
| Update a donation campaign | ||
| """ | ||
| endpoint = self.baseUrl + f"/companies/{companyId}/campaignManagement/{donationCampaignId}" | ||
| method = "PATCH" | ||
| return self.client.call_adyen_api( | ||
| request, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
|
|
||
| def update_donation_campaign_status( | ||
| self, companyId, donationCampaignId, status, idempotency_key=None, **kwargs | ||
|
Check warning on line 76 in Adyen/services/management/donation_campaigns_api.py
|
||
| ): | ||
| """ | ||
| Activate or end a donation campaign | ||
| """ | ||
| endpoint = ( | ||
| self.baseUrl | ||
| + f"/companies/{companyId}/campaignManagement/{donationCampaignId}/status/{status}" | ||
| ) | ||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| from ..base import AdyenServiceBase | ||
|
|
||
|
|
||
| class TerminalThemesCompanyLevelApi(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 = "management" | ||
| self.baseUrl = "https://management-test.adyen.com/v3" | ||
|
|
||
| def add_terminal_theme_asset_for_company(self, companyId, id, idempotency_key=None, **kwargs): | ||
|
Check warning on line 16 in Adyen/services/management/terminal_themes_company_level_api.py
|
||
| """ | ||
| Add an asset to a terminal theme | ||
| """ | ||
| endpoint = self.baseUrl + f"/companies/{companyId}/terminalThemes/{id}/assets" | ||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
|
|
||
| def apply_terminal_theme_for_company(self, companyId, id, idempotency_key=None, **kwargs): | ||
|
Check warning on line 26 in Adyen/services/management/terminal_themes_company_level_api.py
|
||
| """ | ||
| Apply a terminal theme | ||
| """ | ||
| endpoint = self.baseUrl + f"/companies/{companyId}/terminalThemes/{id}/apply" | ||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
|
|
||
| def create_terminal_theme_for_company(self, request, companyId, idempotency_key=None, **kwargs): | ||
|
Check warning on line 36 in Adyen/services/management/terminal_themes_company_level_api.py
|
||
| """ | ||
| Create a terminal theme | ||
| """ | ||
| endpoint = self.baseUrl + f"/companies/{companyId}/terminalThemes" | ||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| request, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
|
|
||
| def delete_terminal_theme_asset_for_company( | ||
| self, companyId, id, idempotency_key=None, **kwargs | ||
|
Check warning on line 47 in Adyen/services/management/terminal_themes_company_level_api.py
|
||
| ): | ||
| """ | ||
| Delete an asset from a terminal theme | ||
| """ | ||
| endpoint = self.baseUrl + f"/companies/{companyId}/terminalThemes/{id}/assets" | ||
| method = "DELETE" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
|
|
||
| def delete_terminal_theme_for_company(self, companyId, id, idempotency_key=None, **kwargs): | ||
|
Check warning on line 58 in Adyen/services/management/terminal_themes_company_level_api.py
|
||
| """ | ||
| Delete a terminal theme | ||
| """ | ||
| endpoint = self.baseUrl + f"/companies/{companyId}/terminalThemes/{id}" | ||
| method = "DELETE" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
|
|
||
| def edit_terminal_theme_asset_for_company(self, companyId, id, idempotency_key=None, **kwargs): | ||
|
Check warning on line 68 in Adyen/services/management/terminal_themes_company_level_api.py
|
||
| """ | ||
| Replace a theme asset | ||
| """ | ||
| endpoint = self.baseUrl + f"/companies/{companyId}/terminalThemes/{id}/assets/replace" | ||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
|
|
||
| def get_terminal_theme_by_id_for_company(self, companyId, id, idempotency_key=None, **kwargs): | ||
|
Check warning on line 78 in Adyen/services/management/terminal_themes_company_level_api.py
|
||
| """ | ||
| Get a terminal theme | ||
| """ | ||
| endpoint = self.baseUrl + f"/companies/{companyId}/terminalThemes/{id}" | ||
| method = "GET" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
|
|
||
| def list_terminal_themes_for_company(self, companyId, idempotency_key=None, **kwargs): | ||
|
Check warning on line 88 in Adyen/services/management/terminal_themes_company_level_api.py
|
||
| """ | ||
| List terminal themes | ||
| """ | ||
| endpoint = self.baseUrl + f"/companies/{companyId}/terminalThemes" | ||
| method = "GET" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
|
|
||
| def unapply_terminal_theme_for_company(self, companyId, idempotency_key=None, **kwargs): | ||
|
Check warning on line 98 in Adyen/services/management/terminal_themes_company_level_api.py
|
||
| """ | ||
| Unapply a terminal theme | ||
| """ | ||
| endpoint = self.baseUrl + f"/companies/{companyId}/terminalThemes/unapply" | ||
| method = "POST" | ||
| return self.client.call_adyen_api( | ||
| None, self.service, method, endpoint, idempotency_key, **kwargs | ||
| ) | ||
|
|
||
| def update_terminal_theme_for_company( | ||
| self, request, companyId, id, idempotency_key=None, **kwargs | ||
|
Check warning on line 109 in Adyen/services/management/terminal_themes_company_level_api.py
|
||
| ): | ||
| """ | ||
| Update the metadata of a terminal theme | ||
| """ | ||
| endpoint = self.baseUrl + f"/companies/{companyId}/terminalThemes/{id}" | ||
| 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.
A new API class
DonationCampaignsApihas been introduced with several new endpoints, but no corresponding unit tests have been added totest/ManagementTest.py. To ensure correctness and prevent future regressions, please add unit tests covering these new methods (e.g., verifying the correct HTTP method, endpoint URL construction, and request body handling).