Skip to content

[management] Code generation: update services and models - #1730

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

[management] Code generation: update services and models#1730
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

@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 service and its associated data models to support donation campaigns, alongside updates to existing payment method models, such as adding Cash App support and making several response properties optional. The review feedback highlights critical improvement opportunities: addressing potential bugs in query parameter handling where truthy checks could ignore valid falsy values (like 0 or ""), restoring type safety in InPersonDonationSettingsUpdate by replacing any | null with number | null for timeout properties, and correcting a typo (endenred instead of edenred) in the MealVoucherFRInfo description.

Comment on lines +97 to +104
const hasDefinedQueryParams = status ?? pageNumber ?? pageSize;
if(hasDefinedQueryParams) {
if(!requestOptions) requestOptions = {};
if(!requestOptions.params) requestOptions.params = {};
if(status) requestOptions.params["status"] = status;
if(pageNumber) requestOptions.params["pageNumber"] = pageNumber;
if(pageSize) requestOptions.params["pageSize"] = pageSize;
}

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

Using the nullish coalescing operator (??) and truthy checks (if (status)) can lead to bugs when query parameters have valid falsy values (such as 0 or "".). For example, if pageSize is 0 or status is "", they will be incorrectly ignored. It is safer to explicitly check against undefined.

        if (status !== undefined || pageNumber !== undefined || pageSize !== undefined) {
            if(!requestOptions) requestOptions = {};
            if(!requestOptions.params) requestOptions.params = {};
            if(status !== undefined) requestOptions.params["status"] = status;
            if(pageNumber !== undefined) requestOptions.params["pageNumber"] = pageNumber;
            if(pageSize !== undefined) requestOptions.params["pageSize"] = pageSize;
        }

Comment on lines +131 to +139
const hasDefinedQueryParams = searchTerm ?? pageNumber ?? pageSize ?? goal;
if(hasDefinedQueryParams) {
if(!requestOptions) requestOptions = {};
if(!requestOptions.params) requestOptions.params = {};
if(searchTerm) requestOptions.params["searchTerm"] = searchTerm;
if(pageNumber) requestOptions.params["pageNumber"] = pageNumber;
if(pageSize) requestOptions.params["pageSize"] = pageSize;
if(goal) requestOptions.params["goal"] = goal;
}

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

Similar to the other query parameter handling, using truthy checks for parameters like searchTerm (which can be an empty string "") or pageNumber/pageSize (which can be 0) will cause them to be ignored when they are falsy but defined. Explicitly checking against undefined is much safer.

        if (searchTerm !== undefined || pageNumber !== undefined || pageSize !== undefined || goal !== undefined) {
            if(!requestOptions) requestOptions = {};
            if(!requestOptions.params) requestOptions.params = {};
            if(searchTerm !== undefined) requestOptions.params["searchTerm"] = searchTerm;
            if(pageNumber !== undefined) requestOptions.params["pageNumber"] = pageNumber;
            if(pageSize !== undefined) requestOptions.params["pageSize"] = pageSize;
            if(goal !== undefined) requestOptions.params["goal"] = goal;
        }

Comment on lines +28 to +32
"presentCardTimeoutMs"?: any | null;
/**
* The time, in milliseconds, that the terminal waits for the shopper to make a selection on the donation screen. Defaults to **10000** (10 seconds). Range: 5000 to 15000.
*/
"promptTimeoutMs"?: any | null;

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

The properties presentCardTimeoutMs and promptTimeoutMs are typed as any | null in this update model, whereas they are typed as number in the base InPersonDonationSettings model. This loses type safety. They should be typed as number | null instead.

Suggested change
"presentCardTimeoutMs"?: any | null;
/**
* The time, in milliseconds, that the terminal waits for the shopper to make a selection on the donation screen. Defaults to **10000** (10 seconds). Range: 5000 to 15000.
*/
"promptTimeoutMs"?: any | null;
"presentCardTimeoutMs"?: number | null;
/**
* The time, in milliseconds, that the terminal waits for the shopper to make a selection on the donation screen. Defaults to **10000** (10 seconds). Range: 5000 to 15000.
*/
"promptTimeoutMs"?: number | null;

Comment on lines +74 to +84
"name": "presentCardTimeoutMs",
"baseName": "presentCardTimeoutMs",
"type": "any | null",
"format": "int64"
},
{
"name": "promptTimeoutMs",
"baseName": "promptTimeoutMs",
"type": "any | null",
"format": "int64"
},

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

The attributeTypeMap should also be updated to use number | null instead of any | null to match the property type definition and ensure correct serialization/deserialization metadata.

        {
            "name": "presentCardTimeoutMs",
            "baseName": "presentCardTimeoutMs",
            "type": "number | null",
            "format": "int64"
        },
        {
            "name": "promptTimeoutMs",
            "baseName": "promptTimeoutMs",
            "type": "number | null",
            "format": "int64"
        },

"siret": string;
/**
* The list of additional payment methods. Allowed values: **mealVoucher_FR_edenred**, **mealVoucher_FR_groupeup**, **mealVoucher_FR_natixis**, **mealVoucher_FR_sodexo**.
* The list of additional payment methods. Allowed values: **mealVoucher_FR_endenred**, **mealVoucher_FR_groupeup**, **mealVoucher_FR_natixis**, **mealVoucher_FR_sodexo**.

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

This change introduces a typo: mealVoucher_FR_endenred instead of mealVoucher_FR_edenred (Edenred is the correct spelling). Please correct this in the OpenAPI specification or the model description.

Suggested change
* The list of additional payment methods. Allowed values: **mealVoucher_FR_endenred**, **mealVoucher_FR_groupeup**, **mealVoucher_FR_natixis**, **mealVoucher_FR_sodexo**.
* The list of additional payment methods. Allowed values: **mealVoucher_FR_edenred**, **mealVoucher_FR_groupeup**, **mealVoucher_FR_natixis**, **mealVoucher_FR_sodexo**.

@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 8 times, most recently from 599aae0 to 8cd4ff7 Compare July 21, 2026 09:54
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 4 times, most recently from 75ce75f to b4e77a7 Compare July 27, 2026 10:29
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 3 times, most recently from fcdadff to 32568bf Compare August 4, 2026 17:16
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 2 times, most recently from e132734 to 9822f45 Compare August 7, 2026 15:19
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 3 times, most recently from cc517a1 to df521ac Compare August 21, 2026 14:01
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch 2 times, most recently from ad70396 to 0372ade Compare August 27, 2026 12:21
@AdyenAutomationBot
AdyenAutomationBot force-pushed the sdk-automation/management branch from 0372ade to e7a2f45 Compare August 27, 2026 13:59
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