-
Notifications
You must be signed in to change notification settings - Fork 113
[PlatformsAPIs] Code generation: update services and models #811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
9ce4f74
to
23b854d
Compare
There was a problem hiding this 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 throwingInvalidArgumentException
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
-
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. ↩
There was a problem hiding this 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.
if (!in_array($status, $allowedValues, true)) { | ||
error_log( | ||
sprintf( | ||
"status: unexpected enum value '%s' - Supported values are [%s]", | ||
$status, | ||
implode(', ', $allowedValues) | ||
) | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
)
);
}
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) | ||
) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
)
);
9202966
to
4aefe8b
Compare
3d30d90
to
fe1e775
Compare
2cf7a32
to
cb166d6
Compare
|
OpenAPI spec files or templates have been modified on 29-08-2025 by commit.