Skip to content

[reportwebhooks] Code generation: update services and models#1792

Closed
AdyenAutomationBot wants to merge 1 commit intomainfrom
sdk-automation/reportwebhooks
Closed

[reportwebhooks] Code generation: update services and models#1792
AdyenAutomationBot wants to merge 1 commit intomainfrom
sdk-automation/reportwebhooks

Conversation

@AdyenAutomationBot
Copy link
Copy Markdown
Collaborator

This PR contains the automated changes for the reportwebhooks 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 March 9, 2026 13:32
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 reportwebhooks service. The primary focus is a significant refactoring of the package structure for model classes, moving them to a more generalized com.adyen.model.java namespace. Additionally, enhancements have been made to the JSON serialization process, enabling explicit inclusion of null values in the output, which offers greater flexibility in API data representation.

Highlights

  • Package Refactoring: All model classes and a utility class previously under com.adyen.model.reportwebhooks have been moved to a more generic com.adyen.model.java package.
  • Explicit Null Serialization: New logic has been introduced in several model classes to allow explicit serialization of null values in JSON payloads, providing more granular control over the generated JSON output.
  • Handler Removal: The ReportWebhooksHandler.java file, responsible for processing report webhooks, has been removed.

🧠 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
  • src/main/java/com/adyen/model/java/AbstractOpenApiSchema.java
    • Renamed file from src/main/java/com/adyen/model/reportwebhooks/AbstractOpenApiSchema.java.
    • Updated package declaration to com.adyen.model.java.
  • src/main/java/com/adyen/model/java/BalancePlatformNotificationResponse.java
    • Renamed file from src/main/java/com/adyen/model/reportwebhooks/BalancePlatformNotificationResponse.java.
    • Updated package declaration to com.adyen.model.java.
    • Added imports for JsonAnyGetter and JsonIgnore.
    • Introduced isSetNotificationResponse and includeNullValues fields to manage explicit null serialization.
    • Modified notificationResponse and setNotificationResponse methods to track if the property has been explicitly set.
    • Added includeNullValues setter and getter methods.
    • Updated equals and hashCode methods to include the new isSetNotificationResponse field.
    • Implemented getExplicitNulls and addIfNull methods for explicit null serialization.
  • src/main/java/com/adyen/model/java/ReportNotificationData.java
    • Renamed file from src/main/java/com/adyen/model/reportwebhooks/ReportNotificationData.java.
    • Updated package declaration to com.adyen.model.java.
    • Added imports for JsonAnyGetter and JsonIgnore.
    • Introduced isSetX boolean fields for all properties (e.g., isSetAccountHolder, isSetBalanceAccount) and an includeNullValues field.
    • Modified all property setters and builder methods to set their corresponding isSetX flag.
    • Added includeNullValues setter and getter methods.
    • Updated equals and hashCode methods to include all isSetX fields.
    • Implemented getExplicitNulls and addIfNull methods for explicit null serialization of all properties.
  • src/main/java/com/adyen/model/java/ReportNotificationRequest.java
    • Renamed file from src/main/java/com/adyen/model/reportwebhooks/ReportNotificationRequest.java.
    • Updated package declaration to com.adyen.model.java.
    • Added imports for JsonAnyGetter and JsonIgnore.
    • Introduced isSetX boolean fields for all properties (e.g., isSetData, isSetEnvironment) and an includeNullValues field.
    • Modified all property setters and builder methods to set their corresponding isSetX flag.
    • Added includeNullValues setter and getter methods.
    • Updated equals and hashCode methods to include all isSetX fields.
    • Implemented getExplicitNulls and addIfNull methods for explicit null serialization of all properties.
  • src/main/java/com/adyen/model/java/Resource.java
    • Renamed file from src/main/java/com/adyen/model/reportwebhooks/Resource.java.
    • Updated package declaration to com.adyen.model.java.
    • Added imports for JsonAnyGetter and JsonIgnore.
    • Introduced isSetX boolean fields for all properties (e.g., isSetBalancePlatform, isSetCreationDate) and an includeNullValues field.
    • Modified all property setters and builder methods to set their corresponding isSetX flag.
    • Added includeNullValues setter and getter methods.
    • Updated equals and hashCode methods to include all isSetX fields.
    • Implemented getExplicitNulls and addIfNull methods for explicit null serialization of all properties.
  • src/main/java/com/adyen/model/java/ResourceReference.java
    • Renamed file from src/main/java/com/adyen/model/reportwebhooks/ResourceReference.java.
    • Updated package declaration to com.adyen.model.java.
    • Added imports for JsonAnyGetter and JsonIgnore.
    • Introduced isSetX boolean fields for all properties (e.g., isSetDescription, isSetId) and an includeNullValues field.
    • Modified all property setters and builder methods to set their corresponding isSetX flag.
    • Added includeNullValues setter and getter methods.
    • Updated equals and hashCode methods to include all isSetX fields.
    • Implemented getExplicitNulls and addIfNull methods for explicit null serialization of all properties.
  • src/main/java/com/adyen/model/reportwebhooks/JSON.java
    • Updated package declaration from com.adyen.model.reportwebhooks to com.adyen.model.java.
  • src/main/java/com/adyen/model/reportwebhooks/ReportWebhooksHandler.java
    • Removed file.
Activity
  • No specific activity has been recorded for this pull request yet.
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
Copy Markdown
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, 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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

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.

Comment on lines +163 to +167
private void addIfNull(Map<String, Object> map, String key, Object value) {
if (value == null) {
map.put(key, null);
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

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