From 46dbe85a347b9d49fda9d3432de7759e7efec286 Mon Sep 17 00:00:00 2001 From: gcatanese Date: Mon, 8 Dec 2025 15:09:12 +0100 Subject: [PATCH 1/3] Generate BalanceWebhooks models --- .../adyen/model/balancewebhooks/Amount.java | 238 +++++++ ...anceAccountBalanceNotificationRequest.java | 81 +++ .../BalanceNotificationData.java | 103 +++ .../BalancePlatformNotificationResponse.java | 57 ++ .../BalanceWebhooksHandler.java | 24 + .../adyen/model/balancewebhooks/Balances.java | 81 +++ ...ReleaseBlockedBalanceNotificationData.java | 624 ++++++++++++++++++ ...asedBlockedBalanceNotificationRequest.java | 373 +++++++++++ .../balancewebhooks/ResourceReference.java | 270 ++++++++ 9 files changed, 1851 insertions(+) create mode 100644 src/main/java/com/adyen/model/balancewebhooks/Amount.java create mode 100644 src/main/java/com/adyen/model/balancewebhooks/ReleaseBlockedBalanceNotificationData.java create mode 100644 src/main/java/com/adyen/model/balancewebhooks/ReleasedBlockedBalanceNotificationRequest.java create mode 100644 src/main/java/com/adyen/model/balancewebhooks/ResourceReference.java diff --git a/src/main/java/com/adyen/model/balancewebhooks/Amount.java b/src/main/java/com/adyen/model/balancewebhooks/Amount.java new file mode 100644 index 000000000..be70619c6 --- /dev/null +++ b/src/main/java/com/adyen/model/balancewebhooks/Amount.java @@ -0,0 +1,238 @@ +/* + * Balance webhook + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balancewebhooks; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** Amount */ +@JsonPropertyOrder({Amount.JSON_PROPERTY_CURRENCY, Amount.JSON_PROPERTY_VALUE}) +public class Amount { + public static final String JSON_PROPERTY_CURRENCY = "currency"; + private String currency; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Long value; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Amount() {} + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. + * + * @param currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. + * @return the current {@code Amount} instance, allowing for method chaining + */ + public Amount currency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + return this; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. + * + * @return currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrency() { + return currency; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. + * + * @param currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + } + + /** + * The numeric value of the amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * + * @param value The numeric value of the amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * @return the current {@code Amount} instance, allowing for method chaining + */ + public Amount value(Long value) { + this.value = value; + isSetValue = true; // mark as set + return this; + } + + /** + * The numeric value of the amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * + * @return value The numeric value of the amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getValue() { + return value; + } + + /** + * The numeric value of the amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * + * @param value The numeric value of the amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(Long value) { + this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Amount includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Amount object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Amount amount = (Amount) o; + return Objects.equals(this.currency, amount.currency) + && Objects.equals(this.value, amount.value); + } + + @Override + public int hashCode() { + return Objects.hash(currency, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Amount {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Amount given an JSON string + * + * @param jsonString JSON string + * @return An instance of Amount + * @throws JsonProcessingException if the JSON string is invalid with respect to Amount + */ + public static Amount fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Amount.class); + } + + /** + * Convert an instance of Amount to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/balancewebhooks/BalanceAccountBalanceNotificationRequest.java b/src/main/java/com/adyen/model/balancewebhooks/BalanceAccountBalanceNotificationRequest.java index 7d2e5378e..38982ec41 100644 --- a/src/main/java/com/adyen/model/balancewebhooks/BalanceAccountBalanceNotificationRequest.java +++ b/src/main/java/com/adyen/model/balancewebhooks/BalanceAccountBalanceNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.balancewebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class BalanceAccountBalanceNotificationRequest { public static final String JSON_PROPERTY_DATA = "data"; private BalanceNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + /** Type of webhook. */ public enum TypeEnum { BALANCEPLATFORM_BALANCEACCOUNT_BALANCE_UPDATED( @@ -82,6 +93,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceAccountBalanceNotificationRequest() {} /** @@ -93,6 +113,7 @@ public BalanceAccountBalanceNotificationRequest() {} */ public BalanceAccountBalanceNotificationRequest data(BalanceNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -116,6 +137,7 @@ public BalanceNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(BalanceNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -128,6 +150,7 @@ public void setData(BalanceNotificationData data) { */ public BalanceAccountBalanceNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -153,6 +176,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -164,6 +188,7 @@ public void setEnvironment(String environment) { */ public BalanceAccountBalanceNotificationRequest timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set return this; } @@ -187,6 +212,7 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set } /** @@ -198,6 +224,7 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public BalanceAccountBalanceNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -221,6 +248,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceAccountBalanceNotificationRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalanceAccountBalanceNotificationRequest object is equal to o. */ @@ -267,6 +315,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceAccountBalanceNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balancewebhooks/BalanceNotificationData.java b/src/main/java/com/adyen/model/balancewebhooks/BalanceNotificationData.java index 61f6bab65..9ad45631c 100644 --- a/src/main/java/com/adyen/model/balancewebhooks/BalanceNotificationData.java +++ b/src/main/java/com/adyen/model/balancewebhooks/BalanceNotificationData.java @@ -11,7 +11,9 @@ package com.adyen.model.balancewebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,24 +37,51 @@ public class BalanceNotificationData { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_BALANCES = "balances"; private Balances balances; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalances = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_SETTING_IDS = "settingIds"; private List settingIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSettingIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceNotificationData() {} @JsonCreator @@ -69,6 +98,7 @@ public BalanceNotificationData(@JsonProperty(JSON_PROPERTY_ID) String id) { */ public BalanceNotificationData balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -92,6 +122,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -102,6 +133,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public BalanceNotificationData balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -125,6 +157,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -135,6 +168,7 @@ public void setBalancePlatform(String balancePlatform) { */ public BalanceNotificationData balances(Balances balances) { this.balances = balances; + isSetBalances = true; // mark as set return this; } @@ -158,6 +192,7 @@ public Balances getBalances() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalances(Balances balances) { this.balances = balances; + isSetBalances = true; // mark as set } /** @@ -170,6 +205,7 @@ public void setBalances(Balances balances) { */ public BalanceNotificationData creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -197,6 +233,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -209,6 +246,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public BalanceNotificationData currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -236,6 +274,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -257,6 +296,7 @@ public String getId() { */ public BalanceNotificationData settingIds(List settingIds) { this.settingIds = settingIds; + isSetSettingIds = true; // mark as set return this; } @@ -288,6 +328,27 @@ public List getSettingIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSettingIds(List settingIds) { this.settingIds = settingIds; + isSetSettingIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceNotificationData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalanceNotificationData object is equal to o. */ @@ -340,6 +401,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetBalances) { + addIfNull(nulls, JSON_PROPERTY_BALANCES, this.balances); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetSettingIds) { + addIfNull(nulls, JSON_PROPERTY_SETTING_IDS, this.settingIds); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceNotificationData given an JSON string * diff --git a/src/main/java/com/adyen/model/balancewebhooks/BalancePlatformNotificationResponse.java b/src/main/java/com/adyen/model/balancewebhooks/BalancePlatformNotificationResponse.java index 535426b80..06d647dca 100644 --- a/src/main/java/com/adyen/model/balancewebhooks/BalancePlatformNotificationResponse.java +++ b/src/main/java/com/adyen/model/balancewebhooks/BalancePlatformNotificationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balancewebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class BalancePlatformNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalancePlatformNotificationResponse() {} /** @@ -36,6 +47,7 @@ public BalancePlatformNotificationResponse() {} */ public BalancePlatformNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalancePlatformNotificationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalancePlatformNotificationResponse object is equal to o. */ @@ -106,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalancePlatformNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balancewebhooks/BalanceWebhooksHandler.java b/src/main/java/com/adyen/model/balancewebhooks/BalanceWebhooksHandler.java index eedb9fc25..da61aa0d2 100644 --- a/src/main/java/com/adyen/model/balancewebhooks/BalanceWebhooksHandler.java +++ b/src/main/java/com/adyen/model/balancewebhooks/BalanceWebhooksHandler.java @@ -58,6 +58,30 @@ public BalanceWebhooksHandler(String payload) { return Optional.empty(); } + /** + * Attempts to deserialize the webhook payload into a ReleasedBlockedBalanceNotificationRequest + * + * @return an Optional containing the deserialized object, or empty if deserialization fails + */ + public Optional + getReleasedBlockedBalanceNotificationRequest() { + + var optionalReleasedBlockedBalanceNotificationRequest = + getOptionalField(ReleasedBlockedBalanceNotificationRequest.class); + + if (optionalReleasedBlockedBalanceNotificationRequest.isPresent()) { + // verify event type + for (var value : ReleasedBlockedBalanceNotificationRequest.TypeEnum.values()) { + if (value.equals(optionalReleasedBlockedBalanceNotificationRequest.get().getType())) { + // found matching event type + return optionalReleasedBlockedBalanceNotificationRequest; + } + } + } + + return Optional.empty(); + } + /** * Deserializes the payload into the specified class type. * diff --git a/src/main/java/com/adyen/model/balancewebhooks/Balances.java b/src/main/java/com/adyen/model/balancewebhooks/Balances.java index 4ea9ac6e9..0bf5e2327 100644 --- a/src/main/java/com/adyen/model/balancewebhooks/Balances.java +++ b/src/main/java/com/adyen/model/balancewebhooks/Balances.java @@ -11,6 +11,8 @@ package com.adyen.model.balancewebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class Balances { public static final String JSON_PROPERTY_AVAILABLE = "available"; private Long available; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAvailable = false; + public static final String JSON_PROPERTY_BALANCE = "balance"; private Long balance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalance = false; + public static final String JSON_PROPERTY_PENDING = "pending"; private Long pending; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPending = false; + public static final String JSON_PROPERTY_RESERVED = "reserved"; private Long reserved; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReserved = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Balances() {} /** @@ -47,6 +67,7 @@ public Balances() {} */ public Balances available(Long available) { this.available = available; + isSetAvailable = true; // mark as set return this; } @@ -70,6 +91,7 @@ public Long getAvailable() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAvailable(Long available) { this.available = available; + isSetAvailable = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setAvailable(Long available) { */ public Balances balance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set return this; } @@ -103,6 +126,7 @@ public Long getBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setBalance(Long balance) { */ public Balances pending(Long pending) { this.pending = pending; + isSetPending = true; // mark as set return this; } @@ -136,6 +161,7 @@ public Long getPending() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPending(Long pending) { this.pending = pending; + isSetPending = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setPending(Long pending) { */ public Balances reserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set return this; } @@ -169,6 +196,27 @@ public Long getReserved() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Balances includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Balances object is equal to o. */ @@ -214,6 +262,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAvailable) { + addIfNull(nulls, JSON_PROPERTY_AVAILABLE, this.available); + } + if (isSetBalance) { + addIfNull(nulls, JSON_PROPERTY_BALANCE, this.balance); + } + if (isSetPending) { + addIfNull(nulls, JSON_PROPERTY_PENDING, this.pending); + } + if (isSetReserved) { + addIfNull(nulls, JSON_PROPERTY_RESERVED, this.reserved); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Balances given an JSON string * diff --git a/src/main/java/com/adyen/model/balancewebhooks/ReleaseBlockedBalanceNotificationData.java b/src/main/java/com/adyen/model/balancewebhooks/ReleaseBlockedBalanceNotificationData.java new file mode 100644 index 000000000..2e1715f5d --- /dev/null +++ b/src/main/java/com/adyen/model/balancewebhooks/ReleaseBlockedBalanceNotificationData.java @@ -0,0 +1,624 @@ +/* + * Balance webhook + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balancewebhooks; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.time.OffsetDateTime; +import java.util.*; + +/** ReleaseBlockedBalanceNotificationData */ +@JsonPropertyOrder({ + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_ACCOUNT_HOLDER, + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_AMOUNT, + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_BALANCE_ACCOUNT, + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_BALANCE_PLATFORM, + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_BATCH_REFERENCE, + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_BLOCKED_BALANCE_AFTER, + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_BLOCKED_BALANCE_BEFORE, + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_CREATION_DATE, + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_ID, + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_VALUE_DATE +}) +public class ReleaseBlockedBalanceNotificationData { + public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; + private ResourceReference accountHolder; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + + public static final String JSON_PROPERTY_AMOUNT = "amount"; + private Amount amount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + public static final String JSON_PROPERTY_BALANCE_ACCOUNT = "balanceAccount"; + private ResourceReference balanceAccount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccount = false; + + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; + private String balancePlatform; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + + public static final String JSON_PROPERTY_BATCH_REFERENCE = "batchReference"; + private String batchReference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBatchReference = false; + + public static final String JSON_PROPERTY_BLOCKED_BALANCE_AFTER = "blockedBalanceAfter"; + private Amount blockedBalanceAfter; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBlockedBalanceAfter = false; + + public static final String JSON_PROPERTY_BLOCKED_BALANCE_BEFORE = "blockedBalanceBefore"; + private Amount blockedBalanceBefore; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBlockedBalanceBefore = false; + + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; + private OffsetDateTime creationDate; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + public static final String JSON_PROPERTY_VALUE_DATE = "valueDate"; + private OffsetDateTime valueDate; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValueDate = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ReleaseBlockedBalanceNotificationData() {} + + @JsonCreator + public ReleaseBlockedBalanceNotificationData(@JsonProperty(JSON_PROPERTY_ID) String id) { + this(); + this.id = id; + } + + /** + * accountHolder + * + * @param accountHolder + * @return the current {@code ReleaseBlockedBalanceNotificationData} instance, allowing for method + * chaining + */ + public ReleaseBlockedBalanceNotificationData accountHolder(ResourceReference accountHolder) { + this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set + return this; + } + + /** + * Get accountHolder + * + * @return accountHolder + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ResourceReference getAccountHolder() { + return accountHolder; + } + + /** + * accountHolder + * + * @param accountHolder + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountHolder(ResourceReference accountHolder) { + this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set + } + + /** + * amount + * + * @param amount + * @return the current {@code ReleaseBlockedBalanceNotificationData} instance, allowing for method + * chaining + */ + public ReleaseBlockedBalanceNotificationData amount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + return this; + } + + /** + * Get amount + * + * @return amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getAmount() { + return amount; + } + + /** + * amount + * + * @param amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * balanceAccount + * + * @param balanceAccount + * @return the current {@code ReleaseBlockedBalanceNotificationData} instance, allowing for method + * chaining + */ + public ReleaseBlockedBalanceNotificationData balanceAccount(ResourceReference balanceAccount) { + this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set + return this; + } + + /** + * Get balanceAccount + * + * @return balanceAccount + */ + @JsonProperty(JSON_PROPERTY_BALANCE_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ResourceReference getBalanceAccount() { + return balanceAccount; + } + + /** + * balanceAccount + * + * @param balanceAccount + */ + @JsonProperty(JSON_PROPERTY_BALANCE_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalanceAccount(ResourceReference balanceAccount) { + this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set + } + + /** + * The unique identifier of the balance platform. + * + * @param balancePlatform The unique identifier of the balance platform. + * @return the current {@code ReleaseBlockedBalanceNotificationData} instance, allowing for method + * chaining + */ + public ReleaseBlockedBalanceNotificationData balancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set + return this; + } + + /** + * The unique identifier of the balance platform. + * + * @return balancePlatform The unique identifier of the balance platform. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_PLATFORM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBalancePlatform() { + return balancePlatform; + } + + /** + * The unique identifier of the balance platform. + * + * @param balancePlatform The unique identifier of the balance platform. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_PLATFORM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set + } + + /** + * The reference of the batch that was released. + * + * @param batchReference The reference of the batch that was released. + * @return the current {@code ReleaseBlockedBalanceNotificationData} instance, allowing for method + * chaining + */ + public ReleaseBlockedBalanceNotificationData batchReference(String batchReference) { + this.batchReference = batchReference; + isSetBatchReference = true; // mark as set + return this; + } + + /** + * The reference of the batch that was released. + * + * @return batchReference The reference of the batch that was released. + */ + @JsonProperty(JSON_PROPERTY_BATCH_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBatchReference() { + return batchReference; + } + + /** + * The reference of the batch that was released. + * + * @param batchReference The reference of the batch that was released. + */ + @JsonProperty(JSON_PROPERTY_BATCH_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBatchReference(String batchReference) { + this.batchReference = batchReference; + isSetBatchReference = true; // mark as set + } + + /** + * blockedBalanceAfter + * + * @param blockedBalanceAfter + * @return the current {@code ReleaseBlockedBalanceNotificationData} instance, allowing for method + * chaining + */ + public ReleaseBlockedBalanceNotificationData blockedBalanceAfter(Amount blockedBalanceAfter) { + this.blockedBalanceAfter = blockedBalanceAfter; + isSetBlockedBalanceAfter = true; // mark as set + return this; + } + + /** + * Get blockedBalanceAfter + * + * @return blockedBalanceAfter + */ + @JsonProperty(JSON_PROPERTY_BLOCKED_BALANCE_AFTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getBlockedBalanceAfter() { + return blockedBalanceAfter; + } + + /** + * blockedBalanceAfter + * + * @param blockedBalanceAfter + */ + @JsonProperty(JSON_PROPERTY_BLOCKED_BALANCE_AFTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlockedBalanceAfter(Amount blockedBalanceAfter) { + this.blockedBalanceAfter = blockedBalanceAfter; + isSetBlockedBalanceAfter = true; // mark as set + } + + /** + * blockedBalanceBefore + * + * @param blockedBalanceBefore + * @return the current {@code ReleaseBlockedBalanceNotificationData} instance, allowing for method + * chaining + */ + public ReleaseBlockedBalanceNotificationData blockedBalanceBefore(Amount blockedBalanceBefore) { + this.blockedBalanceBefore = blockedBalanceBefore; + isSetBlockedBalanceBefore = true; // mark as set + return this; + } + + /** + * Get blockedBalanceBefore + * + * @return blockedBalanceBefore + */ + @JsonProperty(JSON_PROPERTY_BLOCKED_BALANCE_BEFORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getBlockedBalanceBefore() { + return blockedBalanceBefore; + } + + /** + * blockedBalanceBefore + * + * @param blockedBalanceBefore + */ + @JsonProperty(JSON_PROPERTY_BLOCKED_BALANCE_BEFORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlockedBalanceBefore(Amount blockedBalanceBefore) { + this.blockedBalanceBefore = blockedBalanceBefore; + isSetBlockedBalanceBefore = true; // mark as set + } + + /** + * The date and time when the event was triggered, in ISO 8601 extended format. For example, + * **2025-03-19T10:15:30+01:00**. + * + * @param creationDate The date and time when the event was triggered, in ISO 8601 extended + * format. For example, **2025-03-19T10:15:30+01:00**. + * @return the current {@code ReleaseBlockedBalanceNotificationData} instance, allowing for method + * chaining + */ + public ReleaseBlockedBalanceNotificationData creationDate(OffsetDateTime creationDate) { + this.creationDate = creationDate; + isSetCreationDate = true; // mark as set + return this; + } + + /** + * The date and time when the event was triggered, in ISO 8601 extended format. For example, + * **2025-03-19T10:15:30+01:00**. + * + * @return creationDate The date and time when the event was triggered, in ISO 8601 extended + * format. For example, **2025-03-19T10:15:30+01:00**. + */ + @JsonProperty(JSON_PROPERTY_CREATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreationDate() { + return creationDate; + } + + /** + * The date and time when the event was triggered, in ISO 8601 extended format. For example, + * **2025-03-19T10:15:30+01:00**. + * + * @param creationDate The date and time when the event was triggered, in ISO 8601 extended + * format. For example, **2025-03-19T10:15:30+01:00**. + */ + @JsonProperty(JSON_PROPERTY_CREATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreationDate(OffsetDateTime creationDate) { + this.creationDate = creationDate; + isSetCreationDate = true; // mark as set + } + + /** + * The ID of the resource. + * + * @return id The ID of the resource. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The date and time when the amount was released, in ISO 8601 extended format. For example, + * **2025-03-19T10:15:30+01:00**. + * + * @param valueDate The date and time when the amount was released, in ISO 8601 extended format. + * For example, **2025-03-19T10:15:30+01:00**. + * @return the current {@code ReleaseBlockedBalanceNotificationData} instance, allowing for method + * chaining + */ + public ReleaseBlockedBalanceNotificationData valueDate(OffsetDateTime valueDate) { + this.valueDate = valueDate; + isSetValueDate = true; // mark as set + return this; + } + + /** + * The date and time when the amount was released, in ISO 8601 extended format. For example, + * **2025-03-19T10:15:30+01:00**. + * + * @return valueDate The date and time when the amount was released, in ISO 8601 extended format. + * For example, **2025-03-19T10:15:30+01:00**. + */ + @JsonProperty(JSON_PROPERTY_VALUE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getValueDate() { + return valueDate; + } + + /** + * The date and time when the amount was released, in ISO 8601 extended format. For example, + * **2025-03-19T10:15:30+01:00**. + * + * @param valueDate The date and time when the amount was released, in ISO 8601 extended format. + * For example, **2025-03-19T10:15:30+01:00**. + */ + @JsonProperty(JSON_PROPERTY_VALUE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValueDate(OffsetDateTime valueDate) { + this.valueDate = valueDate; + isSetValueDate = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ReleaseBlockedBalanceNotificationData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this ReleaseBlockedBalanceNotificationData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReleaseBlockedBalanceNotificationData releaseBlockedBalanceNotificationData = + (ReleaseBlockedBalanceNotificationData) o; + return Objects.equals(this.accountHolder, releaseBlockedBalanceNotificationData.accountHolder) + && Objects.equals(this.amount, releaseBlockedBalanceNotificationData.amount) + && Objects.equals(this.balanceAccount, releaseBlockedBalanceNotificationData.balanceAccount) + && Objects.equals( + this.balancePlatform, releaseBlockedBalanceNotificationData.balancePlatform) + && Objects.equals(this.batchReference, releaseBlockedBalanceNotificationData.batchReference) + && Objects.equals( + this.blockedBalanceAfter, releaseBlockedBalanceNotificationData.blockedBalanceAfter) + && Objects.equals( + this.blockedBalanceBefore, releaseBlockedBalanceNotificationData.blockedBalanceBefore) + && Objects.equals(this.creationDate, releaseBlockedBalanceNotificationData.creationDate) + && Objects.equals(this.id, releaseBlockedBalanceNotificationData.id) + && Objects.equals(this.valueDate, releaseBlockedBalanceNotificationData.valueDate); + } + + @Override + public int hashCode() { + return Objects.hash( + accountHolder, + amount, + balanceAccount, + balancePlatform, + batchReference, + blockedBalanceAfter, + blockedBalanceBefore, + creationDate, + id, + valueDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReleaseBlockedBalanceNotificationData {\n"); + sb.append(" accountHolder: ").append(toIndentedString(accountHolder)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" balanceAccount: ").append(toIndentedString(balanceAccount)).append("\n"); + sb.append(" balancePlatform: ").append(toIndentedString(balancePlatform)).append("\n"); + sb.append(" batchReference: ").append(toIndentedString(batchReference)).append("\n"); + sb.append(" blockedBalanceAfter: ") + .append(toIndentedString(blockedBalanceAfter)) + .append("\n"); + sb.append(" blockedBalanceBefore: ") + .append(toIndentedString(blockedBalanceBefore)) + .append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" valueDate: ").append(toIndentedString(valueDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBalanceAccount) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT, this.balanceAccount); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetBatchReference) { + addIfNull(nulls, JSON_PROPERTY_BATCH_REFERENCE, this.batchReference); + } + if (isSetBlockedBalanceAfter) { + addIfNull(nulls, JSON_PROPERTY_BLOCKED_BALANCE_AFTER, this.blockedBalanceAfter); + } + if (isSetBlockedBalanceBefore) { + addIfNull(nulls, JSON_PROPERTY_BLOCKED_BALANCE_BEFORE, this.blockedBalanceBefore); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetValueDate) { + addIfNull(nulls, JSON_PROPERTY_VALUE_DATE, this.valueDate); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of ReleaseBlockedBalanceNotificationData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReleaseBlockedBalanceNotificationData + * @throws JsonProcessingException if the JSON string is invalid with respect to + * ReleaseBlockedBalanceNotificationData + */ + public static ReleaseBlockedBalanceNotificationData fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ReleaseBlockedBalanceNotificationData.class); + } + + /** + * Convert an instance of ReleaseBlockedBalanceNotificationData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/balancewebhooks/ReleasedBlockedBalanceNotificationRequest.java b/src/main/java/com/adyen/model/balancewebhooks/ReleasedBlockedBalanceNotificationRequest.java new file mode 100644 index 000000000..007a279dc --- /dev/null +++ b/src/main/java/com/adyen/model/balancewebhooks/ReleasedBlockedBalanceNotificationRequest.java @@ -0,0 +1,373 @@ +/* + * Balance webhook + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balancewebhooks; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.time.OffsetDateTime; +import java.util.*; +import java.util.Arrays; +import java.util.logging.Logger; + +/** ReleasedBlockedBalanceNotificationRequest */ +@JsonPropertyOrder({ + ReleasedBlockedBalanceNotificationRequest.JSON_PROPERTY_DATA, + ReleasedBlockedBalanceNotificationRequest.JSON_PROPERTY_ENVIRONMENT, + ReleasedBlockedBalanceNotificationRequest.JSON_PROPERTY_TIMESTAMP, + ReleasedBlockedBalanceNotificationRequest.JSON_PROPERTY_TYPE +}) +public class ReleasedBlockedBalanceNotificationRequest { + public static final String JSON_PROPERTY_DATA = "data"; + private ReleaseBlockedBalanceNotificationData data; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; + private String environment; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; + private OffsetDateTime timestamp; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + + /** Type of webhook. */ + public enum TypeEnum { + BALANCEPLATFORM_BALANCEACCOUNT_BALANCE_BLOCK_RELEASED( + String.valueOf("balancePlatform.balanceAccount.balance.block.released")); + + private static final Logger LOG = Logger.getLogger(TypeEnum.class.getName()); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "TypeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(TypeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ReleasedBlockedBalanceNotificationRequest() {} + + /** + * data + * + * @param data + * @return the current {@code ReleasedBlockedBalanceNotificationRequest} instance, allowing for + * method chaining + */ + public ReleasedBlockedBalanceNotificationRequest data( + ReleaseBlockedBalanceNotificationData data) { + this.data = data; + isSetData = true; // mark as set + return this; + } + + /** + * Get data + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ReleaseBlockedBalanceNotificationData getData() { + return data; + } + + /** + * data + * + * @param data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(ReleaseBlockedBalanceNotificationData data) { + this.data = data; + isSetData = true; // mark as set + } + + /** + * The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @param environment The environment from which the webhook originated. Possible values: + * **test**, **live**. + * @return the current {@code ReleasedBlockedBalanceNotificationRequest} instance, allowing for + * method chaining + */ + public ReleasedBlockedBalanceNotificationRequest environment(String environment) { + this.environment = environment; + isSetEnvironment = true; // mark as set + return this; + } + + /** + * The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @return environment The environment from which the webhook originated. Possible values: + * **test**, **live**. + */ + @JsonProperty(JSON_PROPERTY_ENVIRONMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEnvironment() { + return environment; + } + + /** + * The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @param environment The environment from which the webhook originated. Possible values: + * **test**, **live**. + */ + @JsonProperty(JSON_PROPERTY_ENVIRONMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnvironment(String environment) { + this.environment = environment; + isSetEnvironment = true; // mark as set + } + + /** + * When the event was queued. + * + * @param timestamp When the event was queued. + * @return the current {@code ReleasedBlockedBalanceNotificationRequest} instance, allowing for + * method chaining + */ + public ReleasedBlockedBalanceNotificationRequest timestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + isSetTimestamp = true; // mark as set + return this; + } + + /** + * When the event was queued. + * + * @return timestamp When the event was queued. + */ + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getTimestamp() { + return timestamp; + } + + /** + * When the event was queued. + * + * @param timestamp When the event was queued. + */ + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + isSetTimestamp = true; // mark as set + } + + /** + * Type of webhook. + * + * @param type Type of webhook. + * @return the current {@code ReleasedBlockedBalanceNotificationRequest} instance, allowing for + * method chaining + */ + public ReleasedBlockedBalanceNotificationRequest type(TypeEnum type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * Type of webhook. + * + * @return type Type of webhook. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TypeEnum getType() { + return type; + } + + /** + * Type of webhook. + * + * @param type Type of webhook. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ReleasedBlockedBalanceNotificationRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this ReleasedBlockedBalanceNotificationRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReleasedBlockedBalanceNotificationRequest releasedBlockedBalanceNotificationRequest = + (ReleasedBlockedBalanceNotificationRequest) o; + return Objects.equals(this.data, releasedBlockedBalanceNotificationRequest.data) + && Objects.equals(this.environment, releasedBlockedBalanceNotificationRequest.environment) + && Objects.equals(this.timestamp, releasedBlockedBalanceNotificationRequest.timestamp) + && Objects.equals(this.type, releasedBlockedBalanceNotificationRequest.type); + } + + @Override + public int hashCode() { + return Objects.hash(data, environment, timestamp, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReleasedBlockedBalanceNotificationRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of ReleasedBlockedBalanceNotificationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReleasedBlockedBalanceNotificationRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * ReleasedBlockedBalanceNotificationRequest + */ + public static ReleasedBlockedBalanceNotificationRequest fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ReleasedBlockedBalanceNotificationRequest.class); + } + + /** + * Convert an instance of ReleasedBlockedBalanceNotificationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/balancewebhooks/ResourceReference.java b/src/main/java/com/adyen/model/balancewebhooks/ResourceReference.java new file mode 100644 index 000000000..699e5c78e --- /dev/null +++ b/src/main/java/com/adyen/model/balancewebhooks/ResourceReference.java @@ -0,0 +1,270 @@ +/* + * Balance webhook + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balancewebhooks; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** ResourceReference */ +@JsonPropertyOrder({ + ResourceReference.JSON_PROPERTY_DESCRIPTION, + ResourceReference.JSON_PROPERTY_ID, + ResourceReference.JSON_PROPERTY_REFERENCE +}) +public class ResourceReference { + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + public static final String JSON_PROPERTY_REFERENCE = "reference"; + private String reference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ResourceReference() {} + + /** + * The description of the resource. + * + * @param description The description of the resource. + * @return the current {@code ResourceReference} instance, allowing for method chaining + */ + public ResourceReference description(String description) { + this.description = description; + isSetDescription = true; // mark as set + return this; + } + + /** + * The description of the resource. + * + * @return description The description of the resource. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + /** + * The description of the resource. + * + * @param description The description of the resource. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + isSetDescription = true; // mark as set + } + + /** + * The unique identifier of the resource. + * + * @param id The unique identifier of the resource. + * @return the current {@code ResourceReference} instance, allowing for method chaining + */ + public ResourceReference id(String id) { + this.id = id; + isSetId = true; // mark as set + return this; + } + + /** + * The unique identifier of the resource. + * + * @return id The unique identifier of the resource. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The unique identifier of the resource. + * + * @param id The unique identifier of the resource. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + isSetId = true; // mark as set + } + + /** + * The reference for the resource. + * + * @param reference The reference for the resource. + * @return the current {@code ResourceReference} instance, allowing for method chaining + */ + public ResourceReference reference(String reference) { + this.reference = reference; + isSetReference = true; // mark as set + return this; + } + + /** + * The reference for the resource. + * + * @return reference The reference for the resource. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReference() { + return reference; + } + + /** + * The reference for the resource. + * + * @param reference The reference for the resource. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReference(String reference) { + this.reference = reference; + isSetReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResourceReference includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this ResourceReference object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResourceReference resourceReference = (ResourceReference) o; + return Objects.equals(this.description, resourceReference.description) + && Objects.equals(this.id, resourceReference.id) + && Objects.equals(this.reference, resourceReference.reference); + } + + @Override + public int hashCode() { + return Objects.hash(description, id, reference); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResourceReference {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of ResourceReference given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResourceReference + * @throws JsonProcessingException if the JSON string is invalid with respect to ResourceReference + */ + public static ResourceReference fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ResourceReference.class); + } + + /** + * Convert an instance of ResourceReference to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} From 36c1c6fc2a7f5c03d795905787d5f5c70d153100 Mon Sep 17 00:00:00 2001 From: gcatanese Date: Mon, 8 Dec 2025 15:09:33 +0100 Subject: [PATCH 2/3] Add test of new event --- .../webhooks/BalancePlatformWebhooksTest.java | 29 ++++++++++++++++ ...balanceAccount-balance-block-released.json | 33 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 src/test/resources/mocks/balancePlatform-webhooks/balancePlatform-balanceAccount-balance-block-released.json diff --git a/src/test/java/com/adyen/webhooks/BalancePlatformWebhooksTest.java b/src/test/java/com/adyen/webhooks/BalancePlatformWebhooksTest.java index 75bb8f435..1c0556442 100644 --- a/src/test/java/com/adyen/webhooks/BalancePlatformWebhooksTest.java +++ b/src/test/java/com/adyen/webhooks/BalancePlatformWebhooksTest.java @@ -8,6 +8,7 @@ import com.adyen.model.acswebhooks.RelayedAuthenticationRequest; import com.adyen.model.balancewebhooks.BalanceAccountBalanceNotificationRequest; import com.adyen.model.balancewebhooks.BalanceWebhooksHandler; +import com.adyen.model.balancewebhooks.ReleasedBlockedBalanceNotificationRequest; import com.adyen.model.configurationwebhooks.*; import com.adyen.model.disputewebhooks.DisputeNotificationRequest; import com.adyen.model.disputewebhooks.DisputeWebhooksHandler; @@ -328,6 +329,34 @@ public void testBalanceAccountBalanceNotificationRequest() { assertFalse(balanceAccountBalanceNotificationRequest.getData().getSettingIds().isEmpty()); } + @Test + public void testBalanceAccountBalanceBlockReleasedNotificationRequest() { + String json = + getFileContents( + "mocks/balancePlatform-webhooks/balancePlatform-balanceAccount-balance-block-released.json"); + + Optional + releasedBlockedBalanceNotificationRequestOptional = + new BalanceWebhooksHandler(json).getReleasedBlockedBalanceNotificationRequest(); + assertTrue(releasedBlockedBalanceNotificationRequestOptional.isPresent()); + + ReleasedBlockedBalanceNotificationRequest releasedBlockedBalanceNotificationRequest = + releasedBlockedBalanceNotificationRequestOptional.get(); + assertNotNull(releasedBlockedBalanceNotificationRequest.getData()); + + assertEquals( + ReleasedBlockedBalanceNotificationRequest.TypeEnum + .BALANCEPLATFORM_BALANCEACCOUNT_BALANCE_BLOCK_RELEASED, + releasedBlockedBalanceNotificationRequest.getType()); + assertEquals( + "BATCH_REF_20250925", + releasedBlockedBalanceNotificationRequest.getData().getBatchReference()); + assertNotNull(releasedBlockedBalanceNotificationRequest.getData().getBalanceAccount()); + assertEquals( + "BA00000000000000000001", + releasedBlockedBalanceNotificationRequest.getData().getBalanceAccount().getId()); + } + @Test public void testNetworkTokenCreatedNotificationRequest() { String json = diff --git a/src/test/resources/mocks/balancePlatform-webhooks/balancePlatform-balanceAccount-balance-block-released.json b/src/test/resources/mocks/balancePlatform-webhooks/balancePlatform-balanceAccount-balance-block-released.json new file mode 100644 index 000000000..0b41d8990 --- /dev/null +++ b/src/test/resources/mocks/balancePlatform-webhooks/balancePlatform-balanceAccount-balance-block-released.json @@ -0,0 +1,33 @@ +{ + "data": { + "accountHolder": { + "description": "Account holder for retail operations", + "id": "AH00000000000000000001", + "reference": "Store_001" + }, + "amount": { + "currency": "EUR", + "value": 25000 + }, + "balanceAccount": { + "description": "Main operating account", + "id": "BA00000000000000000001", + "reference": "OP_ACCT_MAIN" + }, + "balancePlatform": "YOUR_BALANCE_PLATFORM", + "batchReference": "BATCH_REF_20250925", + "blockedBalanceAfter": { + "currency": "EUR", + "value": -75000 + }, + "blockedBalanceBefore": { + "currency": "EUR", + "value": -100000 + }, + "creationDate": "2025-09-25T14:30:00Z", + "valueDate": "2025-09-25T14:35:00Z" + }, + "environment": "test", + "timestamp": "2025-09-25T14:35:00Z", + "type": "balancePlatform.balanceAccount.balance.block.released" +} \ No newline at end of file From b379579bbcadeba3367508044bac5a9a50787717 Mon Sep 17 00:00:00 2001 From: gcatanese Date: Wed, 10 Dec 2025 11:07:38 +0100 Subject: [PATCH 3/3] Regenerate models --- .../adyen/model/balancewebhooks/Amount.java | 65 --------- ...anceAccountBalanceNotificationRequest.java | 81 ----------- .../BalanceNotificationData.java | 103 -------------- .../BalancePlatformNotificationResponse.java | 57 -------- .../adyen/model/balancewebhooks/Balances.java | 81 ----------- ...ReleaseBlockedBalanceNotificationData.java | 127 ------------------ ...asedBlockedBalanceNotificationRequest.java | 81 ----------- .../balancewebhooks/ResourceReference.java | 73 ---------- 8 files changed, 668 deletions(-) diff --git a/src/main/java/com/adyen/model/balancewebhooks/Amount.java b/src/main/java/com/adyen/model/balancewebhooks/Amount.java index be70619c6..c18d98158 100644 --- a/src/main/java/com/adyen/model/balancewebhooks/Amount.java +++ b/src/main/java/com/adyen/model/balancewebhooks/Amount.java @@ -11,8 +11,6 @@ package com.adyen.model.balancewebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,21 +23,9 @@ public class Amount { public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetCurrency = false; - public static final String JSON_PROPERTY_VALUE = "value"; private Long value; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetValue = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public Amount() {} /** @@ -54,7 +40,6 @@ public Amount() {} */ public Amount currency(String currency) { this.currency = currency; - isSetCurrency = true; // mark as set return this; } @@ -86,7 +71,6 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; - isSetCurrency = true; // mark as set } /** @@ -99,7 +83,6 @@ public void setCurrency(String currency) { */ public Amount value(Long value) { this.value = value; - isSetValue = true; // mark as set return this; } @@ -127,27 +110,6 @@ public Long getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Long value) { this.value = value; - isSetValue = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public Amount includeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; - return this; - } - - /** Returns whether null values are explicitly serialized in the JSON payload. */ - public boolean isIncludeNullValues() { - return includeNullValues; - } - - /** - * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. - */ - public void setIncludeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; } /** Return true if this Amount object is equal to o. */ @@ -189,33 +151,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetCurrency) { - addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); - } - if (isSetValue) { - addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of Amount given an JSON string * diff --git a/src/main/java/com/adyen/model/balancewebhooks/BalanceAccountBalanceNotificationRequest.java b/src/main/java/com/adyen/model/balancewebhooks/BalanceAccountBalanceNotificationRequest.java index 38982ec41..7d2e5378e 100644 --- a/src/main/java/com/adyen/model/balancewebhooks/BalanceAccountBalanceNotificationRequest.java +++ b/src/main/java/com/adyen/model/balancewebhooks/BalanceAccountBalanceNotificationRequest.java @@ -11,9 +11,7 @@ package com.adyen.model.balancewebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,21 +33,12 @@ public class BalanceAccountBalanceNotificationRequest { public static final String JSON_PROPERTY_DATA = "data"; private BalanceNotificationData data; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetData = false; - public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetEnvironment = false; - public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetTimestamp = false; - /** Type of webhook. */ public enum TypeEnum { BALANCEPLATFORM_BALANCEACCOUNT_BALANCE_UPDATED( @@ -93,15 +82,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public BalanceAccountBalanceNotificationRequest() {} /** @@ -113,7 +93,6 @@ public BalanceAccountBalanceNotificationRequest() {} */ public BalanceAccountBalanceNotificationRequest data(BalanceNotificationData data) { this.data = data; - isSetData = true; // mark as set return this; } @@ -137,7 +116,6 @@ public BalanceNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(BalanceNotificationData data) { this.data = data; - isSetData = true; // mark as set } /** @@ -150,7 +128,6 @@ public void setData(BalanceNotificationData data) { */ public BalanceAccountBalanceNotificationRequest environment(String environment) { this.environment = environment; - isSetEnvironment = true; // mark as set return this; } @@ -176,7 +153,6 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; - isSetEnvironment = true; // mark as set } /** @@ -188,7 +164,6 @@ public void setEnvironment(String environment) { */ public BalanceAccountBalanceNotificationRequest timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; - isSetTimestamp = true; // mark as set return this; } @@ -212,7 +187,6 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; - isSetTimestamp = true; // mark as set } /** @@ -224,7 +198,6 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public BalanceAccountBalanceNotificationRequest type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -248,27 +221,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public BalanceAccountBalanceNotificationRequest includeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; - return this; - } - - /** Returns whether null values are explicitly serialized in the JSON payload. */ - public boolean isIncludeNullValues() { - return includeNullValues; - } - - /** - * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. - */ - public void setIncludeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; } /** Return true if this BalanceAccountBalanceNotificationRequest object is equal to o. */ @@ -315,39 +267,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetData) { - addIfNull(nulls, JSON_PROPERTY_DATA, this.data); - } - if (isSetEnvironment) { - addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); - } - if (isSetTimestamp) { - addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of BalanceAccountBalanceNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balancewebhooks/BalanceNotificationData.java b/src/main/java/com/adyen/model/balancewebhooks/BalanceNotificationData.java index 9ad45631c..61f6bab65 100644 --- a/src/main/java/com/adyen/model/balancewebhooks/BalanceNotificationData.java +++ b/src/main/java/com/adyen/model/balancewebhooks/BalanceNotificationData.java @@ -11,9 +11,7 @@ package com.adyen.model.balancewebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,51 +35,24 @@ public class BalanceNotificationData { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetBalanceAccountId = false; - public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetBalancePlatform = false; - public static final String JSON_PROPERTY_BALANCES = "balances"; private Balances balances; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetBalances = false; - public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetCreationDate = false; - public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetCurrency = false; - public static final String JSON_PROPERTY_ID = "id"; private String id; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetId = false; - public static final String JSON_PROPERTY_SETTING_IDS = "settingIds"; private List settingIds; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetSettingIds = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public BalanceNotificationData() {} @JsonCreator @@ -98,7 +69,6 @@ public BalanceNotificationData(@JsonProperty(JSON_PROPERTY_ID) String id) { */ public BalanceNotificationData balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; - isSetBalanceAccountId = true; // mark as set return this; } @@ -122,7 +92,6 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; - isSetBalanceAccountId = true; // mark as set } /** @@ -133,7 +102,6 @@ public void setBalanceAccountId(String balanceAccountId) { */ public BalanceNotificationData balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; - isSetBalancePlatform = true; // mark as set return this; } @@ -157,7 +125,6 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; - isSetBalancePlatform = true; // mark as set } /** @@ -168,7 +135,6 @@ public void setBalancePlatform(String balancePlatform) { */ public BalanceNotificationData balances(Balances balances) { this.balances = balances; - isSetBalances = true; // mark as set return this; } @@ -192,7 +158,6 @@ public Balances getBalances() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalances(Balances balances) { this.balances = balances; - isSetBalances = true; // mark as set } /** @@ -205,7 +170,6 @@ public void setBalances(Balances balances) { */ public BalanceNotificationData creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; - isSetCreationDate = true; // mark as set return this; } @@ -233,7 +197,6 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; - isSetCreationDate = true; // mark as set } /** @@ -246,7 +209,6 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public BalanceNotificationData currency(String currency) { this.currency = currency; - isSetCurrency = true; // mark as set return this; } @@ -274,7 +236,6 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; - isSetCurrency = true; // mark as set } /** @@ -296,7 +257,6 @@ public String getId() { */ public BalanceNotificationData settingIds(List settingIds) { this.settingIds = settingIds; - isSetSettingIds = true; // mark as set return this; } @@ -328,27 +288,6 @@ public List getSettingIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSettingIds(List settingIds) { this.settingIds = settingIds; - isSetSettingIds = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public BalanceNotificationData includeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; - return this; - } - - /** Returns whether null values are explicitly serialized in the JSON payload. */ - public boolean isIncludeNullValues() { - return includeNullValues; - } - - /** - * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. - */ - public void setIncludeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; } /** Return true if this BalanceNotificationData object is equal to o. */ @@ -401,48 +340,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetBalanceAccountId) { - addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); - } - if (isSetBalancePlatform) { - addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); - } - if (isSetBalances) { - addIfNull(nulls, JSON_PROPERTY_BALANCES, this.balances); - } - if (isSetCreationDate) { - addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); - } - if (isSetCurrency) { - addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); - } - if (isSetId) { - addIfNull(nulls, JSON_PROPERTY_ID, this.id); - } - if (isSetSettingIds) { - addIfNull(nulls, JSON_PROPERTY_SETTING_IDS, this.settingIds); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of BalanceNotificationData given an JSON string * diff --git a/src/main/java/com/adyen/model/balancewebhooks/BalancePlatformNotificationResponse.java b/src/main/java/com/adyen/model/balancewebhooks/BalancePlatformNotificationResponse.java index 06d647dca..535426b80 100644 --- a/src/main/java/com/adyen/model/balancewebhooks/BalancePlatformNotificationResponse.java +++ b/src/main/java/com/adyen/model/balancewebhooks/BalancePlatformNotificationResponse.java @@ -11,8 +11,6 @@ package com.adyen.model.balancewebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,15 +23,6 @@ public class BalancePlatformNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetNotificationResponse = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public BalancePlatformNotificationResponse() {} /** @@ -47,7 +36,6 @@ public BalancePlatformNotificationResponse() {} */ public BalancePlatformNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; - isSetNotificationResponse = true; // mark as set return this; } @@ -75,27 +63,6 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; - isSetNotificationResponse = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public BalancePlatformNotificationResponse includeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; - return this; - } - - /** Returns whether null values are explicitly serialized in the JSON payload. */ - public boolean isIncludeNullValues() { - return includeNullValues; - } - - /** - * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. - */ - public void setIncludeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; } /** Return true if this BalancePlatformNotificationResponse object is equal to o. */ @@ -139,30 +106,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetNotificationResponse) { - addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of BalancePlatformNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balancewebhooks/Balances.java b/src/main/java/com/adyen/model/balancewebhooks/Balances.java index 0bf5e2327..4ea9ac6e9 100644 --- a/src/main/java/com/adyen/model/balancewebhooks/Balances.java +++ b/src/main/java/com/adyen/model/balancewebhooks/Balances.java @@ -11,8 +11,6 @@ package com.adyen.model.balancewebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,33 +28,15 @@ public class Balances { public static final String JSON_PROPERTY_AVAILABLE = "available"; private Long available; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetAvailable = false; - public static final String JSON_PROPERTY_BALANCE = "balance"; private Long balance; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetBalance = false; - public static final String JSON_PROPERTY_PENDING = "pending"; private Long pending; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetPending = false; - public static final String JSON_PROPERTY_RESERVED = "reserved"; private Long reserved; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetReserved = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public Balances() {} /** @@ -67,7 +47,6 @@ public Balances() {} */ public Balances available(Long available) { this.available = available; - isSetAvailable = true; // mark as set return this; } @@ -91,7 +70,6 @@ public Long getAvailable() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAvailable(Long available) { this.available = available; - isSetAvailable = true; // mark as set } /** @@ -102,7 +80,6 @@ public void setAvailable(Long available) { */ public Balances balance(Long balance) { this.balance = balance; - isSetBalance = true; // mark as set return this; } @@ -126,7 +103,6 @@ public Long getBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalance(Long balance) { this.balance = balance; - isSetBalance = true; // mark as set } /** @@ -137,7 +113,6 @@ public void setBalance(Long balance) { */ public Balances pending(Long pending) { this.pending = pending; - isSetPending = true; // mark as set return this; } @@ -161,7 +136,6 @@ public Long getPending() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPending(Long pending) { this.pending = pending; - isSetPending = true; // mark as set } /** @@ -172,7 +146,6 @@ public void setPending(Long pending) { */ public Balances reserved(Long reserved) { this.reserved = reserved; - isSetReserved = true; // mark as set return this; } @@ -196,27 +169,6 @@ public Long getReserved() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReserved(Long reserved) { this.reserved = reserved; - isSetReserved = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public Balances includeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; - return this; - } - - /** Returns whether null values are explicitly serialized in the JSON payload. */ - public boolean isIncludeNullValues() { - return includeNullValues; - } - - /** - * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. - */ - public void setIncludeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; } /** Return true if this Balances object is equal to o. */ @@ -262,39 +214,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAvailable) { - addIfNull(nulls, JSON_PROPERTY_AVAILABLE, this.available); - } - if (isSetBalance) { - addIfNull(nulls, JSON_PROPERTY_BALANCE, this.balance); - } - if (isSetPending) { - addIfNull(nulls, JSON_PROPERTY_PENDING, this.pending); - } - if (isSetReserved) { - addIfNull(nulls, JSON_PROPERTY_RESERVED, this.reserved); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of Balances given an JSON string * diff --git a/src/main/java/com/adyen/model/balancewebhooks/ReleaseBlockedBalanceNotificationData.java b/src/main/java/com/adyen/model/balancewebhooks/ReleaseBlockedBalanceNotificationData.java index 2e1715f5d..1862a7806 100644 --- a/src/main/java/com/adyen/model/balancewebhooks/ReleaseBlockedBalanceNotificationData.java +++ b/src/main/java/com/adyen/model/balancewebhooks/ReleaseBlockedBalanceNotificationData.java @@ -11,9 +11,7 @@ package com.adyen.model.balancewebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -38,69 +36,33 @@ public class ReleaseBlockedBalanceNotificationData { public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; private ResourceReference accountHolder; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetAccountHolder = false; - public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetAmount = false; - public static final String JSON_PROPERTY_BALANCE_ACCOUNT = "balanceAccount"; private ResourceReference balanceAccount; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetBalanceAccount = false; - public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetBalancePlatform = false; - public static final String JSON_PROPERTY_BATCH_REFERENCE = "batchReference"; private String batchReference; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetBatchReference = false; - public static final String JSON_PROPERTY_BLOCKED_BALANCE_AFTER = "blockedBalanceAfter"; private Amount blockedBalanceAfter; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetBlockedBalanceAfter = false; - public static final String JSON_PROPERTY_BLOCKED_BALANCE_BEFORE = "blockedBalanceBefore"; private Amount blockedBalanceBefore; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetBlockedBalanceBefore = false; - public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetCreationDate = false; - public static final String JSON_PROPERTY_ID = "id"; private String id; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetId = false; - public static final String JSON_PROPERTY_VALUE_DATE = "valueDate"; private OffsetDateTime valueDate; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetValueDate = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public ReleaseBlockedBalanceNotificationData() {} @JsonCreator @@ -118,7 +80,6 @@ public ReleaseBlockedBalanceNotificationData(@JsonProperty(JSON_PROPERTY_ID) Str */ public ReleaseBlockedBalanceNotificationData accountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; - isSetAccountHolder = true; // mark as set return this; } @@ -142,7 +103,6 @@ public ResourceReference getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; - isSetAccountHolder = true; // mark as set } /** @@ -154,7 +114,6 @@ public void setAccountHolder(ResourceReference accountHolder) { */ public ReleaseBlockedBalanceNotificationData amount(Amount amount) { this.amount = amount; - isSetAmount = true; // mark as set return this; } @@ -178,7 +137,6 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; - isSetAmount = true; // mark as set } /** @@ -190,7 +148,6 @@ public void setAmount(Amount amount) { */ public ReleaseBlockedBalanceNotificationData balanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; - isSetBalanceAccount = true; // mark as set return this; } @@ -214,7 +171,6 @@ public ResourceReference getBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; - isSetBalanceAccount = true; // mark as set } /** @@ -226,7 +182,6 @@ public void setBalanceAccount(ResourceReference balanceAccount) { */ public ReleaseBlockedBalanceNotificationData balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; - isSetBalancePlatform = true; // mark as set return this; } @@ -250,7 +205,6 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; - isSetBalancePlatform = true; // mark as set } /** @@ -262,7 +216,6 @@ public void setBalancePlatform(String balancePlatform) { */ public ReleaseBlockedBalanceNotificationData batchReference(String batchReference) { this.batchReference = batchReference; - isSetBatchReference = true; // mark as set return this; } @@ -286,7 +239,6 @@ public String getBatchReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBatchReference(String batchReference) { this.batchReference = batchReference; - isSetBatchReference = true; // mark as set } /** @@ -298,7 +250,6 @@ public void setBatchReference(String batchReference) { */ public ReleaseBlockedBalanceNotificationData blockedBalanceAfter(Amount blockedBalanceAfter) { this.blockedBalanceAfter = blockedBalanceAfter; - isSetBlockedBalanceAfter = true; // mark as set return this; } @@ -322,7 +273,6 @@ public Amount getBlockedBalanceAfter() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBlockedBalanceAfter(Amount blockedBalanceAfter) { this.blockedBalanceAfter = blockedBalanceAfter; - isSetBlockedBalanceAfter = true; // mark as set } /** @@ -334,7 +284,6 @@ public void setBlockedBalanceAfter(Amount blockedBalanceAfter) { */ public ReleaseBlockedBalanceNotificationData blockedBalanceBefore(Amount blockedBalanceBefore) { this.blockedBalanceBefore = blockedBalanceBefore; - isSetBlockedBalanceBefore = true; // mark as set return this; } @@ -358,7 +307,6 @@ public Amount getBlockedBalanceBefore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBlockedBalanceBefore(Amount blockedBalanceBefore) { this.blockedBalanceBefore = blockedBalanceBefore; - isSetBlockedBalanceBefore = true; // mark as set } /** @@ -372,7 +320,6 @@ public void setBlockedBalanceBefore(Amount blockedBalanceBefore) { */ public ReleaseBlockedBalanceNotificationData creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; - isSetCreationDate = true; // mark as set return this; } @@ -400,7 +347,6 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; - isSetCreationDate = true; // mark as set } /** @@ -425,7 +371,6 @@ public String getId() { */ public ReleaseBlockedBalanceNotificationData valueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; - isSetValueDate = true; // mark as set return this; } @@ -453,27 +398,6 @@ public OffsetDateTime getValueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; - isSetValueDate = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public ReleaseBlockedBalanceNotificationData includeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; - return this; - } - - /** Returns whether null values are explicitly serialized in the JSON payload. */ - public boolean isIncludeNullValues() { - return includeNullValues; - } - - /** - * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. - */ - public void setIncludeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; } /** Return true if this ReleaseBlockedBalanceNotificationData object is equal to o. */ @@ -549,57 +473,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetAccountHolder) { - addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); - } - if (isSetAmount) { - addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); - } - if (isSetBalanceAccount) { - addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT, this.balanceAccount); - } - if (isSetBalancePlatform) { - addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); - } - if (isSetBatchReference) { - addIfNull(nulls, JSON_PROPERTY_BATCH_REFERENCE, this.batchReference); - } - if (isSetBlockedBalanceAfter) { - addIfNull(nulls, JSON_PROPERTY_BLOCKED_BALANCE_AFTER, this.blockedBalanceAfter); - } - if (isSetBlockedBalanceBefore) { - addIfNull(nulls, JSON_PROPERTY_BLOCKED_BALANCE_BEFORE, this.blockedBalanceBefore); - } - if (isSetCreationDate) { - addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); - } - if (isSetId) { - addIfNull(nulls, JSON_PROPERTY_ID, this.id); - } - if (isSetValueDate) { - addIfNull(nulls, JSON_PROPERTY_VALUE_DATE, this.valueDate); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of ReleaseBlockedBalanceNotificationData given an JSON string * diff --git a/src/main/java/com/adyen/model/balancewebhooks/ReleasedBlockedBalanceNotificationRequest.java b/src/main/java/com/adyen/model/balancewebhooks/ReleasedBlockedBalanceNotificationRequest.java index 007a279dc..0a2b31ea3 100644 --- a/src/main/java/com/adyen/model/balancewebhooks/ReleasedBlockedBalanceNotificationRequest.java +++ b/src/main/java/com/adyen/model/balancewebhooks/ReleasedBlockedBalanceNotificationRequest.java @@ -11,9 +11,7 @@ package com.adyen.model.balancewebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,21 +33,12 @@ public class ReleasedBlockedBalanceNotificationRequest { public static final String JSON_PROPERTY_DATA = "data"; private ReleaseBlockedBalanceNotificationData data; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetData = false; - public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetEnvironment = false; - public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetTimestamp = false; - /** Type of webhook. */ public enum TypeEnum { BALANCEPLATFORM_BALANCEACCOUNT_BALANCE_BLOCK_RELEASED( @@ -93,15 +82,6 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetType = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public ReleasedBlockedBalanceNotificationRequest() {} /** @@ -114,7 +94,6 @@ public ReleasedBlockedBalanceNotificationRequest() {} public ReleasedBlockedBalanceNotificationRequest data( ReleaseBlockedBalanceNotificationData data) { this.data = data; - isSetData = true; // mark as set return this; } @@ -138,7 +117,6 @@ public ReleaseBlockedBalanceNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(ReleaseBlockedBalanceNotificationData data) { this.data = data; - isSetData = true; // mark as set } /** @@ -151,7 +129,6 @@ public void setData(ReleaseBlockedBalanceNotificationData data) { */ public ReleasedBlockedBalanceNotificationRequest environment(String environment) { this.environment = environment; - isSetEnvironment = true; // mark as set return this; } @@ -177,7 +154,6 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; - isSetEnvironment = true; // mark as set } /** @@ -189,7 +165,6 @@ public void setEnvironment(String environment) { */ public ReleasedBlockedBalanceNotificationRequest timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; - isSetTimestamp = true; // mark as set return this; } @@ -213,7 +188,6 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; - isSetTimestamp = true; // mark as set } /** @@ -225,7 +199,6 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public ReleasedBlockedBalanceNotificationRequest type(TypeEnum type) { this.type = type; - isSetType = true; // mark as set return this; } @@ -249,27 +222,6 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; - isSetType = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public ReleasedBlockedBalanceNotificationRequest includeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; - return this; - } - - /** Returns whether null values are explicitly serialized in the JSON payload. */ - public boolean isIncludeNullValues() { - return includeNullValues; - } - - /** - * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. - */ - public void setIncludeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; } /** Return true if this ReleasedBlockedBalanceNotificationRequest object is equal to o. */ @@ -316,39 +268,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetData) { - addIfNull(nulls, JSON_PROPERTY_DATA, this.data); - } - if (isSetEnvironment) { - addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); - } - if (isSetTimestamp) { - addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); - } - if (isSetType) { - addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of ReleasedBlockedBalanceNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balancewebhooks/ResourceReference.java b/src/main/java/com/adyen/model/balancewebhooks/ResourceReference.java index 699e5c78e..450849788 100644 --- a/src/main/java/com/adyen/model/balancewebhooks/ResourceReference.java +++ b/src/main/java/com/adyen/model/balancewebhooks/ResourceReference.java @@ -11,8 +11,6 @@ package com.adyen.model.balancewebhooks; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,27 +27,12 @@ public class ResourceReference { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetDescription = false; - public static final String JSON_PROPERTY_ID = "id"; private String id; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetId = false; - public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; - /** Mark when the attribute has been explicitly set. */ - private boolean isSetReference = false; - - /** - * Sets whether attributes with null values should be explicitly included in the JSON payload. - * Default is false. - */ - @JsonIgnore private boolean includeNullValues = false; - public ResourceReference() {} /** @@ -60,7 +43,6 @@ public ResourceReference() {} */ public ResourceReference description(String description) { this.description = description; - isSetDescription = true; // mark as set return this; } @@ -84,7 +66,6 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; - isSetDescription = true; // mark as set } /** @@ -95,7 +76,6 @@ public void setDescription(String description) { */ public ResourceReference id(String id) { this.id = id; - isSetId = true; // mark as set return this; } @@ -119,7 +99,6 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; - isSetId = true; // mark as set } /** @@ -130,7 +109,6 @@ public void setId(String id) { */ public ResourceReference reference(String reference) { this.reference = reference; - isSetReference = true; // mark as set return this; } @@ -154,27 +132,6 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; - isSetReference = true; // mark as set - } - - /** - * Configures whether null values are explicitly serialized in the JSON payload. Default is false. - */ - public ResourceReference includeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; - return this; - } - - /** Returns whether null values are explicitly serialized in the JSON payload. */ - public boolean isIncludeNullValues() { - return includeNullValues; - } - - /** - * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. - */ - public void setIncludeNullValues(boolean includeNullValues) { - this.includeNullValues = includeNullValues; } /** Return true if this ResourceReference object is equal to o. */ @@ -218,36 +175,6 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } - /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonAnyGetter - public Map getExplicitNulls() { - if (!this.includeNullValues) { - return Collections.emptyMap(); - } - - Map nulls = new HashMap<>(); - - if (isSetDescription) { - addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); - } - if (isSetId) { - addIfNull(nulls, JSON_PROPERTY_ID, this.id); - } - if (isSetReference) { - addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); - } - - return nulls; - } - - // add to map when value is null - private void addIfNull(Map map, String key, Object value) { - if (value == null) { - map.put(key, null); - } - } - /** * Create an instance of ResourceReference given an JSON string *