[reportwebhooks] Code generation: update services and models#1792
[reportwebhooks] Code generation: update services and models#1792AdyenAutomationBot wants to merge 1 commit intomainfrom
Conversation
Summary of ChangesHello, 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 contains automated code generation updates for the Highlights
🧠 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. Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request, which appears to be auto-generated, primarily introduces support for explicit null serialization in several model classes. This is achieved by adding isSet... flags for each property and a mechanism to include null values in the JSON output when requested. Additionally, several model classes have been moved from the com.adyen.model.reportwebhooks package to a more generic com.adyen.model.java package, and the ReportWebhooksHandler has been removed.
My review has identified a critical issue where the JSON.java file's package is updated but the file itself is not moved, which will lead to a compilation failure. I have also provided feedback to improve maintainability by pointing out code duplication in the addIfNull helper method which could be refactored.
| @@ -1,4 +1,4 @@ | |||
| package com.adyen.model.reportwebhooks; | |||
| package com.adyen.model.java; | |||
There was a problem hiding this comment.
The package declaration has been changed to com.adyen.model.java, but the file itself was not moved to the corresponding directory (src/main/java/com/adyen/model/java/). This mismatch between the file path and the package declaration will cause a compilation error. This file should be moved to src/main/java/com/adyen/model/java/JSON.java.
| private void addIfNull(Map<String, Object> map, String key, Object value) { | ||
| if (value == null) { | ||
| map.put(key, null); | ||
| } | ||
| } |
There was a problem hiding this comment.
The addIfNull method is duplicated across several model classes (e.g., ReportNotificationData, ReportNotificationRequest, Resource, ResourceReference). To improve maintainability and adhere to the DRY (Don't Repeat Yourself) principle, consider extracting this method into a common utility class or a shared base class that these models could extend. Since this is auto-generated code, this might require a change in the code generation template.
This PR contains the automated changes for the
reportwebhooksservice.The commit history of this PR reflects the
adyen-openapicommits that have been applied.