Skip to content

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

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

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

Conversation

@AdyenAutomationBot
Copy link
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 review from a team as code owners January 28, 2026 13:57
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @AdyenAutomationBot, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers a comprehensive update to the balanceplatform service, primarily through the addition of new API functionalities and the refinement of existing data models. The changes aim to expand capabilities related to card user authorization, balance change notifications, secure authentication device management, and flexible transfer limit configurations. These updates enhance the platform's ability to manage financial operations with greater control and detail.

Highlights

  • New API Services: Introduced several new API services: AuthorizedCardUsersApi for managing card user permissions, BalancesApi for configuring balance webhook settings, SCAAssociationManagementApi and SCADeviceManagementApi for Strong Customer Authentication (SCA) device and association management, and TransferLimitsBalanceAccountLevelApi and TransferLimitsBalancePlatformLevelApi for granular control over transfer limits.
  • Enhanced Payment Instrument Capabilities: Added new endpoints within PaymentInstrumentsApi to support network token provisioning data, allowing for the creation and retrieval of data necessary for adding payment instruments to digital wallets.
  • Model Updates and Clarifications: Numerous existing models have been updated with new fields, expanded enum values, and clarified descriptions. Notable changes include additional bank identification types, more detailed address fields in BulkAddress, optional card numbers and usage types in Card and CardInfo, and streamlined DeviceInfo.
  • Improved Transfer and Transaction Rule Management: Updated CreateSweepConfigurationV2 and SweepConfigurationV2 with revised priority descriptions and reason enum values. TransactionRule and TransactionRuleInfo now support enforceSCA as an outcome type, and TransferRoute includes a new interest category.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

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

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 several new API services and models to the Balance Platform API. New API services include AuthorizedCardUsersApi for managing authorized users on cards, BalancesApi for configuring balance webhook settings, SCAAssociationManagementApi for approving, listing, and removing Strong Customer Authentication (SCA) device associations, SCADeviceManagementApi for initiating and completing SCA device registrations, and TransferLimitsBalanceAccountLevelApi and TransferLimitsBalancePlatformLevelApi for managing transfer limits at both account and platform levels. The AccountHoldersApi is updated to support filtering tax forms by legalEntityId, and the PaymentInstrumentsApi now includes functionality for network token provisioning and activation data. Numerous new models and enums are added to support these new functionalities, such as ApproveAssociationRequest, BalanceWebhookSettingInfo, CreateTransferLimitRequest, NetworkTokenActivationDataRequest, ScaDevice, ScaEntityType, LimitStatus, and TransferType. Existing models like AdditionalBankIdentification, BulkAddress, Card, CardConfiguration, CardInfo, DeviceInfo, SweepConfigurationV2, TransactionRule, TransactionRuleInfo, TransferRoute, and VerificationError have been updated with new fields, enum values, or clarified descriptions. The main APIClient is also updated to integrate these new services. Review comments highlight issues with the NewBalanceWebhookSetting constructor in model_balance_webhook_setting.go due to incorrect field initialization, and a recurring pattern of deprecated ioutil.ReadAll usage and unhandled errors in API service files, suggesting refactoring to use io.ReadAll and consolidated switch statements for error handling.

Comment on lines +30 to +38
func NewBalanceWebhookSetting(currency string, id string, status string, target Target, type_ SettingType) *BalanceWebhookSetting {
this := BalanceWebhookSetting{}
this.Currency = currency
this.Id = id
this.Status = status
this.Target = target
this.Type = type_
return &this
}
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The NewBalanceWebhookSetting constructor attempts to initialize fields (Currency, Id, Status, Target, Type) that are not part of the BalanceWebhookSetting struct. This will cause a compilation error.

It seems the intention was for BalanceWebhookSetting to embed the WebhookSetting struct, which contains these fields. The code generator appears to have produced incorrect code.

To make this compile, the assignments should be removed. However, this leaves the constructor with unused parameters and indicates a deeper issue with the struct definition that should be addressed in the code generator.

func NewBalanceWebhookSetting(currency string, id string, status string, target Target, type_ SettingType) *BalanceWebhookSetting {
	this := BalanceWebhookSetting{}
	return &this
}

Comment on lines +77 to +109
var serviceError common.RestServiceError
if httpRes.StatusCode == 400 {
body, _ := ioutil.ReadAll(httpRes.Body)
decodeError := json.Unmarshal([]byte(body), &serviceError)
if decodeError != nil {
return httpRes, decodeError
}
return httpRes, serviceError
}
if httpRes.StatusCode == 401 {
body, _ := ioutil.ReadAll(httpRes.Body)
decodeError := json.Unmarshal([]byte(body), &serviceError)
if decodeError != nil {
return httpRes, decodeError
}
return httpRes, serviceError
}
if httpRes.StatusCode == 403 {
body, _ := ioutil.ReadAll(httpRes.Body)
decodeError := json.Unmarshal([]byte(body), &serviceError)
if decodeError != nil {
return httpRes, decodeError
}
return httpRes, serviceError
}
if httpRes.StatusCode == 422 {
body, _ := ioutil.ReadAll(httpRes.Body)
decodeError := json.Unmarshal([]byte(body), &serviceError)
if decodeError != nil {
return httpRes, decodeError
}
return httpRes, serviceError
}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The error handling logic in this block has several issues that are repeated across many new API methods in this pull request:

  1. Use of deprecated function: ioutil.ReadAll has been deprecated since Go 1.16. It should be replaced with io.ReadAll.
  2. Ignored error: The error returned from ReadAll is ignored (body, _ := ...). If reading the response body fails, this can lead to silent failures or panics. This error must be handled.
  3. Code duplication: The same block of code is repeated for each HTTP status code check. This can be refactored into a switch statement to improve readability and maintainability.

Here is a suggested refactoring that addresses these points. Note that you will need to add "io" to your imports.

	var serviceError common.RestServiceError
	switch httpRes.StatusCode {
	case 400, 401, 403, 422:
		body, err := io.ReadAll(httpRes.Body)
		if err != nil {
			return httpRes, err
		}
		decodeError := json.Unmarshal(body, &serviceError)
		if decodeError != nil {
			return httpRes, decodeError
		}
		return httpRes, serviceError
	}

Comment on lines +88 to +136
var serviceError common.RestServiceError
if httpRes.StatusCode == 400 {
body, _ := ioutil.ReadAll(httpRes.Body)
decodeError := json.Unmarshal([]byte(body), &serviceError)
if decodeError != nil {
return *res, httpRes, decodeError
}
return *res, httpRes, serviceError
}
if httpRes.StatusCode == 401 {
body, _ := ioutil.ReadAll(httpRes.Body)
decodeError := json.Unmarshal([]byte(body), &serviceError)
if decodeError != nil {
return *res, httpRes, decodeError
}
return *res, httpRes, serviceError
}
if httpRes.StatusCode == 403 {
body, _ := ioutil.ReadAll(httpRes.Body)
decodeError := json.Unmarshal([]byte(body), &serviceError)
if decodeError != nil {
return *res, httpRes, decodeError
}
return *res, httpRes, serviceError
}
if httpRes.StatusCode == 404 {
body, _ := ioutil.ReadAll(httpRes.Body)
decodeError := json.Unmarshal([]byte(body), &serviceError)
if decodeError != nil {
return *res, httpRes, decodeError
}
return *res, httpRes, serviceError
}
if httpRes.StatusCode == 422 {
body, _ := ioutil.ReadAll(httpRes.Body)
decodeError := json.Unmarshal([]byte(body), &serviceError)
if decodeError != nil {
return *res, httpRes, decodeError
}
return *res, httpRes, serviceError
}
if httpRes.StatusCode == 500 {
body, _ := ioutil.ReadAll(httpRes.Body)
decodeError := json.Unmarshal([]byte(body), &serviceError)
if decodeError != nil {
return *res, httpRes, decodeError
}
return *res, httpRes, serviceError
}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The error handling logic in this block has several issues:

  1. Use of deprecated function: ioutil.ReadAll has been deprecated since Go 1.16. It should be replaced with io.ReadAll.
  2. Ignored error: The error returned from ReadAll is ignored (body, _ := ...). This can lead to silent failures or panics. This error must be handled.
  3. Code duplication: The same block of code is repeated for each HTTP status code check. This can be refactored into a switch statement to improve readability and maintainability.

This pattern is present in multiple new API files in this PR. Here is a suggested refactoring. Note that you will need to add "io" to your imports.

	var serviceError common.RestServiceError
	switch httpRes.StatusCode {
	case 400, 401, 403, 404, 422, 500:
		body, err := io.ReadAll(httpRes.Body)
		if err != nil {
			return *res, httpRes, err
		}
		decodeError := json.Unmarshal(body, &serviceError)
		if decodeError != nil {
			return *res, httpRes, decodeError
		}
		return *res, httpRes, serviceError
	}

Comment on lines +77 to +117
var serviceError common.RestServiceError
if httpRes.StatusCode == 400 {
body, _ := ioutil.ReadAll(httpRes.Body)
decodeError := json.Unmarshal([]byte(body), &serviceError)
if decodeError != nil {
return *res, httpRes, decodeError
}
return *res, httpRes, serviceError
}
if httpRes.StatusCode == 401 {
body, _ := ioutil.ReadAll(httpRes.Body)
decodeError := json.Unmarshal([]byte(body), &serviceError)
if decodeError != nil {
return *res, httpRes, decodeError
}
return *res, httpRes, serviceError
}
if httpRes.StatusCode == 403 {
body, _ := ioutil.ReadAll(httpRes.Body)
decodeError := json.Unmarshal([]byte(body), &serviceError)
if decodeError != nil {
return *res, httpRes, decodeError
}
return *res, httpRes, serviceError
}
if httpRes.StatusCode == 422 {
body, _ := ioutil.ReadAll(httpRes.Body)
decodeError := json.Unmarshal([]byte(body), &serviceError)
if decodeError != nil {
return *res, httpRes, decodeError
}
return *res, httpRes, serviceError
}
if httpRes.StatusCode == 500 {
body, _ := ioutil.ReadAll(httpRes.Body)
decodeError := json.Unmarshal([]byte(body), &serviceError)
if decodeError != nil {
return *res, httpRes, decodeError
}
return *res, httpRes, serviceError
}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The error handling logic in this block has several issues:

  1. Use of deprecated function: ioutil.ReadAll has been deprecated since Go 1.16. It should be replaced with io.ReadAll.
  2. Ignored error: The error returned from ReadAll is ignored (body, _ := ...). This can lead to silent failures or panics. This error must be handled.
  3. Code duplication: The same block of code is repeated for each HTTP status code check. This can be refactored into a switch statement to improve readability and maintainability.

This pattern is present in multiple new API files in this PR. Here is a suggested refactoring. Note that you will need to add "io" to your imports.

	var serviceError common.RestServiceError
	switch httpRes.StatusCode {
	case 400, 401, 403, 422, 500:
		body, err := io.ReadAll(httpRes.Body)
		if err != nil {
			return *res, httpRes, err
		}
		decodeError := json.Unmarshal(body, &serviceError)
		if decodeError != nil {
			return *res, httpRes, decodeError
		}
		return *res, httpRes, serviceError
	}

@AdyenAutomationBot AdyenAutomationBot force-pushed the sdk-automation/balanceplatform branch from 5459a80 to 1d2ac93 Compare February 2, 2026 09:13
@AdyenAutomationBot AdyenAutomationBot force-pushed the sdk-automation/balanceplatform branch from 1d2ac93 to 358c668 Compare February 9, 2026 12:30
@AdyenAutomationBot AdyenAutomationBot force-pushed the sdk-automation/balanceplatform branch from 358c668 to b90f556 Compare February 10, 2026 13:43
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