Skip to content

Conversation

@AdyenAutomationBot
Copy link
Collaborator

This PR contains the automated changes for the capital 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 15, 2026 14:38
@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 an automated update to the capital service, incorporating new API endpoints and their corresponding data models. The changes primarily focus on introducing functionalities for managing financial grants, including retrieving grant account information, listing and fetching grant offers, and handling grant requests and disbursements. This update ensures the client library is up-to-date with the latest adyen-openapi specification for the capital domain.

Highlights

  • New Capital API Services: Introduces GrantAccountsApi, GrantOffersApi, and GrantsApi to interact with the capital service, enabling operations related to financial grants.
  • Expanded Data Models: Adds a comprehensive set of new data models under src/typings/capital/ to support the new API functionalities, covering entities like GrantAccount, GrantOffer, Disbursement, Amount, and various bank account identification types.
  • Automated Code Generation: This pull request is an automated update, reflecting changes applied from the adyen-openapi specification, ensuring the client library remains synchronized with the API.

🧠 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 PR adds a new capital service, apparently auto-generated from an OpenAPI specification. The changes are extensive, adding many new API clients and model types. My review focuses on several areas for improvement:

  • Robustness: The query parameter handling in some API methods is not robust and could lead to runtime errors.
  • Consistency and Maintainability: There are inconsistencies in the generated objectSerializer.ts and some model files contain commented-out code or empty namespaces that should be cleaned up.
  • Performance: The main CapitalAPI class creates new API instances on every access, which is inefficient.

I've provided specific comments and suggestions to address these points. Since the code is auto-generated, these changes might need to be applied to the generator templates.

Comment on lines +44 to +49
const hasDefinedQueryParams = accountHolderId;
if(hasDefinedQueryParams) {
if(!requestOptions) requestOptions = {};
if(!requestOptions.params) requestOptions.params = {};
if(accountHolderId) requestOptions.params["accountHolderId"] = accountHolderId;
}
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 logic for handling query parameters is not robust and could lead to runtime errors. It assumes requestOptions.params is an object that can be assigned properties to, but its type QueryString also allows for string, string[][], or URLSearchParams. If a caller provides requestOptions.params as one of these other types, this code would fail. Additionally, the logic is verbose and contains redundant checks (if(hasDefinedQueryParams) followed by if(accountHolderId)). A more robust and concise implementation is recommended.

Comment on lines +68 to +73
const hasDefinedQueryParams = counterpartyAccountHolderId;
if(hasDefinedQueryParams) {
if(!requestOptions) requestOptions = {};
if(!requestOptions.params) requestOptions.params = {};
if(counterpartyAccountHolderId) requestOptions.params["counterpartyAccountHolderId"] = counterpartyAccountHolderId;
}
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 logic for handling query parameters is not robust and could lead to runtime errors. It assumes requestOptions.params is an object that can be assigned properties to, but its type QueryString also allows for string, string[][], or URLSearchParams. If a caller provides requestOptions.params as one of these other types, this code would fail. Additionally, the logic is verbose and contains redundant checks (if(hasDefinedQueryParams) followed by if(counterpartyAccountHolderId)). A more robust and concise implementation is recommended.

Comment on lines +17 to +34
export default class CapitalAPI extends Service {

public constructor(client: Client) {
super(client);
}

public get GrantAccountsApi() {
return new GrantAccountsApi(this.client);
}

public get GrantOffersApi() {
return new GrantOffersApi(this.client);
}

public get GrantsApi() {
return new GrantsApi(this.client);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The API getters create a new instance of the respective API class every time they are accessed. This is inefficient, especially if an API is used multiple times. It's better to use lazy initialization to create and cache the instance on first access. This improves performance by avoiding repeated object creation.

export default class CapitalAPI extends Service {
    private _grantAccountsApi?: GrantAccountsApi;
    private _grantOffersApi?: GrantOffersApi;
    private _grantsApi?: GrantsApi;

    public constructor(client: Client) {
        super(client);
    }

    public get GrantAccountsApi(): GrantAccountsApi {
        return this._grantAccountsApi ?? (this._grantAccountsApi = new GrantAccountsApi(this.client));
    }

    public get GrantOffersApi(): GrantOffersApi {
        return this._grantOffersApi ?? (this._grantOffersApi = new GrantOffersApi(this.client));
    }

    public get GrantsApi(): GrantsApi {
        return this._grantsApi ?? (this._grantsApi = new GrantsApi(this.client));
    }
}

Comment on lines +55 to +57
public constructor() {
super();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The constructor for this class is unnecessary as it only calls the parent constructor with no arguments, which is the default behavior. It can be removed for cleaner code.

Comment on lines +46 to +47
export namespace AdditionalBankIdentification {
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This empty namespace appears to be unused and adds unnecessary clutter to the code. It should be removed.

Comment on lines +55 to +57
public constructor() {
super();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The constructor for this class is unnecessary as it only calls the parent constructor with no arguments, which is the default behavior. It can be removed for cleaner code.

Comment on lines +55 to +57
public constructor() {
super();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The constructor for this class is unnecessary as it only calls the parent constructor with no arguments, which is the default behavior. It can be removed for cleaner code.

Comment on lines +55 to +57
public constructor() {
super();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The constructor for this class is unnecessary as it only calls the parent constructor with no arguments, which is the default behavior. It can be removed for cleaner code.

Comment on lines +63 to +65
public constructor() {
super();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The constructor for this class is unnecessary as it only calls the parent constructor with no arguments, which is the default behavior. It can be removed for cleaner code.

Comment on lines +68 to +69
export namespace USLocalAccountIdentification {
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This empty namespace appears to be unused and adds unnecessary clutter to the code. It should be removed.

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.

2 participants