-
Notifications
You must be signed in to change notification settings - Fork 49
[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,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" | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+16
to
+20
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. To prevent constructing malformed URLs and sending invalid requests to the server, consider adding a defensive check to ensure def create_donation_campaign(self, request, companyId, idempotency_key=None, **kwargs):
"""
Create a donation campaign
"""
if not companyId:
raise ValueError("companyId is required and cannot be empty")
endpoint = self.baseUrl + f"/companies/{companyId}/campaignManagement" |
||||||||||||||||||||||||||||||||||||||
| 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}" | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+26
to
+32
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. Both
Suggested change
|
||||||||||||||||||||||||||||||||||||||
| 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,8 @@ | ||
| { | ||
| "service": "management", | ||
| "project": "python", | ||
| "generatedAt": "2026-07-16T13:15:04Z", | ||
| "openapiCommitSha": "c43ebe2c218116a98ddfa97cd5e4d63f6c427d6e", | ||
| "automationCommitSha": "a7fa5d57782b5065affe714e9d9caaf5009a1e24", | ||
| "libraryCommitSha": "68700ffcf8e8e8b5b15733419d83209eda4e6825" | ||
| } |
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).