Skip to content

[balanceplatform] Code generation: update services and models#2016

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

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

Conversation

@AdyenAutomationBot

Copy link
Copy Markdown
Collaborator

This PR contains the automated changes for the balanceplatform 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 23, 2026 13:25

@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 support for recurring top-ups in the balance platform SDK, adding several new DTO models, updating transaction rules with a bypass option, and implementing the RecurringTopUpsApi service. It also adds a delete endpoint to the SCA device management API. Feedback on these changes highlights opportunities to improve efficiency by avoiding unnecessary boxing of primitive booleans in AmountDTO, enhancing robustness with null checks on request bodies in RecurringTopUpsApi, and restoring type safety by using String instead of Object for the beneficiary reference in PatchableCreateRecurringTopUp.

Comment on lines +158 to +161
&& Objects.equals(this.isSetCurrency, amountDTO.isSetCurrency)
&& Objects.equals(this.value, amountDTO.value)
&& Objects.equals(this.isSetValue, amountDTO.isSetValue);
}

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 Objects.equals on primitive boolean fields like isSetCurrency and isSetValue causes unnecessary boxing to Boolean objects. For primitive fields, direct comparison using == is more efficient and idiomatic in Java.

    return Objects.equals(this.currency, amountDTO.currency)
        && this.isSetCurrency == amountDTO.isSetCurrency
        && Objects.equals(this.value, amountDTO.value)
        && this.isSetValue == amountDTO.isSetValue;

Comment on lines +90 to +95
if (balanceAccountId == null) {
throw new IllegalArgumentException("Please provide the balanceAccountId path parameter");
}
pathParams.put("balanceAccountId", balanceAccountId);

String requestBody = createRecurringTopUp.toJson();

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

If createRecurringTopUp is null, calling createRecurringTopUp.toJson() will throw a NullPointerException. It is safer to perform a null check and throw an IllegalArgumentException, similar to the path parameter check.

Suggested change
if (balanceAccountId == null) {
throw new IllegalArgumentException("Please provide the balanceAccountId path parameter");
}
pathParams.put("balanceAccountId", balanceAccountId);
String requestBody = createRecurringTopUp.toJson();
if (balanceAccountId == null) {
throw new IllegalArgumentException("Please provide the balanceAccountId path parameter");
}
pathParams.put("balanceAccountId", balanceAccountId);
if (createRecurringTopUp == null) {
throw new IllegalArgumentException("Please provide the createRecurringTopUp request body");
}
String requestBody = createRecurringTopUp.toJson();

Comment on lines +248 to +257
if (balanceAccountId == null) {
throw new IllegalArgumentException("Please provide the balanceAccountId path parameter");
}
pathParams.put("balanceAccountId", balanceAccountId);
if (topUpId == null) {
throw new IllegalArgumentException("Please provide the topUpId path parameter");
}
pathParams.put("topUpId", topUpId);

String requestBody = patchableCreateRecurringTopUp.toJson();

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

If patchableCreateRecurringTopUp is null, calling patchableCreateRecurringTopUp.toJson() will throw a NullPointerException. It is safer to perform a null check and throw an IllegalArgumentException.

    if (balanceAccountId == null) {
      throw new IllegalArgumentException("Please provide the balanceAccountId path parameter");
    }
    pathParams.put("balanceAccountId", balanceAccountId);
    if (topUpId == null) {
      throw new IllegalArgumentException("Please provide the topUpId path parameter");
    }
    pathParams.put("topUpId", topUpId);
    if (patchableCreateRecurringTopUp == null) {
      throw new IllegalArgumentException("Please provide the patchableCreateRecurringTopUp request body");
    }

    String requestBody = patchableCreateRecurringTopUp.toJson();

Comment on lines +41 to +42
public static final String JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary";
private Object referenceForBeneficiary;

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 field referenceForBeneficiary is defined as Object here, whereas in CreateRecurringTopUp and RecurringTopUp it is defined as String. Using Object loses type safety and forces users to cast or pass arbitrary objects. If this is due to nullability in the OpenAPI spec, consider configuring the generator to map nullable strings to String instead of Object.

@sonarqubecloud

Copy link
Copy Markdown

*/
@JsonIgnore private boolean includeNullValues = false;

public PatchableSchedule() {}

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.

This naming doesn't follow our conventions and must be fixed at the spec. Marking this as do-not-merge for now.

@jeandersonbc jeandersonbc added the Don't Merge Don't merge yet for whatever reason label Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Don't Merge Don't merge yet for whatever reason

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants