Skip to content

[transactionwebhooks] Code generation: update services and models#1782

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

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

Conversation

@AdyenAutomationBot
Copy link
Copy Markdown
Collaborator

This PR contains the automated changes for the transactionwebhooks 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:31
@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 updates the generated code for the transactionwebhooks service, primarily by reorganizing the package structure for all related model classes. It also introduces a new feature that provides more granular control over JSON serialization, specifically enabling the explicit inclusion of null values for properties. These changes reflect an automated update based on the latest OpenAPI specification.

Highlights

  • Package Renaming: All model classes and utility files within the transactionwebhooks service have been refactored, moving from the com.adyen.model.transactionwebhooks package to the more general com.adyen.model.java package.
  • Explicit Null Serialization: A new mechanism has been introduced across numerous model classes to allow for explicit serialization of null values in JSON payloads. This includes adding isSet boolean flags for each property, an includeNullValues flag, and getExplicitNulls methods to control how nulls are represented in the output JSON.
  • Removal of TransactionWebhooksHandler: The TransactionWebhooksHandler.java utility class, previously responsible for processing transaction webhooks, has been removed from the codebase.

🧠 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 package from com.adyen.model.transactionwebhooks to com.adyen.model.java.
  • src/main/java/com/adyen/model/java/Amount.java
    • Renamed package from com.adyen.model.transactionwebhooks to com.adyen.model.java.
    • Added isSetCurrency and isSetValue boolean flags to track if properties have been explicitly set.
    • Introduced includeNullValues flag and associated methods to control explicit null serialization.
    • Updated equals and hashCode methods to include new isSet flags.
    • Added getExplicitNulls and addIfNull methods for explicit null handling during JSON serialization.
  • src/main/java/com/adyen/model/java/BalancePlatformNotificationResponse.java
    • Renamed package from com.adyen.model.transactionwebhooks to com.adyen.model.java.
    • Added isSetNotificationResponse boolean flag to track if the property has been explicitly set.
    • Introduced includeNullValues flag and associated methods to control explicit null serialization.
    • Updated equals and hashCode methods to include new isSet flag.
    • Added getExplicitNulls and addIfNull methods for explicit null handling during JSON serialization.
  • src/main/java/com/adyen/model/java/BankCategoryData.java
    • Renamed package from com.adyen.model.transactionwebhooks to com.adyen.model.java.
    • Added isSetPriority and isSetType boolean flags to track if properties have been explicitly set.
    • Introduced includeNullValues flag and associated methods to control explicit null serialization.
    • Updated equals and hashCode methods to include new isSet flags.
    • Added getExplicitNulls and addIfNull methods for explicit null handling during JSON serialization.
  • src/main/java/com/adyen/model/java/InternalCategoryData.java
    • Renamed package from com.adyen.model.transactionwebhooks to com.adyen.model.java.
    • Added isSetModificationMerchantReference, isSetModificationPspReference, and isSetType boolean flags to track if properties have been explicitly set.
    • Introduced includeNullValues flag and associated methods to control explicit null serialization.
    • Updated equals and hashCode methods to include new isSet flags.
    • Added getExplicitNulls and addIfNull methods for explicit null handling during JSON serialization.
  • src/main/java/com/adyen/model/java/IssuedCard.java
    • Renamed package from com.adyen.model.transactionwebhooks to com.adyen.model.java.
    • Added isSetAuthorisationType, isSetPanEntryMode, isSetProcessingType, isSetRelayedAuthorisationData, isSetSchemeTraceId, isSetSchemeUniqueTransactionId, isSetThreeDSecure, isSetType, and isSetValidationFacts boolean flags to track if properties have been explicitly set.
    • Introduced includeNullValues flag and associated methods to control explicit null serialization.
    • Updated equals and hashCode methods to include new isSet flags.
    • Added getExplicitNulls and addIfNull methods for explicit null handling during JSON serialization.
  • src/main/java/com/adyen/model/java/PaymentInstrument.java
    • Renamed package from com.adyen.model.transactionwebhooks to com.adyen.model.java.
    • Added isSetDescription, isSetId, isSetReference, and isSetTokenType boolean flags to track if properties have been explicitly set.
    • Introduced includeNullValues flag and associated methods to control explicit null serialization.
    • Updated equals and hashCode methods to include new isSet flags.
    • Added getExplicitNulls and addIfNull methods for explicit null handling during JSON serialization.
  • src/main/java/com/adyen/model/java/PlatformPayment.java
    • Renamed package from com.adyen.model.transactionwebhooks to com.adyen.model.java.
    • Added isSetModificationMerchantReference, isSetModificationPspReference, isSetPaymentMerchantReference, isSetPlatformPaymentType, isSetPspPaymentReference, and isSetType boolean flags to track if properties have been explicitly set.
    • Introduced includeNullValues flag and associated methods to control explicit null serialization.
    • Updated equals and hashCode methods to include new isSet flags.
    • Added getExplicitNulls and addIfNull methods for explicit null handling during JSON serialization.
  • src/main/java/com/adyen/model/java/RelayedAuthorisationData.java
    • Renamed package from com.adyen.model.transactionwebhooks to com.adyen.model.java.
    • Added isSetMetadata and isSetReference boolean flags to track if properties have been explicitly set.
    • Introduced includeNullValues flag and associated methods to control explicit null serialization.
    • Updated equals and hashCode methods to include new isSet flags.
    • Added getExplicitNulls and addIfNull methods for explicit null handling during JSON serialization.
  • src/main/java/com/adyen/model/java/Resource.java
    • Renamed package from com.adyen.model.transactionwebhooks to com.adyen.model.java.
    • Added isSetBalancePlatform, isSetCreationDate, and isSetId boolean flags to track if properties have been explicitly set.
    • Introduced includeNullValues flag and associated methods to control explicit null serialization.
    • Updated equals and hashCode methods to include new isSet flags.
    • Added getExplicitNulls and addIfNull methods for explicit null handling during JSON serialization.
  • src/main/java/com/adyen/model/java/ResourceReference.java
    • Renamed package from com.adyen.model.transactionwebhooks to com.adyen.model.java.
    • Added isSetDescription, isSetId, and isSetReference boolean flags to track if properties have been explicitly set.
    • Introduced includeNullValues flag and associated methods to control explicit null serialization.
    • Updated equals and hashCode methods to include new isSet flags.
    • Added getExplicitNulls and addIfNull methods for explicit null handling during JSON serialization.
  • src/main/java/com/adyen/model/java/ThreeDSecure.java
    • Renamed package from com.adyen.model.transactionwebhooks to com.adyen.model.java.
    • Added isSetAcsTransactionId boolean flag to track if the property has been explicitly set.
    • Introduced includeNullValues flag and associated methods to control explicit null serialization.
    • Updated equals and hashCode methods to include new isSet flag.
    • Added getExplicitNulls and addIfNull methods for explicit null handling during JSON serialization.
  • src/main/java/com/adyen/model/java/Transaction.java
    • Renamed package from com.adyen.model.transactionwebhooks to com.adyen.model.java.
    • Added isSetAccountHolder, isSetAmount, isSetBalanceAccount, isSetBalancePlatform, isSetBookingDate, isSetCreationDate, isSetDescription, isSetId, isSetPaymentInstrument, isSetReferenceForBeneficiary, isSetStatus, isSetTransfer, and isSetValueDate boolean flags to track if properties have been explicitly set.
    • Introduced includeNullValues flag and associated methods to control explicit null serialization.
    • Updated equals and hashCode methods to include new isSet flags.
    • Added getExplicitNulls and addIfNull methods for explicit null handling during JSON serialization.
  • src/main/java/com/adyen/model/java/TransactionNotificationRequestV4.java
    • Renamed package from com.adyen.model.transactionwebhooks to com.adyen.model.java.
    • Added isSetData, isSetEnvironment, isSetTimestamp, and isSetType boolean flags to track if properties have been explicitly set.
    • Introduced includeNullValues flag and associated methods to control explicit null serialization.
    • Updated equals and hashCode methods to include new isSet flags.
    • Added getExplicitNulls and addIfNull methods for explicit null handling during JSON serialization.
  • src/main/java/com/adyen/model/java/TransferNotificationValidationFact.java
    • Renamed package from com.adyen.model.transactionwebhooks to com.adyen.model.java.
    • Added isSetResult and isSetType boolean flags to track if properties have been explicitly set.
    • Introduced includeNullValues flag and associated methods to control explicit null serialization.
    • Updated equals and hashCode methods to include new isSet flags.
    • Added getExplicitNulls and addIfNull methods for explicit null handling during JSON serialization.
  • src/main/java/com/adyen/model/java/TransferView.java
    • Renamed package from com.adyen.model.transactionwebhooks to com.adyen.model.java.
    • Added isSetCategoryData, isSetId, and isSetReference boolean flags to track if properties have been explicitly set.
    • Introduced includeNullValues flag and associated methods to control explicit null serialization.
    • Updated equals and hashCode methods to include new isSet flags.
    • Added getExplicitNulls and addIfNull methods for explicit null handling during JSON serialization.
  • src/main/java/com/adyen/model/java/TransferViewCategoryData.java
    • Renamed package from com.adyen.model.transactionwebhooks to com.adyen.model.java.
  • src/main/java/com/adyen/model/transactionwebhooks/JSON.java
    • Updated package declaration from com.adyen.model.transactionwebhooks to com.adyen.model.java.
  • src/main/java/com/adyen/model/transactionwebhooks/TransactionWebhooksHandler.java
    • Removed the file.
