Skip to content

Conversation

AdyenAutomationBot
Copy link
Collaborator

@AdyenAutomationBot AdyenAutomationBot commented Aug 14, 2025

OpenAPI spec files or templates have been modified on 29-08-2025 by commit.

@AdyenAutomationBot AdyenAutomationBot force-pushed the sdk-automation/PlatformsAPIs branch from 9ce4f74 to 23b854d Compare August 14, 2025 23:05
@AdyenAutomationBot AdyenAutomationBot requested a review from a team as a code owner August 14, 2025 23:05
Copy link

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

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 is an automated code generation update for the Adyen Platforms APIs. It primarily focuses on expanding the Balance Platform API with new webhook management capabilities and introducing a brand new Session Authentication API for managing user sessions and resource access. Additionally, it includes minor updates to existing models and services, improving documentation and refining error handling mechanisms.

Highlights

  • New Balance Platform Webhook Functionality: This pull request introduces new models and services for managing balance webhook settings within the Balance Platform API. This includes defining conditions for triggering webhooks based on balance changes and specifying target resources for notifications.
  • Introduction of Session Authentication API: A completely new Session Authentication API has been integrated, providing models and services for creating authentication sessions, managing resources (account holders, legal entities, balance accounts, merchant accounts, payment instruments), and defining access policies.
  • Minor Model and Serialization Updates: Several existing models across Balance Platform, Data Protection, and Legal Entity Management APIs have received minor updates, primarily to PHPDoc comments, including deprecation notices and slight formatting adjustments. Some ObjectSerializer files also received minor code style improvements.
  • Refinement of Error Handling in Services: Error handling in various service methods has been adjusted to use error_log instead of throwing InvalidArgumentException for enum validation failures, providing a more graceful way to handle unexpected enum values.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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

@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 a number of new models and services, likely auto-generated from an updated OpenAPI specification. The changes are mostly additions of new files and minor cosmetic updates to existing ones. My main concern is a pattern of replacing InvalidArgumentException throws with error_log calls in model setters for enum properties. This can lead to objects being in an invalid state without developers being aware, potentially causing bugs. I've added comments with suggestions to revert to throwing exceptions for safer, fail-fast validation.

Comment on lines +428 to +436
if (!in_array($status, $allowedValues, true)) {
error_log(
sprintf(
"status: unexpected enum value '%s' - Supported values are [%s]",
$status,
implode(', ', $allowedValues)
)
);
}

Choose a reason for hiding this comment

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

high

Using error_log for invalid enum values can hide potential issues. The invalid value is still assigned to the property, which can lead to an object being in an invalid state. This might cause unexpected behavior later if the valid() method is not explicitly called to check the object's state. It would be safer to throw an \InvalidArgumentException to fail fast and prevent the use of invalid data. This pattern is present in many of the new and modified model files in this pull request.

        if (!in_array($status, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'status', must be one of '%s'",
                    $status,
                    implode(', ', $allowedValues)
                )
            );
        }

Comment on lines +324 to 330
error_log(
sprintf(
"Invalid value '%s' for 'result', must be one of '%s'",
"result: unexpected enum value '%s' - Supported values are [%s]",
$result,
implode("', '", $allowedValues)
implode(', ', $allowedValues)
)
);

Choose a reason for hiding this comment

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

high

Replacing throw new \InvalidArgumentException with error_log for invalid enum values can hide potential issues. The invalid value is still assigned to the property, which can lead to an object being in an invalid state. This might cause unexpected behavior later if the valid() method is not explicitly called to check the object's state. It would be safer to throw an exception to fail fast and prevent the use of invalid data.

            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'result', must be one of '%s'",
                    $result,
                    implode("', '", $allowedValues)
                )
            );

@AdyenAutomationBot AdyenAutomationBot force-pushed the sdk-automation/PlatformsAPIs branch 6 times, most recently from 9202966 to 4aefe8b Compare August 20, 2025 14:15
@AdyenAutomationBot AdyenAutomationBot force-pushed the sdk-automation/PlatformsAPIs branch 4 times, most recently from 3d30d90 to fe1e775 Compare August 29, 2025 13:14
@AdyenAutomationBot AdyenAutomationBot force-pushed the sdk-automation/PlatformsAPIs branch from 2cf7a32 to cb166d6 Compare August 29, 2025 16:29
Copy link

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