Skip to content
Open
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/management/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from .api_key_merchant_level_api import APIKeyMerchantLevelApi
from .client_key_company_level_api import ClientKeyCompanyLevelApi
from .client_key_merchant_level_api import ClientKeyMerchantLevelApi
from .donation_campaigns_api import DonationCampaignsApi
from .my_api_credential_api import MyAPICredentialApi
from .payment_methods_merchant_level_api import PaymentMethodsMerchantLevelApi
from .payout_settings_merchant_level_api import PayoutSettingsMerchantLevelApi
Expand Down Expand Up @@ -51,6 +52,7 @@ def __init__(self, client=None):
self.android_files_company_level_api = AndroidFilesCompanyLevelApi(client=client)
self.client_key_company_level_api = ClientKeyCompanyLevelApi(client=client)
self.client_key_merchant_level_api = ClientKeyMerchantLevelApi(client=client)
self.donation_campaigns_api = DonationCampaignsApi(client=client)
self.my_api_credential_api = MyAPICredentialApi(client=client)
self.payment_methods_merchant_level_api = PaymentMethodsMerchantLevelApi(client=client)
self.payout_settings_merchant_level_api = PayoutSettingsMerchantLevelApi(client=client)
Expand Down
88 changes: 88 additions & 0 deletions Adyen/services/management/donation_campaigns_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
from ..base import AdyenServiceBase


class DonationCampaignsApi(AdyenServiceBase):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

A new API class DonationCampaignsApi has been introduced with several new endpoints, but no corresponding unit tests have been added to test/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).

"""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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "companyId" 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=AZ9b3NcUKJyKTmB7Ns0c&open=AZ9b3NcUKJyKTmB7Ns0c&pullRequest=497
"""
Create a donation campaign
"""
endpoint = self.baseUrl + f"/companies/{companyId}/campaignManagement"
Comment on lines +16 to +20

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To prevent constructing malformed URLs and sending invalid requests to the server, consider adding a defensive check to ensure companyId is provided and is not empty.

    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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "companyId" 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=AZ9b3NcUKJyKTmB7Ns0d&open=AZ9b3NcUKJyKTmB7Ns0d&pullRequest=497

Check warning on line 27 in Adyen/services/management/donation_campaigns_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "donationCampaignId" 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=AZ9b3NcUKJyKTmB7Ns0e&open=AZ9b3NcUKJyKTmB7Ns0e&pullRequest=497
):
"""
Delete a donation campaign
"""
endpoint = self.baseUrl + f"/companies/{companyId}/campaignManagement/{donationCampaignId}"
Comment on lines +26 to +32

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Both companyId and donationCampaignId are required path parameters. Consider adding defensive checks to ensure they are provided and not empty before constructing the endpoint URL.

Suggested change
def delete_donation_campaign(
self, companyId, donationCampaignId, idempotency_key=None, **kwargs
):
"""
Delete a donation campaign
"""
endpoint = self.baseUrl + f"/companies/{companyId}/campaignManagement/{donationCampaignId}"
def delete_donation_campaign(
self, companyId, donationCampaignId, idempotency_key=None, **kwargs
):
"""
Delete a donation campaign
"""
if not companyId:
raise ValueError("companyId is required and cannot be empty")
if not donationCampaignId:
raise ValueError("donationCampaignId is required and cannot be empty")
endpoint = self.baseUrl + f"/companies/{companyId}/campaignManagement/{donationCampaignId}"

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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "companyId" 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=AZ9b3NcUKJyKTmB7Ns0g&open=AZ9b3NcUKJyKTmB7Ns0g&pullRequest=497

Check warning on line 39 in Adyen/services/management/donation_campaigns_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "accountHolderId" 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=AZ9b3NcUKJyKTmB7Ns0f&open=AZ9b3NcUKJyKTmB7Ns0f&pullRequest=497
):
"""
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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "companyId" 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=AZ9b3NcUKJyKTmB7Ns0h&open=AZ9b3NcUKJyKTmB7Ns0h&pullRequest=497
"""
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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "companyId" 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=AZ9b3NcUKJyKTmB7Ns0i&open=AZ9b3NcUKJyKTmB7Ns0i&pullRequest=497

Check warning on line 64 in Adyen/services/management/donation_campaigns_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "donationCampaignId" 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=AZ9b3NcUKJyKTmB7Ns0j&open=AZ9b3NcUKJyKTmB7Ns0j&pullRequest=497
):
"""
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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "donationCampaignId" 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=AZ9b3NcUKJyKTmB7Ns0l&open=AZ9b3NcUKJyKTmB7Ns0l&pullRequest=497

Check warning on line 76 in Adyen/services/management/donation_campaigns_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this parameter "companyId" 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=AZ9b3NcUKJyKTmB7Ns0k&open=AZ9b3NcUKJyKTmB7Ns0k&pullRequest=497
):
"""
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
)
8 changes: 8 additions & 0 deletions sdk-generation-log/management.json
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"
}
Loading