Activity
  • The pull request was opened by AdyenAutomationBot, indicating that these changes are a result of an automated code generation process.
  • The commit history reflects updates from the adyen-openapi source, suggesting synchronization with the latest API definitions.
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, updates the transaction webhook models. The main changes include renaming the package from com.adyen.model.transactionwebhooks to com.adyen.model.java, removing the TransactionWebhooksHandler class, and introducing a new mechanism across all model classes to support explicit null value serialization in JSON.

My review has identified two main points. Firstly, the PR introduces significant breaking changes by renaming packages and removing a public class. These changes should be clearly communicated in the PR description to inform users about the necessary migration steps. Secondly, the new implementation for explicit null serialization introduces a considerable amount of duplicated code across the model classes. I've suggested a refactoring approach using a common base class to improve maintainability.

*/

package com.adyen.model.transactionwebhooks;
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.

high

This PR introduces significant breaking changes:

  • The package for all model classes has been changed from com.adyen.model.transactionwebhooks to com.adyen.model.java.
  • The public class TransactionWebhooksHandler has been removed.

These changes will require users of the library to update their code. It would be very helpful to clearly document these breaking changes in the pull request description, along with guidance on how to migrate. For example, what is the new recommended way to handle transaction webhooks now that TransactionWebhooksHandler is gone?

Comment on lines +214 to +219
// add to map when value is null
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

This helper method addIfNull, along with the includeNullValues field and its associated methods (includeNullValues, isIncludeNullValues, setIncludeNullValues), are duplicated across multiple model classes in this PR. This introduces a lot of code duplication, making future maintenance harder.

Consider extracting this common functionality into a shared base class. This would centralize the logic for handling explicit null serialization, improving maintainability and reducing code redundancy. Since this code is auto-generated, this feedback is likely for the team maintaining the code generator.

For example, you could have a base class like this:

public abstract class AbstractAdyenModel {
    @JsonIgnore
    private boolean includeNullValues = false;

    // Using generics for a fluent interface in subclasses
    @SuppressWarnings("unchecked")
    public <T extends AbstractAdyenModel> T includeNullValues(boolean includeNullValues) {
        this.includeNullValues = includeNullValues;
        return (T) this;
    }

    public boolean isIncludeNullValues() {
        return includeNullValues;
    }

    public void setIncludeNullValues(boolean includeNullValues) {
        this.includeNullValues = includeNullValues;
    }

    protected void addIfNull(Map<String, Object> map, String key, Object value) {
        if (value == null) {
            map.put(key, null);
        }
    }

    @JsonInclude(JsonInclude.Include.ALWAYS)
    @JsonAnyGetter
    public abstract Map<String, Object> getExplicitNulls();
}

Then, model classes like Amount could extend AbstractAdyenModel and override getExplicitNulls().

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