Skip to content

[management] Code generation: update services and models#497

Open
AdyenAutomationBot wants to merge 1 commit into
mainfrom
sdk-automation/management
Open

[management] Code generation: update services and models#497
AdyenAutomationBot wants to merge 1 commit into
mainfrom
sdk-automation/management

Conversation

@AdyenAutomationBot

Copy link
Copy Markdown
Collaborator

This PR contains the automated changes for the management service.

The commit history of this PR reflects the adyen-openapi commits that have been applied.

@AdyenAutomationBot AdyenAutomationBot requested a review from a team as a code owner July 13, 2026 14:23
@sonarqubecloud

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request introduces the DonationCampaignsApi class to the management service, adding endpoints for managing donation campaigns and listing nonprofits. Feedback suggests adding corresponding unit tests to prevent regressions, and implementing defensive checks for required path parameters (such as companyId and donationCampaignId) to avoid malformed API requests.

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).

Comment on lines +16 to +20
def create_donation_campaign(self, request, companyId, idempotency_key=None, **kwargs):
"""
Create a donation campaign
"""
endpoint = self.baseUrl + f"/companies/{companyId}/campaignManagement"

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"

Comment on lines +26 to +32
def delete_donation_campaign(
self, companyId, donationCampaignId, idempotency_key=None, **kwargs
):
"""
Delete a donation campaign
"""
endpoint = self.baseUrl + f"/companies/{companyId}/campaignManagement/{donationCampaignId}"

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant