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 introduces a new set of API services under the 'Capital' domain, automatically generated to align with the latest adyen-openapi specification. It expands the client library's capabilities by providing structured access to grant accounts, grant offers, and comprehensive grant management functionalities, ensuring the SDK remains up-to-date with Adyen's Capital API.

Highlights

  • New Capital Service: Introduction of a new Capital service class to encapsulate various Capital-related API functionalities.
  • Grant Accounts API: Addition of GrantAccountsApi for programmatic access to grant account information.
  • Grant Offers API: Inclusion of GrantOffersApi to fetch available grant offers and their details.
  • Grants API: Implementation of GrantsApi to manage grants, including retrieving disbursements, listing grants, getting grant details, requesting new grants, and updating disbursement configurations.

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

@sonarqubecloud
Copy link

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 the new Capital service, with APIs for grant accounts, grant offers, and grants. The changes appear to be auto-generated. My review has identified a critical issue: the new 'Capital' service is not registered in the client, which will cause all its API calls to fail. This must be addressed for the service to be functional. Additionally, I've provided several suggestions to improve the generated code's quality, such as removing redundant code and simplifying endpoint construction for better readability and maintainability, and preventing potential bugs by making attributes read-only where appropriate.


DEFAULT_VERSION = 1
def initialize(client, version = DEFAULT_VERSION)
@service = 'Capital'
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 service name 'Capital' is not registered in Adyen::Client. All API calls for this service will fail with an ArgumentError because service_url_base in lib/adyen/client.rb does not handle this new service. Please add the 'Capital' service to the case statement in lib/adyen/client.rb to define its base URL.

#
# Do not edit the class manually.
class Capital
attr_accessor :service, :version
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 service and version attributes should be read-only to prevent accidental modification after initialization. Changing them could lead to inconsistent state, especially since the API client instances are memoized and won't be recreated with the new values. Consider using attr_reader instead.

    attr_reader :service, :version

#
# Do not edit the class manually.
class GrantAccountsApi < Service
attr_accessor :service, :version
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 attr_accessor for :service and :version is redundant because it's already defined in the parent Service class. This line can be removed for cleaner code.

Comment on lines +17 to +19
endpoint = '/grantAccounts/{id}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, id)
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 endpoint construction can be greatly simplified using Ruby's string interpolation. This improves readability and is more idiomatic.

      endpoint = "grantAccounts/#{id}"

#
# Do not edit the class manually.
class GrantOffersApi < Service
attr_accessor :service, :version
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 attr_accessor for :service and :version is redundant as it's inherited from the Service class. Removing it will make the code cleaner.

Comment on lines +17 to +19
endpoint = '/grantOffers'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint)
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 endpoint construction is unnecessarily complex. Since there are no path parameters, the gsub and format calls are redundant. The endpoint can be defined as a simple string.

      endpoint = 'grantOffers'

#
# Do not edit the class manually.
class GrantsApi < Service
attr_accessor :service, :version
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 attr_accessor is redundant as it is already defined in the parent Service class. It can be safely removed.

Comment on lines +47 to +49
endpoint = '/grants/{grantId}/disbursements/{disbursementId}'.gsub(/{.+?}/, '%s')
endpoint = endpoint.gsub(%r{^/}, '')
endpoint = format(endpoint, grant_id, disbursement_id)
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 endpoint construction can be simplified using Ruby's string interpolation for better readability and conciseness. This approach is more idiomatic for building strings with variables.

      endpoint = "grants/#{grant_id}/disbursements/#{disbursement_id}"

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