diff --git a/src/main/java/com/adyen/model/acswebhooks/Amount.java b/src/main/java/com/adyen/model/acswebhooks/Amount.java index 1266aa4d6..d732861aa 100644 --- a/src/main/java/com/adyen/model/acswebhooks/Amount.java +++ b/src/main/java/com/adyen/model/acswebhooks/Amount.java @@ -30,10 +30,12 @@ public Amount() {} /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * 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). + * 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) { @@ -43,10 +45,12 @@ public Amount currency(String currency) { /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * 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). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -56,10 +60,12 @@ public String getCurrency() { /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * 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). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -68,10 +74,10 @@ public void setCurrency(String currency) { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @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 */ @@ -81,10 +87,10 @@ public Amount value(Long value) { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @return value The amount of the transaction, in [minor + * @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) @@ -94,10 +100,10 @@ public Long getValue() { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @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) diff --git a/src/main/java/com/adyen/model/balancecontrol/Amount.java b/src/main/java/com/adyen/model/balancecontrol/Amount.java index 076c43f80..2fedd397b 100644 --- a/src/main/java/com/adyen/model/balancecontrol/Amount.java +++ b/src/main/java/com/adyen/model/balancecontrol/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.balancecontrol; +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,9 +25,21 @@ 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() {} /** @@ -38,6 +52,7 @@ public Amount() {} */ public Amount currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -65,6 +80,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -77,6 +93,7 @@ public void setCurrency(String currency) { */ public Amount value(Long value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -104,6 +121,27 @@ 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. */ @@ -117,12 +155,14 @@ public boolean equals(Object o) { } Amount amount = (Amount) o; return Objects.equals(this.currency, amount.currency) - && Objects.equals(this.value, amount.value); + && Objects.equals(this.isSetCurrency, amount.isSetCurrency) + && Objects.equals(this.value, amount.value) + && Objects.equals(this.isSetValue, amount.isSetValue); } @Override public int hashCode() { - return Objects.hash(currency, value); + return Objects.hash(currency, isSetCurrency, value, isSetValue); } @Override @@ -145,6 +185,33 @@ 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/balancecontrol/BalanceTransferRequest.java b/src/main/java/com/adyen/model/balancecontrol/BalanceTransferRequest.java index a4b8feb0b..7f48b42b3 100644 --- a/src/main/java/com/adyen/model/balancecontrol/BalanceTransferRequest.java +++ b/src/main/java/com/adyen/model/balancecontrol/BalanceTransferRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.balancecontrol; +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; @@ -34,18 +36,33 @@ public class BalanceTransferRequest { 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_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_FROM_MERCHANT = "fromMerchant"; private String fromMerchant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFromMerchant = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_TO_MERCHANT = "toMerchant"; private String toMerchant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetToMerchant = false; + /** * The type of balance transfer. Possible values: **tax**, **fee**, **terminalSale**, **credit**, * **debit**, and **adjustment**. @@ -101,6 +118,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 BalanceTransferRequest() {} /** @@ -111,6 +137,7 @@ public BalanceTransferRequest() {} */ public BalanceTransferRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -134,6 +161,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -147,6 +175,7 @@ public void setAmount(Amount amount) { */ public BalanceTransferRequest description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -176,6 +205,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -187,6 +217,7 @@ public void setDescription(String description) { */ public BalanceTransferRequest fromMerchant(String fromMerchant) { this.fromMerchant = fromMerchant; + isSetFromMerchant = true; // mark as set return this; } @@ -212,6 +243,7 @@ public String getFromMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFromMerchant(String fromMerchant) { this.fromMerchant = fromMerchant; + isSetFromMerchant = true; // mark as set } /** @@ -224,6 +256,7 @@ public void setFromMerchant(String fromMerchant) { */ public BalanceTransferRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -251,6 +284,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -262,6 +296,7 @@ public void setReference(String reference) { */ public BalanceTransferRequest toMerchant(String toMerchant) { this.toMerchant = toMerchant; + isSetToMerchant = true; // mark as set return this; } @@ -287,6 +322,7 @@ public String getToMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setToMerchant(String toMerchant) { this.toMerchant = toMerchant; + isSetToMerchant = true; // mark as set } /** @@ -299,6 +335,7 @@ public void setToMerchant(String toMerchant) { */ public BalanceTransferRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -326,6 +363,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 BalanceTransferRequest 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 BalanceTransferRequest object is equal to o. */ @@ -339,16 +397,34 @@ public boolean equals(Object o) { } BalanceTransferRequest balanceTransferRequest = (BalanceTransferRequest) o; return Objects.equals(this.amount, balanceTransferRequest.amount) + && Objects.equals(this.isSetAmount, balanceTransferRequest.isSetAmount) && Objects.equals(this.description, balanceTransferRequest.description) + && Objects.equals(this.isSetDescription, balanceTransferRequest.isSetDescription) && Objects.equals(this.fromMerchant, balanceTransferRequest.fromMerchant) + && Objects.equals(this.isSetFromMerchant, balanceTransferRequest.isSetFromMerchant) && Objects.equals(this.reference, balanceTransferRequest.reference) + && Objects.equals(this.isSetReference, balanceTransferRequest.isSetReference) && Objects.equals(this.toMerchant, balanceTransferRequest.toMerchant) - && Objects.equals(this.type, balanceTransferRequest.type); + && Objects.equals(this.isSetToMerchant, balanceTransferRequest.isSetToMerchant) + && Objects.equals(this.type, balanceTransferRequest.type) + && Objects.equals(this.isSetType, balanceTransferRequest.isSetType); } @Override public int hashCode() { - return Objects.hash(amount, description, fromMerchant, reference, toMerchant, type); + return Objects.hash( + amount, + isSetAmount, + description, + isSetDescription, + fromMerchant, + isSetFromMerchant, + reference, + isSetReference, + toMerchant, + isSetToMerchant, + type, + isSetType); } @Override @@ -375,6 +451,45 @@ 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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetFromMerchant) { + addIfNull(nulls, JSON_PROPERTY_FROM_MERCHANT, this.fromMerchant); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetToMerchant) { + addIfNull(nulls, JSON_PROPERTY_TO_MERCHANT, this.toMerchant); + } + 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 BalanceTransferRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balancecontrol/BalanceTransferResponse.java b/src/main/java/com/adyen/model/balancecontrol/BalanceTransferResponse.java index e4922ef8a..417920aaf 100644 --- a/src/main/java/com/adyen/model/balancecontrol/BalanceTransferResponse.java +++ b/src/main/java/com/adyen/model/balancecontrol/BalanceTransferResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.balancecontrol; +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,21 +40,39 @@ public class BalanceTransferResponse { 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_CREATED_AT = "createdAt"; private OffsetDateTime createdAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreatedAt = false; + 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_FROM_MERCHANT = "fromMerchant"; private String fromMerchant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFromMerchant = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * The status of the balance transfer. Possible values: **transferred**, **failed**, **error**, * and **notEnoughBalance**. @@ -104,9 +124,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TO_MERCHANT = "toMerchant"; private String toMerchant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetToMerchant = false; + /** * The type of balance transfer. Possible values: **tax**, **fee**, **terminalSale**, **credit**, * **debit**, and **adjustment**. @@ -162,6 +188,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 BalanceTransferResponse() {} /** @@ -172,6 +207,7 @@ public BalanceTransferResponse() {} */ public BalanceTransferResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -195,6 +231,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -205,6 +242,7 @@ public void setAmount(Amount amount) { */ public BalanceTransferResponse createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -228,6 +266,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -241,6 +280,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public BalanceTransferResponse description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -270,6 +310,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -281,6 +322,7 @@ public void setDescription(String description) { */ public BalanceTransferResponse fromMerchant(String fromMerchant) { this.fromMerchant = fromMerchant; + isSetFromMerchant = true; // mark as set return this; } @@ -306,6 +348,7 @@ public String getFromMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFromMerchant(String fromMerchant) { this.fromMerchant = fromMerchant; + isSetFromMerchant = true; // mark as set } /** @@ -317,6 +360,7 @@ public void setFromMerchant(String fromMerchant) { */ public BalanceTransferResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -342,6 +386,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -354,6 +399,7 @@ public void setPspReference(String pspReference) { */ public BalanceTransferResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -381,6 +427,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -393,6 +440,7 @@ public void setReference(String reference) { */ public BalanceTransferResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -420,6 +468,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -431,6 +480,7 @@ public void setStatus(StatusEnum status) { */ public BalanceTransferResponse toMerchant(String toMerchant) { this.toMerchant = toMerchant; + isSetToMerchant = true; // mark as set return this; } @@ -456,6 +506,7 @@ public String getToMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setToMerchant(String toMerchant) { this.toMerchant = toMerchant; + isSetToMerchant = true; // mark as set } /** @@ -468,6 +519,7 @@ public void setToMerchant(String toMerchant) { */ public BalanceTransferResponse type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -495,6 +547,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 BalanceTransferResponse 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 BalanceTransferResponse object is equal to o. */ @@ -508,28 +581,46 @@ public boolean equals(Object o) { } BalanceTransferResponse balanceTransferResponse = (BalanceTransferResponse) o; return Objects.equals(this.amount, balanceTransferResponse.amount) + && Objects.equals(this.isSetAmount, balanceTransferResponse.isSetAmount) && Objects.equals(this.createdAt, balanceTransferResponse.createdAt) + && Objects.equals(this.isSetCreatedAt, balanceTransferResponse.isSetCreatedAt) && Objects.equals(this.description, balanceTransferResponse.description) + && Objects.equals(this.isSetDescription, balanceTransferResponse.isSetDescription) && Objects.equals(this.fromMerchant, balanceTransferResponse.fromMerchant) + && Objects.equals(this.isSetFromMerchant, balanceTransferResponse.isSetFromMerchant) && Objects.equals(this.pspReference, balanceTransferResponse.pspReference) + && Objects.equals(this.isSetPspReference, balanceTransferResponse.isSetPspReference) && Objects.equals(this.reference, balanceTransferResponse.reference) + && Objects.equals(this.isSetReference, balanceTransferResponse.isSetReference) && Objects.equals(this.status, balanceTransferResponse.status) + && Objects.equals(this.isSetStatus, balanceTransferResponse.isSetStatus) && Objects.equals(this.toMerchant, balanceTransferResponse.toMerchant) - && Objects.equals(this.type, balanceTransferResponse.type); + && Objects.equals(this.isSetToMerchant, balanceTransferResponse.isSetToMerchant) + && Objects.equals(this.type, balanceTransferResponse.type) + && Objects.equals(this.isSetType, balanceTransferResponse.isSetType); } @Override public int hashCode() { return Objects.hash( amount, + isSetAmount, createdAt, + isSetCreatedAt, description, + isSetDescription, fromMerchant, + isSetFromMerchant, pspReference, + isSetPspReference, reference, + isSetReference, status, + isSetStatus, toMerchant, - type); + isSetToMerchant, + type, + isSetType); } @Override @@ -559,6 +650,54 @@ 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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetFromMerchant) { + addIfNull(nulls, JSON_PROPERTY_FROM_MERCHANT, this.fromMerchant); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetToMerchant) { + addIfNull(nulls, JSON_PROPERTY_TO_MERCHANT, this.toMerchant); + } + 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 BalanceTransferResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Balance.java b/src/main/java/com/adyen/model/balanceplatform/Balance.java index f42dbb425..67f5f4e54 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Balance.java +++ b/src/main/java/com/adyen/model/balanceplatform/Balance.java @@ -25,7 +25,6 @@ Balance.JSON_PROPERTY_BALANCE, Balance.JSON_PROPERTY_CURRENCY, Balance.JSON_PROPERTY_PENDING, - Balance.JSON_PROPERTY_PENDING_AVAILABLE, Balance.JSON_PROPERTY_RESERVED }) public class Balance { @@ -53,12 +52,6 @@ public class Balance { /** Mark when the attribute has been explicitly set. */ private boolean isSetPending = false; - public static final String JSON_PROPERTY_PENDING_AVAILABLE = "pendingAvailable"; - private Long pendingAvailable; - - /** Mark when the attribute has been explicitly set. */ - private boolean isSetPendingAvailable = false; - public static final String JSON_PROPERTY_RESERVED = "reserved"; private Long reserved; @@ -219,35 +212,6 @@ public void setPending(Long pending) { isSetPending = true; // mark as set } - /** - * @param pendingAvailable - * @return the current {@code Balance} instance, allowing for method chaining - */ - public Balance pendingAvailable(Long pendingAvailable) { - this.pendingAvailable = pendingAvailable; - isSetPendingAvailable = true; // mark as set - return this; - } - - /** - * @return pendingAvailable - */ - @JsonProperty(JSON_PROPERTY_PENDING_AVAILABLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getPendingAvailable() { - return pendingAvailable; - } - - /** - * @param pendingAvailable - */ - @JsonProperty(JSON_PROPERTY_PENDING_AVAILABLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPendingAvailable(Long pendingAvailable) { - this.pendingAvailable = pendingAvailable; - isSetPendingAvailable = true; // mark as set - } - /** * The balance currently held in reserve. * @@ -321,8 +285,6 @@ public boolean equals(Object o) { && Objects.equals(this.isSetCurrency, balance.isSetCurrency) && Objects.equals(this.pending, balance.pending) && Objects.equals(this.isSetPending, balance.isSetPending) - && Objects.equals(this.pendingAvailable, balance.pendingAvailable) - && Objects.equals(this.isSetPendingAvailable, balance.isSetPendingAvailable) && Objects.equals(this.reserved, balance.reserved) && Objects.equals(this.isSetReserved, balance.isSetReserved); } @@ -338,8 +300,6 @@ public int hashCode() { isSetCurrency, pending, isSetPending, - pendingAvailable, - isSetPendingAvailable, reserved, isSetReserved); } @@ -352,7 +312,6 @@ public String toString() { sb.append(" balance: ").append(toIndentedString(balance)).append("\n"); sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); sb.append(" pending: ").append(toIndentedString(pending)).append("\n"); - sb.append(" pendingAvailable: ").append(toIndentedString(pendingAvailable)).append("\n"); sb.append(" reserved: ").append(toIndentedString(reserved)).append("\n"); sb.append("}"); return sb.toString(); @@ -390,9 +349,6 @@ public Map getExplicitNulls() { if (isSetPending) { addIfNull(nulls, JSON_PROPERTY_PENDING, this.pending); } - if (isSetPendingAvailable) { - addIfNull(nulls, JSON_PROPERTY_PENDING_AVAILABLE, this.pendingAvailable); - } if (isSetReserved) { addIfNull(nulls, JSON_PROPERTY_RESERVED, this.reserved); } diff --git a/src/main/java/com/adyen/model/configurationwebhooks/Amount.java b/src/main/java/com/adyen/model/configurationwebhooks/Amount.java index 706cfa8f0..35f0c4c76 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/Amount.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/Amount.java @@ -30,10 +30,12 @@ public Amount() {} /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * 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). + * 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) { @@ -43,10 +45,12 @@ public Amount currency(String currency) { /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * 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). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -56,10 +60,12 @@ public String getCurrency() { /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * 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). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -68,10 +74,10 @@ public void setCurrency(String currency) { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @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 */ @@ -81,10 +87,10 @@ public Amount value(Long value) { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @return value The amount of the transaction, in [minor + * @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) @@ -94,10 +100,10 @@ public Long getValue() { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @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) diff --git a/src/main/java/com/adyen/model/configurationwebhooks/BulkAddress.java b/src/main/java/com/adyen/model/configurationwebhooks/BulkAddress.java index d5892bebc..2c7962a33 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/BulkAddress.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/BulkAddress.java @@ -28,6 +28,7 @@ BulkAddress.JSON_PROPERTY_LINE2, BulkAddress.JSON_PROPERTY_LINE3, BulkAddress.JSON_PROPERTY_MOBILE, + BulkAddress.JSON_PROPERTY_NAME, BulkAddress.JSON_PROPERTY_POSTAL_CODE, BulkAddress.JSON_PROPERTY_STATE_OR_PROVINCE, BulkAddress.JSON_PROPERTY_STREET @@ -60,6 +61,9 @@ public class BulkAddress { public static final String JSON_PROPERTY_MOBILE = "mobile"; private String mobile; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; private String postalCode; @@ -377,6 +381,39 @@ public void setMobile(String mobile) { this.mobile = mobile; } + /** + * The recipient’s name (person or contact), for example ‘John Doe’. + * + * @param name The recipient’s name (person or contact), for example ‘John Doe’. + * @return the current {@code BulkAddress} instance, allowing for method chaining + */ + public BulkAddress name(String name) { + this.name = name; + return this; + } + + /** + * The recipient’s name (person or contact), for example ‘John Doe’. + * + * @return name The recipient’s name (person or contact), for example ‘John Doe’. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + /** + * The recipient’s name (person or contact), for example ‘John Doe’. + * + * @param name The recipient’s name (person or contact), for example ‘John Doe’. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + /** * The postal code. Maximum length: * 5 digits for addresses in the US. * 10 characters for all * other countries. @@ -507,6 +544,7 @@ public boolean equals(Object o) { && Objects.equals(this.line2, bulkAddress.line2) && Objects.equals(this.line3, bulkAddress.line3) && Objects.equals(this.mobile, bulkAddress.mobile) + && Objects.equals(this.name, bulkAddress.name) && Objects.equals(this.postalCode, bulkAddress.postalCode) && Objects.equals(this.stateOrProvince, bulkAddress.stateOrProvince) && Objects.equals(this.street, bulkAddress.street); @@ -524,6 +562,7 @@ public int hashCode() { line2, line3, mobile, + name, postalCode, stateOrProvince, street); @@ -542,6 +581,7 @@ public String toString() { sb.append(" line2: ").append(toIndentedString(line2)).append("\n"); sb.append(" line3: ").append(toIndentedString(line3)).append("\n"); sb.append(" mobile: ").append(toIndentedString(mobile)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n"); sb.append(" stateOrProvince: ").append(toIndentedString(stateOrProvince)).append("\n"); sb.append(" street: ").append(toIndentedString(street)).append("\n"); diff --git a/src/main/java/com/adyen/model/configurationwebhooks/CardConfiguration.java b/src/main/java/com/adyen/model/configurationwebhooks/CardConfiguration.java index dd2eeaa80..9f2b92731 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/CardConfiguration.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/CardConfiguration.java @@ -80,12 +80,12 @@ public class CardConfiguration { public CardConfiguration() {} /** - * Overrides the activation label design ID defined in the `configurationProfileId`. The - * activation label is attached to the card and contains the activation instructions. + * The activation label attached to the card that contains the activation instructions. This field + * overrides the activation label design ID defined in the card configuration profile. * - * @param activation Overrides the activation label design ID defined in the - * `configurationProfileId`. The activation label is attached to the card and - * contains the activation instructions. + * @param activation The activation label attached to the card that contains the activation + * instructions. This field overrides the activation label design ID defined in the card + * configuration profile. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration activation(String activation) { @@ -94,12 +94,12 @@ public CardConfiguration activation(String activation) { } /** - * Overrides the activation label design ID defined in the `configurationProfileId`. The - * activation label is attached to the card and contains the activation instructions. + * The activation label attached to the card that contains the activation instructions. This field + * overrides the activation label design ID defined in the card configuration profile. * - * @return activation Overrides the activation label design ID defined in the - * `configurationProfileId`. The activation label is attached to the card and - * contains the activation instructions. + * @return activation The activation label attached to the card that contains the activation + * instructions. This field overrides the activation label design ID defined in the card + * configuration profile. */ @JsonProperty(JSON_PROPERTY_ACTIVATION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -108,12 +108,12 @@ public String getActivation() { } /** - * Overrides the activation label design ID defined in the `configurationProfileId`. The - * activation label is attached to the card and contains the activation instructions. + * The activation label attached to the card that contains the activation instructions. This field + * overrides the activation label design ID defined in the card configuration profile. * - * @param activation Overrides the activation label design ID defined in the - * `configurationProfileId`. The activation label is attached to the card and - * contains the activation instructions. + * @param activation The activation label attached to the card that contains the activation + * instructions. This field overrides the activation label design ID defined in the card + * configuration profile. */ @JsonProperty(JSON_PROPERTY_ACTIVATION) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -206,9 +206,9 @@ public void setBulkAddress(BulkAddress bulkAddress) { } /** - * The ID of the card image. This is the image that will be printed on the full front of the card. + * The unique identifier of the card image. This image is printed on the full front of the card. * - * @param cardImageId The ID of the card image. This is the image that will be printed on the full + * @param cardImageId The unique identifier of the card image. This image is printed on the full * front of the card. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ @@ -218,10 +218,10 @@ public CardConfiguration cardImageId(String cardImageId) { } /** - * The ID of the card image. This is the image that will be printed on the full front of the card. + * The unique identifier of the card image. This image is printed on the full front of the card. * - * @return cardImageId The ID of the card image. This is the image that will be printed on the - * full front of the card. + * @return cardImageId The unique identifier of the card image. This image is printed on the full + * front of the card. */ @JsonProperty(JSON_PROPERTY_CARD_IMAGE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -230,9 +230,9 @@ public String getCardImageId() { } /** - * The ID of the card image. This is the image that will be printed on the full front of the card. + * The unique identifier of the card image. This image is printed on the full front of the card. * - * @param cardImageId The ID of the card image. This is the image that will be printed on the full + * @param cardImageId The unique identifier of the card image. This image is printed on the full * front of the card. */ @JsonProperty(JSON_PROPERTY_CARD_IMAGE_ID) @@ -242,12 +242,11 @@ public void setCardImageId(String cardImageId) { } /** - * Overrides the carrier design ID defined in the `configurationProfileId`. The carrier - * is the letter or packaging to which the card is attached. + * The letter or packaging to which the card is attached. This field overrides the carrier design + * ID defined in the card configuration profile. * - * @param carrier Overrides the carrier design ID defined in the - * `configurationProfileId`. The carrier is the letter or packaging to which the - * card is attached. + * @param carrier The letter or packaging to which the card is attached. This field overrides the + * carrier design ID defined in the card configuration profile. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration carrier(String carrier) { @@ -256,12 +255,11 @@ public CardConfiguration carrier(String carrier) { } /** - * Overrides the carrier design ID defined in the `configurationProfileId`. The carrier - * is the letter or packaging to which the card is attached. + * The letter or packaging to which the card is attached. This field overrides the carrier design + * ID defined in the card configuration profile. * - * @return carrier Overrides the carrier design ID defined in the - * `configurationProfileId`. The carrier is the letter or packaging to which the - * card is attached. + * @return carrier The letter or packaging to which the card is attached. This field overrides the + * carrier design ID defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_CARRIER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -270,12 +268,11 @@ public String getCarrier() { } /** - * Overrides the carrier design ID defined in the `configurationProfileId`. The carrier - * is the letter or packaging to which the card is attached. + * The letter or packaging to which the card is attached. This field overrides the carrier design + * ID defined in the card configuration profile. * - * @param carrier Overrides the carrier design ID defined in the - * `configurationProfileId`. The carrier is the letter or packaging to which the - * card is attached. + * @param carrier The letter or packaging to which the card is attached. This field overrides the + * carrier design ID defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_CARRIER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -284,10 +281,10 @@ public void setCarrier(String carrier) { } /** - * The ID of the carrier image. This is the image that will printed on the letter to which the + * The unique identifier of the carrier image. This image is printed on the letter to which the * card is attached. * - * @param carrierImageId The ID of the carrier image. This is the image that will printed on the + * @param carrierImageId The unique identifier of the carrier image. This image is printed on the * letter to which the card is attached. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ @@ -297,10 +294,10 @@ public CardConfiguration carrierImageId(String carrierImageId) { } /** - * The ID of the carrier image. This is the image that will printed on the letter to which the + * The unique identifier of the carrier image. This image is printed on the letter to which the * card is attached. * - * @return carrierImageId The ID of the carrier image. This is the image that will printed on the + * @return carrierImageId The unique identifier of the carrier image. This image is printed on the * letter to which the card is attached. */ @JsonProperty(JSON_PROPERTY_CARRIER_IMAGE_ID) @@ -310,10 +307,10 @@ public String getCarrierImageId() { } /** - * The ID of the carrier image. This is the image that will printed on the letter to which the + * The unique identifier of the carrier image. This image is printed on the letter to which the * card is attached. * - * @param carrierImageId The ID of the carrier image. This is the image that will printed on the + * @param carrierImageId The unique identifier of the carrier image. This image is printed on the * letter to which the card is attached. */ @JsonProperty(JSON_PROPERTY_CARRIER_IMAGE_ID) @@ -323,18 +320,19 @@ public void setCarrierImageId(String carrierImageId) { } /** - * The ID of the card configuration profile that contains the settings of the card. For example, - * the envelope and PIN mailer designs or the logistics company handling the shipment. All the - * settings in the profile are applied to the card, unless you provide other fields to override - * them. For example, send the `shipmentMethod` to override the logistics company - * defined in the card configuration profile. + * The unique identifier of the card configuration profile that contains the settings that are + * applied to the card. For example, the envelope and PIN mailer designs or the logistics company + * handling the shipment. You can override some of the existing settings in the configuration + * profile by providing the corresponding fields in the `configuration` object. For + * example, send the `shipmentMethod` to override the logistics company defined in the + * card configuration profile. * - * @param configurationProfileId The ID of the card configuration profile that contains the - * settings of the card. For example, the envelope and PIN mailer designs or the logistics - * company handling the shipment. All the settings in the profile are applied to the card, - * unless you provide other fields to override them. For example, send the - * `shipmentMethod` to override the logistics company defined in the card - * configuration profile. + * @param configurationProfileId The unique identifier of the card configuration profile that + * contains the settings that are applied to the card. For example, the envelope and PIN + * mailer designs or the logistics company handling the shipment. You can override some of the + * existing settings in the configuration profile by providing the corresponding fields in the + * `configuration` object. For example, send the `shipmentMethod` to + * override the logistics company defined in the card configuration profile. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration configurationProfileId(String configurationProfileId) { @@ -343,18 +341,19 @@ public CardConfiguration configurationProfileId(String configurationProfileId) { } /** - * The ID of the card configuration profile that contains the settings of the card. For example, - * the envelope and PIN mailer designs or the logistics company handling the shipment. All the - * settings in the profile are applied to the card, unless you provide other fields to override - * them. For example, send the `shipmentMethod` to override the logistics company - * defined in the card configuration profile. + * The unique identifier of the card configuration profile that contains the settings that are + * applied to the card. For example, the envelope and PIN mailer designs or the logistics company + * handling the shipment. You can override some of the existing settings in the configuration + * profile by providing the corresponding fields in the `configuration` object. For + * example, send the `shipmentMethod` to override the logistics company defined in the + * card configuration profile. * - * @return configurationProfileId The ID of the card configuration profile that contains the - * settings of the card. For example, the envelope and PIN mailer designs or the logistics - * company handling the shipment. All the settings in the profile are applied to the card, - * unless you provide other fields to override them. For example, send the - * `shipmentMethod` to override the logistics company defined in the card - * configuration profile. + * @return configurationProfileId The unique identifier of the card configuration profile that + * contains the settings that are applied to the card. For example, the envelope and PIN + * mailer designs or the logistics company handling the shipment. You can override some of the + * existing settings in the configuration profile by providing the corresponding fields in the + * `configuration` object. For example, send the `shipmentMethod` to + * override the logistics company defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_CONFIGURATION_PROFILE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -363,18 +362,19 @@ public String getConfigurationProfileId() { } /** - * The ID of the card configuration profile that contains the settings of the card. For example, - * the envelope and PIN mailer designs or the logistics company handling the shipment. All the - * settings in the profile are applied to the card, unless you provide other fields to override - * them. For example, send the `shipmentMethod` to override the logistics company - * defined in the card configuration profile. + * The unique identifier of the card configuration profile that contains the settings that are + * applied to the card. For example, the envelope and PIN mailer designs or the logistics company + * handling the shipment. You can override some of the existing settings in the configuration + * profile by providing the corresponding fields in the `configuration` object. For + * example, send the `shipmentMethod` to override the logistics company defined in the + * card configuration profile. * - * @param configurationProfileId The ID of the card configuration profile that contains the - * settings of the card. For example, the envelope and PIN mailer designs or the logistics - * company handling the shipment. All the settings in the profile are applied to the card, - * unless you provide other fields to override them. For example, send the - * `shipmentMethod` to override the logistics company defined in the card - * configuration profile. + * @param configurationProfileId The unique identifier of the card configuration profile that + * contains the settings that are applied to the card. For example, the envelope and PIN + * mailer designs or the logistics company handling the shipment. You can override some of the + * existing settings in the configuration profile by providing the corresponding fields in the + * `configuration` object. For example, send the `shipmentMethod` to + * override the logistics company defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_CONFIGURATION_PROFILE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -384,10 +384,12 @@ public void setConfigurationProfileId(String configurationProfileId) { /** * The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. - * For example, **EUR**. + * For example, **EUR**. This field overrides the existing currency setting on the card + * configuration profile. * * @param currency The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency - * code of the card. For example, **EUR**. + * code of the card. For example, **EUR**. This field overrides the existing currency setting + * on the card configuration profile. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration currency(String currency) { @@ -397,10 +399,12 @@ public CardConfiguration currency(String currency) { /** * The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. - * For example, **EUR**. + * For example, **EUR**. This field overrides the existing currency setting on the card + * configuration profile. * * @return currency The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency - * code of the card. For example, **EUR**. + * code of the card. For example, **EUR**. This field overrides the existing currency setting + * on the card configuration profile. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -410,10 +414,12 @@ public String getCurrency() { /** * The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. - * For example, **EUR**. + * For example, **EUR**. This field overrides the existing currency setting on the card + * configuration profile. * * @param currency The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency - * code of the card. For example, **EUR**. + * code of the card. For example, **EUR**. This field overrides the existing currency setting + * on the card configuration profile. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -422,10 +428,9 @@ public void setCurrency(String currency) { } /** - * Overrides the envelope design ID defined in the `configurationProfileId`. + * Overrides the envelope design ID defined in the card configuration profile. * - * @param envelope Overrides the envelope design ID defined in the - * `configurationProfileId`. + * @param envelope Overrides the envelope design ID defined in the card configuration profile. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration envelope(String envelope) { @@ -434,10 +439,9 @@ public CardConfiguration envelope(String envelope) { } /** - * Overrides the envelope design ID defined in the `configurationProfileId`. + * Overrides the envelope design ID defined in the card configuration profile. * - * @return envelope Overrides the envelope design ID defined in the - * `configurationProfileId`. + * @return envelope Overrides the envelope design ID defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_ENVELOPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -446,10 +450,9 @@ public String getEnvelope() { } /** - * Overrides the envelope design ID defined in the `configurationProfileId`. + * Overrides the envelope design ID defined in the card configuration profile. * - * @param envelope Overrides the envelope design ID defined in the - * `configurationProfileId`. + * @param envelope Overrides the envelope design ID defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_ENVELOPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -458,12 +461,12 @@ public void setEnvelope(String envelope) { } /** - * Overrides the insert design ID defined in the `configurationProfileId`. An insert is - * any additional material, such as marketing materials, that are shipped together with the card. + * Any additional material, such as marketing material, that is shipped together with the card. + * This field overrides the insert design ID defined in the card configuration profile. * - * @param insert Overrides the insert design ID defined in the `configurationProfileId`. - * An insert is any additional material, such as marketing materials, that are shipped - * together with the card. + * @param insert Any additional material, such as marketing material, that is shipped together + * with the card. This field overrides the insert design ID defined in the card configuration + * profile. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration insert(String insert) { @@ -472,12 +475,12 @@ public CardConfiguration insert(String insert) { } /** - * Overrides the insert design ID defined in the `configurationProfileId`. An insert is - * any additional material, such as marketing materials, that are shipped together with the card. + * Any additional material, such as marketing material, that is shipped together with the card. + * This field overrides the insert design ID defined in the card configuration profile. * - * @return insert Overrides the insert design ID defined in the - * `configurationProfileId`. An insert is any additional material, such as marketing - * materials, that are shipped together with the card. + * @return insert Any additional material, such as marketing material, that is shipped together + * with the card. This field overrides the insert design ID defined in the card configuration + * profile. */ @JsonProperty(JSON_PROPERTY_INSERT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -486,12 +489,12 @@ public String getInsert() { } /** - * Overrides the insert design ID defined in the `configurationProfileId`. An insert is - * any additional material, such as marketing materials, that are shipped together with the card. + * Any additional material, such as marketing material, that is shipped together with the card. + * This field overrides the insert design ID defined in the card configuration profile. * - * @param insert Overrides the insert design ID defined in the `configurationProfileId`. - * An insert is any additional material, such as marketing materials, that are shipped - * together with the card. + * @param insert Any additional material, such as marketing material, that is shipped together + * with the card. This field overrides the insert design ID defined in the card configuration + * profile. */ @JsonProperty(JSON_PROPERTY_INSERT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -542,11 +545,11 @@ public void setLanguage(String language) { } /** - * The ID of the logo image. This is the image that will be printed on the partial front of the - * card, such as a logo on the upper right corner. + * The unique identifier of the logo image. This image is printed on the partial front of the + * card, for example, a logo on the upper right corner. * - * @param logoImageId The ID of the logo image. This is the image that will be printed on the - * partial front of the card, such as a logo on the upper right corner. + * @param logoImageId The unique identifier of the logo image. This image is printed on the + * partial front of the card, for example, a logo on the upper right corner. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration logoImageId(String logoImageId) { @@ -555,11 +558,11 @@ public CardConfiguration logoImageId(String logoImageId) { } /** - * The ID of the logo image. This is the image that will be printed on the partial front of the - * card, such as a logo on the upper right corner. + * The unique identifier of the logo image. This image is printed on the partial front of the + * card, for example, a logo on the upper right corner. * - * @return logoImageId The ID of the logo image. This is the image that will be printed on the - * partial front of the card, such as a logo on the upper right corner. + * @return logoImageId The unique identifier of the logo image. This image is printed on the + * partial front of the card, for example, a logo on the upper right corner. */ @JsonProperty(JSON_PROPERTY_LOGO_IMAGE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -568,11 +571,11 @@ public String getLogoImageId() { } /** - * The ID of the logo image. This is the image that will be printed on the partial front of the - * card, such as a logo on the upper right corner. + * The unique identifier of the logo image. This image is printed on the partial front of the + * card, for example, a logo on the upper right corner. * - * @param logoImageId The ID of the logo image. This is the image that will be printed on the - * partial front of the card, such as a logo on the upper right corner. + * @param logoImageId The unique identifier of the logo image. This image is printed on the + * partial front of the card, for example, a logo on the upper right corner. */ @JsonProperty(JSON_PROPERTY_LOGO_IMAGE_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -581,12 +584,11 @@ public void setLogoImageId(String logoImageId) { } /** - * Overrides the PIN mailer design ID defined in the `configurationProfileId`. The PIN - * mailer is the letter on which the PIN is printed. + * The letter on which the PIN of the card is printed. This field overrides the PIN mailer design + * ID defined in the card configuration profile. * - * @param pinMailer Overrides the PIN mailer design ID defined in the - * `configurationProfileId`. The PIN mailer is the letter on which the PIN is - * printed. + * @param pinMailer The letter on which the PIN of the card is printed. This field overrides the + * PIN mailer design ID defined in the card configuration profile. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration pinMailer(String pinMailer) { @@ -595,12 +597,11 @@ public CardConfiguration pinMailer(String pinMailer) { } /** - * Overrides the PIN mailer design ID defined in the `configurationProfileId`. The PIN - * mailer is the letter on which the PIN is printed. + * The letter on which the PIN of the card is printed. This field overrides the PIN mailer design + * ID defined in the card configuration profile. * - * @return pinMailer Overrides the PIN mailer design ID defined in the - * `configurationProfileId`. The PIN mailer is the letter on which the PIN is - * printed. + * @return pinMailer The letter on which the PIN of the card is printed. This field overrides the + * PIN mailer design ID defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_PIN_MAILER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -609,12 +610,11 @@ public String getPinMailer() { } /** - * Overrides the PIN mailer design ID defined in the `configurationProfileId`. The PIN - * mailer is the letter on which the PIN is printed. + * The letter on which the PIN of the card is printed. This field overrides the PIN mailer design + * ID defined in the card configuration profile. * - * @param pinMailer Overrides the PIN mailer design ID defined in the - * `configurationProfileId`. The PIN mailer is the letter on which the PIN is - * printed. + * @param pinMailer The letter on which the PIN of the card is printed. This field overrides the + * PIN mailer design ID defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_PIN_MAILER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -623,10 +623,11 @@ public void setPinMailer(String pinMailer) { } /** - * Overrides the logistics company defined in the `configurationProfileId`. + * The logistics company that ships the card. This field overrides the logistics company defined + * in the card configuration profile. * - * @param shipmentMethod Overrides the logistics company defined in the - * `configurationProfileId`. + * @param shipmentMethod The logistics company that ships the card. This field overrides the + * logistics company defined in the card configuration profile. * @return the current {@code CardConfiguration} instance, allowing for method chaining */ public CardConfiguration shipmentMethod(String shipmentMethod) { @@ -635,10 +636,11 @@ public CardConfiguration shipmentMethod(String shipmentMethod) { } /** - * Overrides the logistics company defined in the `configurationProfileId`. + * The logistics company that ships the card. This field overrides the logistics company defined + * in the card configuration profile. * - * @return shipmentMethod Overrides the logistics company defined in the - * `configurationProfileId`. + * @return shipmentMethod The logistics company that ships the card. This field overrides the + * logistics company defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_SHIPMENT_METHOD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -647,10 +649,11 @@ public String getShipmentMethod() { } /** - * Overrides the logistics company defined in the `configurationProfileId`. + * The logistics company that ships the card. This field overrides the logistics company defined + * in the card configuration profile. * - * @param shipmentMethod Overrides the logistics company defined in the - * `configurationProfileId`. + * @param shipmentMethod The logistics company that ships the card. This field overrides the + * logistics company defined in the card configuration profile. */ @JsonProperty(JSON_PROPERTY_SHIPMENT_METHOD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationV2.java b/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationV2.java index 228e1fac8..e4dcd651c 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationV2.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationV2.java @@ -209,6 +209,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -605,14 +607,14 @@ public void setId(String id) { * priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if * you provide `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to * transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. - * * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional priorities * setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -628,14 +630,14 @@ public void setId(String id) { * activated for your platform). For example, if you provide * `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster * way to transfer funds, but the fees are higher. Recommended for high-priority, low-value - * transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. - * Recommended for high-priority, high-value transactions. * **instant**: for instant funds + * transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. + * Recommended for high-priority, high-value transactions. * **instant**: For instant funds * transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional * priorities setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -665,14 +667,14 @@ public SweepConfigurationV2 addPrioritiesItem(PrioritiesEnum prioritiesItem) { * priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if * you provide `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to * transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. - * * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional priorities * setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -688,14 +690,14 @@ public SweepConfigurationV2 addPrioritiesItem(PrioritiesEnum prioritiesItem) { * activated for your platform). For example, if you provide * `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster * way to transfer funds, but the fees are higher. Recommended for high-priority, low-value - * transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. - * Recommended for high-priority, high-value transactions. * **instant**: for instant funds + * transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. + * Recommended for high-priority, high-value transactions. * **instant**: For instant funds * transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional * priorities setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -717,14 +719,14 @@ public List getPriorities() { * priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if * you provide `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to * transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. - * * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional priorities * setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) @@ -740,14 +742,14 @@ public List getPriorities() { * activated for your platform). For example, if you provide * `[\"wire\",\"regular\"]`, and `wire` is not * supported but `regular` is, the request will still be accepted and processed. - * Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster + * Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster * way to transfer funds, but the fees are higher. Recommended for high-priority, low-value - * transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. - * Recommended for high-priority, high-value transactions. * **instant**: for instant funds + * transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. + * Recommended for high-priority, high-value transactions. * **instant**: For instant funds * transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). Set `category` to **bank**. For more details, see optional * priorities setup for * [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Support.java b/src/main/java/com/adyen/model/legalentitymanagement/Support.java index cea6608bc..84fb48102 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Support.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Support.java @@ -43,9 +43,10 @@ public class Support { public Support() {} /** - * The support email address of the legal entity. + * The support email address of the legal entity. Required if you have a platform setup. * - * @param email The support email address of the legal entity. + * @param email The support email address of the legal entity. Required if you have a platform + * setup. * @return the current {@code Support} instance, allowing for method chaining */ public Support email(String email) { @@ -55,9 +56,10 @@ public Support email(String email) { } /** - * The support email address of the legal entity. + * The support email address of the legal entity. Required if you have a platform setup. * - * @return email The support email address of the legal entity. + * @return email The support email address of the legal entity. Required if you have a platform + * setup. */ @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -66,9 +68,10 @@ public String getEmail() { } /** - * The support email address of the legal entity. + * The support email address of the legal entity. Required if you have a platform setup. * - * @param email The support email address of the legal entity. + * @param email The support email address of the legal entity. Required if you have a platform + * setup. */ @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/adyen/model/management/ForceRebootDetails.java b/src/main/java/com/adyen/model/management/ForceRebootDetails.java new file mode 100644 index 000000000..f9191c270 --- /dev/null +++ b/src/main/java/com/adyen/model/management/ForceRebootDetails.java @@ -0,0 +1,219 @@ +/* + * Management API + * + * The version of the OpenAPI document: 3 + * + * + * 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.management; + +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.util.*; +import java.util.Arrays; +import java.util.logging.Logger; + +/** ForceRebootDetails */ +@JsonPropertyOrder({ForceRebootDetails.JSON_PROPERTY_TYPE}) +public class ForceRebootDetails { + /** Type of terminal action: Force Reboot. */ + public enum TypeEnum { + FORCEREBOOT(String.valueOf("ForceReboot")); + + 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 ForceRebootDetails() {} + + /** + * Type of terminal action: Force Reboot. + * + * @param type Type of terminal action: Force Reboot. + * @return the current {@code ForceRebootDetails} instance, allowing for method chaining + */ + public ForceRebootDetails type(TypeEnum type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * Type of terminal action: Force Reboot. + * + * @return type Type of terminal action: Force Reboot. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TypeEnum getType() { + return type; + } + + /** + * Type of terminal action: Force Reboot. + * + * @param type Type of terminal action: Force Reboot. + */ + @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 ForceRebootDetails 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 ForceRebootDetails object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ForceRebootDetails forceRebootDetails = (ForceRebootDetails) o; + return Objects.equals(this.type, forceRebootDetails.type) + && Objects.equals(this.isSetType, forceRebootDetails.isSetType); + } + + @Override + public int hashCode() { + return Objects.hash(type, isSetType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ForceRebootDetails {\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 (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 ForceRebootDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of ForceRebootDetails + * @throws JsonProcessingException if the JSON string is invalid with respect to + * ForceRebootDetails + */ + public static ForceRebootDetails fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ForceRebootDetails.class); + } + + /** + * Convert an instance of ForceRebootDetails 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/management/Moto.java b/src/main/java/com/adyen/model/management/Moto.java index 27b27e585..208d44d96 100644 --- a/src/main/java/com/adyen/model/management/Moto.java +++ b/src/main/java/com/adyen/model/management/Moto.java @@ -20,11 +20,7 @@ import java.util.*; /** Moto */ -@JsonPropertyOrder({ - Moto.JSON_PROPERTY_ENABLE_MOTO, - Moto.JSON_PROPERTY_ENABLE_REFUNDS, - Moto.JSON_PROPERTY_MAX_AMOUNT -}) +@JsonPropertyOrder({Moto.JSON_PROPERTY_ENABLE_MOTO, Moto.JSON_PROPERTY_MAX_AMOUNT}) public class Moto { public static final String JSON_PROPERTY_ENABLE_MOTO = "enableMoto"; private Boolean enableMoto; @@ -32,12 +28,6 @@ public class Moto { /** Mark when the attribute has been explicitly set. */ private boolean isSetEnableMoto = false; - public static final String JSON_PROPERTY_ENABLE_REFUNDS = "enableRefunds"; - private Boolean enableRefunds; - - /** Mark when the attribute has been explicitly set. */ - private boolean isSetEnableRefunds = false; - public static final String JSON_PROPERTY_MAX_AMOUNT = "maxAmount"; private Integer maxAmount; @@ -87,41 +77,6 @@ public void setEnableMoto(Boolean enableMoto) { isSetEnableMoto = true; // mark as set } - /** - * Enable MOTO refunds. - * - * @param enableRefunds Enable MOTO refunds. - * @return the current {@code Moto} instance, allowing for method chaining - */ - public Moto enableRefunds(Boolean enableRefunds) { - this.enableRefunds = enableRefunds; - isSetEnableRefunds = true; // mark as set - return this; - } - - /** - * Enable MOTO refunds. - * - * @return enableRefunds Enable MOTO refunds. - */ - @JsonProperty(JSON_PROPERTY_ENABLE_REFUNDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getEnableRefunds() { - return enableRefunds; - } - - /** - * Enable MOTO refunds. - * - * @param enableRefunds Enable MOTO refunds. - */ - @JsonProperty(JSON_PROPERTY_ENABLE_REFUNDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEnableRefunds(Boolean enableRefunds) { - this.enableRefunds = enableRefunds; - isSetEnableRefunds = true; // mark as set - } - /** * The maximum amount for MOTO transactions. You need to set the currency for this amount using * the @@ -207,16 +162,13 @@ public boolean equals(Object o) { Moto moto = (Moto) o; return Objects.equals(this.enableMoto, moto.enableMoto) && Objects.equals(this.isSetEnableMoto, moto.isSetEnableMoto) - && Objects.equals(this.enableRefunds, moto.enableRefunds) - && Objects.equals(this.isSetEnableRefunds, moto.isSetEnableRefunds) && Objects.equals(this.maxAmount, moto.maxAmount) && Objects.equals(this.isSetMaxAmount, moto.isSetMaxAmount); } @Override public int hashCode() { - return Objects.hash( - enableMoto, isSetEnableMoto, enableRefunds, isSetEnableRefunds, maxAmount, isSetMaxAmount); + return Objects.hash(enableMoto, isSetEnableMoto, maxAmount, isSetMaxAmount); } @Override @@ -224,7 +176,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Moto {\n"); sb.append(" enableMoto: ").append(toIndentedString(enableMoto)).append("\n"); - sb.append(" enableRefunds: ").append(toIndentedString(enableRefunds)).append("\n"); sb.append(" maxAmount: ").append(toIndentedString(maxAmount)).append("\n"); sb.append("}"); return sb.toString(); @@ -253,9 +204,6 @@ public Map getExplicitNulls() { if (isSetEnableMoto) { addIfNull(nulls, JSON_PROPERTY_ENABLE_MOTO, this.enableMoto); } - if (isSetEnableRefunds) { - addIfNull(nulls, JSON_PROPERTY_ENABLE_REFUNDS, this.enableRefunds); - } if (isSetMaxAmount) { addIfNull(nulls, JSON_PROPERTY_MAX_AMOUNT, this.maxAmount); } diff --git a/src/main/java/com/adyen/model/management/PaymentMethodResponse.java b/src/main/java/com/adyen/model/management/PaymentMethodResponse.java index 39057ab7c..ac0d52891 100644 --- a/src/main/java/com/adyen/model/management/PaymentMethodResponse.java +++ b/src/main/java/com/adyen/model/management/PaymentMethodResponse.java @@ -108,6 +108,8 @@ public enum TypesWithErrorsEnum { BLIK(String.valueOf("blik")), + BLIK_POS(String.valueOf("blik_pos")), + BR_SCHEMES(String.valueOf("br_schemes")), CARTEBANCAIRE(String.valueOf("cartebancaire")), diff --git a/src/main/java/com/adyen/model/management/PaymentMethodSetupInfo.java b/src/main/java/com/adyen/model/management/PaymentMethodSetupInfo.java index 151a3b89f..96f81da91 100644 --- a/src/main/java/com/adyen/model/management/PaymentMethodSetupInfo.java +++ b/src/main/java/com/adyen/model/management/PaymentMethodSetupInfo.java @@ -459,6 +459,8 @@ public enum TypeEnum { BLIK(String.valueOf("blik")), + BLIK_POS(String.valueOf("blik_pos")), + BR_SCHEMES(String.valueOf("br_schemes")), CARTEBANCAIRE(String.valueOf("cartebancaire")), diff --git a/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequestActionDetails.java b/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequestActionDetails.java index 94436e76c..3381a85ad 100644 --- a/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequestActionDetails.java +++ b/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequestActionDetails.java @@ -84,6 +84,32 @@ public ScheduleTerminalActionsRequestActionDetails deserialize( boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); int match = 0; JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize ForceRebootDetails + try { + boolean attemptParsing = true; + if (attemptParsing) { + // Checks if the unique type of the oneOf json matches any of the object TypeEnum values + boolean typeMatch = false; + if (tree.findValue("type") != null) { + typeMatch = + Arrays.stream(ForceRebootDetails.TypeEnum.values()) + .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText())); + } + + if (typeMatch) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ForceRebootDetails.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'ForceRebootDetails'"); + } + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ForceRebootDetails'", e); + } + // deserialize InstallAndroidAppDetails try { boolean attemptParsing = true; @@ -249,6 +275,11 @@ public ScheduleTerminalActionsRequestActionDetails() { super("oneOf", Boolean.FALSE); } + public ScheduleTerminalActionsRequestActionDetails(ForceRebootDetails o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + public ScheduleTerminalActionsRequestActionDetails(InstallAndroidAppDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); @@ -275,6 +306,7 @@ public ScheduleTerminalActionsRequestActionDetails(UninstallAndroidCertificateDe } static { + schemas.put("ForceRebootDetails", new GenericType() {}); schemas.put("InstallAndroidAppDetails", new GenericType() {}); schemas.put( "InstallAndroidCertificateDetails", new GenericType() {}); @@ -294,14 +326,20 @@ public Map> getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: InstallAndroidAppDetails, InstallAndroidCertificateDetails, - * ReleaseUpdateDetails, UninstallAndroidAppDetails, UninstallAndroidCertificateDetails + * against the oneOf child schemas: ForceRebootDetails, InstallAndroidAppDetails, + * InstallAndroidCertificateDetails, ReleaseUpdateDetails, UninstallAndroidAppDetails, + * UninstallAndroidCertificateDetails * *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a * composed schema (allOf, anyOf, oneOf). */ @Override public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(ForceRebootDetails.class, instance, new HashSet<>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(InstallAndroidAppDetails.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; @@ -328,22 +366,34 @@ public void setActualInstance(Object instance) { } throw new RuntimeException( - "Invalid instance type. Must be InstallAndroidAppDetails, InstallAndroidCertificateDetails, ReleaseUpdateDetails, UninstallAndroidAppDetails, UninstallAndroidCertificateDetails"); + "Invalid instance type. Must be ForceRebootDetails, InstallAndroidAppDetails, InstallAndroidCertificateDetails, ReleaseUpdateDetails, UninstallAndroidAppDetails, UninstallAndroidCertificateDetails"); } /** - * Get the actual instance, which can be the following: InstallAndroidAppDetails, - * InstallAndroidCertificateDetails, ReleaseUpdateDetails, UninstallAndroidAppDetails, - * UninstallAndroidCertificateDetails + * Get the actual instance, which can be the following: ForceRebootDetails, + * InstallAndroidAppDetails, InstallAndroidCertificateDetails, ReleaseUpdateDetails, + * UninstallAndroidAppDetails, UninstallAndroidCertificateDetails * - * @return The actual instance (InstallAndroidAppDetails, InstallAndroidCertificateDetails, - * ReleaseUpdateDetails, UninstallAndroidAppDetails, UninstallAndroidCertificateDetails) + * @return The actual instance (ForceRebootDetails, InstallAndroidAppDetails, + * InstallAndroidCertificateDetails, ReleaseUpdateDetails, UninstallAndroidAppDetails, + * UninstallAndroidCertificateDetails) */ @Override public Object getActualInstance() { return super.getActualInstance(); } + /** + * Get the actual instance of `ForceRebootDetails`. If the actual instance is not + * `ForceRebootDetails`, the ClassCastException will be thrown. + * + * @return The actual instance of `ForceRebootDetails` + * @throws ClassCastException if the instance is not `ForceRebootDetails` + */ + public ForceRebootDetails getForceRebootDetails() throws ClassCastException { + return (ForceRebootDetails) super.getActualInstance(); + } + /** * Get the actual instance of `InstallAndroidAppDetails`. If the actual instance is not * `InstallAndroidAppDetails`, the ClassCastException will be thrown. diff --git a/src/main/java/com/adyen/model/negativebalancewarningwebhooks/Amount.java b/src/main/java/com/adyen/model/negativebalancewarningwebhooks/Amount.java index 24a355339..ed1518219 100644 --- a/src/main/java/com/adyen/model/negativebalancewarningwebhooks/Amount.java +++ b/src/main/java/com/adyen/model/negativebalancewarningwebhooks/Amount.java @@ -30,10 +30,12 @@ public Amount() {} /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * 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). + * 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) { @@ -43,10 +45,12 @@ public Amount currency(String currency) { /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * 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). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -56,10 +60,12 @@ public String getCurrency() { /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * 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). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -68,10 +74,10 @@ public void setCurrency(String currency) { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @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 */ @@ -81,10 +87,10 @@ public Amount value(Long value) { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @return value The amount of the transaction, in [minor + * @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) @@ -94,10 +100,10 @@ public Long getValue() { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @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) diff --git a/src/main/java/com/adyen/model/payment/AccountInfo.java b/src/main/java/com/adyen/model/payment/AccountInfo.java index 4b204b5ba..b4224b202 100644 --- a/src/main/java/com/adyen/model/payment/AccountInfo.java +++ b/src/main/java/com/adyen/model/payment/AccountInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -99,9 +101,15 @@ public static AccountAgeIndicatorEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCOUNT_AGE_INDICATOR = "accountAgeIndicator"; private AccountAgeIndicatorEnum accountAgeIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountAgeIndicator = false; + public static final String JSON_PROPERTY_ACCOUNT_CHANGE_DATE = "accountChangeDate"; private OffsetDateTime accountChangeDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountChangeDate = false; + /** * Indicator for the length of time since the shopper's account was last updated. Allowed * values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days @@ -153,9 +161,15 @@ public static AccountChangeIndicatorEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCOUNT_CHANGE_INDICATOR = "accountChangeIndicator"; private AccountChangeIndicatorEnum accountChangeIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountChangeIndicator = false; + public static final String JSON_PROPERTY_ACCOUNT_CREATION_DATE = "accountCreationDate"; private OffsetDateTime accountCreationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountCreationDate = false; + /** * Indicates the type of account. For example, for a multi-account card product. Allowed values: * * notApplicable * credit * debit @@ -205,12 +219,21 @@ public static AccountTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCOUNT_TYPE = "accountType"; private AccountTypeEnum accountType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountType = false; + public static final String JSON_PROPERTY_ADD_CARD_ATTEMPTS_DAY = "addCardAttemptsDay"; private Integer addCardAttemptsDay; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddCardAttemptsDay = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS_USAGE_DATE = "deliveryAddressUsageDate"; private OffsetDateTime deliveryAddressUsageDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddressUsageDate = false; + /** * Indicator for the length of time since this delivery address was first used. Allowed values: * * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days @@ -264,19 +287,31 @@ public static DeliveryAddressUsageIndicatorEnum fromValue(String value) { "deliveryAddressUsageIndicator"; private DeliveryAddressUsageIndicatorEnum deliveryAddressUsageIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddressUsageIndicator = false; + public static final String JSON_PROPERTY_HOME_PHONE = "homePhone"; @Deprecated // deprecated since Adyen Payment API v68: Use `ThreeDS2RequestData.homePhone` // instead. private String homePhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHomePhone = false; + public static final String JSON_PROPERTY_MOBILE_PHONE = "mobilePhone"; @Deprecated // deprecated since Adyen Payment API v68: Use `ThreeDS2RequestData.mobilePhone` // instead. private String mobilePhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMobilePhone = false; + public static final String JSON_PROPERTY_PASSWORD_CHANGE_DATE = "passwordChangeDate"; private OffsetDateTime passwordChangeDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPasswordChangeDate = false; + /** * Indicator when the shopper has changed their password. Allowed values: * notApplicable * * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days @@ -330,15 +365,27 @@ public static PasswordChangeIndicatorEnum fromValue(String value) { public static final String JSON_PROPERTY_PASSWORD_CHANGE_INDICATOR = "passwordChangeIndicator"; private PasswordChangeIndicatorEnum passwordChangeIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPasswordChangeIndicator = false; + public static final String JSON_PROPERTY_PAST_TRANSACTIONS_DAY = "pastTransactionsDay"; private Integer pastTransactionsDay; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPastTransactionsDay = false; + public static final String JSON_PROPERTY_PAST_TRANSACTIONS_YEAR = "pastTransactionsYear"; private Integer pastTransactionsYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPastTransactionsYear = false; + public static final String JSON_PROPERTY_PAYMENT_ACCOUNT_AGE = "paymentAccountAge"; private OffsetDateTime paymentAccountAge; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentAccountAge = false; + /** * Indicator for the length of time since this payment method was added to this shopper's * account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * @@ -393,17 +440,35 @@ public static PaymentAccountIndicatorEnum fromValue(String value) { public static final String JSON_PROPERTY_PAYMENT_ACCOUNT_INDICATOR = "paymentAccountIndicator"; private PaymentAccountIndicatorEnum paymentAccountIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentAccountIndicator = false; + public static final String JSON_PROPERTY_PURCHASES_LAST6_MONTHS = "purchasesLast6Months"; private Integer purchasesLast6Months; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPurchasesLast6Months = false; + public static final String JSON_PROPERTY_SUSPICIOUS_ACTIVITY = "suspiciousActivity"; private Boolean suspiciousActivity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSuspiciousActivity = false; + public static final String JSON_PROPERTY_WORK_PHONE = "workPhone"; @Deprecated // deprecated since Adyen Payment API v68: Use `ThreeDS2RequestData.workPhone` // instead. private String workPhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWorkPhone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountInfo() {} /** @@ -418,6 +483,7 @@ public AccountInfo() {} */ public AccountInfo accountAgeIndicator(AccountAgeIndicatorEnum accountAgeIndicator) { this.accountAgeIndicator = accountAgeIndicator; + isSetAccountAgeIndicator = true; // mark as set return this; } @@ -449,6 +515,7 @@ public AccountAgeIndicatorEnum getAccountAgeIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountAgeIndicator(AccountAgeIndicatorEnum accountAgeIndicator) { this.accountAgeIndicator = accountAgeIndicator; + isSetAccountAgeIndicator = true; // mark as set } /** @@ -459,6 +526,7 @@ public void setAccountAgeIndicator(AccountAgeIndicatorEnum accountAgeIndicator) */ public AccountInfo accountChangeDate(OffsetDateTime accountChangeDate) { this.accountChangeDate = accountChangeDate; + isSetAccountChangeDate = true; // mark as set return this; } @@ -482,6 +550,7 @@ public OffsetDateTime getAccountChangeDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountChangeDate(OffsetDateTime accountChangeDate) { this.accountChangeDate = accountChangeDate; + isSetAccountChangeDate = true; // mark as set } /** @@ -495,6 +564,7 @@ public void setAccountChangeDate(OffsetDateTime accountChangeDate) { */ public AccountInfo accountChangeIndicator(AccountChangeIndicatorEnum accountChangeIndicator) { this.accountChangeIndicator = accountChangeIndicator; + isSetAccountChangeIndicator = true; // mark as set return this; } @@ -524,6 +594,7 @@ public AccountChangeIndicatorEnum getAccountChangeIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountChangeIndicator(AccountChangeIndicatorEnum accountChangeIndicator) { this.accountChangeIndicator = accountChangeIndicator; + isSetAccountChangeIndicator = true; // mark as set } /** @@ -534,6 +605,7 @@ public void setAccountChangeIndicator(AccountChangeIndicatorEnum accountChangeIn */ public AccountInfo accountCreationDate(OffsetDateTime accountCreationDate) { this.accountCreationDate = accountCreationDate; + isSetAccountCreationDate = true; // mark as set return this; } @@ -557,6 +629,7 @@ public OffsetDateTime getAccountCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountCreationDate(OffsetDateTime accountCreationDate) { this.accountCreationDate = accountCreationDate; + isSetAccountCreationDate = true; // mark as set } /** @@ -569,6 +642,7 @@ public void setAccountCreationDate(OffsetDateTime accountCreationDate) { */ public AccountInfo accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -596,6 +670,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -607,6 +682,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public AccountInfo addCardAttemptsDay(Integer addCardAttemptsDay) { this.addCardAttemptsDay = addCardAttemptsDay; + isSetAddCardAttemptsDay = true; // mark as set return this; } @@ -632,6 +708,7 @@ public Integer getAddCardAttemptsDay() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddCardAttemptsDay(Integer addCardAttemptsDay) { this.addCardAttemptsDay = addCardAttemptsDay; + isSetAddCardAttemptsDay = true; // mark as set } /** @@ -642,6 +719,7 @@ public void setAddCardAttemptsDay(Integer addCardAttemptsDay) { */ public AccountInfo deliveryAddressUsageDate(OffsetDateTime deliveryAddressUsageDate) { this.deliveryAddressUsageDate = deliveryAddressUsageDate; + isSetDeliveryAddressUsageDate = true; // mark as set return this; } @@ -665,6 +743,7 @@ public OffsetDateTime getDeliveryAddressUsageDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddressUsageDate(OffsetDateTime deliveryAddressUsageDate) { this.deliveryAddressUsageDate = deliveryAddressUsageDate; + isSetDeliveryAddressUsageDate = true; // mark as set } /** @@ -679,6 +758,7 @@ public void setDeliveryAddressUsageDate(OffsetDateTime deliveryAddressUsageDate) public AccountInfo deliveryAddressUsageIndicator( DeliveryAddressUsageIndicatorEnum deliveryAddressUsageIndicator) { this.deliveryAddressUsageIndicator = deliveryAddressUsageIndicator; + isSetDeliveryAddressUsageIndicator = true; // mark as set return this; } @@ -709,6 +789,7 @@ public DeliveryAddressUsageIndicatorEnum getDeliveryAddressUsageIndicator() { public void setDeliveryAddressUsageIndicator( DeliveryAddressUsageIndicatorEnum deliveryAddressUsageIndicator) { this.deliveryAddressUsageIndicator = deliveryAddressUsageIndicator; + isSetDeliveryAddressUsageIndicator = true; // mark as set } /** @@ -722,6 +803,7 @@ public void setDeliveryAddressUsageIndicator( // instead. public AccountInfo homePhone(String homePhone) { this.homePhone = homePhone; + isSetHomePhone = true; // mark as set return this; } @@ -752,6 +834,7 @@ public String getHomePhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHomePhone(String homePhone) { this.homePhone = homePhone; + isSetHomePhone = true; // mark as set } /** @@ -766,6 +849,7 @@ public void setHomePhone(String homePhone) { // instead. public AccountInfo mobilePhone(String mobilePhone) { this.mobilePhone = mobilePhone; + isSetMobilePhone = true; // mark as set return this; } @@ -797,6 +881,7 @@ public String getMobilePhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMobilePhone(String mobilePhone) { this.mobilePhone = mobilePhone; + isSetMobilePhone = true; // mark as set } /** @@ -807,6 +892,7 @@ public void setMobilePhone(String mobilePhone) { */ public AccountInfo passwordChangeDate(OffsetDateTime passwordChangeDate) { this.passwordChangeDate = passwordChangeDate; + isSetPasswordChangeDate = true; // mark as set return this; } @@ -830,6 +916,7 @@ public OffsetDateTime getPasswordChangeDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPasswordChangeDate(OffsetDateTime passwordChangeDate) { this.passwordChangeDate = passwordChangeDate; + isSetPasswordChangeDate = true; // mark as set } /** @@ -843,6 +930,7 @@ public void setPasswordChangeDate(OffsetDateTime passwordChangeDate) { */ public AccountInfo passwordChangeIndicator(PasswordChangeIndicatorEnum passwordChangeIndicator) { this.passwordChangeIndicator = passwordChangeIndicator; + isSetPasswordChangeIndicator = true; // mark as set return this; } @@ -872,6 +960,7 @@ public PasswordChangeIndicatorEnum getPasswordChangeIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPasswordChangeIndicator(PasswordChangeIndicatorEnum passwordChangeIndicator) { this.passwordChangeIndicator = passwordChangeIndicator; + isSetPasswordChangeIndicator = true; // mark as set } /** @@ -883,6 +972,7 @@ public void setPasswordChangeIndicator(PasswordChangeIndicatorEnum passwordChang */ public AccountInfo pastTransactionsDay(Integer pastTransactionsDay) { this.pastTransactionsDay = pastTransactionsDay; + isSetPastTransactionsDay = true; // mark as set return this; } @@ -908,6 +998,7 @@ public Integer getPastTransactionsDay() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPastTransactionsDay(Integer pastTransactionsDay) { this.pastTransactionsDay = pastTransactionsDay; + isSetPastTransactionsDay = true; // mark as set } /** @@ -919,6 +1010,7 @@ public void setPastTransactionsDay(Integer pastTransactionsDay) { */ public AccountInfo pastTransactionsYear(Integer pastTransactionsYear) { this.pastTransactionsYear = pastTransactionsYear; + isSetPastTransactionsYear = true; // mark as set return this; } @@ -944,6 +1036,7 @@ public Integer getPastTransactionsYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPastTransactionsYear(Integer pastTransactionsYear) { this.pastTransactionsYear = pastTransactionsYear; + isSetPastTransactionsYear = true; // mark as set } /** @@ -954,6 +1047,7 @@ public void setPastTransactionsYear(Integer pastTransactionsYear) { */ public AccountInfo paymentAccountAge(OffsetDateTime paymentAccountAge) { this.paymentAccountAge = paymentAccountAge; + isSetPaymentAccountAge = true; // mark as set return this; } @@ -977,6 +1071,7 @@ public OffsetDateTime getPaymentAccountAge() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentAccountAge(OffsetDateTime paymentAccountAge) { this.paymentAccountAge = paymentAccountAge; + isSetPaymentAccountAge = true; // mark as set } /** @@ -991,6 +1086,7 @@ public void setPaymentAccountAge(OffsetDateTime paymentAccountAge) { */ public AccountInfo paymentAccountIndicator(PaymentAccountIndicatorEnum paymentAccountIndicator) { this.paymentAccountIndicator = paymentAccountIndicator; + isSetPaymentAccountIndicator = true; // mark as set return this; } @@ -1022,6 +1118,7 @@ public PaymentAccountIndicatorEnum getPaymentAccountIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentAccountIndicator(PaymentAccountIndicatorEnum paymentAccountIndicator) { this.paymentAccountIndicator = paymentAccountIndicator; + isSetPaymentAccountIndicator = true; // mark as set } /** @@ -1032,6 +1129,7 @@ public void setPaymentAccountIndicator(PaymentAccountIndicatorEnum paymentAccoun */ public AccountInfo purchasesLast6Months(Integer purchasesLast6Months) { this.purchasesLast6Months = purchasesLast6Months; + isSetPurchasesLast6Months = true; // mark as set return this; } @@ -1055,6 +1153,7 @@ public Integer getPurchasesLast6Months() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPurchasesLast6Months(Integer purchasesLast6Months) { this.purchasesLast6Months = purchasesLast6Months; + isSetPurchasesLast6Months = true; // mark as set } /** @@ -1065,6 +1164,7 @@ public void setPurchasesLast6Months(Integer purchasesLast6Months) { */ public AccountInfo suspiciousActivity(Boolean suspiciousActivity) { this.suspiciousActivity = suspiciousActivity; + isSetSuspiciousActivity = true; // mark as set return this; } @@ -1088,6 +1188,7 @@ public Boolean getSuspiciousActivity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSuspiciousActivity(Boolean suspiciousActivity) { this.suspiciousActivity = suspiciousActivity; + isSetSuspiciousActivity = true; // mark as set } /** @@ -1101,6 +1202,7 @@ public void setSuspiciousActivity(Boolean suspiciousActivity) { // instead. public AccountInfo workPhone(String workPhone) { this.workPhone = workPhone; + isSetWorkPhone = true; // mark as set return this; } @@ -1131,6 +1233,27 @@ public String getWorkPhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWorkPhone(String workPhone) { this.workPhone = workPhone; + isSetWorkPhone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountInfo 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 AccountInfo object is equal to o. */ @@ -1144,49 +1267,91 @@ public boolean equals(Object o) { } AccountInfo accountInfo = (AccountInfo) o; return Objects.equals(this.accountAgeIndicator, accountInfo.accountAgeIndicator) + && Objects.equals(this.isSetAccountAgeIndicator, accountInfo.isSetAccountAgeIndicator) && Objects.equals(this.accountChangeDate, accountInfo.accountChangeDate) + && Objects.equals(this.isSetAccountChangeDate, accountInfo.isSetAccountChangeDate) && Objects.equals(this.accountChangeIndicator, accountInfo.accountChangeIndicator) + && Objects.equals(this.isSetAccountChangeIndicator, accountInfo.isSetAccountChangeIndicator) && Objects.equals(this.accountCreationDate, accountInfo.accountCreationDate) + && Objects.equals(this.isSetAccountCreationDate, accountInfo.isSetAccountCreationDate) && Objects.equals(this.accountType, accountInfo.accountType) + && Objects.equals(this.isSetAccountType, accountInfo.isSetAccountType) && Objects.equals(this.addCardAttemptsDay, accountInfo.addCardAttemptsDay) + && Objects.equals(this.isSetAddCardAttemptsDay, accountInfo.isSetAddCardAttemptsDay) && Objects.equals(this.deliveryAddressUsageDate, accountInfo.deliveryAddressUsageDate) + && Objects.equals( + this.isSetDeliveryAddressUsageDate, accountInfo.isSetDeliveryAddressUsageDate) && Objects.equals( this.deliveryAddressUsageIndicator, accountInfo.deliveryAddressUsageIndicator) + && Objects.equals( + this.isSetDeliveryAddressUsageIndicator, accountInfo.isSetDeliveryAddressUsageIndicator) && Objects.equals(this.homePhone, accountInfo.homePhone) + && Objects.equals(this.isSetHomePhone, accountInfo.isSetHomePhone) && Objects.equals(this.mobilePhone, accountInfo.mobilePhone) + && Objects.equals(this.isSetMobilePhone, accountInfo.isSetMobilePhone) && Objects.equals(this.passwordChangeDate, accountInfo.passwordChangeDate) + && Objects.equals(this.isSetPasswordChangeDate, accountInfo.isSetPasswordChangeDate) && Objects.equals(this.passwordChangeIndicator, accountInfo.passwordChangeIndicator) + && Objects.equals( + this.isSetPasswordChangeIndicator, accountInfo.isSetPasswordChangeIndicator) && Objects.equals(this.pastTransactionsDay, accountInfo.pastTransactionsDay) + && Objects.equals(this.isSetPastTransactionsDay, accountInfo.isSetPastTransactionsDay) && Objects.equals(this.pastTransactionsYear, accountInfo.pastTransactionsYear) + && Objects.equals(this.isSetPastTransactionsYear, accountInfo.isSetPastTransactionsYear) && Objects.equals(this.paymentAccountAge, accountInfo.paymentAccountAge) + && Objects.equals(this.isSetPaymentAccountAge, accountInfo.isSetPaymentAccountAge) && Objects.equals(this.paymentAccountIndicator, accountInfo.paymentAccountIndicator) + && Objects.equals( + this.isSetPaymentAccountIndicator, accountInfo.isSetPaymentAccountIndicator) && Objects.equals(this.purchasesLast6Months, accountInfo.purchasesLast6Months) + && Objects.equals(this.isSetPurchasesLast6Months, accountInfo.isSetPurchasesLast6Months) && Objects.equals(this.suspiciousActivity, accountInfo.suspiciousActivity) - && Objects.equals(this.workPhone, accountInfo.workPhone); + && Objects.equals(this.isSetSuspiciousActivity, accountInfo.isSetSuspiciousActivity) + && Objects.equals(this.workPhone, accountInfo.workPhone) + && Objects.equals(this.isSetWorkPhone, accountInfo.isSetWorkPhone); } @Override public int hashCode() { return Objects.hash( accountAgeIndicator, + isSetAccountAgeIndicator, accountChangeDate, + isSetAccountChangeDate, accountChangeIndicator, + isSetAccountChangeIndicator, accountCreationDate, + isSetAccountCreationDate, accountType, + isSetAccountType, addCardAttemptsDay, + isSetAddCardAttemptsDay, deliveryAddressUsageDate, + isSetDeliveryAddressUsageDate, deliveryAddressUsageIndicator, + isSetDeliveryAddressUsageIndicator, homePhone, + isSetHomePhone, mobilePhone, + isSetMobilePhone, passwordChangeDate, + isSetPasswordChangeDate, passwordChangeIndicator, + isSetPasswordChangeIndicator, pastTransactionsDay, + isSetPastTransactionsDay, pastTransactionsYear, + isSetPastTransactionsYear, paymentAccountAge, + isSetPaymentAccountAge, paymentAccountIndicator, + isSetPaymentAccountIndicator, purchasesLast6Months, + isSetPurchasesLast6Months, suspiciousActivity, - workPhone); + isSetSuspiciousActivity, + workPhone, + isSetWorkPhone); } @Override @@ -1246,6 +1411,87 @@ 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 (isSetAccountAgeIndicator) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_AGE_INDICATOR, this.accountAgeIndicator); + } + if (isSetAccountChangeDate) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_CHANGE_DATE, this.accountChangeDate); + } + if (isSetAccountChangeIndicator) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_CHANGE_INDICATOR, this.accountChangeIndicator); + } + if (isSetAccountCreationDate) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_CREATION_DATE, this.accountCreationDate); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetAddCardAttemptsDay) { + addIfNull(nulls, JSON_PROPERTY_ADD_CARD_ATTEMPTS_DAY, this.addCardAttemptsDay); + } + if (isSetDeliveryAddressUsageDate) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS_USAGE_DATE, this.deliveryAddressUsageDate); + } + if (isSetDeliveryAddressUsageIndicator) { + addIfNull( + nulls, + JSON_PROPERTY_DELIVERY_ADDRESS_USAGE_INDICATOR, + this.deliveryAddressUsageIndicator); + } + if (isSetHomePhone) { + addIfNull(nulls, JSON_PROPERTY_HOME_PHONE, this.homePhone); + } + if (isSetMobilePhone) { + addIfNull(nulls, JSON_PROPERTY_MOBILE_PHONE, this.mobilePhone); + } + if (isSetPasswordChangeDate) { + addIfNull(nulls, JSON_PROPERTY_PASSWORD_CHANGE_DATE, this.passwordChangeDate); + } + if (isSetPasswordChangeIndicator) { + addIfNull(nulls, JSON_PROPERTY_PASSWORD_CHANGE_INDICATOR, this.passwordChangeIndicator); + } + if (isSetPastTransactionsDay) { + addIfNull(nulls, JSON_PROPERTY_PAST_TRANSACTIONS_DAY, this.pastTransactionsDay); + } + if (isSetPastTransactionsYear) { + addIfNull(nulls, JSON_PROPERTY_PAST_TRANSACTIONS_YEAR, this.pastTransactionsYear); + } + if (isSetPaymentAccountAge) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_ACCOUNT_AGE, this.paymentAccountAge); + } + if (isSetPaymentAccountIndicator) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_ACCOUNT_INDICATOR, this.paymentAccountIndicator); + } + if (isSetPurchasesLast6Months) { + addIfNull(nulls, JSON_PROPERTY_PURCHASES_LAST6_MONTHS, this.purchasesLast6Months); + } + if (isSetSuspiciousActivity) { + addIfNull(nulls, JSON_PROPERTY_SUSPICIOUS_ACTIVITY, this.suspiciousActivity); + } + if (isSetWorkPhone) { + addIfNull(nulls, JSON_PROPERTY_WORK_PHONE, this.workPhone); + } + + 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 AccountInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AcctInfo.java b/src/main/java/com/adyen/model/payment/AcctInfo.java index 8183f8e0d..6708ccc51 100644 --- a/src/main/java/com/adyen/model/payment/AcctInfo.java +++ b/src/main/java/com/adyen/model/payment/AcctInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -95,9 +97,15 @@ public static ChAccAgeIndEnum fromValue(String value) { public static final String JSON_PROPERTY_CH_ACC_AGE_IND = "chAccAgeInd"; private ChAccAgeIndEnum chAccAgeInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChAccAgeInd = false; + public static final String JSON_PROPERTY_CH_ACC_CHANGE = "chAccChange"; private String chAccChange; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChAccChange = false; + /** * Length of time since the cardholder’s account information with the 3DS Requestor was last * changed, including Billing or Shipping address, new payment account, or new user(s) added. @@ -151,9 +159,15 @@ public static ChAccChangeIndEnum fromValue(String value) { public static final String JSON_PROPERTY_CH_ACC_CHANGE_IND = "chAccChangeInd"; private ChAccChangeIndEnum chAccChangeInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChAccChangeInd = false; + public static final String JSON_PROPERTY_CH_ACC_PW_CHANGE = "chAccPwChange"; private String chAccPwChange; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChAccPwChange = false; + /** * Indicates the length of time since the cardholder’s account with the 3DS Requestor had a * password change or account reset. Allowed values: * **01** — No change * **02** — Changed @@ -209,15 +223,27 @@ public static ChAccPwChangeIndEnum fromValue(String value) { public static final String JSON_PROPERTY_CH_ACC_PW_CHANGE_IND = "chAccPwChangeInd"; private ChAccPwChangeIndEnum chAccPwChangeInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChAccPwChangeInd = false; + public static final String JSON_PROPERTY_CH_ACC_STRING = "chAccString"; private String chAccString; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChAccString = false; + public static final String JSON_PROPERTY_NB_PURCHASE_ACCOUNT = "nbPurchaseAccount"; private String nbPurchaseAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNbPurchaseAccount = false; + public static final String JSON_PROPERTY_PAYMENT_ACC_AGE = "paymentAccAge"; private String paymentAccAge; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentAccAge = false; + /** * Indicates the length of time that the payment account was enrolled in the cardholder’s account * with the 3DS Requestor. Allowed values: * **01** — No account (guest checkout) * **02** — @@ -273,12 +299,21 @@ public static PaymentAccIndEnum fromValue(String value) { public static final String JSON_PROPERTY_PAYMENT_ACC_IND = "paymentAccInd"; private PaymentAccIndEnum paymentAccInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentAccInd = false; + public static final String JSON_PROPERTY_PROVISION_ATTEMPTS_DAY = "provisionAttemptsDay"; private String provisionAttemptsDay; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProvisionAttemptsDay = false; + public static final String JSON_PROPERTY_SHIP_ADDRESS_USAGE = "shipAddressUsage"; private String shipAddressUsage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShipAddressUsage = false; + /** * Indicates when the shipping address used for this transaction was first used with the 3DS * Requestor. Allowed values: * **01** — This transaction * **02** — Less than 30 days * **03** — @@ -331,6 +366,9 @@ public static ShipAddressUsageIndEnum fromValue(String value) { public static final String JSON_PROPERTY_SHIP_ADDRESS_USAGE_IND = "shipAddressUsageInd"; private ShipAddressUsageIndEnum shipAddressUsageInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShipAddressUsageInd = false; + /** * Indicates if the Cardholder Name on the account is identical to the shipping Name used for this * transaction. Allowed values: * **01** — Account Name identical to shipping Name * **02** — @@ -379,6 +417,9 @@ public static ShipNameIndicatorEnum fromValue(String value) { public static final String JSON_PROPERTY_SHIP_NAME_INDICATOR = "shipNameIndicator"; private ShipNameIndicatorEnum shipNameIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShipNameIndicator = false; + /** * Indicates whether the 3DS Requestor has experienced suspicious activity (including previous * fraud) on the cardholder account. Allowed values: * **01** — No suspicious activity has been @@ -427,12 +468,27 @@ public static SuspiciousAccActivityEnum fromValue(String value) { public static final String JSON_PROPERTY_SUSPICIOUS_ACC_ACTIVITY = "suspiciousAccActivity"; private SuspiciousAccActivityEnum suspiciousAccActivity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSuspiciousAccActivity = false; + public static final String JSON_PROPERTY_TXN_ACTIVITY_DAY = "txnActivityDay"; private String txnActivityDay; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTxnActivityDay = false; + public static final String JSON_PROPERTY_TXN_ACTIVITY_YEAR = "txnActivityYear"; private String txnActivityYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTxnActivityYear = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AcctInfo() {} /** @@ -447,6 +503,7 @@ public AcctInfo() {} */ public AcctInfo chAccAgeInd(ChAccAgeIndEnum chAccAgeInd) { this.chAccAgeInd = chAccAgeInd; + isSetChAccAgeInd = true; // mark as set return this; } @@ -478,6 +535,7 @@ public ChAccAgeIndEnum getChAccAgeInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChAccAgeInd(ChAccAgeIndEnum chAccAgeInd) { this.chAccAgeInd = chAccAgeInd; + isSetChAccAgeInd = true; // mark as set } /** @@ -491,6 +549,7 @@ public void setChAccAgeInd(ChAccAgeIndEnum chAccAgeInd) { */ public AcctInfo chAccChange(String chAccChange) { this.chAccChange = chAccChange; + isSetChAccChange = true; // mark as set return this; } @@ -520,6 +579,7 @@ public String getChAccChange() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChAccChange(String chAccChange) { this.chAccChange = chAccChange; + isSetChAccChange = true; // mark as set } /** @@ -536,6 +596,7 @@ public void setChAccChange(String chAccChange) { */ public AcctInfo chAccChangeInd(ChAccChangeIndEnum chAccChangeInd) { this.chAccChangeInd = chAccChangeInd; + isSetChAccChangeInd = true; // mark as set return this; } @@ -571,6 +632,7 @@ public ChAccChangeIndEnum getChAccChangeInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChAccChangeInd(ChAccChangeIndEnum chAccChangeInd) { this.chAccChangeInd = chAccChangeInd; + isSetChAccChangeInd = true; // mark as set } /** @@ -583,6 +645,7 @@ public void setChAccChangeInd(ChAccChangeIndEnum chAccChangeInd) { */ public AcctInfo chAccPwChange(String chAccPwChange) { this.chAccPwChange = chAccPwChange; + isSetChAccPwChange = true; // mark as set return this; } @@ -610,6 +673,7 @@ public String getChAccPwChange() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChAccPwChange(String chAccPwChange) { this.chAccPwChange = chAccPwChange; + isSetChAccPwChange = true; // mark as set } /** @@ -626,6 +690,7 @@ public void setChAccPwChange(String chAccPwChange) { */ public AcctInfo chAccPwChangeInd(ChAccPwChangeIndEnum chAccPwChangeInd) { this.chAccPwChangeInd = chAccPwChangeInd; + isSetChAccPwChangeInd = true; // mark as set return this; } @@ -661,6 +726,7 @@ public ChAccPwChangeIndEnum getChAccPwChangeInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChAccPwChangeInd(ChAccPwChangeIndEnum chAccPwChangeInd) { this.chAccPwChangeInd = chAccPwChangeInd; + isSetChAccPwChangeInd = true; // mark as set } /** @@ -672,6 +738,7 @@ public void setChAccPwChangeInd(ChAccPwChangeIndEnum chAccPwChangeInd) { */ public AcctInfo chAccString(String chAccString) { this.chAccString = chAccString; + isSetChAccString = true; // mark as set return this; } @@ -697,6 +764,7 @@ public String getChAccString() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChAccString(String chAccString) { this.chAccString = chAccString; + isSetChAccString = true; // mark as set } /** @@ -709,6 +777,7 @@ public void setChAccString(String chAccString) { */ public AcctInfo nbPurchaseAccount(String nbPurchaseAccount) { this.nbPurchaseAccount = nbPurchaseAccount; + isSetNbPurchaseAccount = true; // mark as set return this; } @@ -736,6 +805,7 @@ public String getNbPurchaseAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNbPurchaseAccount(String nbPurchaseAccount) { this.nbPurchaseAccount = nbPurchaseAccount; + isSetNbPurchaseAccount = true; // mark as set } /** @@ -748,6 +818,7 @@ public void setNbPurchaseAccount(String nbPurchaseAccount) { */ public AcctInfo paymentAccAge(String paymentAccAge) { this.paymentAccAge = paymentAccAge; + isSetPaymentAccAge = true; // mark as set return this; } @@ -775,6 +846,7 @@ public String getPaymentAccAge() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentAccAge(String paymentAccAge) { this.paymentAccAge = paymentAccAge; + isSetPaymentAccAge = true; // mark as set } /** @@ -791,6 +863,7 @@ public void setPaymentAccAge(String paymentAccAge) { */ public AcctInfo paymentAccInd(PaymentAccIndEnum paymentAccInd) { this.paymentAccInd = paymentAccInd; + isSetPaymentAccInd = true; // mark as set return this; } @@ -826,6 +899,7 @@ public PaymentAccIndEnum getPaymentAccInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentAccInd(PaymentAccIndEnum paymentAccInd) { this.paymentAccInd = paymentAccInd; + isSetPaymentAccInd = true; // mark as set } /** @@ -837,6 +911,7 @@ public void setPaymentAccInd(PaymentAccIndEnum paymentAccInd) { */ public AcctInfo provisionAttemptsDay(String provisionAttemptsDay) { this.provisionAttemptsDay = provisionAttemptsDay; + isSetProvisionAttemptsDay = true; // mark as set return this; } @@ -862,6 +937,7 @@ public String getProvisionAttemptsDay() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProvisionAttemptsDay(String provisionAttemptsDay) { this.provisionAttemptsDay = provisionAttemptsDay; + isSetProvisionAttemptsDay = true; // mark as set } /** @@ -874,6 +950,7 @@ public void setProvisionAttemptsDay(String provisionAttemptsDay) { */ public AcctInfo shipAddressUsage(String shipAddressUsage) { this.shipAddressUsage = shipAddressUsage; + isSetShipAddressUsage = true; // mark as set return this; } @@ -901,6 +978,7 @@ public String getShipAddressUsage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShipAddressUsage(String shipAddressUsage) { this.shipAddressUsage = shipAddressUsage; + isSetShipAddressUsage = true; // mark as set } /** @@ -915,6 +993,7 @@ public void setShipAddressUsage(String shipAddressUsage) { */ public AcctInfo shipAddressUsageInd(ShipAddressUsageIndEnum shipAddressUsageInd) { this.shipAddressUsageInd = shipAddressUsageInd; + isSetShipAddressUsageInd = true; // mark as set return this; } @@ -946,6 +1025,7 @@ public ShipAddressUsageIndEnum getShipAddressUsageInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShipAddressUsageInd(ShipAddressUsageIndEnum shipAddressUsageInd) { this.shipAddressUsageInd = shipAddressUsageInd; + isSetShipAddressUsageInd = true; // mark as set } /** @@ -960,6 +1040,7 @@ public void setShipAddressUsageInd(ShipAddressUsageIndEnum shipAddressUsageInd) */ public AcctInfo shipNameIndicator(ShipNameIndicatorEnum shipNameIndicator) { this.shipNameIndicator = shipNameIndicator; + isSetShipNameIndicator = true; // mark as set return this; } @@ -991,6 +1072,7 @@ public ShipNameIndicatorEnum getShipNameIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShipNameIndicator(ShipNameIndicatorEnum shipNameIndicator) { this.shipNameIndicator = shipNameIndicator; + isSetShipNameIndicator = true; // mark as set } /** @@ -1005,6 +1087,7 @@ public void setShipNameIndicator(ShipNameIndicatorEnum shipNameIndicator) { */ public AcctInfo suspiciousAccActivity(SuspiciousAccActivityEnum suspiciousAccActivity) { this.suspiciousAccActivity = suspiciousAccActivity; + isSetSuspiciousAccActivity = true; // mark as set return this; } @@ -1036,6 +1119,7 @@ public SuspiciousAccActivityEnum getSuspiciousAccActivity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSuspiciousAccActivity(SuspiciousAccActivityEnum suspiciousAccActivity) { this.suspiciousAccActivity = suspiciousAccActivity; + isSetSuspiciousAccActivity = true; // mark as set } /** @@ -1049,6 +1133,7 @@ public void setSuspiciousAccActivity(SuspiciousAccActivityEnum suspiciousAccActi */ public AcctInfo txnActivityDay(String txnActivityDay) { this.txnActivityDay = txnActivityDay; + isSetTxnActivityDay = true; // mark as set return this; } @@ -1078,6 +1163,7 @@ public String getTxnActivityDay() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTxnActivityDay(String txnActivityDay) { this.txnActivityDay = txnActivityDay; + isSetTxnActivityDay = true; // mark as set } /** @@ -1091,6 +1177,7 @@ public void setTxnActivityDay(String txnActivityDay) { */ public AcctInfo txnActivityYear(String txnActivityYear) { this.txnActivityYear = txnActivityYear; + isSetTxnActivityYear = true; // mark as set return this; } @@ -1120,6 +1207,27 @@ public String getTxnActivityYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTxnActivityYear(String txnActivityYear) { this.txnActivityYear = txnActivityYear; + isSetTxnActivityYear = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AcctInfo 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 AcctInfo object is equal to o. */ @@ -1133,42 +1241,74 @@ public boolean equals(Object o) { } AcctInfo acctInfo = (AcctInfo) o; return Objects.equals(this.chAccAgeInd, acctInfo.chAccAgeInd) + && Objects.equals(this.isSetChAccAgeInd, acctInfo.isSetChAccAgeInd) && Objects.equals(this.chAccChange, acctInfo.chAccChange) + && Objects.equals(this.isSetChAccChange, acctInfo.isSetChAccChange) && Objects.equals(this.chAccChangeInd, acctInfo.chAccChangeInd) + && Objects.equals(this.isSetChAccChangeInd, acctInfo.isSetChAccChangeInd) && Objects.equals(this.chAccPwChange, acctInfo.chAccPwChange) + && Objects.equals(this.isSetChAccPwChange, acctInfo.isSetChAccPwChange) && Objects.equals(this.chAccPwChangeInd, acctInfo.chAccPwChangeInd) + && Objects.equals(this.isSetChAccPwChangeInd, acctInfo.isSetChAccPwChangeInd) && Objects.equals(this.chAccString, acctInfo.chAccString) + && Objects.equals(this.isSetChAccString, acctInfo.isSetChAccString) && Objects.equals(this.nbPurchaseAccount, acctInfo.nbPurchaseAccount) + && Objects.equals(this.isSetNbPurchaseAccount, acctInfo.isSetNbPurchaseAccount) && Objects.equals(this.paymentAccAge, acctInfo.paymentAccAge) + && Objects.equals(this.isSetPaymentAccAge, acctInfo.isSetPaymentAccAge) && Objects.equals(this.paymentAccInd, acctInfo.paymentAccInd) + && Objects.equals(this.isSetPaymentAccInd, acctInfo.isSetPaymentAccInd) && Objects.equals(this.provisionAttemptsDay, acctInfo.provisionAttemptsDay) + && Objects.equals(this.isSetProvisionAttemptsDay, acctInfo.isSetProvisionAttemptsDay) && Objects.equals(this.shipAddressUsage, acctInfo.shipAddressUsage) + && Objects.equals(this.isSetShipAddressUsage, acctInfo.isSetShipAddressUsage) && Objects.equals(this.shipAddressUsageInd, acctInfo.shipAddressUsageInd) + && Objects.equals(this.isSetShipAddressUsageInd, acctInfo.isSetShipAddressUsageInd) && Objects.equals(this.shipNameIndicator, acctInfo.shipNameIndicator) + && Objects.equals(this.isSetShipNameIndicator, acctInfo.isSetShipNameIndicator) && Objects.equals(this.suspiciousAccActivity, acctInfo.suspiciousAccActivity) + && Objects.equals(this.isSetSuspiciousAccActivity, acctInfo.isSetSuspiciousAccActivity) && Objects.equals(this.txnActivityDay, acctInfo.txnActivityDay) - && Objects.equals(this.txnActivityYear, acctInfo.txnActivityYear); + && Objects.equals(this.isSetTxnActivityDay, acctInfo.isSetTxnActivityDay) + && Objects.equals(this.txnActivityYear, acctInfo.txnActivityYear) + && Objects.equals(this.isSetTxnActivityYear, acctInfo.isSetTxnActivityYear); } @Override public int hashCode() { return Objects.hash( chAccAgeInd, + isSetChAccAgeInd, chAccChange, + isSetChAccChange, chAccChangeInd, + isSetChAccChangeInd, chAccPwChange, + isSetChAccPwChange, chAccPwChangeInd, + isSetChAccPwChangeInd, chAccString, + isSetChAccString, nbPurchaseAccount, + isSetNbPurchaseAccount, paymentAccAge, + isSetPaymentAccAge, paymentAccInd, + isSetPaymentAccInd, provisionAttemptsDay, + isSetProvisionAttemptsDay, shipAddressUsage, + isSetShipAddressUsage, shipAddressUsageInd, + isSetShipAddressUsageInd, shipNameIndicator, + isSetShipNameIndicator, suspiciousAccActivity, + isSetSuspiciousAccActivity, txnActivityDay, - txnActivityYear); + isSetTxnActivityDay, + txnActivityYear, + isSetTxnActivityYear); } @Override @@ -1211,6 +1351,75 @@ 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 (isSetChAccAgeInd) { + addIfNull(nulls, JSON_PROPERTY_CH_ACC_AGE_IND, this.chAccAgeInd); + } + if (isSetChAccChange) { + addIfNull(nulls, JSON_PROPERTY_CH_ACC_CHANGE, this.chAccChange); + } + if (isSetChAccChangeInd) { + addIfNull(nulls, JSON_PROPERTY_CH_ACC_CHANGE_IND, this.chAccChangeInd); + } + if (isSetChAccPwChange) { + addIfNull(nulls, JSON_PROPERTY_CH_ACC_PW_CHANGE, this.chAccPwChange); + } + if (isSetChAccPwChangeInd) { + addIfNull(nulls, JSON_PROPERTY_CH_ACC_PW_CHANGE_IND, this.chAccPwChangeInd); + } + if (isSetChAccString) { + addIfNull(nulls, JSON_PROPERTY_CH_ACC_STRING, this.chAccString); + } + if (isSetNbPurchaseAccount) { + addIfNull(nulls, JSON_PROPERTY_NB_PURCHASE_ACCOUNT, this.nbPurchaseAccount); + } + if (isSetPaymentAccAge) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_ACC_AGE, this.paymentAccAge); + } + if (isSetPaymentAccInd) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_ACC_IND, this.paymentAccInd); + } + if (isSetProvisionAttemptsDay) { + addIfNull(nulls, JSON_PROPERTY_PROVISION_ATTEMPTS_DAY, this.provisionAttemptsDay); + } + if (isSetShipAddressUsage) { + addIfNull(nulls, JSON_PROPERTY_SHIP_ADDRESS_USAGE, this.shipAddressUsage); + } + if (isSetShipAddressUsageInd) { + addIfNull(nulls, JSON_PROPERTY_SHIP_ADDRESS_USAGE_IND, this.shipAddressUsageInd); + } + if (isSetShipNameIndicator) { + addIfNull(nulls, JSON_PROPERTY_SHIP_NAME_INDICATOR, this.shipNameIndicator); + } + if (isSetSuspiciousAccActivity) { + addIfNull(nulls, JSON_PROPERTY_SUSPICIOUS_ACC_ACTIVITY, this.suspiciousAccActivity); + } + if (isSetTxnActivityDay) { + addIfNull(nulls, JSON_PROPERTY_TXN_ACTIVITY_DAY, this.txnActivityDay); + } + if (isSetTxnActivityYear) { + addIfNull(nulls, JSON_PROPERTY_TXN_ACTIVITY_YEAR, this.txnActivityYear); + } + + 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 AcctInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AdditionalData3DSecure.java b/src/main/java/com/adyen/model/payment/AdditionalData3DSecure.java index a0e8d6cf9..59964379a 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalData3DSecure.java +++ b/src/main/java/com/adyen/model/payment/AdditionalData3DSecure.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -34,6 +36,9 @@ public class AdditionalData3DSecure { public static final String JSON_PROPERTY_ALLOW3_D_S2 = "allow3DS2"; private String allow3DS2; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllow3DS2 = false; + /** * Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size @@ -88,18 +93,39 @@ public static ChallengeWindowSizeEnum fromValue(String value) { public static final String JSON_PROPERTY_CHALLENGE_WINDOW_SIZE = "challengeWindowSize"; private ChallengeWindowSizeEnum challengeWindowSize; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChallengeWindowSize = false; + public static final String JSON_PROPERTY_EXECUTE_THREE_D = "executeThreeD"; private String executeThreeD; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExecuteThreeD = false; + public static final String JSON_PROPERTY_MPI_IMPLEMENTATION_TYPE = "mpiImplementationType"; private String mpiImplementationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMpiImplementationType = false; + public static final String JSON_PROPERTY_SCA_EXEMPTION = "scaExemption"; private String scaExemption; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaExemption = false; + public static final String JSON_PROPERTY_THREE_D_S_VERSION = "threeDSVersion"; private String threeDSVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSVersion = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalData3DSecure() {} /** @@ -132,6 +158,7 @@ public AdditionalData3DSecure() {} */ public AdditionalData3DSecure allow3DS2(String allow3DS2) { this.allow3DS2 = allow3DS2; + isSetAllow3DS2 = true; // mark as set return this; } @@ -199,6 +226,7 @@ public String getAllow3DS2() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllow3DS2(String allow3DS2) { this.allow3DS2 = allow3DS2; + isSetAllow3DS2 = true; // mark as set } /** @@ -213,6 +241,7 @@ public void setAllow3DS2(String allow3DS2) { */ public AdditionalData3DSecure challengeWindowSize(ChallengeWindowSizeEnum challengeWindowSize) { this.challengeWindowSize = challengeWindowSize; + isSetChallengeWindowSize = true; // mark as set return this; } @@ -244,6 +273,7 @@ public ChallengeWindowSizeEnum getChallengeWindowSize() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallengeWindowSize(ChallengeWindowSizeEnum challengeWindowSize) { this.challengeWindowSize = challengeWindowSize; + isSetChallengeWindowSize = true; // mark as set } /** @@ -263,6 +293,7 @@ public void setChallengeWindowSize(ChallengeWindowSizeEnum challengeWindowSize) */ public AdditionalData3DSecure executeThreeD(String executeThreeD) { this.executeThreeD = executeThreeD; + isSetExecuteThreeD = true; // mark as set return this; } @@ -304,6 +335,7 @@ public String getExecuteThreeD() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExecuteThreeD(String executeThreeD) { this.executeThreeD = executeThreeD; + isSetExecuteThreeD = true; // mark as set } /** @@ -314,6 +346,7 @@ public void setExecuteThreeD(String executeThreeD) { */ public AdditionalData3DSecure mpiImplementationType(String mpiImplementationType) { this.mpiImplementationType = mpiImplementationType; + isSetMpiImplementationType = true; // mark as set return this; } @@ -337,6 +370,7 @@ public String getMpiImplementationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiImplementationType(String mpiImplementationType) { this.mpiImplementationType = mpiImplementationType; + isSetMpiImplementationType = true; // mark as set } /** @@ -353,6 +387,7 @@ public void setMpiImplementationType(String mpiImplementationType) { */ public AdditionalData3DSecure scaExemption(String scaExemption) { this.scaExemption = scaExemption; + isSetScaExemption = true; // mark as set return this; } @@ -388,6 +423,7 @@ public String getScaExemption() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaExemption(String scaExemption) { this.scaExemption = scaExemption; + isSetScaExemption = true; // mark as set } /** @@ -412,6 +448,7 @@ public void setScaExemption(String scaExemption) { */ public AdditionalData3DSecure threeDSVersion(String threeDSVersion) { this.threeDSVersion = threeDSVersion; + isSetThreeDSVersion = true; // mark as set return this; } @@ -463,6 +500,27 @@ public String getThreeDSVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSVersion(String threeDSVersion) { this.threeDSVersion = threeDSVersion; + isSetThreeDSVersion = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalData3DSecure 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 AdditionalData3DSecure object is equal to o. */ @@ -476,22 +534,36 @@ public boolean equals(Object o) { } AdditionalData3DSecure additionalData3DSecure = (AdditionalData3DSecure) o; return Objects.equals(this.allow3DS2, additionalData3DSecure.allow3DS2) + && Objects.equals(this.isSetAllow3DS2, additionalData3DSecure.isSetAllow3DS2) && Objects.equals(this.challengeWindowSize, additionalData3DSecure.challengeWindowSize) + && Objects.equals( + this.isSetChallengeWindowSize, additionalData3DSecure.isSetChallengeWindowSize) && Objects.equals(this.executeThreeD, additionalData3DSecure.executeThreeD) + && Objects.equals(this.isSetExecuteThreeD, additionalData3DSecure.isSetExecuteThreeD) && Objects.equals(this.mpiImplementationType, additionalData3DSecure.mpiImplementationType) + && Objects.equals( + this.isSetMpiImplementationType, additionalData3DSecure.isSetMpiImplementationType) && Objects.equals(this.scaExemption, additionalData3DSecure.scaExemption) - && Objects.equals(this.threeDSVersion, additionalData3DSecure.threeDSVersion); + && Objects.equals(this.isSetScaExemption, additionalData3DSecure.isSetScaExemption) + && Objects.equals(this.threeDSVersion, additionalData3DSecure.threeDSVersion) + && Objects.equals(this.isSetThreeDSVersion, additionalData3DSecure.isSetThreeDSVersion); } @Override public int hashCode() { return Objects.hash( allow3DS2, + isSetAllow3DS2, challengeWindowSize, + isSetChallengeWindowSize, executeThreeD, + isSetExecuteThreeD, mpiImplementationType, + isSetMpiImplementationType, scaExemption, - threeDSVersion); + isSetScaExemption, + threeDSVersion, + isSetThreeDSVersion); } @Override @@ -522,6 +594,45 @@ 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 (isSetAllow3DS2) { + addIfNull(nulls, JSON_PROPERTY_ALLOW3_D_S2, this.allow3DS2); + } + if (isSetChallengeWindowSize) { + addIfNull(nulls, JSON_PROPERTY_CHALLENGE_WINDOW_SIZE, this.challengeWindowSize); + } + if (isSetExecuteThreeD) { + addIfNull(nulls, JSON_PROPERTY_EXECUTE_THREE_D, this.executeThreeD); + } + if (isSetMpiImplementationType) { + addIfNull(nulls, JSON_PROPERTY_MPI_IMPLEMENTATION_TYPE, this.mpiImplementationType); + } + if (isSetScaExemption) { + addIfNull(nulls, JSON_PROPERTY_SCA_EXEMPTION, this.scaExemption); + } + if (isSetThreeDSVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_VERSION, this.threeDSVersion); + } + + 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 AdditionalData3DSecure given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataAirline.java b/src/main/java/com/adyen/model/payment/AdditionalDataAirline.java index 5e5935a7b..f6d2684eb 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataAirline.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataAirline.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -54,107 +56,200 @@ public class AdditionalDataAirline { "airline.agency_invoice_number"; private String airlineAgencyInvoiceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineAgencyInvoiceNumber = false; + public static final String JSON_PROPERTY_AIRLINE_AGENCY_PLAN_NAME = "airline.agency_plan_name"; private String airlineAgencyPlanName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineAgencyPlanName = false; + public static final String JSON_PROPERTY_AIRLINE_AIRLINE_CODE = "airline.airline_code"; private String airlineAirlineCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineAirlineCode = false; + public static final String JSON_PROPERTY_AIRLINE_AIRLINE_DESIGNATOR_CODE = "airline.airline_designator_code"; private String airlineAirlineDesignatorCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineAirlineDesignatorCode = false; + public static final String JSON_PROPERTY_AIRLINE_BOARDING_FEE = "airline.boarding_fee"; private String airlineBoardingFee; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineBoardingFee = false; + public static final String JSON_PROPERTY_AIRLINE_COMPUTERIZED_RESERVATION_SYSTEM = "airline.computerized_reservation_system"; private String airlineComputerizedReservationSystem; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineComputerizedReservationSystem = false; + public static final String JSON_PROPERTY_AIRLINE_CUSTOMER_REFERENCE_NUMBER = "airline.customer_reference_number"; private String airlineCustomerReferenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineCustomerReferenceNumber = false; + public static final String JSON_PROPERTY_AIRLINE_DOCUMENT_TYPE = "airline.document_type"; private String airlineDocumentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineDocumentType = false; + public static final String JSON_PROPERTY_AIRLINE_FLIGHT_DATE = "airline.flight_date"; private String airlineFlightDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineFlightDate = false; + public static final String JSON_PROPERTY_AIRLINE_ISSUE_DATE = "airline.issue_date"; private String airlineIssueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineIssueDate = false; + public static final String JSON_PROPERTY_AIRLINE_LEG_CARRIER_CODE = "airline.leg.carrier_code"; private String airlineLegCarrierCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineLegCarrierCode = false; + public static final String JSON_PROPERTY_AIRLINE_LEG_CLASS_OF_TRAVEL = "airline.leg.class_of_travel"; private String airlineLegClassOfTravel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineLegClassOfTravel = false; + public static final String JSON_PROPERTY_AIRLINE_LEG_DATE_OF_TRAVEL = "airline.leg.date_of_travel"; private String airlineLegDateOfTravel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineLegDateOfTravel = false; + public static final String JSON_PROPERTY_AIRLINE_LEG_DEPART_AIRPORT = "airline.leg.depart_airport"; private String airlineLegDepartAirport; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineLegDepartAirport = false; + public static final String JSON_PROPERTY_AIRLINE_LEG_DEPART_TAX = "airline.leg.depart_tax"; private String airlineLegDepartTax; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineLegDepartTax = false; + public static final String JSON_PROPERTY_AIRLINE_LEG_DESTINATION_CODE = "airline.leg.destination_code"; private String airlineLegDestinationCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineLegDestinationCode = false; + public static final String JSON_PROPERTY_AIRLINE_LEG_FARE_BASE_CODE = "airline.leg.fare_base_code"; private String airlineLegFareBaseCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineLegFareBaseCode = false; + public static final String JSON_PROPERTY_AIRLINE_LEG_FLIGHT_NUMBER = "airline.leg.flight_number"; private String airlineLegFlightNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineLegFlightNumber = false; + public static final String JSON_PROPERTY_AIRLINE_LEG_STOP_OVER_CODE = "airline.leg.stop_over_code"; private String airlineLegStopOverCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineLegStopOverCode = false; + public static final String JSON_PROPERTY_AIRLINE_PASSENGER_DATE_OF_BIRTH = "airline.passenger.date_of_birth"; private String airlinePassengerDateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlinePassengerDateOfBirth = false; + public static final String JSON_PROPERTY_AIRLINE_PASSENGER_FIRST_NAME = "airline.passenger.first_name"; private String airlinePassengerFirstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlinePassengerFirstName = false; + public static final String JSON_PROPERTY_AIRLINE_PASSENGER_LAST_NAME = "airline.passenger.last_name"; private String airlinePassengerLastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlinePassengerLastName = false; + public static final String JSON_PROPERTY_AIRLINE_PASSENGER_PHONE_NUMBER = "airline.passenger.phone_number"; private String airlinePassengerPhoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlinePassengerPhoneNumber = false; + public static final String JSON_PROPERTY_AIRLINE_PASSENGER_TRAVELLER_TYPE = "airline.passenger.traveller_type"; private String airlinePassengerTravellerType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlinePassengerTravellerType = false; + public static final String JSON_PROPERTY_AIRLINE_PASSENGER_NAME = "airline.passenger_name"; private String airlinePassengerName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlinePassengerName = false; + public static final String JSON_PROPERTY_AIRLINE_TICKET_ISSUE_ADDRESS = "airline.ticket_issue_address"; private String airlineTicketIssueAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineTicketIssueAddress = false; + public static final String JSON_PROPERTY_AIRLINE_TICKET_NUMBER = "airline.ticket_number"; private String airlineTicketNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineTicketNumber = false; + public static final String JSON_PROPERTY_AIRLINE_TRAVEL_AGENCY_CODE = "airline.travel_agency_code"; private String airlineTravelAgencyCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineTravelAgencyCode = false; + public static final String JSON_PROPERTY_AIRLINE_TRAVEL_AGENCY_NAME = "airline.travel_agency_name"; private String airlineTravelAgencyName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineTravelAgencyName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataAirline() {} /** @@ -167,6 +262,7 @@ public AdditionalDataAirline() {} */ public AdditionalDataAirline airlineAgencyInvoiceNumber(String airlineAgencyInvoiceNumber) { this.airlineAgencyInvoiceNumber = airlineAgencyInvoiceNumber; + isSetAirlineAgencyInvoiceNumber = true; // mark as set return this; } @@ -194,6 +290,7 @@ public String getAirlineAgencyInvoiceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineAgencyInvoiceNumber(String airlineAgencyInvoiceNumber) { this.airlineAgencyInvoiceNumber = airlineAgencyInvoiceNumber; + isSetAirlineAgencyInvoiceNumber = true; // mark as set } /** @@ -206,6 +303,7 @@ public void setAirlineAgencyInvoiceNumber(String airlineAgencyInvoiceNumber) { */ public AdditionalDataAirline airlineAgencyPlanName(String airlineAgencyPlanName) { this.airlineAgencyPlanName = airlineAgencyPlanName; + isSetAirlineAgencyPlanName = true; // mark as set return this; } @@ -233,6 +331,7 @@ public String getAirlineAgencyPlanName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineAgencyPlanName(String airlineAgencyPlanName) { this.airlineAgencyPlanName = airlineAgencyPlanName; + isSetAirlineAgencyPlanName = true; // mark as set } /** @@ -249,6 +348,7 @@ public void setAirlineAgencyPlanName(String airlineAgencyPlanName) { */ public AdditionalDataAirline airlineAirlineCode(String airlineAirlineCode) { this.airlineAirlineCode = airlineAirlineCode; + isSetAirlineAirlineCode = true; // mark as set return this; } @@ -284,6 +384,7 @@ public String getAirlineAirlineCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineAirlineCode(String airlineAirlineCode) { this.airlineAirlineCode = airlineAirlineCode; + isSetAirlineAirlineCode = true; // mark as set } /** @@ -299,6 +400,7 @@ public void setAirlineAirlineCode(String airlineAirlineCode) { */ public AdditionalDataAirline airlineAirlineDesignatorCode(String airlineAirlineDesignatorCode) { this.airlineAirlineDesignatorCode = airlineAirlineDesignatorCode; + isSetAirlineAirlineDesignatorCode = true; // mark as set return this; } @@ -332,6 +434,7 @@ public String getAirlineAirlineDesignatorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineAirlineDesignatorCode(String airlineAirlineDesignatorCode) { this.airlineAirlineDesignatorCode = airlineAirlineDesignatorCode; + isSetAirlineAirlineDesignatorCode = true; // mark as set } /** @@ -346,6 +449,7 @@ public void setAirlineAirlineDesignatorCode(String airlineAirlineDesignatorCode) */ public AdditionalDataAirline airlineBoardingFee(String airlineBoardingFee) { this.airlineBoardingFee = airlineBoardingFee; + isSetAirlineBoardingFee = true; // mark as set return this; } @@ -377,6 +481,7 @@ public String getAirlineBoardingFee() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineBoardingFee(String airlineBoardingFee) { this.airlineBoardingFee = airlineBoardingFee; + isSetAirlineBoardingFee = true; // mark as set } /** @@ -393,6 +498,7 @@ public void setAirlineBoardingFee(String airlineBoardingFee) { public AdditionalDataAirline airlineComputerizedReservationSystem( String airlineComputerizedReservationSystem) { this.airlineComputerizedReservationSystem = airlineComputerizedReservationSystem; + isSetAirlineComputerizedReservationSystem = true; // mark as set return this; } @@ -426,6 +532,7 @@ public String getAirlineComputerizedReservationSystem() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineComputerizedReservationSystem(String airlineComputerizedReservationSystem) { this.airlineComputerizedReservationSystem = airlineComputerizedReservationSystem; + isSetAirlineComputerizedReservationSystem = true; // mark as set } /** @@ -441,6 +548,7 @@ public void setAirlineComputerizedReservationSystem(String airlineComputerizedRe public AdditionalDataAirline airlineCustomerReferenceNumber( String airlineCustomerReferenceNumber) { this.airlineCustomerReferenceNumber = airlineCustomerReferenceNumber; + isSetAirlineCustomerReferenceNumber = true; // mark as set return this; } @@ -472,6 +580,7 @@ public String getAirlineCustomerReferenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineCustomerReferenceNumber(String airlineCustomerReferenceNumber) { this.airlineCustomerReferenceNumber = airlineCustomerReferenceNumber; + isSetAirlineCustomerReferenceNumber = true; // mark as set } /** @@ -486,6 +595,7 @@ public void setAirlineCustomerReferenceNumber(String airlineCustomerReferenceNum */ public AdditionalDataAirline airlineDocumentType(String airlineDocumentType) { this.airlineDocumentType = airlineDocumentType; + isSetAirlineDocumentType = true; // mark as set return this; } @@ -517,6 +627,7 @@ public String getAirlineDocumentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineDocumentType(String airlineDocumentType) { this.airlineDocumentType = airlineDocumentType; + isSetAirlineDocumentType = true; // mark as set } /** @@ -531,6 +642,7 @@ public void setAirlineDocumentType(String airlineDocumentType) { */ public AdditionalDataAirline airlineFlightDate(String airlineFlightDate) { this.airlineFlightDate = airlineFlightDate; + isSetAirlineFlightDate = true; // mark as set return this; } @@ -562,6 +674,7 @@ public String getAirlineFlightDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineFlightDate(String airlineFlightDate) { this.airlineFlightDate = airlineFlightDate; + isSetAirlineFlightDate = true; // mark as set } /** @@ -574,6 +687,7 @@ public void setAirlineFlightDate(String airlineFlightDate) { */ public AdditionalDataAirline airlineIssueDate(String airlineIssueDate) { this.airlineIssueDate = airlineIssueDate; + isSetAirlineIssueDate = true; // mark as set return this; } @@ -601,6 +715,7 @@ public String getAirlineIssueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineIssueDate(String airlineIssueDate) { this.airlineIssueDate = airlineIssueDate; + isSetAirlineIssueDate = true; // mark as set } /** @@ -617,6 +732,7 @@ public void setAirlineIssueDate(String airlineIssueDate) { */ public AdditionalDataAirline airlineLegCarrierCode(String airlineLegCarrierCode) { this.airlineLegCarrierCode = airlineLegCarrierCode; + isSetAirlineLegCarrierCode = true; // mark as set return this; } @@ -652,6 +768,7 @@ public String getAirlineLegCarrierCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineLegCarrierCode(String airlineLegCarrierCode) { this.airlineLegCarrierCode = airlineLegCarrierCode; + isSetAirlineLegCarrierCode = true; // mark as set } /** @@ -667,6 +784,7 @@ public void setAirlineLegCarrierCode(String airlineLegCarrierCode) { */ public AdditionalDataAirline airlineLegClassOfTravel(String airlineLegClassOfTravel) { this.airlineLegClassOfTravel = airlineLegClassOfTravel; + isSetAirlineLegClassOfTravel = true; // mark as set return this; } @@ -700,6 +818,7 @@ public String getAirlineLegClassOfTravel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineLegClassOfTravel(String airlineLegClassOfTravel) { this.airlineLegClassOfTravel = airlineLegClassOfTravel; + isSetAirlineLegClassOfTravel = true; // mark as set } /** @@ -714,6 +833,7 @@ public void setAirlineLegClassOfTravel(String airlineLegClassOfTravel) { */ public AdditionalDataAirline airlineLegDateOfTravel(String airlineLegDateOfTravel) { this.airlineLegDateOfTravel = airlineLegDateOfTravel; + isSetAirlineLegDateOfTravel = true; // mark as set return this; } @@ -745,6 +865,7 @@ public String getAirlineLegDateOfTravel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineLegDateOfTravel(String airlineLegDateOfTravel) { this.airlineLegDateOfTravel = airlineLegDateOfTravel; + isSetAirlineLegDateOfTravel = true; // mark as set } /** @@ -761,6 +882,7 @@ public void setAirlineLegDateOfTravel(String airlineLegDateOfTravel) { */ public AdditionalDataAirline airlineLegDepartAirport(String airlineLegDepartAirport) { this.airlineLegDepartAirport = airlineLegDepartAirport; + isSetAirlineLegDepartAirport = true; // mark as set return this; } @@ -796,6 +918,7 @@ public String getAirlineLegDepartAirport() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineLegDepartAirport(String airlineLegDepartAirport) { this.airlineLegDepartAirport = airlineLegDepartAirport; + isSetAirlineLegDepartAirport = true; // mark as set } /** @@ -811,6 +934,7 @@ public void setAirlineLegDepartAirport(String airlineLegDepartAirport) { */ public AdditionalDataAirline airlineLegDepartTax(String airlineLegDepartTax) { this.airlineLegDepartTax = airlineLegDepartTax; + isSetAirlineLegDepartTax = true; // mark as set return this; } @@ -844,6 +968,7 @@ public String getAirlineLegDepartTax() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineLegDepartTax(String airlineLegDepartTax) { this.airlineLegDepartTax = airlineLegDepartTax; + isSetAirlineLegDepartTax = true; // mark as set } /** @@ -860,6 +985,7 @@ public void setAirlineLegDepartTax(String airlineLegDepartTax) { */ public AdditionalDataAirline airlineLegDestinationCode(String airlineLegDestinationCode) { this.airlineLegDestinationCode = airlineLegDestinationCode; + isSetAirlineLegDestinationCode = true; // mark as set return this; } @@ -895,6 +1021,7 @@ public String getAirlineLegDestinationCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineLegDestinationCode(String airlineLegDestinationCode) { this.airlineLegDestinationCode = airlineLegDestinationCode; + isSetAirlineLegDestinationCode = true; // mark as set } /** @@ -909,6 +1036,7 @@ public void setAirlineLegDestinationCode(String airlineLegDestinationCode) { */ public AdditionalDataAirline airlineLegFareBaseCode(String airlineLegFareBaseCode) { this.airlineLegFareBaseCode = airlineLegFareBaseCode; + isSetAirlineLegFareBaseCode = true; // mark as set return this; } @@ -940,6 +1068,7 @@ public String getAirlineLegFareBaseCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineLegFareBaseCode(String airlineLegFareBaseCode) { this.airlineLegFareBaseCode = airlineLegFareBaseCode; + isSetAirlineLegFareBaseCode = true; // mark as set } /** @@ -952,6 +1081,7 @@ public void setAirlineLegFareBaseCode(String airlineLegFareBaseCode) { */ public AdditionalDataAirline airlineLegFlightNumber(String airlineLegFlightNumber) { this.airlineLegFlightNumber = airlineLegFlightNumber; + isSetAirlineLegFlightNumber = true; // mark as set return this; } @@ -979,6 +1109,7 @@ public String getAirlineLegFlightNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineLegFlightNumber(String airlineLegFlightNumber) { this.airlineLegFlightNumber = airlineLegFlightNumber; + isSetAirlineLegFlightNumber = true; // mark as set } /** @@ -994,6 +1125,7 @@ public void setAirlineLegFlightNumber(String airlineLegFlightNumber) { */ public AdditionalDataAirline airlineLegStopOverCode(String airlineLegStopOverCode) { this.airlineLegStopOverCode = airlineLegStopOverCode; + isSetAirlineLegStopOverCode = true; // mark as set return this; } @@ -1027,6 +1159,7 @@ public String getAirlineLegStopOverCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineLegStopOverCode(String airlineLegStopOverCode) { this.airlineLegStopOverCode = airlineLegStopOverCode; + isSetAirlineLegStopOverCode = true; // mark as set } /** @@ -1039,6 +1172,7 @@ public void setAirlineLegStopOverCode(String airlineLegStopOverCode) { */ public AdditionalDataAirline airlinePassengerDateOfBirth(String airlinePassengerDateOfBirth) { this.airlinePassengerDateOfBirth = airlinePassengerDateOfBirth; + isSetAirlinePassengerDateOfBirth = true; // mark as set return this; } @@ -1066,6 +1200,7 @@ public String getAirlinePassengerDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlinePassengerDateOfBirth(String airlinePassengerDateOfBirth) { this.airlinePassengerDateOfBirth = airlinePassengerDateOfBirth; + isSetAirlinePassengerDateOfBirth = true; // mark as set } /** @@ -1078,6 +1213,7 @@ public void setAirlinePassengerDateOfBirth(String airlinePassengerDateOfBirth) { */ public AdditionalDataAirline airlinePassengerFirstName(String airlinePassengerFirstName) { this.airlinePassengerFirstName = airlinePassengerFirstName; + isSetAirlinePassengerFirstName = true; // mark as set return this; } @@ -1105,6 +1241,7 @@ public String getAirlinePassengerFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlinePassengerFirstName(String airlinePassengerFirstName) { this.airlinePassengerFirstName = airlinePassengerFirstName; + isSetAirlinePassengerFirstName = true; // mark as set } /** @@ -1117,6 +1254,7 @@ public void setAirlinePassengerFirstName(String airlinePassengerFirstName) { */ public AdditionalDataAirline airlinePassengerLastName(String airlinePassengerLastName) { this.airlinePassengerLastName = airlinePassengerLastName; + isSetAirlinePassengerLastName = true; // mark as set return this; } @@ -1144,6 +1282,7 @@ public String getAirlinePassengerLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlinePassengerLastName(String airlinePassengerLastName) { this.airlinePassengerLastName = airlinePassengerLastName; + isSetAirlinePassengerLastName = true; // mark as set } /** @@ -1158,6 +1297,7 @@ public void setAirlinePassengerLastName(String airlinePassengerLastName) { */ public AdditionalDataAirline airlinePassengerPhoneNumber(String airlinePassengerPhoneNumber) { this.airlinePassengerPhoneNumber = airlinePassengerPhoneNumber; + isSetAirlinePassengerPhoneNumber = true; // mark as set return this; } @@ -1189,6 +1329,7 @@ public String getAirlinePassengerPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlinePassengerPhoneNumber(String airlinePassengerPhoneNumber) { this.airlinePassengerPhoneNumber = airlinePassengerPhoneNumber; + isSetAirlinePassengerPhoneNumber = true; // mark as set } /** @@ -1201,6 +1342,7 @@ public void setAirlinePassengerPhoneNumber(String airlinePassengerPhoneNumber) { */ public AdditionalDataAirline airlinePassengerTravellerType(String airlinePassengerTravellerType) { this.airlinePassengerTravellerType = airlinePassengerTravellerType; + isSetAirlinePassengerTravellerType = true; // mark as set return this; } @@ -1228,6 +1370,7 @@ public String getAirlinePassengerTravellerType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlinePassengerTravellerType(String airlinePassengerTravellerType) { this.airlinePassengerTravellerType = airlinePassengerTravellerType; + isSetAirlinePassengerTravellerType = true; // mark as set } /** @@ -1244,6 +1387,7 @@ public void setAirlinePassengerTravellerType(String airlinePassengerTravellerTyp */ public AdditionalDataAirline airlinePassengerName(String airlinePassengerName) { this.airlinePassengerName = airlinePassengerName; + isSetAirlinePassengerName = true; // mark as set return this; } @@ -1279,6 +1423,7 @@ public String getAirlinePassengerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlinePassengerName(String airlinePassengerName) { this.airlinePassengerName = airlinePassengerName; + isSetAirlinePassengerName = true; // mark as set } /** @@ -1291,6 +1436,7 @@ public void setAirlinePassengerName(String airlinePassengerName) { */ public AdditionalDataAirline airlineTicketIssueAddress(String airlineTicketIssueAddress) { this.airlineTicketIssueAddress = airlineTicketIssueAddress; + isSetAirlineTicketIssueAddress = true; // mark as set return this; } @@ -1318,6 +1464,7 @@ public String getAirlineTicketIssueAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineTicketIssueAddress(String airlineTicketIssueAddress) { this.airlineTicketIssueAddress = airlineTicketIssueAddress; + isSetAirlineTicketIssueAddress = true; // mark as set } /** @@ -1330,6 +1477,7 @@ public void setAirlineTicketIssueAddress(String airlineTicketIssueAddress) { */ public AdditionalDataAirline airlineTicketNumber(String airlineTicketNumber) { this.airlineTicketNumber = airlineTicketNumber; + isSetAirlineTicketNumber = true; // mark as set return this; } @@ -1357,6 +1505,7 @@ public String getAirlineTicketNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineTicketNumber(String airlineTicketNumber) { this.airlineTicketNumber = airlineTicketNumber; + isSetAirlineTicketNumber = true; // mark as set } /** @@ -1371,6 +1520,7 @@ public void setAirlineTicketNumber(String airlineTicketNumber) { */ public AdditionalDataAirline airlineTravelAgencyCode(String airlineTravelAgencyCode) { this.airlineTravelAgencyCode = airlineTravelAgencyCode; + isSetAirlineTravelAgencyCode = true; // mark as set return this; } @@ -1402,6 +1552,7 @@ public String getAirlineTravelAgencyCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineTravelAgencyCode(String airlineTravelAgencyCode) { this.airlineTravelAgencyCode = airlineTravelAgencyCode; + isSetAirlineTravelAgencyCode = true; // mark as set } /** @@ -1414,6 +1565,7 @@ public void setAirlineTravelAgencyCode(String airlineTravelAgencyCode) { */ public AdditionalDataAirline airlineTravelAgencyName(String airlineTravelAgencyName) { this.airlineTravelAgencyName = airlineTravelAgencyName; + isSetAirlineTravelAgencyName = true; // mark as set return this; } @@ -1441,6 +1593,27 @@ public String getAirlineTravelAgencyName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineTravelAgencyName(String airlineTravelAgencyName) { this.airlineTravelAgencyName = airlineTravelAgencyName; + isSetAirlineTravelAgencyName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataAirline 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 AdditionalDataAirline object is equal to o. */ @@ -1455,84 +1628,179 @@ public boolean equals(Object o) { AdditionalDataAirline additionalDataAirline = (AdditionalDataAirline) o; return Objects.equals( this.airlineAgencyInvoiceNumber, additionalDataAirline.airlineAgencyInvoiceNumber) + && Objects.equals( + this.isSetAirlineAgencyInvoiceNumber, + additionalDataAirline.isSetAirlineAgencyInvoiceNumber) && Objects.equals(this.airlineAgencyPlanName, additionalDataAirline.airlineAgencyPlanName) + && Objects.equals( + this.isSetAirlineAgencyPlanName, additionalDataAirline.isSetAirlineAgencyPlanName) && Objects.equals(this.airlineAirlineCode, additionalDataAirline.airlineAirlineCode) + && Objects.equals( + this.isSetAirlineAirlineCode, additionalDataAirline.isSetAirlineAirlineCode) && Objects.equals( this.airlineAirlineDesignatorCode, additionalDataAirline.airlineAirlineDesignatorCode) + && Objects.equals( + this.isSetAirlineAirlineDesignatorCode, + additionalDataAirline.isSetAirlineAirlineDesignatorCode) && Objects.equals(this.airlineBoardingFee, additionalDataAirline.airlineBoardingFee) + && Objects.equals( + this.isSetAirlineBoardingFee, additionalDataAirline.isSetAirlineBoardingFee) && Objects.equals( this.airlineComputerizedReservationSystem, additionalDataAirline.airlineComputerizedReservationSystem) + && Objects.equals( + this.isSetAirlineComputerizedReservationSystem, + additionalDataAirline.isSetAirlineComputerizedReservationSystem) && Objects.equals( this.airlineCustomerReferenceNumber, additionalDataAirline.airlineCustomerReferenceNumber) + && Objects.equals( + this.isSetAirlineCustomerReferenceNumber, + additionalDataAirline.isSetAirlineCustomerReferenceNumber) && Objects.equals(this.airlineDocumentType, additionalDataAirline.airlineDocumentType) + && Objects.equals( + this.isSetAirlineDocumentType, additionalDataAirline.isSetAirlineDocumentType) && Objects.equals(this.airlineFlightDate, additionalDataAirline.airlineFlightDate) + && Objects.equals(this.isSetAirlineFlightDate, additionalDataAirline.isSetAirlineFlightDate) && Objects.equals(this.airlineIssueDate, additionalDataAirline.airlineIssueDate) + && Objects.equals(this.isSetAirlineIssueDate, additionalDataAirline.isSetAirlineIssueDate) && Objects.equals(this.airlineLegCarrierCode, additionalDataAirline.airlineLegCarrierCode) + && Objects.equals( + this.isSetAirlineLegCarrierCode, additionalDataAirline.isSetAirlineLegCarrierCode) && Objects.equals( this.airlineLegClassOfTravel, additionalDataAirline.airlineLegClassOfTravel) + && Objects.equals( + this.isSetAirlineLegClassOfTravel, additionalDataAirline.isSetAirlineLegClassOfTravel) && Objects.equals(this.airlineLegDateOfTravel, additionalDataAirline.airlineLegDateOfTravel) + && Objects.equals( + this.isSetAirlineLegDateOfTravel, additionalDataAirline.isSetAirlineLegDateOfTravel) && Objects.equals( this.airlineLegDepartAirport, additionalDataAirline.airlineLegDepartAirport) + && Objects.equals( + this.isSetAirlineLegDepartAirport, additionalDataAirline.isSetAirlineLegDepartAirport) && Objects.equals(this.airlineLegDepartTax, additionalDataAirline.airlineLegDepartTax) + && Objects.equals( + this.isSetAirlineLegDepartTax, additionalDataAirline.isSetAirlineLegDepartTax) && Objects.equals( this.airlineLegDestinationCode, additionalDataAirline.airlineLegDestinationCode) + && Objects.equals( + this.isSetAirlineLegDestinationCode, + additionalDataAirline.isSetAirlineLegDestinationCode) && Objects.equals(this.airlineLegFareBaseCode, additionalDataAirline.airlineLegFareBaseCode) + && Objects.equals( + this.isSetAirlineLegFareBaseCode, additionalDataAirline.isSetAirlineLegFareBaseCode) && Objects.equals(this.airlineLegFlightNumber, additionalDataAirline.airlineLegFlightNumber) + && Objects.equals( + this.isSetAirlineLegFlightNumber, additionalDataAirline.isSetAirlineLegFlightNumber) && Objects.equals(this.airlineLegStopOverCode, additionalDataAirline.airlineLegStopOverCode) + && Objects.equals( + this.isSetAirlineLegStopOverCode, additionalDataAirline.isSetAirlineLegStopOverCode) && Objects.equals( this.airlinePassengerDateOfBirth, additionalDataAirline.airlinePassengerDateOfBirth) + && Objects.equals( + this.isSetAirlinePassengerDateOfBirth, + additionalDataAirline.isSetAirlinePassengerDateOfBirth) && Objects.equals( this.airlinePassengerFirstName, additionalDataAirline.airlinePassengerFirstName) + && Objects.equals( + this.isSetAirlinePassengerFirstName, + additionalDataAirline.isSetAirlinePassengerFirstName) && Objects.equals( this.airlinePassengerLastName, additionalDataAirline.airlinePassengerLastName) + && Objects.equals( + this.isSetAirlinePassengerLastName, additionalDataAirline.isSetAirlinePassengerLastName) && Objects.equals( this.airlinePassengerPhoneNumber, additionalDataAirline.airlinePassengerPhoneNumber) + && Objects.equals( + this.isSetAirlinePassengerPhoneNumber, + additionalDataAirline.isSetAirlinePassengerPhoneNumber) && Objects.equals( this.airlinePassengerTravellerType, additionalDataAirline.airlinePassengerTravellerType) + && Objects.equals( + this.isSetAirlinePassengerTravellerType, + additionalDataAirline.isSetAirlinePassengerTravellerType) && Objects.equals(this.airlinePassengerName, additionalDataAirline.airlinePassengerName) + && Objects.equals( + this.isSetAirlinePassengerName, additionalDataAirline.isSetAirlinePassengerName) && Objects.equals( this.airlineTicketIssueAddress, additionalDataAirline.airlineTicketIssueAddress) + && Objects.equals( + this.isSetAirlineTicketIssueAddress, + additionalDataAirline.isSetAirlineTicketIssueAddress) && Objects.equals(this.airlineTicketNumber, additionalDataAirline.airlineTicketNumber) + && Objects.equals( + this.isSetAirlineTicketNumber, additionalDataAirline.isSetAirlineTicketNumber) && Objects.equals( this.airlineTravelAgencyCode, additionalDataAirline.airlineTravelAgencyCode) && Objects.equals( - this.airlineTravelAgencyName, additionalDataAirline.airlineTravelAgencyName); + this.isSetAirlineTravelAgencyCode, additionalDataAirline.isSetAirlineTravelAgencyCode) + && Objects.equals( + this.airlineTravelAgencyName, additionalDataAirline.airlineTravelAgencyName) + && Objects.equals( + this.isSetAirlineTravelAgencyName, additionalDataAirline.isSetAirlineTravelAgencyName); } @Override public int hashCode() { return Objects.hash( airlineAgencyInvoiceNumber, + isSetAirlineAgencyInvoiceNumber, airlineAgencyPlanName, + isSetAirlineAgencyPlanName, airlineAirlineCode, + isSetAirlineAirlineCode, airlineAirlineDesignatorCode, + isSetAirlineAirlineDesignatorCode, airlineBoardingFee, + isSetAirlineBoardingFee, airlineComputerizedReservationSystem, + isSetAirlineComputerizedReservationSystem, airlineCustomerReferenceNumber, + isSetAirlineCustomerReferenceNumber, airlineDocumentType, + isSetAirlineDocumentType, airlineFlightDate, + isSetAirlineFlightDate, airlineIssueDate, + isSetAirlineIssueDate, airlineLegCarrierCode, + isSetAirlineLegCarrierCode, airlineLegClassOfTravel, + isSetAirlineLegClassOfTravel, airlineLegDateOfTravel, + isSetAirlineLegDateOfTravel, airlineLegDepartAirport, + isSetAirlineLegDepartAirport, airlineLegDepartTax, + isSetAirlineLegDepartTax, airlineLegDestinationCode, + isSetAirlineLegDestinationCode, airlineLegFareBaseCode, + isSetAirlineLegFareBaseCode, airlineLegFlightNumber, + isSetAirlineLegFlightNumber, airlineLegStopOverCode, + isSetAirlineLegStopOverCode, airlinePassengerDateOfBirth, + isSetAirlinePassengerDateOfBirth, airlinePassengerFirstName, + isSetAirlinePassengerFirstName, airlinePassengerLastName, + isSetAirlinePassengerLastName, airlinePassengerPhoneNumber, + isSetAirlinePassengerPhoneNumber, airlinePassengerTravellerType, + isSetAirlinePassengerTravellerType, airlinePassengerName, + isSetAirlinePassengerName, airlineTicketIssueAddress, + isSetAirlineTicketIssueAddress, airlineTicketNumber, + isSetAirlineTicketNumber, airlineTravelAgencyCode, - airlineTravelAgencyName); + isSetAirlineTravelAgencyCode, + airlineTravelAgencyName, + isSetAirlineTravelAgencyName); } @Override @@ -1632,6 +1900,127 @@ 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 (isSetAirlineAgencyInvoiceNumber) { + addIfNull( + nulls, JSON_PROPERTY_AIRLINE_AGENCY_INVOICE_NUMBER, this.airlineAgencyInvoiceNumber); + } + if (isSetAirlineAgencyPlanName) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_AGENCY_PLAN_NAME, this.airlineAgencyPlanName); + } + if (isSetAirlineAirlineCode) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_AIRLINE_CODE, this.airlineAirlineCode); + } + if (isSetAirlineAirlineDesignatorCode) { + addIfNull( + nulls, JSON_PROPERTY_AIRLINE_AIRLINE_DESIGNATOR_CODE, this.airlineAirlineDesignatorCode); + } + if (isSetAirlineBoardingFee) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_BOARDING_FEE, this.airlineBoardingFee); + } + if (isSetAirlineComputerizedReservationSystem) { + addIfNull( + nulls, + JSON_PROPERTY_AIRLINE_COMPUTERIZED_RESERVATION_SYSTEM, + this.airlineComputerizedReservationSystem); + } + if (isSetAirlineCustomerReferenceNumber) { + addIfNull( + nulls, + JSON_PROPERTY_AIRLINE_CUSTOMER_REFERENCE_NUMBER, + this.airlineCustomerReferenceNumber); + } + if (isSetAirlineDocumentType) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_DOCUMENT_TYPE, this.airlineDocumentType); + } + if (isSetAirlineFlightDate) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_FLIGHT_DATE, this.airlineFlightDate); + } + if (isSetAirlineIssueDate) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_ISSUE_DATE, this.airlineIssueDate); + } + if (isSetAirlineLegCarrierCode) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_LEG_CARRIER_CODE, this.airlineLegCarrierCode); + } + if (isSetAirlineLegClassOfTravel) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_LEG_CLASS_OF_TRAVEL, this.airlineLegClassOfTravel); + } + if (isSetAirlineLegDateOfTravel) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_LEG_DATE_OF_TRAVEL, this.airlineLegDateOfTravel); + } + if (isSetAirlineLegDepartAirport) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_LEG_DEPART_AIRPORT, this.airlineLegDepartAirport); + } + if (isSetAirlineLegDepartTax) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_LEG_DEPART_TAX, this.airlineLegDepartTax); + } + if (isSetAirlineLegDestinationCode) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_LEG_DESTINATION_CODE, this.airlineLegDestinationCode); + } + if (isSetAirlineLegFareBaseCode) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_LEG_FARE_BASE_CODE, this.airlineLegFareBaseCode); + } + if (isSetAirlineLegFlightNumber) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_LEG_FLIGHT_NUMBER, this.airlineLegFlightNumber); + } + if (isSetAirlineLegStopOverCode) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_LEG_STOP_OVER_CODE, this.airlineLegStopOverCode); + } + if (isSetAirlinePassengerDateOfBirth) { + addIfNull( + nulls, JSON_PROPERTY_AIRLINE_PASSENGER_DATE_OF_BIRTH, this.airlinePassengerDateOfBirth); + } + if (isSetAirlinePassengerFirstName) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_PASSENGER_FIRST_NAME, this.airlinePassengerFirstName); + } + if (isSetAirlinePassengerLastName) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_PASSENGER_LAST_NAME, this.airlinePassengerLastName); + } + if (isSetAirlinePassengerPhoneNumber) { + addIfNull( + nulls, JSON_PROPERTY_AIRLINE_PASSENGER_PHONE_NUMBER, this.airlinePassengerPhoneNumber); + } + if (isSetAirlinePassengerTravellerType) { + addIfNull( + nulls, + JSON_PROPERTY_AIRLINE_PASSENGER_TRAVELLER_TYPE, + this.airlinePassengerTravellerType); + } + if (isSetAirlinePassengerName) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_PASSENGER_NAME, this.airlinePassengerName); + } + if (isSetAirlineTicketIssueAddress) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_TICKET_ISSUE_ADDRESS, this.airlineTicketIssueAddress); + } + if (isSetAirlineTicketNumber) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_TICKET_NUMBER, this.airlineTicketNumber); + } + if (isSetAirlineTravelAgencyCode) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_TRAVEL_AGENCY_CODE, this.airlineTravelAgencyCode); + } + if (isSetAirlineTravelAgencyName) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_TRAVEL_AGENCY_NAME, this.airlineTravelAgencyName); + } + + 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 AdditionalDataAirline given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataCarRental.java b/src/main/java/com/adyen/model/payment/AdditionalDataCarRental.java index a260323dc..40ed98055 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataCarRental.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataCarRental.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -47,84 +49,159 @@ public class AdditionalDataCarRental { public static final String JSON_PROPERTY_CAR_RENTAL_CHECK_OUT_DATE = "carRental.checkOutDate"; private String carRentalCheckOutDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalCheckOutDate = false; + public static final String JSON_PROPERTY_CAR_RENTAL_CUSTOMER_SERVICE_TOLL_FREE_NUMBER = "carRental.customerServiceTollFreeNumber"; private String carRentalCustomerServiceTollFreeNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalCustomerServiceTollFreeNumber = false; + public static final String JSON_PROPERTY_CAR_RENTAL_DAYS_RENTED = "carRental.daysRented"; private String carRentalDaysRented; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalDaysRented = false; + public static final String JSON_PROPERTY_CAR_RENTAL_FUEL_CHARGES = "carRental.fuelCharges"; private String carRentalFuelCharges; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalFuelCharges = false; + public static final String JSON_PROPERTY_CAR_RENTAL_INSURANCE_CHARGES = "carRental.insuranceCharges"; private String carRentalInsuranceCharges; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalInsuranceCharges = false; + public static final String JSON_PROPERTY_CAR_RENTAL_LOCATION_CITY = "carRental.locationCity"; private String carRentalLocationCity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalLocationCity = false; + public static final String JSON_PROPERTY_CAR_RENTAL_LOCATION_COUNTRY = "carRental.locationCountry"; private String carRentalLocationCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalLocationCountry = false; + public static final String JSON_PROPERTY_CAR_RENTAL_LOCATION_STATE_PROVINCE = "carRental.locationStateProvince"; private String carRentalLocationStateProvince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalLocationStateProvince = false; + public static final String JSON_PROPERTY_CAR_RENTAL_NO_SHOW_INDICATOR = "carRental.noShowIndicator"; private String carRentalNoShowIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalNoShowIndicator = false; + public static final String JSON_PROPERTY_CAR_RENTAL_ONE_WAY_DROP_OFF_CHARGES = "carRental.oneWayDropOffCharges"; private String carRentalOneWayDropOffCharges; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalOneWayDropOffCharges = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RATE = "carRental.rate"; private String carRentalRate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalRate = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RATE_INDICATOR = "carRental.rateIndicator"; private String carRentalRateIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalRateIndicator = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RENTAL_AGREEMENT_NUMBER = "carRental.rentalAgreementNumber"; private String carRentalRentalAgreementNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalRentalAgreementNumber = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RENTAL_CLASS_ID = "carRental.rentalClassId"; private String carRentalRentalClassId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalRentalClassId = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RENTER_NAME = "carRental.renterName"; private String carRentalRenterName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalRenterName = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RETURN_CITY = "carRental.returnCity"; private String carRentalReturnCity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalReturnCity = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RETURN_COUNTRY = "carRental.returnCountry"; private String carRentalReturnCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalReturnCountry = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RETURN_DATE = "carRental.returnDate"; private String carRentalReturnDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalReturnDate = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RETURN_LOCATION_ID = "carRental.returnLocationId"; private String carRentalReturnLocationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalReturnLocationId = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RETURN_STATE_PROVINCE = "carRental.returnStateProvince"; private String carRentalReturnStateProvince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalReturnStateProvince = false; + public static final String JSON_PROPERTY_CAR_RENTAL_TAX_EXEMPT_INDICATOR = "carRental.taxExemptIndicator"; private String carRentalTaxExemptIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalTaxExemptIndicator = false; + public static final String JSON_PROPERTY_TRAVEL_ENTERTAINMENT_AUTH_DATA_DURATION = "travelEntertainmentAuthData.duration"; private String travelEntertainmentAuthDataDuration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTravelEntertainmentAuthDataDuration = false; + public static final String JSON_PROPERTY_TRAVEL_ENTERTAINMENT_AUTH_DATA_MARKET = "travelEntertainmentAuthData.market"; private String travelEntertainmentAuthDataMarket; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTravelEntertainmentAuthDataMarket = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataCarRental() {} /** @@ -135,6 +212,7 @@ public AdditionalDataCarRental() {} */ public AdditionalDataCarRental carRentalCheckOutDate(String carRentalCheckOutDate) { this.carRentalCheckOutDate = carRentalCheckOutDate; + isSetCarRentalCheckOutDate = true; // mark as set return this; } @@ -158,6 +236,7 @@ public String getCarRentalCheckOutDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalCheckOutDate(String carRentalCheckOutDate) { this.carRentalCheckOutDate = carRentalCheckOutDate; + isSetCarRentalCheckOutDate = true; // mark as set } /** @@ -174,6 +253,7 @@ public void setCarRentalCheckOutDate(String carRentalCheckOutDate) { public AdditionalDataCarRental carRentalCustomerServiceTollFreeNumber( String carRentalCustomerServiceTollFreeNumber) { this.carRentalCustomerServiceTollFreeNumber = carRentalCustomerServiceTollFreeNumber; + isSetCarRentalCustomerServiceTollFreeNumber = true; // mark as set return this; } @@ -208,6 +288,7 @@ public String getCarRentalCustomerServiceTollFreeNumber() { public void setCarRentalCustomerServiceTollFreeNumber( String carRentalCustomerServiceTollFreeNumber) { this.carRentalCustomerServiceTollFreeNumber = carRentalCustomerServiceTollFreeNumber; + isSetCarRentalCustomerServiceTollFreeNumber = true; // mark as set } /** @@ -220,6 +301,7 @@ public void setCarRentalCustomerServiceTollFreeNumber( */ public AdditionalDataCarRental carRentalDaysRented(String carRentalDaysRented) { this.carRentalDaysRented = carRentalDaysRented; + isSetCarRentalDaysRented = true; // mark as set return this; } @@ -247,6 +329,7 @@ public String getCarRentalDaysRented() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalDaysRented(String carRentalDaysRented) { this.carRentalDaysRented = carRentalDaysRented; + isSetCarRentalDaysRented = true; // mark as set } /** @@ -261,6 +344,7 @@ public void setCarRentalDaysRented(String carRentalDaysRented) { */ public AdditionalDataCarRental carRentalFuelCharges(String carRentalFuelCharges) { this.carRentalFuelCharges = carRentalFuelCharges; + isSetCarRentalFuelCharges = true; // mark as set return this; } @@ -292,6 +376,7 @@ public String getCarRentalFuelCharges() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalFuelCharges(String carRentalFuelCharges) { this.carRentalFuelCharges = carRentalFuelCharges; + isSetCarRentalFuelCharges = true; // mark as set } /** @@ -306,6 +391,7 @@ public void setCarRentalFuelCharges(String carRentalFuelCharges) { */ public AdditionalDataCarRental carRentalInsuranceCharges(String carRentalInsuranceCharges) { this.carRentalInsuranceCharges = carRentalInsuranceCharges; + isSetCarRentalInsuranceCharges = true; // mark as set return this; } @@ -337,6 +423,7 @@ public String getCarRentalInsuranceCharges() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalInsuranceCharges(String carRentalInsuranceCharges) { this.carRentalInsuranceCharges = carRentalInsuranceCharges; + isSetCarRentalInsuranceCharges = true; // mark as set } /** @@ -349,6 +436,7 @@ public void setCarRentalInsuranceCharges(String carRentalInsuranceCharges) { */ public AdditionalDataCarRental carRentalLocationCity(String carRentalLocationCity) { this.carRentalLocationCity = carRentalLocationCity; + isSetCarRentalLocationCity = true; // mark as set return this; } @@ -376,6 +464,7 @@ public String getCarRentalLocationCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalLocationCity(String carRentalLocationCity) { this.carRentalLocationCity = carRentalLocationCity; + isSetCarRentalLocationCity = true; // mark as set } /** @@ -390,6 +479,7 @@ public void setCarRentalLocationCity(String carRentalLocationCity) { */ public AdditionalDataCarRental carRentalLocationCountry(String carRentalLocationCountry) { this.carRentalLocationCountry = carRentalLocationCountry; + isSetCarRentalLocationCountry = true; // mark as set return this; } @@ -421,6 +511,7 @@ public String getCarRentalLocationCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalLocationCountry(String carRentalLocationCountry) { this.carRentalLocationCountry = carRentalLocationCountry; + isSetCarRentalLocationCountry = true; // mark as set } /** @@ -435,6 +526,7 @@ public void setCarRentalLocationCountry(String carRentalLocationCountry) { public AdditionalDataCarRental carRentalLocationStateProvince( String carRentalLocationStateProvince) { this.carRentalLocationStateProvince = carRentalLocationStateProvince; + isSetCarRentalLocationStateProvince = true; // mark as set return this; } @@ -464,6 +556,7 @@ public String getCarRentalLocationStateProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalLocationStateProvince(String carRentalLocationStateProvince) { this.carRentalLocationStateProvince = carRentalLocationStateProvince; + isSetCarRentalLocationStateProvince = true; // mark as set } /** @@ -476,6 +569,7 @@ public void setCarRentalLocationStateProvince(String carRentalLocationStateProvi */ public AdditionalDataCarRental carRentalNoShowIndicator(String carRentalNoShowIndicator) { this.carRentalNoShowIndicator = carRentalNoShowIndicator; + isSetCarRentalNoShowIndicator = true; // mark as set return this; } @@ -503,6 +597,7 @@ public String getCarRentalNoShowIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalNoShowIndicator(String carRentalNoShowIndicator) { this.carRentalNoShowIndicator = carRentalNoShowIndicator; + isSetCarRentalNoShowIndicator = true; // mark as set } /** @@ -517,6 +612,7 @@ public void setCarRentalNoShowIndicator(String carRentalNoShowIndicator) { public AdditionalDataCarRental carRentalOneWayDropOffCharges( String carRentalOneWayDropOffCharges) { this.carRentalOneWayDropOffCharges = carRentalOneWayDropOffCharges; + isSetCarRentalOneWayDropOffCharges = true; // mark as set return this; } @@ -546,6 +642,7 @@ public String getCarRentalOneWayDropOffCharges() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalOneWayDropOffCharges(String carRentalOneWayDropOffCharges) { this.carRentalOneWayDropOffCharges = carRentalOneWayDropOffCharges; + isSetCarRentalOneWayDropOffCharges = true; // mark as set } /** @@ -560,6 +657,7 @@ public void setCarRentalOneWayDropOffCharges(String carRentalOneWayDropOffCharge */ public AdditionalDataCarRental carRentalRate(String carRentalRate) { this.carRentalRate = carRentalRate; + isSetCarRentalRate = true; // mark as set return this; } @@ -591,6 +689,7 @@ public String getCarRentalRate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalRate(String carRentalRate) { this.carRentalRate = carRentalRate; + isSetCarRentalRate = true; // mark as set } /** @@ -602,6 +701,7 @@ public void setCarRentalRate(String carRentalRate) { */ public AdditionalDataCarRental carRentalRateIndicator(String carRentalRateIndicator) { this.carRentalRateIndicator = carRentalRateIndicator; + isSetCarRentalRateIndicator = true; // mark as set return this; } @@ -627,6 +727,7 @@ public String getCarRentalRateIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalRateIndicator(String carRentalRateIndicator) { this.carRentalRateIndicator = carRentalRateIndicator; + isSetCarRentalRateIndicator = true; // mark as set } /** @@ -641,6 +742,7 @@ public void setCarRentalRateIndicator(String carRentalRateIndicator) { public AdditionalDataCarRental carRentalRentalAgreementNumber( String carRentalRentalAgreementNumber) { this.carRentalRentalAgreementNumber = carRentalRentalAgreementNumber; + isSetCarRentalRentalAgreementNumber = true; // mark as set return this; } @@ -670,6 +772,7 @@ public String getCarRentalRentalAgreementNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalRentalAgreementNumber(String carRentalRentalAgreementNumber) { this.carRentalRentalAgreementNumber = carRentalRentalAgreementNumber; + isSetCarRentalRentalAgreementNumber = true; // mark as set } /** @@ -682,6 +785,7 @@ public void setCarRentalRentalAgreementNumber(String carRentalRentalAgreementNum */ public AdditionalDataCarRental carRentalRentalClassId(String carRentalRentalClassId) { this.carRentalRentalClassId = carRentalRentalClassId; + isSetCarRentalRentalClassId = true; // mark as set return this; } @@ -709,6 +813,7 @@ public String getCarRentalRentalClassId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalRentalClassId(String carRentalRentalClassId) { this.carRentalRentalClassId = carRentalRentalClassId; + isSetCarRentalRentalClassId = true; // mark as set } /** @@ -723,6 +828,7 @@ public void setCarRentalRentalClassId(String carRentalRentalClassId) { */ public AdditionalDataCarRental carRentalRenterName(String carRentalRenterName) { this.carRentalRenterName = carRentalRenterName; + isSetCarRentalRenterName = true; // mark as set return this; } @@ -754,6 +860,7 @@ public String getCarRentalRenterName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalRenterName(String carRentalRenterName) { this.carRentalRenterName = carRentalRenterName; + isSetCarRentalRenterName = true; // mark as set } /** @@ -766,6 +873,7 @@ public void setCarRentalRenterName(String carRentalRenterName) { */ public AdditionalDataCarRental carRentalReturnCity(String carRentalReturnCity) { this.carRentalReturnCity = carRentalReturnCity; + isSetCarRentalReturnCity = true; // mark as set return this; } @@ -793,6 +901,7 @@ public String getCarRentalReturnCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalReturnCity(String carRentalReturnCity) { this.carRentalReturnCity = carRentalReturnCity; + isSetCarRentalReturnCity = true; // mark as set } /** @@ -807,6 +916,7 @@ public void setCarRentalReturnCity(String carRentalReturnCity) { */ public AdditionalDataCarRental carRentalReturnCountry(String carRentalReturnCountry) { this.carRentalReturnCountry = carRentalReturnCountry; + isSetCarRentalReturnCountry = true; // mark as set return this; } @@ -838,6 +948,7 @@ public String getCarRentalReturnCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalReturnCountry(String carRentalReturnCountry) { this.carRentalReturnCountry = carRentalReturnCountry; + isSetCarRentalReturnCountry = true; // mark as set } /** @@ -849,6 +960,7 @@ public void setCarRentalReturnCountry(String carRentalReturnCountry) { */ public AdditionalDataCarRental carRentalReturnDate(String carRentalReturnDate) { this.carRentalReturnDate = carRentalReturnDate; + isSetCarRentalReturnDate = true; // mark as set return this; } @@ -874,6 +986,7 @@ public String getCarRentalReturnDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalReturnDate(String carRentalReturnDate) { this.carRentalReturnDate = carRentalReturnDate; + isSetCarRentalReturnDate = true; // mark as set } /** @@ -887,6 +1000,7 @@ public void setCarRentalReturnDate(String carRentalReturnDate) { */ public AdditionalDataCarRental carRentalReturnLocationId(String carRentalReturnLocationId) { this.carRentalReturnLocationId = carRentalReturnLocationId; + isSetCarRentalReturnLocationId = true; // mark as set return this; } @@ -916,6 +1030,7 @@ public String getCarRentalReturnLocationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalReturnLocationId(String carRentalReturnLocationId) { this.carRentalReturnLocationId = carRentalReturnLocationId; + isSetCarRentalReturnLocationId = true; // mark as set } /** @@ -929,6 +1044,7 @@ public void setCarRentalReturnLocationId(String carRentalReturnLocationId) { */ public AdditionalDataCarRental carRentalReturnStateProvince(String carRentalReturnStateProvince) { this.carRentalReturnStateProvince = carRentalReturnStateProvince; + isSetCarRentalReturnStateProvince = true; // mark as set return this; } @@ -958,6 +1074,7 @@ public String getCarRentalReturnStateProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalReturnStateProvince(String carRentalReturnStateProvince) { this.carRentalReturnStateProvince = carRentalReturnStateProvince; + isSetCarRentalReturnStateProvince = true; // mark as set } /** @@ -971,6 +1088,7 @@ public void setCarRentalReturnStateProvince(String carRentalReturnStateProvince) */ public AdditionalDataCarRental carRentalTaxExemptIndicator(String carRentalTaxExemptIndicator) { this.carRentalTaxExemptIndicator = carRentalTaxExemptIndicator; + isSetCarRentalTaxExemptIndicator = true; // mark as set return this; } @@ -1000,6 +1118,7 @@ public String getCarRentalTaxExemptIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalTaxExemptIndicator(String carRentalTaxExemptIndicator) { this.carRentalTaxExemptIndicator = carRentalTaxExemptIndicator; + isSetCarRentalTaxExemptIndicator = true; // mark as set } /** @@ -1013,6 +1132,7 @@ public void setCarRentalTaxExemptIndicator(String carRentalTaxExemptIndicator) { public AdditionalDataCarRental travelEntertainmentAuthDataDuration( String travelEntertainmentAuthDataDuration) { this.travelEntertainmentAuthDataDuration = travelEntertainmentAuthDataDuration; + isSetTravelEntertainmentAuthDataDuration = true; // mark as set return this; } @@ -1040,6 +1160,7 @@ public String getTravelEntertainmentAuthDataDuration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTravelEntertainmentAuthDataDuration(String travelEntertainmentAuthDataDuration) { this.travelEntertainmentAuthDataDuration = travelEntertainmentAuthDataDuration; + isSetTravelEntertainmentAuthDataDuration = true; // mark as set } /** @@ -1055,6 +1176,7 @@ public void setTravelEntertainmentAuthDataDuration(String travelEntertainmentAut public AdditionalDataCarRental travelEntertainmentAuthDataMarket( String travelEntertainmentAuthDataMarket) { this.travelEntertainmentAuthDataMarket = travelEntertainmentAuthDataMarket; + isSetTravelEntertainmentAuthDataMarket = true; // mark as set return this; } @@ -1086,6 +1208,27 @@ public String getTravelEntertainmentAuthDataMarket() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTravelEntertainmentAuthDataMarket(String travelEntertainmentAuthDataMarket) { this.travelEntertainmentAuthDataMarket = travelEntertainmentAuthDataMarket; + isSetTravelEntertainmentAuthDataMarket = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataCarRental 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 AdditionalDataCarRental object is equal to o. */ @@ -1099,77 +1242,157 @@ public boolean equals(Object o) { } AdditionalDataCarRental additionalDataCarRental = (AdditionalDataCarRental) o; return Objects.equals(this.carRentalCheckOutDate, additionalDataCarRental.carRentalCheckOutDate) + && Objects.equals( + this.isSetCarRentalCheckOutDate, additionalDataCarRental.isSetCarRentalCheckOutDate) && Objects.equals( this.carRentalCustomerServiceTollFreeNumber, additionalDataCarRental.carRentalCustomerServiceTollFreeNumber) + && Objects.equals( + this.isSetCarRentalCustomerServiceTollFreeNumber, + additionalDataCarRental.isSetCarRentalCustomerServiceTollFreeNumber) && Objects.equals(this.carRentalDaysRented, additionalDataCarRental.carRentalDaysRented) + && Objects.equals( + this.isSetCarRentalDaysRented, additionalDataCarRental.isSetCarRentalDaysRented) && Objects.equals(this.carRentalFuelCharges, additionalDataCarRental.carRentalFuelCharges) + && Objects.equals( + this.isSetCarRentalFuelCharges, additionalDataCarRental.isSetCarRentalFuelCharges) && Objects.equals( this.carRentalInsuranceCharges, additionalDataCarRental.carRentalInsuranceCharges) + && Objects.equals( + this.isSetCarRentalInsuranceCharges, + additionalDataCarRental.isSetCarRentalInsuranceCharges) && Objects.equals(this.carRentalLocationCity, additionalDataCarRental.carRentalLocationCity) + && Objects.equals( + this.isSetCarRentalLocationCity, additionalDataCarRental.isSetCarRentalLocationCity) && Objects.equals( this.carRentalLocationCountry, additionalDataCarRental.carRentalLocationCountry) + && Objects.equals( + this.isSetCarRentalLocationCountry, + additionalDataCarRental.isSetCarRentalLocationCountry) && Objects.equals( this.carRentalLocationStateProvince, additionalDataCarRental.carRentalLocationStateProvince) + && Objects.equals( + this.isSetCarRentalLocationStateProvince, + additionalDataCarRental.isSetCarRentalLocationStateProvince) && Objects.equals( this.carRentalNoShowIndicator, additionalDataCarRental.carRentalNoShowIndicator) + && Objects.equals( + this.isSetCarRentalNoShowIndicator, + additionalDataCarRental.isSetCarRentalNoShowIndicator) && Objects.equals( this.carRentalOneWayDropOffCharges, additionalDataCarRental.carRentalOneWayDropOffCharges) + && Objects.equals( + this.isSetCarRentalOneWayDropOffCharges, + additionalDataCarRental.isSetCarRentalOneWayDropOffCharges) && Objects.equals(this.carRentalRate, additionalDataCarRental.carRentalRate) + && Objects.equals(this.isSetCarRentalRate, additionalDataCarRental.isSetCarRentalRate) && Objects.equals( this.carRentalRateIndicator, additionalDataCarRental.carRentalRateIndicator) + && Objects.equals( + this.isSetCarRentalRateIndicator, additionalDataCarRental.isSetCarRentalRateIndicator) && Objects.equals( this.carRentalRentalAgreementNumber, additionalDataCarRental.carRentalRentalAgreementNumber) + && Objects.equals( + this.isSetCarRentalRentalAgreementNumber, + additionalDataCarRental.isSetCarRentalRentalAgreementNumber) && Objects.equals( this.carRentalRentalClassId, additionalDataCarRental.carRentalRentalClassId) + && Objects.equals( + this.isSetCarRentalRentalClassId, additionalDataCarRental.isSetCarRentalRentalClassId) && Objects.equals(this.carRentalRenterName, additionalDataCarRental.carRentalRenterName) + && Objects.equals( + this.isSetCarRentalRenterName, additionalDataCarRental.isSetCarRentalRenterName) && Objects.equals(this.carRentalReturnCity, additionalDataCarRental.carRentalReturnCity) + && Objects.equals( + this.isSetCarRentalReturnCity, additionalDataCarRental.isSetCarRentalReturnCity) && Objects.equals( this.carRentalReturnCountry, additionalDataCarRental.carRentalReturnCountry) + && Objects.equals( + this.isSetCarRentalReturnCountry, additionalDataCarRental.isSetCarRentalReturnCountry) && Objects.equals(this.carRentalReturnDate, additionalDataCarRental.carRentalReturnDate) + && Objects.equals( + this.isSetCarRentalReturnDate, additionalDataCarRental.isSetCarRentalReturnDate) && Objects.equals( this.carRentalReturnLocationId, additionalDataCarRental.carRentalReturnLocationId) + && Objects.equals( + this.isSetCarRentalReturnLocationId, + additionalDataCarRental.isSetCarRentalReturnLocationId) && Objects.equals( this.carRentalReturnStateProvince, additionalDataCarRental.carRentalReturnStateProvince) + && Objects.equals( + this.isSetCarRentalReturnStateProvince, + additionalDataCarRental.isSetCarRentalReturnStateProvince) && Objects.equals( this.carRentalTaxExemptIndicator, additionalDataCarRental.carRentalTaxExemptIndicator) + && Objects.equals( + this.isSetCarRentalTaxExemptIndicator, + additionalDataCarRental.isSetCarRentalTaxExemptIndicator) && Objects.equals( this.travelEntertainmentAuthDataDuration, additionalDataCarRental.travelEntertainmentAuthDataDuration) + && Objects.equals( + this.isSetTravelEntertainmentAuthDataDuration, + additionalDataCarRental.isSetTravelEntertainmentAuthDataDuration) && Objects.equals( this.travelEntertainmentAuthDataMarket, - additionalDataCarRental.travelEntertainmentAuthDataMarket); + additionalDataCarRental.travelEntertainmentAuthDataMarket) + && Objects.equals( + this.isSetTravelEntertainmentAuthDataMarket, + additionalDataCarRental.isSetTravelEntertainmentAuthDataMarket); } @Override public int hashCode() { return Objects.hash( carRentalCheckOutDate, + isSetCarRentalCheckOutDate, carRentalCustomerServiceTollFreeNumber, + isSetCarRentalCustomerServiceTollFreeNumber, carRentalDaysRented, + isSetCarRentalDaysRented, carRentalFuelCharges, + isSetCarRentalFuelCharges, carRentalInsuranceCharges, + isSetCarRentalInsuranceCharges, carRentalLocationCity, + isSetCarRentalLocationCity, carRentalLocationCountry, + isSetCarRentalLocationCountry, carRentalLocationStateProvince, + isSetCarRentalLocationStateProvince, carRentalNoShowIndicator, + isSetCarRentalNoShowIndicator, carRentalOneWayDropOffCharges, + isSetCarRentalOneWayDropOffCharges, carRentalRate, + isSetCarRentalRate, carRentalRateIndicator, + isSetCarRentalRateIndicator, carRentalRentalAgreementNumber, + isSetCarRentalRentalAgreementNumber, carRentalRentalClassId, + isSetCarRentalRentalClassId, carRentalRenterName, + isSetCarRentalRenterName, carRentalReturnCity, + isSetCarRentalReturnCity, carRentalReturnCountry, + isSetCarRentalReturnCountry, carRentalReturnDate, + isSetCarRentalReturnDate, carRentalReturnLocationId, + isSetCarRentalReturnLocationId, carRentalReturnStateProvince, + isSetCarRentalReturnStateProvince, carRentalTaxExemptIndicator, + isSetCarRentalTaxExemptIndicator, travelEntertainmentAuthDataDuration, - travelEntertainmentAuthDataMarket); + isSetTravelEntertainmentAuthDataDuration, + travelEntertainmentAuthDataMarket, + isSetTravelEntertainmentAuthDataMarket); } @Override @@ -1257,6 +1480,116 @@ 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 (isSetCarRentalCheckOutDate) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_CHECK_OUT_DATE, this.carRentalCheckOutDate); + } + if (isSetCarRentalCustomerServiceTollFreeNumber) { + addIfNull( + nulls, + JSON_PROPERTY_CAR_RENTAL_CUSTOMER_SERVICE_TOLL_FREE_NUMBER, + this.carRentalCustomerServiceTollFreeNumber); + } + if (isSetCarRentalDaysRented) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_DAYS_RENTED, this.carRentalDaysRented); + } + if (isSetCarRentalFuelCharges) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_FUEL_CHARGES, this.carRentalFuelCharges); + } + if (isSetCarRentalInsuranceCharges) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_INSURANCE_CHARGES, this.carRentalInsuranceCharges); + } + if (isSetCarRentalLocationCity) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_LOCATION_CITY, this.carRentalLocationCity); + } + if (isSetCarRentalLocationCountry) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_LOCATION_COUNTRY, this.carRentalLocationCountry); + } + if (isSetCarRentalLocationStateProvince) { + addIfNull( + nulls, + JSON_PROPERTY_CAR_RENTAL_LOCATION_STATE_PROVINCE, + this.carRentalLocationStateProvince); + } + if (isSetCarRentalNoShowIndicator) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_NO_SHOW_INDICATOR, this.carRentalNoShowIndicator); + } + if (isSetCarRentalOneWayDropOffCharges) { + addIfNull( + nulls, + JSON_PROPERTY_CAR_RENTAL_ONE_WAY_DROP_OFF_CHARGES, + this.carRentalOneWayDropOffCharges); + } + if (isSetCarRentalRate) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_RATE, this.carRentalRate); + } + if (isSetCarRentalRateIndicator) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_RATE_INDICATOR, this.carRentalRateIndicator); + } + if (isSetCarRentalRentalAgreementNumber) { + addIfNull( + nulls, + JSON_PROPERTY_CAR_RENTAL_RENTAL_AGREEMENT_NUMBER, + this.carRentalRentalAgreementNumber); + } + if (isSetCarRentalRentalClassId) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_RENTAL_CLASS_ID, this.carRentalRentalClassId); + } + if (isSetCarRentalRenterName) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_RENTER_NAME, this.carRentalRenterName); + } + if (isSetCarRentalReturnCity) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_RETURN_CITY, this.carRentalReturnCity); + } + if (isSetCarRentalReturnCountry) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_RETURN_COUNTRY, this.carRentalReturnCountry); + } + if (isSetCarRentalReturnDate) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_RETURN_DATE, this.carRentalReturnDate); + } + if (isSetCarRentalReturnLocationId) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_RETURN_LOCATION_ID, this.carRentalReturnLocationId); + } + if (isSetCarRentalReturnStateProvince) { + addIfNull( + nulls, JSON_PROPERTY_CAR_RENTAL_RETURN_STATE_PROVINCE, this.carRentalReturnStateProvince); + } + if (isSetCarRentalTaxExemptIndicator) { + addIfNull( + nulls, JSON_PROPERTY_CAR_RENTAL_TAX_EXEMPT_INDICATOR, this.carRentalTaxExemptIndicator); + } + if (isSetTravelEntertainmentAuthDataDuration) { + addIfNull( + nulls, + JSON_PROPERTY_TRAVEL_ENTERTAINMENT_AUTH_DATA_DURATION, + this.travelEntertainmentAuthDataDuration); + } + if (isSetTravelEntertainmentAuthDataMarket) { + addIfNull( + nulls, + JSON_PROPERTY_TRAVEL_ENTERTAINMENT_AUTH_DATA_MARKET, + this.travelEntertainmentAuthDataMarket); + } + + 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 AdditionalDataCarRental given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataCommon.java b/src/main/java/com/adyen/model/payment/AdditionalDataCommon.java index 05f31cf1c..abeb686d0 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataCommon.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataCommon.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -50,22 +52,40 @@ public class AdditionalDataCommon { "RequestedTestAcquirerResponseCode"; private String requestedTestAcquirerResponseCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedTestAcquirerResponseCode = false; + public static final String JSON_PROPERTY_REQUESTED_TEST_ERROR_RESPONSE_CODE = "RequestedTestErrorResponseCode"; private String requestedTestErrorResponseCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedTestErrorResponseCode = false; + public static final String JSON_PROPERTY_ALLOW_PARTIAL_AUTH = "allowPartialAuth"; private String allowPartialAuth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowPartialAuth = false; + public static final String JSON_PROPERTY_AUTHORISATION_TYPE = "authorisationType"; private String authorisationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorisationType = false; + public static final String JSON_PROPERTY_AUTO_RESCUE = "autoRescue"; private String autoRescue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAutoRescue = false; + public static final String JSON_PROPERTY_CUSTOM_ROUTING_FLAG = "customRoutingFlag"; private String customRoutingFlag; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCustomRoutingFlag = false; + /** * In case of [asynchronous authorisation * adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#adjust-authorisation), @@ -117,48 +137,99 @@ public static IndustryUsageEnum fromValue(String value) { public static final String JSON_PROPERTY_INDUSTRY_USAGE = "industryUsage"; private IndustryUsageEnum industryUsage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIndustryUsage = false; + public static final String JSON_PROPERTY_MANUAL_CAPTURE = "manualCapture"; private String manualCapture; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetManualCapture = false; + public static final String JSON_PROPERTY_MAX_DAYS_TO_RESCUE = "maxDaysToRescue"; private String maxDaysToRescue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaxDaysToRescue = false; + public static final String JSON_PROPERTY_NETWORK_TX_REFERENCE = "networkTxReference"; private String networkTxReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkTxReference = false; + public static final String JSON_PROPERTY_OVERWRITE_BRAND = "overwriteBrand"; private String overwriteBrand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOverwriteBrand = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_CITY = "subMerchantCity"; private String subMerchantCity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantCity = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_COUNTRY = "subMerchantCountry"; private String subMerchantCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantCountry = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_EMAIL = "subMerchantEmail"; private String subMerchantEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantEmail = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_I_D = "subMerchantID"; private String subMerchantID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantID = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_NAME = "subMerchantName"; private String subMerchantName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantName = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_PHONE_NUMBER = "subMerchantPhoneNumber"; private String subMerchantPhoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantPhoneNumber = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_POSTAL_CODE = "subMerchantPostalCode"; private String subMerchantPostalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantPostalCode = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_STATE = "subMerchantState"; private String subMerchantState; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantState = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_STREET = "subMerchantStreet"; private String subMerchantStreet; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantStreet = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_TAX_ID = "subMerchantTaxId"; private String subMerchantTaxId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantTaxId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataCommon() {} /** @@ -176,6 +247,7 @@ public AdditionalDataCommon() {} public AdditionalDataCommon requestedTestAcquirerResponseCode( String requestedTestAcquirerResponseCode) { this.requestedTestAcquirerResponseCode = requestedTestAcquirerResponseCode; + isSetRequestedTestAcquirerResponseCode = true; // mark as set return this; } @@ -211,6 +283,7 @@ public String getRequestedTestAcquirerResponseCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestedTestAcquirerResponseCode(String requestedTestAcquirerResponseCode) { this.requestedTestAcquirerResponseCode = requestedTestAcquirerResponseCode; + isSetRequestedTestAcquirerResponseCode = true; // mark as set } /** @@ -243,6 +316,7 @@ public void setRequestedTestAcquirerResponseCode(String requestedTestAcquirerRes public AdditionalDataCommon requestedTestErrorResponseCode( String requestedTestErrorResponseCode) { this.requestedTestErrorResponseCode = requestedTestErrorResponseCode; + isSetRequestedTestErrorResponseCode = true; // mark as set return this; } @@ -308,6 +382,7 @@ public String getRequestedTestErrorResponseCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestedTestErrorResponseCode(String requestedTestErrorResponseCode) { this.requestedTestErrorResponseCode = requestedTestErrorResponseCode; + isSetRequestedTestErrorResponseCode = true; // mark as set } /** @@ -325,6 +400,7 @@ public void setRequestedTestErrorResponseCode(String requestedTestErrorResponseC */ public AdditionalDataCommon allowPartialAuth(String allowPartialAuth) { this.allowPartialAuth = allowPartialAuth; + isSetAllowPartialAuth = true; // mark as set return this; } @@ -362,6 +438,7 @@ public String getAllowPartialAuth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowPartialAuth(String allowPartialAuth) { this.allowPartialAuth = allowPartialAuth; + isSetAllowPartialAuth = true; // mark as set } /** @@ -381,6 +458,7 @@ public void setAllowPartialAuth(String allowPartialAuth) { */ public AdditionalDataCommon authorisationType(String authorisationType) { this.authorisationType = authorisationType; + isSetAuthorisationType = true; // mark as set return this; } @@ -422,6 +500,7 @@ public String getAuthorisationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisationType(String authorisationType) { this.authorisationType = authorisationType; + isSetAuthorisationType = true; // mark as set } /** @@ -435,6 +514,7 @@ public void setAuthorisationType(String authorisationType) { */ public AdditionalDataCommon autoRescue(String autoRescue) { this.autoRescue = autoRescue; + isSetAutoRescue = true; // mark as set return this; } @@ -464,6 +544,7 @@ public String getAutoRescue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAutoRescue(String autoRescue) { this.autoRescue = autoRescue; + isSetAutoRescue = true; // mark as set } /** @@ -483,6 +564,7 @@ public void setAutoRescue(String autoRescue) { */ public AdditionalDataCommon customRoutingFlag(String customRoutingFlag) { this.customRoutingFlag = customRoutingFlag; + isSetCustomRoutingFlag = true; // mark as set return this; } @@ -524,6 +606,7 @@ public String getCustomRoutingFlag() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCustomRoutingFlag(String customRoutingFlag) { this.customRoutingFlag = customRoutingFlag; + isSetCustomRoutingFlag = true; // mark as set } /** @@ -545,6 +628,7 @@ public void setCustomRoutingFlag(String customRoutingFlag) { */ public AdditionalDataCommon industryUsage(IndustryUsageEnum industryUsage) { this.industryUsage = industryUsage; + isSetIndustryUsage = true; // mark as set return this; } @@ -590,6 +674,7 @@ public IndustryUsageEnum getIndustryUsage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIndustryUsage(IndustryUsageEnum industryUsage) { this.industryUsage = industryUsage; + isSetIndustryUsage = true; // mark as set } /** @@ -602,6 +687,7 @@ public void setIndustryUsage(IndustryUsageEnum industryUsage) { */ public AdditionalDataCommon manualCapture(String manualCapture) { this.manualCapture = manualCapture; + isSetManualCapture = true; // mark as set return this; } @@ -629,6 +715,7 @@ public String getManualCapture() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setManualCapture(String manualCapture) { this.manualCapture = manualCapture; + isSetManualCapture = true; // mark as set } /** @@ -647,6 +734,7 @@ public void setManualCapture(String manualCapture) { */ public AdditionalDataCommon maxDaysToRescue(String maxDaysToRescue) { this.maxDaysToRescue = maxDaysToRescue; + isSetMaxDaysToRescue = true; // mark as set return this; } @@ -686,6 +774,7 @@ public String getMaxDaysToRescue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaxDaysToRescue(String maxDaysToRescue) { this.maxDaysToRescue = maxDaysToRescue; + isSetMaxDaysToRescue = true; // mark as set } /** @@ -712,6 +801,7 @@ public void setMaxDaysToRescue(String maxDaysToRescue) { */ public AdditionalDataCommon networkTxReference(String networkTxReference) { this.networkTxReference = networkTxReference; + isSetNetworkTxReference = true; // mark as set return this; } @@ -767,6 +857,7 @@ public String getNetworkTxReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkTxReference(String networkTxReference) { this.networkTxReference = networkTxReference; + isSetNetworkTxReference = true; // mark as set } /** @@ -783,6 +874,7 @@ public void setNetworkTxReference(String networkTxReference) { */ public AdditionalDataCommon overwriteBrand(String overwriteBrand) { this.overwriteBrand = overwriteBrand; + isSetOverwriteBrand = true; // mark as set return this; } @@ -818,6 +910,7 @@ public String getOverwriteBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOverwriteBrand(String overwriteBrand) { this.overwriteBrand = overwriteBrand; + isSetOverwriteBrand = true; // mark as set } /** @@ -832,6 +925,7 @@ public void setOverwriteBrand(String overwriteBrand) { */ public AdditionalDataCommon subMerchantCity(String subMerchantCity) { this.subMerchantCity = subMerchantCity; + isSetSubMerchantCity = true; // mark as set return this; } @@ -863,6 +957,7 @@ public String getSubMerchantCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantCity(String subMerchantCity) { this.subMerchantCity = subMerchantCity; + isSetSubMerchantCity = true; // mark as set } /** @@ -877,6 +972,7 @@ public void setSubMerchantCity(String subMerchantCity) { */ public AdditionalDataCommon subMerchantCountry(String subMerchantCountry) { this.subMerchantCountry = subMerchantCountry; + isSetSubMerchantCountry = true; // mark as set return this; } @@ -908,6 +1004,7 @@ public String getSubMerchantCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantCountry(String subMerchantCountry) { this.subMerchantCountry = subMerchantCountry; + isSetSubMerchantCountry = true; // mark as set } /** @@ -922,6 +1019,7 @@ public void setSubMerchantCountry(String subMerchantCountry) { */ public AdditionalDataCommon subMerchantEmail(String subMerchantEmail) { this.subMerchantEmail = subMerchantEmail; + isSetSubMerchantEmail = true; // mark as set return this; } @@ -953,6 +1051,7 @@ public String getSubMerchantEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantEmail(String subMerchantEmail) { this.subMerchantEmail = subMerchantEmail; + isSetSubMerchantEmail = true; // mark as set } /** @@ -970,6 +1069,7 @@ public void setSubMerchantEmail(String subMerchantEmail) { */ public AdditionalDataCommon subMerchantID(String subMerchantID) { this.subMerchantID = subMerchantID; + isSetSubMerchantID = true; // mark as set return this; } @@ -1007,6 +1107,7 @@ public String getSubMerchantID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantID(String subMerchantID) { this.subMerchantID = subMerchantID; + isSetSubMerchantID = true; // mark as set } /** @@ -1021,6 +1122,7 @@ public void setSubMerchantID(String subMerchantID) { */ public AdditionalDataCommon subMerchantName(String subMerchantName) { this.subMerchantName = subMerchantName; + isSetSubMerchantName = true; // mark as set return this; } @@ -1052,6 +1154,7 @@ public String getSubMerchantName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantName(String subMerchantName) { this.subMerchantName = subMerchantName; + isSetSubMerchantName = true; // mark as set } /** @@ -1066,6 +1169,7 @@ public void setSubMerchantName(String subMerchantName) { */ public AdditionalDataCommon subMerchantPhoneNumber(String subMerchantPhoneNumber) { this.subMerchantPhoneNumber = subMerchantPhoneNumber; + isSetSubMerchantPhoneNumber = true; // mark as set return this; } @@ -1097,6 +1201,7 @@ public String getSubMerchantPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantPhoneNumber(String subMerchantPhoneNumber) { this.subMerchantPhoneNumber = subMerchantPhoneNumber; + isSetSubMerchantPhoneNumber = true; // mark as set } /** @@ -1111,6 +1216,7 @@ public void setSubMerchantPhoneNumber(String subMerchantPhoneNumber) { */ public AdditionalDataCommon subMerchantPostalCode(String subMerchantPostalCode) { this.subMerchantPostalCode = subMerchantPostalCode; + isSetSubMerchantPostalCode = true; // mark as set return this; } @@ -1142,6 +1248,7 @@ public String getSubMerchantPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantPostalCode(String subMerchantPostalCode) { this.subMerchantPostalCode = subMerchantPostalCode; + isSetSubMerchantPostalCode = true; // mark as set } /** @@ -1157,6 +1264,7 @@ public void setSubMerchantPostalCode(String subMerchantPostalCode) { */ public AdditionalDataCommon subMerchantState(String subMerchantState) { this.subMerchantState = subMerchantState; + isSetSubMerchantState = true; // mark as set return this; } @@ -1190,6 +1298,7 @@ public String getSubMerchantState() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantState(String subMerchantState) { this.subMerchantState = subMerchantState; + isSetSubMerchantState = true; // mark as set } /** @@ -1204,6 +1313,7 @@ public void setSubMerchantState(String subMerchantState) { */ public AdditionalDataCommon subMerchantStreet(String subMerchantStreet) { this.subMerchantStreet = subMerchantStreet; + isSetSubMerchantStreet = true; // mark as set return this; } @@ -1235,6 +1345,7 @@ public String getSubMerchantStreet() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantStreet(String subMerchantStreet) { this.subMerchantStreet = subMerchantStreet; + isSetSubMerchantStreet = true; // mark as set } /** @@ -1249,6 +1360,7 @@ public void setSubMerchantStreet(String subMerchantStreet) { */ public AdditionalDataCommon subMerchantTaxId(String subMerchantTaxId) { this.subMerchantTaxId = subMerchantTaxId; + isSetSubMerchantTaxId = true; // mark as set return this; } @@ -1280,6 +1392,27 @@ public String getSubMerchantTaxId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantTaxId(String subMerchantTaxId) { this.subMerchantTaxId = subMerchantTaxId; + isSetSubMerchantTaxId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataCommon 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 AdditionalDataCommon object is equal to o. */ @@ -1295,54 +1428,104 @@ public boolean equals(Object o) { return Objects.equals( this.requestedTestAcquirerResponseCode, additionalDataCommon.requestedTestAcquirerResponseCode) + && Objects.equals( + this.isSetRequestedTestAcquirerResponseCode, + additionalDataCommon.isSetRequestedTestAcquirerResponseCode) && Objects.equals( this.requestedTestErrorResponseCode, additionalDataCommon.requestedTestErrorResponseCode) + && Objects.equals( + this.isSetRequestedTestErrorResponseCode, + additionalDataCommon.isSetRequestedTestErrorResponseCode) && Objects.equals(this.allowPartialAuth, additionalDataCommon.allowPartialAuth) + && Objects.equals(this.isSetAllowPartialAuth, additionalDataCommon.isSetAllowPartialAuth) && Objects.equals(this.authorisationType, additionalDataCommon.authorisationType) + && Objects.equals(this.isSetAuthorisationType, additionalDataCommon.isSetAuthorisationType) && Objects.equals(this.autoRescue, additionalDataCommon.autoRescue) + && Objects.equals(this.isSetAutoRescue, additionalDataCommon.isSetAutoRescue) && Objects.equals(this.customRoutingFlag, additionalDataCommon.customRoutingFlag) + && Objects.equals(this.isSetCustomRoutingFlag, additionalDataCommon.isSetCustomRoutingFlag) && Objects.equals(this.industryUsage, additionalDataCommon.industryUsage) + && Objects.equals(this.isSetIndustryUsage, additionalDataCommon.isSetIndustryUsage) && Objects.equals(this.manualCapture, additionalDataCommon.manualCapture) + && Objects.equals(this.isSetManualCapture, additionalDataCommon.isSetManualCapture) && Objects.equals(this.maxDaysToRescue, additionalDataCommon.maxDaysToRescue) + && Objects.equals(this.isSetMaxDaysToRescue, additionalDataCommon.isSetMaxDaysToRescue) && Objects.equals(this.networkTxReference, additionalDataCommon.networkTxReference) + && Objects.equals( + this.isSetNetworkTxReference, additionalDataCommon.isSetNetworkTxReference) && Objects.equals(this.overwriteBrand, additionalDataCommon.overwriteBrand) + && Objects.equals(this.isSetOverwriteBrand, additionalDataCommon.isSetOverwriteBrand) && Objects.equals(this.subMerchantCity, additionalDataCommon.subMerchantCity) + && Objects.equals(this.isSetSubMerchantCity, additionalDataCommon.isSetSubMerchantCity) && Objects.equals(this.subMerchantCountry, additionalDataCommon.subMerchantCountry) + && Objects.equals( + this.isSetSubMerchantCountry, additionalDataCommon.isSetSubMerchantCountry) && Objects.equals(this.subMerchantEmail, additionalDataCommon.subMerchantEmail) + && Objects.equals(this.isSetSubMerchantEmail, additionalDataCommon.isSetSubMerchantEmail) && Objects.equals(this.subMerchantID, additionalDataCommon.subMerchantID) + && Objects.equals(this.isSetSubMerchantID, additionalDataCommon.isSetSubMerchantID) && Objects.equals(this.subMerchantName, additionalDataCommon.subMerchantName) + && Objects.equals(this.isSetSubMerchantName, additionalDataCommon.isSetSubMerchantName) && Objects.equals(this.subMerchantPhoneNumber, additionalDataCommon.subMerchantPhoneNumber) + && Objects.equals( + this.isSetSubMerchantPhoneNumber, additionalDataCommon.isSetSubMerchantPhoneNumber) && Objects.equals(this.subMerchantPostalCode, additionalDataCommon.subMerchantPostalCode) + && Objects.equals( + this.isSetSubMerchantPostalCode, additionalDataCommon.isSetSubMerchantPostalCode) && Objects.equals(this.subMerchantState, additionalDataCommon.subMerchantState) + && Objects.equals(this.isSetSubMerchantState, additionalDataCommon.isSetSubMerchantState) && Objects.equals(this.subMerchantStreet, additionalDataCommon.subMerchantStreet) - && Objects.equals(this.subMerchantTaxId, additionalDataCommon.subMerchantTaxId); + && Objects.equals(this.isSetSubMerchantStreet, additionalDataCommon.isSetSubMerchantStreet) + && Objects.equals(this.subMerchantTaxId, additionalDataCommon.subMerchantTaxId) + && Objects.equals(this.isSetSubMerchantTaxId, additionalDataCommon.isSetSubMerchantTaxId); } @Override public int hashCode() { return Objects.hash( requestedTestAcquirerResponseCode, + isSetRequestedTestAcquirerResponseCode, requestedTestErrorResponseCode, + isSetRequestedTestErrorResponseCode, allowPartialAuth, + isSetAllowPartialAuth, authorisationType, + isSetAuthorisationType, autoRescue, + isSetAutoRescue, customRoutingFlag, + isSetCustomRoutingFlag, industryUsage, + isSetIndustryUsage, manualCapture, + isSetManualCapture, maxDaysToRescue, + isSetMaxDaysToRescue, networkTxReference, + isSetNetworkTxReference, overwriteBrand, + isSetOverwriteBrand, subMerchantCity, + isSetSubMerchantCity, subMerchantCountry, + isSetSubMerchantCountry, subMerchantEmail, + isSetSubMerchantEmail, subMerchantID, + isSetSubMerchantID, subMerchantName, + isSetSubMerchantName, subMerchantPhoneNumber, + isSetSubMerchantPhoneNumber, subMerchantPostalCode, + isSetSubMerchantPostalCode, subMerchantState, + isSetSubMerchantState, subMerchantStreet, - subMerchantTaxId); + isSetSubMerchantStreet, + subMerchantTaxId, + isSetSubMerchantTaxId); } @Override @@ -1392,6 +1575,96 @@ 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 (isSetRequestedTestAcquirerResponseCode) { + addIfNull( + nulls, + JSON_PROPERTY_REQUESTED_TEST_ACQUIRER_RESPONSE_CODE, + this.requestedTestAcquirerResponseCode); + } + if (isSetRequestedTestErrorResponseCode) { + addIfNull( + nulls, + JSON_PROPERTY_REQUESTED_TEST_ERROR_RESPONSE_CODE, + this.requestedTestErrorResponseCode); + } + if (isSetAllowPartialAuth) { + addIfNull(nulls, JSON_PROPERTY_ALLOW_PARTIAL_AUTH, this.allowPartialAuth); + } + if (isSetAuthorisationType) { + addIfNull(nulls, JSON_PROPERTY_AUTHORISATION_TYPE, this.authorisationType); + } + if (isSetAutoRescue) { + addIfNull(nulls, JSON_PROPERTY_AUTO_RESCUE, this.autoRescue); + } + if (isSetCustomRoutingFlag) { + addIfNull(nulls, JSON_PROPERTY_CUSTOM_ROUTING_FLAG, this.customRoutingFlag); + } + if (isSetIndustryUsage) { + addIfNull(nulls, JSON_PROPERTY_INDUSTRY_USAGE, this.industryUsage); + } + if (isSetManualCapture) { + addIfNull(nulls, JSON_PROPERTY_MANUAL_CAPTURE, this.manualCapture); + } + if (isSetMaxDaysToRescue) { + addIfNull(nulls, JSON_PROPERTY_MAX_DAYS_TO_RESCUE, this.maxDaysToRescue); + } + if (isSetNetworkTxReference) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TX_REFERENCE, this.networkTxReference); + } + if (isSetOverwriteBrand) { + addIfNull(nulls, JSON_PROPERTY_OVERWRITE_BRAND, this.overwriteBrand); + } + if (isSetSubMerchantCity) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_CITY, this.subMerchantCity); + } + if (isSetSubMerchantCountry) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_COUNTRY, this.subMerchantCountry); + } + if (isSetSubMerchantEmail) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_EMAIL, this.subMerchantEmail); + } + if (isSetSubMerchantID) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_I_D, this.subMerchantID); + } + if (isSetSubMerchantName) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_NAME, this.subMerchantName); + } + if (isSetSubMerchantPhoneNumber) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_PHONE_NUMBER, this.subMerchantPhoneNumber); + } + if (isSetSubMerchantPostalCode) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_POSTAL_CODE, this.subMerchantPostalCode); + } + if (isSetSubMerchantState) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_STATE, this.subMerchantState); + } + if (isSetSubMerchantStreet) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_STREET, this.subMerchantStreet); + } + if (isSetSubMerchantTaxId) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_TAX_ID, this.subMerchantTaxId); + } + + 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 AdditionalDataCommon given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataLevel23.java b/src/main/java/com/adyen/model/payment/AdditionalDataLevel23.java index 9791e8f51..0b8af6d71 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataLevel23.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataLevel23.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -42,77 +44,134 @@ public class AdditionalDataLevel23 { "enhancedSchemeData.customerReference"; private String enhancedSchemeDataCustomerReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataCustomerReference = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_DESTINATION_COUNTRY_CODE = "enhancedSchemeData.destinationCountryCode"; private String enhancedSchemeDataDestinationCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataDestinationCountryCode = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_DESTINATION_POSTAL_CODE = "enhancedSchemeData.destinationPostalCode"; private String enhancedSchemeDataDestinationPostalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataDestinationPostalCode = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_DESTINATION_STATE_PROVINCE_CODE = "enhancedSchemeData.destinationStateProvinceCode"; private String enhancedSchemeDataDestinationStateProvinceCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataDestinationStateProvinceCode = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_DUTY_AMOUNT = "enhancedSchemeData.dutyAmount"; private String enhancedSchemeDataDutyAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataDutyAmount = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_FREIGHT_AMOUNT = "enhancedSchemeData.freightAmount"; private String enhancedSchemeDataFreightAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataFreightAmount = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_COMMODITY_CODE = "enhancedSchemeData.itemDetailLine[itemNr].commodityCode"; private String enhancedSchemeDataItemDetailLineItemNrCommodityCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataItemDetailLineItemNrCommodityCode = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_DESCRIPTION = "enhancedSchemeData.itemDetailLine[itemNr].description"; private String enhancedSchemeDataItemDetailLineItemNrDescription; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataItemDetailLineItemNrDescription = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_DISCOUNT_AMOUNT = "enhancedSchemeData.itemDetailLine[itemNr].discountAmount"; private String enhancedSchemeDataItemDetailLineItemNrDiscountAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataItemDetailLineItemNrDiscountAmount = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_PRODUCT_CODE = "enhancedSchemeData.itemDetailLine[itemNr].productCode"; private String enhancedSchemeDataItemDetailLineItemNrProductCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataItemDetailLineItemNrProductCode = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_QUANTITY = "enhancedSchemeData.itemDetailLine[itemNr].quantity"; private String enhancedSchemeDataItemDetailLineItemNrQuantity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataItemDetailLineItemNrQuantity = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_TOTAL_AMOUNT = "enhancedSchemeData.itemDetailLine[itemNr].totalAmount"; private String enhancedSchemeDataItemDetailLineItemNrTotalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataItemDetailLineItemNrTotalAmount = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_UNIT_OF_MEASURE = "enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure"; private String enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_UNIT_PRICE = "enhancedSchemeData.itemDetailLine[itemNr].unitPrice"; private String enhancedSchemeDataItemDetailLineItemNrUnitPrice; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataItemDetailLineItemNrUnitPrice = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_ORDER_DATE = "enhancedSchemeData.orderDate"; private String enhancedSchemeDataOrderDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataOrderDate = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_SHIP_FROM_POSTAL_CODE = "enhancedSchemeData.shipFromPostalCode"; private String enhancedSchemeDataShipFromPostalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataShipFromPostalCode = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_TOTAL_TAX_AMOUNT = "enhancedSchemeData.totalTaxAmount"; private String enhancedSchemeDataTotalTaxAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataTotalTaxAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataLevel23() {} /** @@ -127,6 +186,7 @@ public AdditionalDataLevel23() {} public AdditionalDataLevel23 enhancedSchemeDataCustomerReference( String enhancedSchemeDataCustomerReference) { this.enhancedSchemeDataCustomerReference = enhancedSchemeDataCustomerReference; + isSetEnhancedSchemeDataCustomerReference = true; // mark as set return this; } @@ -156,6 +216,7 @@ public String getEnhancedSchemeDataCustomerReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataCustomerReference(String enhancedSchemeDataCustomerReference) { this.enhancedSchemeDataCustomerReference = enhancedSchemeDataCustomerReference; + isSetEnhancedSchemeDataCustomerReference = true; // mark as set } /** @@ -171,6 +232,7 @@ public void setEnhancedSchemeDataCustomerReference(String enhancedSchemeDataCust public AdditionalDataLevel23 enhancedSchemeDataDestinationCountryCode( String enhancedSchemeDataDestinationCountryCode) { this.enhancedSchemeDataDestinationCountryCode = enhancedSchemeDataDestinationCountryCode; + isSetEnhancedSchemeDataDestinationCountryCode = true; // mark as set return this; } @@ -203,6 +265,7 @@ public String getEnhancedSchemeDataDestinationCountryCode() { public void setEnhancedSchemeDataDestinationCountryCode( String enhancedSchemeDataDestinationCountryCode) { this.enhancedSchemeDataDestinationCountryCode = enhancedSchemeDataDestinationCountryCode; + isSetEnhancedSchemeDataDestinationCountryCode = true; // mark as set } /** @@ -220,6 +283,7 @@ public void setEnhancedSchemeDataDestinationCountryCode( public AdditionalDataLevel23 enhancedSchemeDataDestinationPostalCode( String enhancedSchemeDataDestinationPostalCode) { this.enhancedSchemeDataDestinationPostalCode = enhancedSchemeDataDestinationPostalCode; + isSetEnhancedSchemeDataDestinationPostalCode = true; // mark as set return this; } @@ -256,6 +320,7 @@ public String getEnhancedSchemeDataDestinationPostalCode() { public void setEnhancedSchemeDataDestinationPostalCode( String enhancedSchemeDataDestinationPostalCode) { this.enhancedSchemeDataDestinationPostalCode = enhancedSchemeDataDestinationPostalCode; + isSetEnhancedSchemeDataDestinationPostalCode = true; // mark as set } /** @@ -271,6 +336,7 @@ public AdditionalDataLevel23 enhancedSchemeDataDestinationStateProvinceCode( String enhancedSchemeDataDestinationStateProvinceCode) { this.enhancedSchemeDataDestinationStateProvinceCode = enhancedSchemeDataDestinationStateProvinceCode; + isSetEnhancedSchemeDataDestinationStateProvinceCode = true; // mark as set return this; } @@ -302,6 +368,7 @@ public void setEnhancedSchemeDataDestinationStateProvinceCode( String enhancedSchemeDataDestinationStateProvinceCode) { this.enhancedSchemeDataDestinationStateProvinceCode = enhancedSchemeDataDestinationStateProvinceCode; + isSetEnhancedSchemeDataDestinationStateProvinceCode = true; // mark as set } /** @@ -316,6 +383,7 @@ public void setEnhancedSchemeDataDestinationStateProvinceCode( */ public AdditionalDataLevel23 enhancedSchemeDataDutyAmount(String enhancedSchemeDataDutyAmount) { this.enhancedSchemeDataDutyAmount = enhancedSchemeDataDutyAmount; + isSetEnhancedSchemeDataDutyAmount = true; // mark as set return this; } @@ -347,6 +415,7 @@ public String getEnhancedSchemeDataDutyAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataDutyAmount(String enhancedSchemeDataDutyAmount) { this.enhancedSchemeDataDutyAmount = enhancedSchemeDataDutyAmount; + isSetEnhancedSchemeDataDutyAmount = true; // mark as set } /** @@ -362,6 +431,7 @@ public void setEnhancedSchemeDataDutyAmount(String enhancedSchemeDataDutyAmount) public AdditionalDataLevel23 enhancedSchemeDataFreightAmount( String enhancedSchemeDataFreightAmount) { this.enhancedSchemeDataFreightAmount = enhancedSchemeDataFreightAmount; + isSetEnhancedSchemeDataFreightAmount = true; // mark as set return this; } @@ -393,6 +463,7 @@ public String getEnhancedSchemeDataFreightAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataFreightAmount(String enhancedSchemeDataFreightAmount) { this.enhancedSchemeDataFreightAmount = enhancedSchemeDataFreightAmount; + isSetEnhancedSchemeDataFreightAmount = true; // mark as set } /** @@ -417,6 +488,7 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrCommodityCode String enhancedSchemeDataItemDetailLineItemNrCommodityCode) { this.enhancedSchemeDataItemDetailLineItemNrCommodityCode = enhancedSchemeDataItemDetailLineItemNrCommodityCode; + isSetEnhancedSchemeDataItemDetailLineItemNrCommodityCode = true; // mark as set return this; } @@ -466,6 +538,7 @@ public void setEnhancedSchemeDataItemDetailLineItemNrCommodityCode( String enhancedSchemeDataItemDetailLineItemNrCommodityCode) { this.enhancedSchemeDataItemDetailLineItemNrCommodityCode = enhancedSchemeDataItemDetailLineItemNrCommodityCode; + isSetEnhancedSchemeDataItemDetailLineItemNrCommodityCode = true; // mark as set } /** @@ -489,6 +562,7 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrDescription( String enhancedSchemeDataItemDetailLineItemNrDescription) { this.enhancedSchemeDataItemDetailLineItemNrDescription = enhancedSchemeDataItemDetailLineItemNrDescription; + isSetEnhancedSchemeDataItemDetailLineItemNrDescription = true; // mark as set return this; } @@ -536,6 +610,7 @@ public void setEnhancedSchemeDataItemDetailLineItemNrDescription( String enhancedSchemeDataItemDetailLineItemNrDescription) { this.enhancedSchemeDataItemDetailLineItemNrDescription = enhancedSchemeDataItemDetailLineItemNrDescription; + isSetEnhancedSchemeDataItemDetailLineItemNrDescription = true; // mark as set } /** @@ -552,6 +627,7 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrDiscountAmoun String enhancedSchemeDataItemDetailLineItemNrDiscountAmount) { this.enhancedSchemeDataItemDetailLineItemNrDiscountAmount = enhancedSchemeDataItemDetailLineItemNrDiscountAmount; + isSetEnhancedSchemeDataItemDetailLineItemNrDiscountAmount = true; // mark as set return this; } @@ -585,6 +661,7 @@ public void setEnhancedSchemeDataItemDetailLineItemNrDiscountAmount( String enhancedSchemeDataItemDetailLineItemNrDiscountAmount) { this.enhancedSchemeDataItemDetailLineItemNrDiscountAmount = enhancedSchemeDataItemDetailLineItemNrDiscountAmount; + isSetEnhancedSchemeDataItemDetailLineItemNrDiscountAmount = true; // mark as set } /** @@ -603,6 +680,7 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrProductCode( String enhancedSchemeDataItemDetailLineItemNrProductCode) { this.enhancedSchemeDataItemDetailLineItemNrProductCode = enhancedSchemeDataItemDetailLineItemNrProductCode; + isSetEnhancedSchemeDataItemDetailLineItemNrProductCode = true; // mark as set return this; } @@ -640,6 +718,7 @@ public void setEnhancedSchemeDataItemDetailLineItemNrProductCode( String enhancedSchemeDataItemDetailLineItemNrProductCode) { this.enhancedSchemeDataItemDetailLineItemNrProductCode = enhancedSchemeDataItemDetailLineItemNrProductCode; + isSetEnhancedSchemeDataItemDetailLineItemNrProductCode = true; // mark as set } /** @@ -655,6 +734,7 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrQuantity( String enhancedSchemeDataItemDetailLineItemNrQuantity) { this.enhancedSchemeDataItemDetailLineItemNrQuantity = enhancedSchemeDataItemDetailLineItemNrQuantity; + isSetEnhancedSchemeDataItemDetailLineItemNrQuantity = true; // mark as set return this; } @@ -686,6 +766,7 @@ public void setEnhancedSchemeDataItemDetailLineItemNrQuantity( String enhancedSchemeDataItemDetailLineItemNrQuantity) { this.enhancedSchemeDataItemDetailLineItemNrQuantity = enhancedSchemeDataItemDetailLineItemNrQuantity; + isSetEnhancedSchemeDataItemDetailLineItemNrQuantity = true; // mark as set } /** @@ -710,6 +791,7 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrTotalAmount( String enhancedSchemeDataItemDetailLineItemNrTotalAmount) { this.enhancedSchemeDataItemDetailLineItemNrTotalAmount = enhancedSchemeDataItemDetailLineItemNrTotalAmount; + isSetEnhancedSchemeDataItemDetailLineItemNrTotalAmount = true; // mark as set return this; } @@ -759,6 +841,7 @@ public void setEnhancedSchemeDataItemDetailLineItemNrTotalAmount( String enhancedSchemeDataItemDetailLineItemNrTotalAmount) { this.enhancedSchemeDataItemDetailLineItemNrTotalAmount = enhancedSchemeDataItemDetailLineItemNrTotalAmount; + isSetEnhancedSchemeDataItemDetailLineItemNrTotalAmount = true; // mark as set } /** @@ -774,6 +857,7 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure String enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure) { this.enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure; + isSetEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = true; // mark as set return this; } @@ -805,6 +889,7 @@ public void setEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure( String enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure) { this.enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure; + isSetEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = true; // mark as set } /** @@ -821,6 +906,7 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrUnitPrice( String enhancedSchemeDataItemDetailLineItemNrUnitPrice) { this.enhancedSchemeDataItemDetailLineItemNrUnitPrice = enhancedSchemeDataItemDetailLineItemNrUnitPrice; + isSetEnhancedSchemeDataItemDetailLineItemNrUnitPrice = true; // mark as set return this; } @@ -854,6 +940,7 @@ public void setEnhancedSchemeDataItemDetailLineItemNrUnitPrice( String enhancedSchemeDataItemDetailLineItemNrUnitPrice) { this.enhancedSchemeDataItemDetailLineItemNrUnitPrice = enhancedSchemeDataItemDetailLineItemNrUnitPrice; + isSetEnhancedSchemeDataItemDetailLineItemNrUnitPrice = true; // mark as set } /** @@ -865,6 +952,7 @@ public void setEnhancedSchemeDataItemDetailLineItemNrUnitPrice( */ public AdditionalDataLevel23 enhancedSchemeDataOrderDate(String enhancedSchemeDataOrderDate) { this.enhancedSchemeDataOrderDate = enhancedSchemeDataOrderDate; + isSetEnhancedSchemeDataOrderDate = true; // mark as set return this; } @@ -890,6 +978,7 @@ public String getEnhancedSchemeDataOrderDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataOrderDate(String enhancedSchemeDataOrderDate) { this.enhancedSchemeDataOrderDate = enhancedSchemeDataOrderDate; + isSetEnhancedSchemeDataOrderDate = true; // mark as set } /** @@ -908,6 +997,7 @@ public void setEnhancedSchemeDataOrderDate(String enhancedSchemeDataOrderDate) { public AdditionalDataLevel23 enhancedSchemeDataShipFromPostalCode( String enhancedSchemeDataShipFromPostalCode) { this.enhancedSchemeDataShipFromPostalCode = enhancedSchemeDataShipFromPostalCode; + isSetEnhancedSchemeDataShipFromPostalCode = true; // mark as set return this; } @@ -945,6 +1035,7 @@ public String getEnhancedSchemeDataShipFromPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataShipFromPostalCode(String enhancedSchemeDataShipFromPostalCode) { this.enhancedSchemeDataShipFromPostalCode = enhancedSchemeDataShipFromPostalCode; + isSetEnhancedSchemeDataShipFromPostalCode = true; // mark as set } /** @@ -965,6 +1056,7 @@ public void setEnhancedSchemeDataShipFromPostalCode(String enhancedSchemeDataShi public AdditionalDataLevel23 enhancedSchemeDataTotalTaxAmount( String enhancedSchemeDataTotalTaxAmount) { this.enhancedSchemeDataTotalTaxAmount = enhancedSchemeDataTotalTaxAmount; + isSetEnhancedSchemeDataTotalTaxAmount = true; // mark as set return this; } @@ -1006,6 +1098,27 @@ public String getEnhancedSchemeDataTotalTaxAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataTotalTaxAmount(String enhancedSchemeDataTotalTaxAmount) { this.enhancedSchemeDataTotalTaxAmount = enhancedSchemeDataTotalTaxAmount; + isSetEnhancedSchemeDataTotalTaxAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataLevel23 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 AdditionalDataLevel23 object is equal to o. */ @@ -1021,74 +1134,142 @@ public boolean equals(Object o) { return Objects.equals( this.enhancedSchemeDataCustomerReference, additionalDataLevel23.enhancedSchemeDataCustomerReference) + && Objects.equals( + this.isSetEnhancedSchemeDataCustomerReference, + additionalDataLevel23.isSetEnhancedSchemeDataCustomerReference) && Objects.equals( this.enhancedSchemeDataDestinationCountryCode, additionalDataLevel23.enhancedSchemeDataDestinationCountryCode) + && Objects.equals( + this.isSetEnhancedSchemeDataDestinationCountryCode, + additionalDataLevel23.isSetEnhancedSchemeDataDestinationCountryCode) && Objects.equals( this.enhancedSchemeDataDestinationPostalCode, additionalDataLevel23.enhancedSchemeDataDestinationPostalCode) + && Objects.equals( + this.isSetEnhancedSchemeDataDestinationPostalCode, + additionalDataLevel23.isSetEnhancedSchemeDataDestinationPostalCode) && Objects.equals( this.enhancedSchemeDataDestinationStateProvinceCode, additionalDataLevel23.enhancedSchemeDataDestinationStateProvinceCode) + && Objects.equals( + this.isSetEnhancedSchemeDataDestinationStateProvinceCode, + additionalDataLevel23.isSetEnhancedSchemeDataDestinationStateProvinceCode) && Objects.equals( this.enhancedSchemeDataDutyAmount, additionalDataLevel23.enhancedSchemeDataDutyAmount) + && Objects.equals( + this.isSetEnhancedSchemeDataDutyAmount, + additionalDataLevel23.isSetEnhancedSchemeDataDutyAmount) && Objects.equals( this.enhancedSchemeDataFreightAmount, additionalDataLevel23.enhancedSchemeDataFreightAmount) + && Objects.equals( + this.isSetEnhancedSchemeDataFreightAmount, + additionalDataLevel23.isSetEnhancedSchemeDataFreightAmount) && Objects.equals( this.enhancedSchemeDataItemDetailLineItemNrCommodityCode, additionalDataLevel23.enhancedSchemeDataItemDetailLineItemNrCommodityCode) + && Objects.equals( + this.isSetEnhancedSchemeDataItemDetailLineItemNrCommodityCode, + additionalDataLevel23.isSetEnhancedSchemeDataItemDetailLineItemNrCommodityCode) && Objects.equals( this.enhancedSchemeDataItemDetailLineItemNrDescription, additionalDataLevel23.enhancedSchemeDataItemDetailLineItemNrDescription) + && Objects.equals( + this.isSetEnhancedSchemeDataItemDetailLineItemNrDescription, + additionalDataLevel23.isSetEnhancedSchemeDataItemDetailLineItemNrDescription) && Objects.equals( this.enhancedSchemeDataItemDetailLineItemNrDiscountAmount, additionalDataLevel23.enhancedSchemeDataItemDetailLineItemNrDiscountAmount) + && Objects.equals( + this.isSetEnhancedSchemeDataItemDetailLineItemNrDiscountAmount, + additionalDataLevel23.isSetEnhancedSchemeDataItemDetailLineItemNrDiscountAmount) && Objects.equals( this.enhancedSchemeDataItemDetailLineItemNrProductCode, additionalDataLevel23.enhancedSchemeDataItemDetailLineItemNrProductCode) + && Objects.equals( + this.isSetEnhancedSchemeDataItemDetailLineItemNrProductCode, + additionalDataLevel23.isSetEnhancedSchemeDataItemDetailLineItemNrProductCode) && Objects.equals( this.enhancedSchemeDataItemDetailLineItemNrQuantity, additionalDataLevel23.enhancedSchemeDataItemDetailLineItemNrQuantity) + && Objects.equals( + this.isSetEnhancedSchemeDataItemDetailLineItemNrQuantity, + additionalDataLevel23.isSetEnhancedSchemeDataItemDetailLineItemNrQuantity) && Objects.equals( this.enhancedSchemeDataItemDetailLineItemNrTotalAmount, additionalDataLevel23.enhancedSchemeDataItemDetailLineItemNrTotalAmount) + && Objects.equals( + this.isSetEnhancedSchemeDataItemDetailLineItemNrTotalAmount, + additionalDataLevel23.isSetEnhancedSchemeDataItemDetailLineItemNrTotalAmount) && Objects.equals( this.enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure, additionalDataLevel23.enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure) + && Objects.equals( + this.isSetEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure, + additionalDataLevel23.isSetEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure) && Objects.equals( this.enhancedSchemeDataItemDetailLineItemNrUnitPrice, additionalDataLevel23.enhancedSchemeDataItemDetailLineItemNrUnitPrice) + && Objects.equals( + this.isSetEnhancedSchemeDataItemDetailLineItemNrUnitPrice, + additionalDataLevel23.isSetEnhancedSchemeDataItemDetailLineItemNrUnitPrice) && Objects.equals( this.enhancedSchemeDataOrderDate, additionalDataLevel23.enhancedSchemeDataOrderDate) + && Objects.equals( + this.isSetEnhancedSchemeDataOrderDate, + additionalDataLevel23.isSetEnhancedSchemeDataOrderDate) && Objects.equals( this.enhancedSchemeDataShipFromPostalCode, additionalDataLevel23.enhancedSchemeDataShipFromPostalCode) + && Objects.equals( + this.isSetEnhancedSchemeDataShipFromPostalCode, + additionalDataLevel23.isSetEnhancedSchemeDataShipFromPostalCode) && Objects.equals( this.enhancedSchemeDataTotalTaxAmount, - additionalDataLevel23.enhancedSchemeDataTotalTaxAmount); + additionalDataLevel23.enhancedSchemeDataTotalTaxAmount) + && Objects.equals( + this.isSetEnhancedSchemeDataTotalTaxAmount, + additionalDataLevel23.isSetEnhancedSchemeDataTotalTaxAmount); } @Override public int hashCode() { return Objects.hash( enhancedSchemeDataCustomerReference, + isSetEnhancedSchemeDataCustomerReference, enhancedSchemeDataDestinationCountryCode, + isSetEnhancedSchemeDataDestinationCountryCode, enhancedSchemeDataDestinationPostalCode, + isSetEnhancedSchemeDataDestinationPostalCode, enhancedSchemeDataDestinationStateProvinceCode, + isSetEnhancedSchemeDataDestinationStateProvinceCode, enhancedSchemeDataDutyAmount, + isSetEnhancedSchemeDataDutyAmount, enhancedSchemeDataFreightAmount, + isSetEnhancedSchemeDataFreightAmount, enhancedSchemeDataItemDetailLineItemNrCommodityCode, + isSetEnhancedSchemeDataItemDetailLineItemNrCommodityCode, enhancedSchemeDataItemDetailLineItemNrDescription, + isSetEnhancedSchemeDataItemDetailLineItemNrDescription, enhancedSchemeDataItemDetailLineItemNrDiscountAmount, + isSetEnhancedSchemeDataItemDetailLineItemNrDiscountAmount, enhancedSchemeDataItemDetailLineItemNrProductCode, + isSetEnhancedSchemeDataItemDetailLineItemNrProductCode, enhancedSchemeDataItemDetailLineItemNrQuantity, + isSetEnhancedSchemeDataItemDetailLineItemNrQuantity, enhancedSchemeDataItemDetailLineItemNrTotalAmount, + isSetEnhancedSchemeDataItemDetailLineItemNrTotalAmount, enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure, + isSetEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure, enhancedSchemeDataItemDetailLineItemNrUnitPrice, + isSetEnhancedSchemeDataItemDetailLineItemNrUnitPrice, enhancedSchemeDataOrderDate, + isSetEnhancedSchemeDataOrderDate, enhancedSchemeDataShipFromPostalCode, - enhancedSchemeDataTotalTaxAmount); + isSetEnhancedSchemeDataShipFromPostalCode, + enhancedSchemeDataTotalTaxAmount, + isSetEnhancedSchemeDataTotalTaxAmount); } @Override @@ -1160,6 +1341,125 @@ 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 (isSetEnhancedSchemeDataCustomerReference) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_CUSTOMER_REFERENCE, + this.enhancedSchemeDataCustomerReference); + } + if (isSetEnhancedSchemeDataDestinationCountryCode) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_DESTINATION_COUNTRY_CODE, + this.enhancedSchemeDataDestinationCountryCode); + } + if (isSetEnhancedSchemeDataDestinationPostalCode) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_DESTINATION_POSTAL_CODE, + this.enhancedSchemeDataDestinationPostalCode); + } + if (isSetEnhancedSchemeDataDestinationStateProvinceCode) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_DESTINATION_STATE_PROVINCE_CODE, + this.enhancedSchemeDataDestinationStateProvinceCode); + } + if (isSetEnhancedSchemeDataDutyAmount) { + addIfNull( + nulls, JSON_PROPERTY_ENHANCED_SCHEME_DATA_DUTY_AMOUNT, this.enhancedSchemeDataDutyAmount); + } + if (isSetEnhancedSchemeDataFreightAmount) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_FREIGHT_AMOUNT, + this.enhancedSchemeDataFreightAmount); + } + if (isSetEnhancedSchemeDataItemDetailLineItemNrCommodityCode) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_COMMODITY_CODE, + this.enhancedSchemeDataItemDetailLineItemNrCommodityCode); + } + if (isSetEnhancedSchemeDataItemDetailLineItemNrDescription) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_DESCRIPTION, + this.enhancedSchemeDataItemDetailLineItemNrDescription); + } + if (isSetEnhancedSchemeDataItemDetailLineItemNrDiscountAmount) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_DISCOUNT_AMOUNT, + this.enhancedSchemeDataItemDetailLineItemNrDiscountAmount); + } + if (isSetEnhancedSchemeDataItemDetailLineItemNrProductCode) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_PRODUCT_CODE, + this.enhancedSchemeDataItemDetailLineItemNrProductCode); + } + if (isSetEnhancedSchemeDataItemDetailLineItemNrQuantity) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_QUANTITY, + this.enhancedSchemeDataItemDetailLineItemNrQuantity); + } + if (isSetEnhancedSchemeDataItemDetailLineItemNrTotalAmount) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_TOTAL_AMOUNT, + this.enhancedSchemeDataItemDetailLineItemNrTotalAmount); + } + if (isSetEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_UNIT_OF_MEASURE, + this.enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure); + } + if (isSetEnhancedSchemeDataItemDetailLineItemNrUnitPrice) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_UNIT_PRICE, + this.enhancedSchemeDataItemDetailLineItemNrUnitPrice); + } + if (isSetEnhancedSchemeDataOrderDate) { + addIfNull( + nulls, JSON_PROPERTY_ENHANCED_SCHEME_DATA_ORDER_DATE, this.enhancedSchemeDataOrderDate); + } + if (isSetEnhancedSchemeDataShipFromPostalCode) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_SHIP_FROM_POSTAL_CODE, + this.enhancedSchemeDataShipFromPostalCode); + } + if (isSetEnhancedSchemeDataTotalTaxAmount) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_TOTAL_TAX_AMOUNT, + this.enhancedSchemeDataTotalTaxAmount); + } + + 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 AdditionalDataLevel23 given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataLodging.java b/src/main/java/com/adyen/model/payment/AdditionalDataLodging.java index c0bac4128..be055b6c2 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataLodging.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataLodging.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -42,62 +44,119 @@ public class AdditionalDataLodging { "lodging.SpecialProgramCode"; private String lodgingSpecialProgramCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingSpecialProgramCode = false; + public static final String JSON_PROPERTY_LODGING_CHECK_IN_DATE = "lodging.checkInDate"; private String lodgingCheckInDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingCheckInDate = false; + public static final String JSON_PROPERTY_LODGING_CHECK_OUT_DATE = "lodging.checkOutDate"; private String lodgingCheckOutDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingCheckOutDate = false; + public static final String JSON_PROPERTY_LODGING_CUSTOMER_SERVICE_TOLL_FREE_NUMBER = "lodging.customerServiceTollFreeNumber"; private String lodgingCustomerServiceTollFreeNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingCustomerServiceTollFreeNumber = false; + public static final String JSON_PROPERTY_LODGING_FIRE_SAFETY_ACT_INDICATOR = "lodging.fireSafetyActIndicator"; private String lodgingFireSafetyActIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingFireSafetyActIndicator = false; + public static final String JSON_PROPERTY_LODGING_FOLIO_CASH_ADVANCES = "lodging.folioCashAdvances"; private String lodgingFolioCashAdvances; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingFolioCashAdvances = false; + public static final String JSON_PROPERTY_LODGING_FOLIO_NUMBER = "lodging.folioNumber"; private String lodgingFolioNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingFolioNumber = false; + public static final String JSON_PROPERTY_LODGING_FOOD_BEVERAGE_CHARGES = "lodging.foodBeverageCharges"; private String lodgingFoodBeverageCharges; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingFoodBeverageCharges = false; + public static final String JSON_PROPERTY_LODGING_NO_SHOW_INDICATOR = "lodging.noShowIndicator"; private String lodgingNoShowIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingNoShowIndicator = false; + public static final String JSON_PROPERTY_LODGING_PREPAID_EXPENSES = "lodging.prepaidExpenses"; private String lodgingPrepaidExpenses; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingPrepaidExpenses = false; + public static final String JSON_PROPERTY_LODGING_PROPERTY_PHONE_NUMBER = "lodging.propertyPhoneNumber"; private String lodgingPropertyPhoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingPropertyPhoneNumber = false; + public static final String JSON_PROPERTY_LODGING_ROOM1_NUMBER_OF_NIGHTS = "lodging.room1.numberOfNights"; private String lodgingRoom1NumberOfNights; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingRoom1NumberOfNights = false; + public static final String JSON_PROPERTY_LODGING_ROOM1_RATE = "lodging.room1.rate"; private String lodgingRoom1Rate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingRoom1Rate = false; + public static final String JSON_PROPERTY_LODGING_TOTAL_ROOM_TAX = "lodging.totalRoomTax"; private String lodgingTotalRoomTax; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingTotalRoomTax = false; + public static final String JSON_PROPERTY_LODGING_TOTAL_TAX = "lodging.totalTax"; private String lodgingTotalTax; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingTotalTax = false; + public static final String JSON_PROPERTY_TRAVEL_ENTERTAINMENT_AUTH_DATA_DURATION = "travelEntertainmentAuthData.duration"; private String travelEntertainmentAuthDataDuration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTravelEntertainmentAuthDataDuration = false; + public static final String JSON_PROPERTY_TRAVEL_ENTERTAINMENT_AUTH_DATA_MARKET = "travelEntertainmentAuthData.market"; private String travelEntertainmentAuthDataMarket; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTravelEntertainmentAuthDataMarket = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataLodging() {} /** @@ -110,6 +169,7 @@ public AdditionalDataLodging() {} */ public AdditionalDataLodging lodgingSpecialProgramCode(String lodgingSpecialProgramCode) { this.lodgingSpecialProgramCode = lodgingSpecialProgramCode; + isSetLodgingSpecialProgramCode = true; // mark as set return this; } @@ -138,6 +198,7 @@ public String getLodgingSpecialProgramCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingSpecialProgramCode(String lodgingSpecialProgramCode) { this.lodgingSpecialProgramCode = lodgingSpecialProgramCode; + isSetLodgingSpecialProgramCode = true; // mark as set } /** @@ -149,6 +210,7 @@ public void setLodgingSpecialProgramCode(String lodgingSpecialProgramCode) { */ public AdditionalDataLodging lodgingCheckInDate(String lodgingCheckInDate) { this.lodgingCheckInDate = lodgingCheckInDate; + isSetLodgingCheckInDate = true; // mark as set return this; } @@ -174,6 +236,7 @@ public String getLodgingCheckInDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingCheckInDate(String lodgingCheckInDate) { this.lodgingCheckInDate = lodgingCheckInDate; + isSetLodgingCheckInDate = true; // mark as set } /** @@ -185,6 +248,7 @@ public void setLodgingCheckInDate(String lodgingCheckInDate) { */ public AdditionalDataLodging lodgingCheckOutDate(String lodgingCheckOutDate) { this.lodgingCheckOutDate = lodgingCheckOutDate; + isSetLodgingCheckOutDate = true; // mark as set return this; } @@ -210,6 +274,7 @@ public String getLodgingCheckOutDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingCheckOutDate(String lodgingCheckOutDate) { this.lodgingCheckOutDate = lodgingCheckOutDate; + isSetLodgingCheckOutDate = true; // mark as set } /** @@ -226,6 +291,7 @@ public void setLodgingCheckOutDate(String lodgingCheckOutDate) { public AdditionalDataLodging lodgingCustomerServiceTollFreeNumber( String lodgingCustomerServiceTollFreeNumber) { this.lodgingCustomerServiceTollFreeNumber = lodgingCustomerServiceTollFreeNumber; + isSetLodgingCustomerServiceTollFreeNumber = true; // mark as set return this; } @@ -259,6 +325,7 @@ public String getLodgingCustomerServiceTollFreeNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingCustomerServiceTollFreeNumber(String lodgingCustomerServiceTollFreeNumber) { this.lodgingCustomerServiceTollFreeNumber = lodgingCustomerServiceTollFreeNumber; + isSetLodgingCustomerServiceTollFreeNumber = true; // mark as set } /** @@ -272,6 +339,7 @@ public void setLodgingCustomerServiceTollFreeNumber(String lodgingCustomerServic */ public AdditionalDataLodging lodgingFireSafetyActIndicator(String lodgingFireSafetyActIndicator) { this.lodgingFireSafetyActIndicator = lodgingFireSafetyActIndicator; + isSetLodgingFireSafetyActIndicator = true; // mark as set return this; } @@ -301,6 +369,7 @@ public String getLodgingFireSafetyActIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingFireSafetyActIndicator(String lodgingFireSafetyActIndicator) { this.lodgingFireSafetyActIndicator = lodgingFireSafetyActIndicator; + isSetLodgingFireSafetyActIndicator = true; // mark as set } /** @@ -315,6 +384,7 @@ public void setLodgingFireSafetyActIndicator(String lodgingFireSafetyActIndicato */ public AdditionalDataLodging lodgingFolioCashAdvances(String lodgingFolioCashAdvances) { this.lodgingFolioCashAdvances = lodgingFolioCashAdvances; + isSetLodgingFolioCashAdvances = true; // mark as set return this; } @@ -346,6 +416,7 @@ public String getLodgingFolioCashAdvances() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingFolioCashAdvances(String lodgingFolioCashAdvances) { this.lodgingFolioCashAdvances = lodgingFolioCashAdvances; + isSetLodgingFolioCashAdvances = true; // mark as set } /** @@ -360,6 +431,7 @@ public void setLodgingFolioCashAdvances(String lodgingFolioCashAdvances) { */ public AdditionalDataLodging lodgingFolioNumber(String lodgingFolioNumber) { this.lodgingFolioNumber = lodgingFolioNumber; + isSetLodgingFolioNumber = true; // mark as set return this; } @@ -391,6 +463,7 @@ public String getLodgingFolioNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingFolioNumber(String lodgingFolioNumber) { this.lodgingFolioNumber = lodgingFolioNumber; + isSetLodgingFolioNumber = true; // mark as set } /** @@ -405,6 +478,7 @@ public void setLodgingFolioNumber(String lodgingFolioNumber) { */ public AdditionalDataLodging lodgingFoodBeverageCharges(String lodgingFoodBeverageCharges) { this.lodgingFoodBeverageCharges = lodgingFoodBeverageCharges; + isSetLodgingFoodBeverageCharges = true; // mark as set return this; } @@ -436,6 +510,7 @@ public String getLodgingFoodBeverageCharges() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingFoodBeverageCharges(String lodgingFoodBeverageCharges) { this.lodgingFoodBeverageCharges = lodgingFoodBeverageCharges; + isSetLodgingFoodBeverageCharges = true; // mark as set } /** @@ -448,6 +523,7 @@ public void setLodgingFoodBeverageCharges(String lodgingFoodBeverageCharges) { */ public AdditionalDataLodging lodgingNoShowIndicator(String lodgingNoShowIndicator) { this.lodgingNoShowIndicator = lodgingNoShowIndicator; + isSetLodgingNoShowIndicator = true; // mark as set return this; } @@ -475,6 +551,7 @@ public String getLodgingNoShowIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingNoShowIndicator(String lodgingNoShowIndicator) { this.lodgingNoShowIndicator = lodgingNoShowIndicator; + isSetLodgingNoShowIndicator = true; // mark as set } /** @@ -486,6 +563,7 @@ public void setLodgingNoShowIndicator(String lodgingNoShowIndicator) { */ public AdditionalDataLodging lodgingPrepaidExpenses(String lodgingPrepaidExpenses) { this.lodgingPrepaidExpenses = lodgingPrepaidExpenses; + isSetLodgingPrepaidExpenses = true; // mark as set return this; } @@ -511,6 +589,7 @@ public String getLodgingPrepaidExpenses() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingPrepaidExpenses(String lodgingPrepaidExpenses) { this.lodgingPrepaidExpenses = lodgingPrepaidExpenses; + isSetLodgingPrepaidExpenses = true; // mark as set } /** @@ -527,6 +606,7 @@ public void setLodgingPrepaidExpenses(String lodgingPrepaidExpenses) { */ public AdditionalDataLodging lodgingPropertyPhoneNumber(String lodgingPropertyPhoneNumber) { this.lodgingPropertyPhoneNumber = lodgingPropertyPhoneNumber; + isSetLodgingPropertyPhoneNumber = true; // mark as set return this; } @@ -562,6 +642,7 @@ public String getLodgingPropertyPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingPropertyPhoneNumber(String lodgingPropertyPhoneNumber) { this.lodgingPropertyPhoneNumber = lodgingPropertyPhoneNumber; + isSetLodgingPropertyPhoneNumber = true; // mark as set } /** @@ -574,6 +655,7 @@ public void setLodgingPropertyPhoneNumber(String lodgingPropertyPhoneNumber) { */ public AdditionalDataLodging lodgingRoom1NumberOfNights(String lodgingRoom1NumberOfNights) { this.lodgingRoom1NumberOfNights = lodgingRoom1NumberOfNights; + isSetLodgingRoom1NumberOfNights = true; // mark as set return this; } @@ -601,6 +683,7 @@ public String getLodgingRoom1NumberOfNights() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingRoom1NumberOfNights(String lodgingRoom1NumberOfNights) { this.lodgingRoom1NumberOfNights = lodgingRoom1NumberOfNights; + isSetLodgingRoom1NumberOfNights = true; // mark as set } /** @@ -615,6 +698,7 @@ public void setLodgingRoom1NumberOfNights(String lodgingRoom1NumberOfNights) { */ public AdditionalDataLodging lodgingRoom1Rate(String lodgingRoom1Rate) { this.lodgingRoom1Rate = lodgingRoom1Rate; + isSetLodgingRoom1Rate = true; // mark as set return this; } @@ -646,6 +730,7 @@ public String getLodgingRoom1Rate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingRoom1Rate(String lodgingRoom1Rate) { this.lodgingRoom1Rate = lodgingRoom1Rate; + isSetLodgingRoom1Rate = true; // mark as set } /** @@ -660,6 +745,7 @@ public void setLodgingRoom1Rate(String lodgingRoom1Rate) { */ public AdditionalDataLodging lodgingTotalRoomTax(String lodgingTotalRoomTax) { this.lodgingTotalRoomTax = lodgingTotalRoomTax; + isSetLodgingTotalRoomTax = true; // mark as set return this; } @@ -691,6 +777,7 @@ public String getLodgingTotalRoomTax() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingTotalRoomTax(String lodgingTotalRoomTax) { this.lodgingTotalRoomTax = lodgingTotalRoomTax; + isSetLodgingTotalRoomTax = true; // mark as set } /** @@ -705,6 +792,7 @@ public void setLodgingTotalRoomTax(String lodgingTotalRoomTax) { */ public AdditionalDataLodging lodgingTotalTax(String lodgingTotalTax) { this.lodgingTotalTax = lodgingTotalTax; + isSetLodgingTotalTax = true; // mark as set return this; } @@ -736,6 +824,7 @@ public String getLodgingTotalTax() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingTotalTax(String lodgingTotalTax) { this.lodgingTotalTax = lodgingTotalTax; + isSetLodgingTotalTax = true; // mark as set } /** @@ -749,6 +838,7 @@ public void setLodgingTotalTax(String lodgingTotalTax) { public AdditionalDataLodging travelEntertainmentAuthDataDuration( String travelEntertainmentAuthDataDuration) { this.travelEntertainmentAuthDataDuration = travelEntertainmentAuthDataDuration; + isSetTravelEntertainmentAuthDataDuration = true; // mark as set return this; } @@ -776,6 +866,7 @@ public String getTravelEntertainmentAuthDataDuration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTravelEntertainmentAuthDataDuration(String travelEntertainmentAuthDataDuration) { this.travelEntertainmentAuthDataDuration = travelEntertainmentAuthDataDuration; + isSetTravelEntertainmentAuthDataDuration = true; // mark as set } /** @@ -790,6 +881,7 @@ public void setTravelEntertainmentAuthDataDuration(String travelEntertainmentAut public AdditionalDataLodging travelEntertainmentAuthDataMarket( String travelEntertainmentAuthDataMarket) { this.travelEntertainmentAuthDataMarket = travelEntertainmentAuthDataMarket; + isSetTravelEntertainmentAuthDataMarket = true; // mark as set return this; } @@ -819,6 +911,27 @@ public String getTravelEntertainmentAuthDataMarket() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTravelEntertainmentAuthDataMarket(String travelEntertainmentAuthDataMarket) { this.travelEntertainmentAuthDataMarket = travelEntertainmentAuthDataMarket; + isSetTravelEntertainmentAuthDataMarket = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataLodging 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 AdditionalDataLodging object is equal to o. */ @@ -833,55 +946,112 @@ public boolean equals(Object o) { AdditionalDataLodging additionalDataLodging = (AdditionalDataLodging) o; return Objects.equals( this.lodgingSpecialProgramCode, additionalDataLodging.lodgingSpecialProgramCode) + && Objects.equals( + this.isSetLodgingSpecialProgramCode, + additionalDataLodging.isSetLodgingSpecialProgramCode) && Objects.equals(this.lodgingCheckInDate, additionalDataLodging.lodgingCheckInDate) + && Objects.equals( + this.isSetLodgingCheckInDate, additionalDataLodging.isSetLodgingCheckInDate) && Objects.equals(this.lodgingCheckOutDate, additionalDataLodging.lodgingCheckOutDate) + && Objects.equals( + this.isSetLodgingCheckOutDate, additionalDataLodging.isSetLodgingCheckOutDate) && Objects.equals( this.lodgingCustomerServiceTollFreeNumber, additionalDataLodging.lodgingCustomerServiceTollFreeNumber) + && Objects.equals( + this.isSetLodgingCustomerServiceTollFreeNumber, + additionalDataLodging.isSetLodgingCustomerServiceTollFreeNumber) && Objects.equals( this.lodgingFireSafetyActIndicator, additionalDataLodging.lodgingFireSafetyActIndicator) + && Objects.equals( + this.isSetLodgingFireSafetyActIndicator, + additionalDataLodging.isSetLodgingFireSafetyActIndicator) && Objects.equals( this.lodgingFolioCashAdvances, additionalDataLodging.lodgingFolioCashAdvances) + && Objects.equals( + this.isSetLodgingFolioCashAdvances, additionalDataLodging.isSetLodgingFolioCashAdvances) && Objects.equals(this.lodgingFolioNumber, additionalDataLodging.lodgingFolioNumber) + && Objects.equals( + this.isSetLodgingFolioNumber, additionalDataLodging.isSetLodgingFolioNumber) && Objects.equals( this.lodgingFoodBeverageCharges, additionalDataLodging.lodgingFoodBeverageCharges) + && Objects.equals( + this.isSetLodgingFoodBeverageCharges, + additionalDataLodging.isSetLodgingFoodBeverageCharges) && Objects.equals(this.lodgingNoShowIndicator, additionalDataLodging.lodgingNoShowIndicator) + && Objects.equals( + this.isSetLodgingNoShowIndicator, additionalDataLodging.isSetLodgingNoShowIndicator) && Objects.equals(this.lodgingPrepaidExpenses, additionalDataLodging.lodgingPrepaidExpenses) + && Objects.equals( + this.isSetLodgingPrepaidExpenses, additionalDataLodging.isSetLodgingPrepaidExpenses) && Objects.equals( this.lodgingPropertyPhoneNumber, additionalDataLodging.lodgingPropertyPhoneNumber) + && Objects.equals( + this.isSetLodgingPropertyPhoneNumber, + additionalDataLodging.isSetLodgingPropertyPhoneNumber) && Objects.equals( this.lodgingRoom1NumberOfNights, additionalDataLodging.lodgingRoom1NumberOfNights) + && Objects.equals( + this.isSetLodgingRoom1NumberOfNights, + additionalDataLodging.isSetLodgingRoom1NumberOfNights) && Objects.equals(this.lodgingRoom1Rate, additionalDataLodging.lodgingRoom1Rate) + && Objects.equals(this.isSetLodgingRoom1Rate, additionalDataLodging.isSetLodgingRoom1Rate) && Objects.equals(this.lodgingTotalRoomTax, additionalDataLodging.lodgingTotalRoomTax) + && Objects.equals( + this.isSetLodgingTotalRoomTax, additionalDataLodging.isSetLodgingTotalRoomTax) && Objects.equals(this.lodgingTotalTax, additionalDataLodging.lodgingTotalTax) + && Objects.equals(this.isSetLodgingTotalTax, additionalDataLodging.isSetLodgingTotalTax) && Objects.equals( this.travelEntertainmentAuthDataDuration, additionalDataLodging.travelEntertainmentAuthDataDuration) + && Objects.equals( + this.isSetTravelEntertainmentAuthDataDuration, + additionalDataLodging.isSetTravelEntertainmentAuthDataDuration) && Objects.equals( this.travelEntertainmentAuthDataMarket, - additionalDataLodging.travelEntertainmentAuthDataMarket); + additionalDataLodging.travelEntertainmentAuthDataMarket) + && Objects.equals( + this.isSetTravelEntertainmentAuthDataMarket, + additionalDataLodging.isSetTravelEntertainmentAuthDataMarket); } @Override public int hashCode() { return Objects.hash( lodgingSpecialProgramCode, + isSetLodgingSpecialProgramCode, lodgingCheckInDate, + isSetLodgingCheckInDate, lodgingCheckOutDate, + isSetLodgingCheckOutDate, lodgingCustomerServiceTollFreeNumber, + isSetLodgingCustomerServiceTollFreeNumber, lodgingFireSafetyActIndicator, + isSetLodgingFireSafetyActIndicator, lodgingFolioCashAdvances, + isSetLodgingFolioCashAdvances, lodgingFolioNumber, + isSetLodgingFolioNumber, lodgingFoodBeverageCharges, + isSetLodgingFoodBeverageCharges, lodgingNoShowIndicator, + isSetLodgingNoShowIndicator, lodgingPrepaidExpenses, + isSetLodgingPrepaidExpenses, lodgingPropertyPhoneNumber, + isSetLodgingPropertyPhoneNumber, lodgingRoom1NumberOfNights, + isSetLodgingRoom1NumberOfNights, lodgingRoom1Rate, + isSetLodgingRoom1Rate, lodgingTotalRoomTax, + isSetLodgingTotalRoomTax, lodgingTotalTax, + isSetLodgingTotalTax, travelEntertainmentAuthDataDuration, - travelEntertainmentAuthDataMarket); + isSetTravelEntertainmentAuthDataDuration, + travelEntertainmentAuthDataMarket, + isSetTravelEntertainmentAuthDataMarket); } @Override @@ -945,6 +1115,93 @@ 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 (isSetLodgingSpecialProgramCode) { + addIfNull(nulls, JSON_PROPERTY_LODGING_SPECIAL_PROGRAM_CODE, this.lodgingSpecialProgramCode); + } + if (isSetLodgingCheckInDate) { + addIfNull(nulls, JSON_PROPERTY_LODGING_CHECK_IN_DATE, this.lodgingCheckInDate); + } + if (isSetLodgingCheckOutDate) { + addIfNull(nulls, JSON_PROPERTY_LODGING_CHECK_OUT_DATE, this.lodgingCheckOutDate); + } + if (isSetLodgingCustomerServiceTollFreeNumber) { + addIfNull( + nulls, + JSON_PROPERTY_LODGING_CUSTOMER_SERVICE_TOLL_FREE_NUMBER, + this.lodgingCustomerServiceTollFreeNumber); + } + if (isSetLodgingFireSafetyActIndicator) { + addIfNull( + nulls, + JSON_PROPERTY_LODGING_FIRE_SAFETY_ACT_INDICATOR, + this.lodgingFireSafetyActIndicator); + } + if (isSetLodgingFolioCashAdvances) { + addIfNull(nulls, JSON_PROPERTY_LODGING_FOLIO_CASH_ADVANCES, this.lodgingFolioCashAdvances); + } + if (isSetLodgingFolioNumber) { + addIfNull(nulls, JSON_PROPERTY_LODGING_FOLIO_NUMBER, this.lodgingFolioNumber); + } + if (isSetLodgingFoodBeverageCharges) { + addIfNull( + nulls, JSON_PROPERTY_LODGING_FOOD_BEVERAGE_CHARGES, this.lodgingFoodBeverageCharges); + } + if (isSetLodgingNoShowIndicator) { + addIfNull(nulls, JSON_PROPERTY_LODGING_NO_SHOW_INDICATOR, this.lodgingNoShowIndicator); + } + if (isSetLodgingPrepaidExpenses) { + addIfNull(nulls, JSON_PROPERTY_LODGING_PREPAID_EXPENSES, this.lodgingPrepaidExpenses); + } + if (isSetLodgingPropertyPhoneNumber) { + addIfNull( + nulls, JSON_PROPERTY_LODGING_PROPERTY_PHONE_NUMBER, this.lodgingPropertyPhoneNumber); + } + if (isSetLodgingRoom1NumberOfNights) { + addIfNull( + nulls, JSON_PROPERTY_LODGING_ROOM1_NUMBER_OF_NIGHTS, this.lodgingRoom1NumberOfNights); + } + if (isSetLodgingRoom1Rate) { + addIfNull(nulls, JSON_PROPERTY_LODGING_ROOM1_RATE, this.lodgingRoom1Rate); + } + if (isSetLodgingTotalRoomTax) { + addIfNull(nulls, JSON_PROPERTY_LODGING_TOTAL_ROOM_TAX, this.lodgingTotalRoomTax); + } + if (isSetLodgingTotalTax) { + addIfNull(nulls, JSON_PROPERTY_LODGING_TOTAL_TAX, this.lodgingTotalTax); + } + if (isSetTravelEntertainmentAuthDataDuration) { + addIfNull( + nulls, + JSON_PROPERTY_TRAVEL_ENTERTAINMENT_AUTH_DATA_DURATION, + this.travelEntertainmentAuthDataDuration); + } + if (isSetTravelEntertainmentAuthDataMarket) { + addIfNull( + nulls, + JSON_PROPERTY_TRAVEL_ENTERTAINMENT_AUTH_DATA_MARKET, + this.travelEntertainmentAuthDataMarket); + } + + 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 AdditionalDataLodging given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataModifications.java b/src/main/java/com/adyen/model/payment/AdditionalDataModifications.java index c36a6ec9b..539887193 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataModifications.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataModifications.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -26,6 +28,15 @@ public class AdditionalDataModifications { "installmentPaymentData.selectedInstallmentOption"; private String installmentPaymentDataSelectedInstallmentOption; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataSelectedInstallmentOption = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataModifications() {} /** @@ -40,6 +51,7 @@ public AdditionalDataModifications installmentPaymentDataSelectedInstallmentOpti String installmentPaymentDataSelectedInstallmentOption) { this.installmentPaymentDataSelectedInstallmentOption = installmentPaymentDataSelectedInstallmentOption; + isSetInstallmentPaymentDataSelectedInstallmentOption = true; // mark as set return this; } @@ -69,6 +81,27 @@ public void setInstallmentPaymentDataSelectedInstallmentOption( String installmentPaymentDataSelectedInstallmentOption) { this.installmentPaymentDataSelectedInstallmentOption = installmentPaymentDataSelectedInstallmentOption; + isSetInstallmentPaymentDataSelectedInstallmentOption = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataModifications 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 AdditionalDataModifications object is equal to o. */ @@ -82,13 +115,18 @@ public boolean equals(Object o) { } AdditionalDataModifications additionalDataModifications = (AdditionalDataModifications) o; return Objects.equals( - this.installmentPaymentDataSelectedInstallmentOption, - additionalDataModifications.installmentPaymentDataSelectedInstallmentOption); + this.installmentPaymentDataSelectedInstallmentOption, + additionalDataModifications.installmentPaymentDataSelectedInstallmentOption) + && Objects.equals( + this.isSetInstallmentPaymentDataSelectedInstallmentOption, + additionalDataModifications.isSetInstallmentPaymentDataSelectedInstallmentOption); } @Override public int hashCode() { - return Objects.hash(installmentPaymentDataSelectedInstallmentOption); + return Objects.hash( + installmentPaymentDataSelectedInstallmentOption, + isSetInstallmentPaymentDataSelectedInstallmentOption); } @Override @@ -112,6 +150,33 @@ 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 (isSetInstallmentPaymentDataSelectedInstallmentOption) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_SELECTED_INSTALLMENT_OPTION, + this.installmentPaymentDataSelectedInstallmentOption); + } + + 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 AdditionalDataModifications given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataOpenInvoice.java b/src/main/java/com/adyen/model/payment/AdditionalDataOpenInvoice.java index bf39ddf4c..06e8099eb 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataOpenInvoice.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataOpenInvoice.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -43,74 +45,134 @@ public class AdditionalDataOpenInvoice { "openinvoicedata.merchantData"; private String openinvoicedataMerchantData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataMerchantData = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_NUMBER_OF_LINES = "openinvoicedata.numberOfLines"; private String openinvoicedataNumberOfLines; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataNumberOfLines = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_RECIPIENT_FIRST_NAME = "openinvoicedata.recipientFirstName"; private String openinvoicedataRecipientFirstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataRecipientFirstName = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_RECIPIENT_LAST_NAME = "openinvoicedata.recipientLastName"; private String openinvoicedataRecipientLastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataRecipientLastName = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_CURRENCY_CODE = "openinvoicedataLine[itemNr].currencyCode"; private String openinvoicedataLineItemNrCurrencyCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrCurrencyCode = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_DESCRIPTION = "openinvoicedataLine[itemNr].description"; private String openinvoicedataLineItemNrDescription; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrDescription = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_ITEM_AMOUNT = "openinvoicedataLine[itemNr].itemAmount"; private String openinvoicedataLineItemNrItemAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrItemAmount = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_ITEM_ID = "openinvoicedataLine[itemNr].itemId"; private String openinvoicedataLineItemNrItemId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrItemId = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_ITEM_VAT_AMOUNT = "openinvoicedataLine[itemNr].itemVatAmount"; private String openinvoicedataLineItemNrItemVatAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrItemVatAmount = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_ITEM_VAT_PERCENTAGE = "openinvoicedataLine[itemNr].itemVatPercentage"; private String openinvoicedataLineItemNrItemVatPercentage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrItemVatPercentage = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_NUMBER_OF_ITEMS = "openinvoicedataLine[itemNr].numberOfItems"; private String openinvoicedataLineItemNrNumberOfItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrNumberOfItems = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_RETURN_SHIPPING_COMPANY = "openinvoicedataLine[itemNr].returnShippingCompany"; private String openinvoicedataLineItemNrReturnShippingCompany; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrReturnShippingCompany = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_RETURN_TRACKING_NUMBER = "openinvoicedataLine[itemNr].returnTrackingNumber"; private String openinvoicedataLineItemNrReturnTrackingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrReturnTrackingNumber = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_RETURN_TRACKING_URI = "openinvoicedataLine[itemNr].returnTrackingUri"; private String openinvoicedataLineItemNrReturnTrackingUri; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrReturnTrackingUri = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_SHIPPING_COMPANY = "openinvoicedataLine[itemNr].shippingCompany"; private String openinvoicedataLineItemNrShippingCompany; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrShippingCompany = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_SHIPPING_METHOD = "openinvoicedataLine[itemNr].shippingMethod"; private String openinvoicedataLineItemNrShippingMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrShippingMethod = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_TRACKING_NUMBER = "openinvoicedataLine[itemNr].trackingNumber"; private String openinvoicedataLineItemNrTrackingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrTrackingNumber = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_TRACKING_URI = "openinvoicedataLine[itemNr].trackingUri"; private String openinvoicedataLineItemNrTrackingUri; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrTrackingUri = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataOpenInvoice() {} /** @@ -130,6 +192,7 @@ public AdditionalDataOpenInvoice() {} */ public AdditionalDataOpenInvoice openinvoicedataMerchantData(String openinvoicedataMerchantData) { this.openinvoicedataMerchantData = openinvoicedataMerchantData; + isSetOpeninvoicedataMerchantData = true; // mark as set return this; } @@ -171,6 +234,7 @@ public String getOpeninvoicedataMerchantData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpeninvoicedataMerchantData(String openinvoicedataMerchantData) { this.openinvoicedataMerchantData = openinvoicedataMerchantData; + isSetOpeninvoicedataMerchantData = true; // mark as set } /** @@ -185,6 +249,7 @@ public void setOpeninvoicedataMerchantData(String openinvoicedataMerchantData) { public AdditionalDataOpenInvoice openinvoicedataNumberOfLines( String openinvoicedataNumberOfLines) { this.openinvoicedataNumberOfLines = openinvoicedataNumberOfLines; + isSetOpeninvoicedataNumberOfLines = true; // mark as set return this; } @@ -214,6 +279,7 @@ public String getOpeninvoicedataNumberOfLines() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpeninvoicedataNumberOfLines(String openinvoicedataNumberOfLines) { this.openinvoicedataNumberOfLines = openinvoicedataNumberOfLines; + isSetOpeninvoicedataNumberOfLines = true; // mark as set } /** @@ -230,6 +296,7 @@ public void setOpeninvoicedataNumberOfLines(String openinvoicedataNumberOfLines) public AdditionalDataOpenInvoice openinvoicedataRecipientFirstName( String openinvoicedataRecipientFirstName) { this.openinvoicedataRecipientFirstName = openinvoicedataRecipientFirstName; + isSetOpeninvoicedataRecipientFirstName = true; // mark as set return this; } @@ -263,6 +330,7 @@ public String getOpeninvoicedataRecipientFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpeninvoicedataRecipientFirstName(String openinvoicedataRecipientFirstName) { this.openinvoicedataRecipientFirstName = openinvoicedataRecipientFirstName; + isSetOpeninvoicedataRecipientFirstName = true; // mark as set } /** @@ -279,6 +347,7 @@ public void setOpeninvoicedataRecipientFirstName(String openinvoicedataRecipient public AdditionalDataOpenInvoice openinvoicedataRecipientLastName( String openinvoicedataRecipientLastName) { this.openinvoicedataRecipientLastName = openinvoicedataRecipientLastName; + isSetOpeninvoicedataRecipientLastName = true; // mark as set return this; } @@ -312,6 +381,7 @@ public String getOpeninvoicedataRecipientLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpeninvoicedataRecipientLastName(String openinvoicedataRecipientLastName) { this.openinvoicedataRecipientLastName = openinvoicedataRecipientLastName; + isSetOpeninvoicedataRecipientLastName = true; // mark as set } /** @@ -323,6 +393,7 @@ public void setOpeninvoicedataRecipientLastName(String openinvoicedataRecipientL public AdditionalDataOpenInvoice openinvoicedataLineItemNrCurrencyCode( String openinvoicedataLineItemNrCurrencyCode) { this.openinvoicedataLineItemNrCurrencyCode = openinvoicedataLineItemNrCurrencyCode; + isSetOpeninvoicedataLineItemNrCurrencyCode = true; // mark as set return this; } @@ -347,6 +418,7 @@ public String getOpeninvoicedataLineItemNrCurrencyCode() { public void setOpeninvoicedataLineItemNrCurrencyCode( String openinvoicedataLineItemNrCurrencyCode) { this.openinvoicedataLineItemNrCurrencyCode = openinvoicedataLineItemNrCurrencyCode; + isSetOpeninvoicedataLineItemNrCurrencyCode = true; // mark as set } /** @@ -359,6 +431,7 @@ public void setOpeninvoicedataLineItemNrCurrencyCode( public AdditionalDataOpenInvoice openinvoicedataLineItemNrDescription( String openinvoicedataLineItemNrDescription) { this.openinvoicedataLineItemNrDescription = openinvoicedataLineItemNrDescription; + isSetOpeninvoicedataLineItemNrDescription = true; // mark as set return this; } @@ -384,6 +457,7 @@ public String getOpeninvoicedataLineItemNrDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpeninvoicedataLineItemNrDescription(String openinvoicedataLineItemNrDescription) { this.openinvoicedataLineItemNrDescription = openinvoicedataLineItemNrDescription; + isSetOpeninvoicedataLineItemNrDescription = true; // mark as set } /** @@ -397,6 +471,7 @@ public void setOpeninvoicedataLineItemNrDescription(String openinvoicedataLineIt public AdditionalDataOpenInvoice openinvoicedataLineItemNrItemAmount( String openinvoicedataLineItemNrItemAmount) { this.openinvoicedataLineItemNrItemAmount = openinvoicedataLineItemNrItemAmount; + isSetOpeninvoicedataLineItemNrItemAmount = true; // mark as set return this; } @@ -424,6 +499,7 @@ public String getOpeninvoicedataLineItemNrItemAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpeninvoicedataLineItemNrItemAmount(String openinvoicedataLineItemNrItemAmount) { this.openinvoicedataLineItemNrItemAmount = openinvoicedataLineItemNrItemAmount; + isSetOpeninvoicedataLineItemNrItemAmount = true; // mark as set } /** @@ -436,6 +512,7 @@ public void setOpeninvoicedataLineItemNrItemAmount(String openinvoicedataLineIte public AdditionalDataOpenInvoice openinvoicedataLineItemNrItemId( String openinvoicedataLineItemNrItemId) { this.openinvoicedataLineItemNrItemId = openinvoicedataLineItemNrItemId; + isSetOpeninvoicedataLineItemNrItemId = true; // mark as set return this; } @@ -461,6 +538,7 @@ public String getOpeninvoicedataLineItemNrItemId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpeninvoicedataLineItemNrItemId(String openinvoicedataLineItemNrItemId) { this.openinvoicedataLineItemNrItemId = openinvoicedataLineItemNrItemId; + isSetOpeninvoicedataLineItemNrItemId = true; // mark as set } /** @@ -473,6 +551,7 @@ public void setOpeninvoicedataLineItemNrItemId(String openinvoicedataLineItemNrI public AdditionalDataOpenInvoice openinvoicedataLineItemNrItemVatAmount( String openinvoicedataLineItemNrItemVatAmount) { this.openinvoicedataLineItemNrItemVatAmount = openinvoicedataLineItemNrItemVatAmount; + isSetOpeninvoicedataLineItemNrItemVatAmount = true; // mark as set return this; } @@ -499,6 +578,7 @@ public String getOpeninvoicedataLineItemNrItemVatAmount() { public void setOpeninvoicedataLineItemNrItemVatAmount( String openinvoicedataLineItemNrItemVatAmount) { this.openinvoicedataLineItemNrItemVatAmount = openinvoicedataLineItemNrItemVatAmount; + isSetOpeninvoicedataLineItemNrItemVatAmount = true; // mark as set } /** @@ -512,6 +592,7 @@ public void setOpeninvoicedataLineItemNrItemVatAmount( public AdditionalDataOpenInvoice openinvoicedataLineItemNrItemVatPercentage( String openinvoicedataLineItemNrItemVatPercentage) { this.openinvoicedataLineItemNrItemVatPercentage = openinvoicedataLineItemNrItemVatPercentage; + isSetOpeninvoicedataLineItemNrItemVatPercentage = true; // mark as set return this; } @@ -540,6 +621,7 @@ public String getOpeninvoicedataLineItemNrItemVatPercentage() { public void setOpeninvoicedataLineItemNrItemVatPercentage( String openinvoicedataLineItemNrItemVatPercentage) { this.openinvoicedataLineItemNrItemVatPercentage = openinvoicedataLineItemNrItemVatPercentage; + isSetOpeninvoicedataLineItemNrItemVatPercentage = true; // mark as set } /** @@ -552,6 +634,7 @@ public void setOpeninvoicedataLineItemNrItemVatPercentage( public AdditionalDataOpenInvoice openinvoicedataLineItemNrNumberOfItems( String openinvoicedataLineItemNrNumberOfItems) { this.openinvoicedataLineItemNrNumberOfItems = openinvoicedataLineItemNrNumberOfItems; + isSetOpeninvoicedataLineItemNrNumberOfItems = true; // mark as set return this; } @@ -578,6 +661,7 @@ public String getOpeninvoicedataLineItemNrNumberOfItems() { public void setOpeninvoicedataLineItemNrNumberOfItems( String openinvoicedataLineItemNrNumberOfItems) { this.openinvoicedataLineItemNrNumberOfItems = openinvoicedataLineItemNrNumberOfItems; + isSetOpeninvoicedataLineItemNrNumberOfItems = true; // mark as set } /** @@ -591,6 +675,7 @@ public AdditionalDataOpenInvoice openinvoicedataLineItemNrReturnShippingCompany( String openinvoicedataLineItemNrReturnShippingCompany) { this.openinvoicedataLineItemNrReturnShippingCompany = openinvoicedataLineItemNrReturnShippingCompany; + isSetOpeninvoicedataLineItemNrReturnShippingCompany = true; // mark as set return this; } @@ -618,6 +703,7 @@ public void setOpeninvoicedataLineItemNrReturnShippingCompany( String openinvoicedataLineItemNrReturnShippingCompany) { this.openinvoicedataLineItemNrReturnShippingCompany = openinvoicedataLineItemNrReturnShippingCompany; + isSetOpeninvoicedataLineItemNrReturnShippingCompany = true; // mark as set } /** @@ -631,6 +717,7 @@ public AdditionalDataOpenInvoice openinvoicedataLineItemNrReturnTrackingNumber( String openinvoicedataLineItemNrReturnTrackingNumber) { this.openinvoicedataLineItemNrReturnTrackingNumber = openinvoicedataLineItemNrReturnTrackingNumber; + isSetOpeninvoicedataLineItemNrReturnTrackingNumber = true; // mark as set return this; } @@ -658,6 +745,7 @@ public void setOpeninvoicedataLineItemNrReturnTrackingNumber( String openinvoicedataLineItemNrReturnTrackingNumber) { this.openinvoicedataLineItemNrReturnTrackingNumber = openinvoicedataLineItemNrReturnTrackingNumber; + isSetOpeninvoicedataLineItemNrReturnTrackingNumber = true; // mark as set } /** @@ -670,6 +758,7 @@ public void setOpeninvoicedataLineItemNrReturnTrackingNumber( public AdditionalDataOpenInvoice openinvoicedataLineItemNrReturnTrackingUri( String openinvoicedataLineItemNrReturnTrackingUri) { this.openinvoicedataLineItemNrReturnTrackingUri = openinvoicedataLineItemNrReturnTrackingUri; + isSetOpeninvoicedataLineItemNrReturnTrackingUri = true; // mark as set return this; } @@ -696,6 +785,7 @@ public String getOpeninvoicedataLineItemNrReturnTrackingUri() { public void setOpeninvoicedataLineItemNrReturnTrackingUri( String openinvoicedataLineItemNrReturnTrackingUri) { this.openinvoicedataLineItemNrReturnTrackingUri = openinvoicedataLineItemNrReturnTrackingUri; + isSetOpeninvoicedataLineItemNrReturnTrackingUri = true; // mark as set } /** @@ -708,6 +798,7 @@ public void setOpeninvoicedataLineItemNrReturnTrackingUri( public AdditionalDataOpenInvoice openinvoicedataLineItemNrShippingCompany( String openinvoicedataLineItemNrShippingCompany) { this.openinvoicedataLineItemNrShippingCompany = openinvoicedataLineItemNrShippingCompany; + isSetOpeninvoicedataLineItemNrShippingCompany = true; // mark as set return this; } @@ -734,6 +825,7 @@ public String getOpeninvoicedataLineItemNrShippingCompany() { public void setOpeninvoicedataLineItemNrShippingCompany( String openinvoicedataLineItemNrShippingCompany) { this.openinvoicedataLineItemNrShippingCompany = openinvoicedataLineItemNrShippingCompany; + isSetOpeninvoicedataLineItemNrShippingCompany = true; // mark as set } /** @@ -745,6 +837,7 @@ public void setOpeninvoicedataLineItemNrShippingCompany( public AdditionalDataOpenInvoice openinvoicedataLineItemNrShippingMethod( String openinvoicedataLineItemNrShippingMethod) { this.openinvoicedataLineItemNrShippingMethod = openinvoicedataLineItemNrShippingMethod; + isSetOpeninvoicedataLineItemNrShippingMethod = true; // mark as set return this; } @@ -769,6 +862,7 @@ public String getOpeninvoicedataLineItemNrShippingMethod() { public void setOpeninvoicedataLineItemNrShippingMethod( String openinvoicedataLineItemNrShippingMethod) { this.openinvoicedataLineItemNrShippingMethod = openinvoicedataLineItemNrShippingMethod; + isSetOpeninvoicedataLineItemNrShippingMethod = true; // mark as set } /** @@ -780,6 +874,7 @@ public void setOpeninvoicedataLineItemNrShippingMethod( public AdditionalDataOpenInvoice openinvoicedataLineItemNrTrackingNumber( String openinvoicedataLineItemNrTrackingNumber) { this.openinvoicedataLineItemNrTrackingNumber = openinvoicedataLineItemNrTrackingNumber; + isSetOpeninvoicedataLineItemNrTrackingNumber = true; // mark as set return this; } @@ -804,6 +899,7 @@ public String getOpeninvoicedataLineItemNrTrackingNumber() { public void setOpeninvoicedataLineItemNrTrackingNumber( String openinvoicedataLineItemNrTrackingNumber) { this.openinvoicedataLineItemNrTrackingNumber = openinvoicedataLineItemNrTrackingNumber; + isSetOpeninvoicedataLineItemNrTrackingNumber = true; // mark as set } /** @@ -815,6 +911,7 @@ public void setOpeninvoicedataLineItemNrTrackingNumber( public AdditionalDataOpenInvoice openinvoicedataLineItemNrTrackingUri( String openinvoicedataLineItemNrTrackingUri) { this.openinvoicedataLineItemNrTrackingUri = openinvoicedataLineItemNrTrackingUri; + isSetOpeninvoicedataLineItemNrTrackingUri = true; // mark as set return this; } @@ -838,6 +935,27 @@ public String getOpeninvoicedataLineItemNrTrackingUri() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpeninvoicedataLineItemNrTrackingUri(String openinvoicedataLineItemNrTrackingUri) { this.openinvoicedataLineItemNrTrackingUri = openinvoicedataLineItemNrTrackingUri; + isSetOpeninvoicedataLineItemNrTrackingUri = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataOpenInvoice 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 AdditionalDataOpenInvoice object is equal to o. */ @@ -852,80 +970,152 @@ public boolean equals(Object o) { AdditionalDataOpenInvoice additionalDataOpenInvoice = (AdditionalDataOpenInvoice) o; return Objects.equals( this.openinvoicedataMerchantData, additionalDataOpenInvoice.openinvoicedataMerchantData) + && Objects.equals( + this.isSetOpeninvoicedataMerchantData, + additionalDataOpenInvoice.isSetOpeninvoicedataMerchantData) && Objects.equals( this.openinvoicedataNumberOfLines, additionalDataOpenInvoice.openinvoicedataNumberOfLines) + && Objects.equals( + this.isSetOpeninvoicedataNumberOfLines, + additionalDataOpenInvoice.isSetOpeninvoicedataNumberOfLines) && Objects.equals( this.openinvoicedataRecipientFirstName, additionalDataOpenInvoice.openinvoicedataRecipientFirstName) + && Objects.equals( + this.isSetOpeninvoicedataRecipientFirstName, + additionalDataOpenInvoice.isSetOpeninvoicedataRecipientFirstName) && Objects.equals( this.openinvoicedataRecipientLastName, additionalDataOpenInvoice.openinvoicedataRecipientLastName) + && Objects.equals( + this.isSetOpeninvoicedataRecipientLastName, + additionalDataOpenInvoice.isSetOpeninvoicedataRecipientLastName) && Objects.equals( this.openinvoicedataLineItemNrCurrencyCode, additionalDataOpenInvoice.openinvoicedataLineItemNrCurrencyCode) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrCurrencyCode, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrCurrencyCode) && Objects.equals( this.openinvoicedataLineItemNrDescription, additionalDataOpenInvoice.openinvoicedataLineItemNrDescription) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrDescription, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrDescription) && Objects.equals( this.openinvoicedataLineItemNrItemAmount, additionalDataOpenInvoice.openinvoicedataLineItemNrItemAmount) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrItemAmount, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrItemAmount) && Objects.equals( this.openinvoicedataLineItemNrItemId, additionalDataOpenInvoice.openinvoicedataLineItemNrItemId) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrItemId, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrItemId) && Objects.equals( this.openinvoicedataLineItemNrItemVatAmount, additionalDataOpenInvoice.openinvoicedataLineItemNrItemVatAmount) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrItemVatAmount, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrItemVatAmount) && Objects.equals( this.openinvoicedataLineItemNrItemVatPercentage, additionalDataOpenInvoice.openinvoicedataLineItemNrItemVatPercentage) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrItemVatPercentage, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrItemVatPercentage) && Objects.equals( this.openinvoicedataLineItemNrNumberOfItems, additionalDataOpenInvoice.openinvoicedataLineItemNrNumberOfItems) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrNumberOfItems, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrNumberOfItems) && Objects.equals( this.openinvoicedataLineItemNrReturnShippingCompany, additionalDataOpenInvoice.openinvoicedataLineItemNrReturnShippingCompany) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrReturnShippingCompany, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrReturnShippingCompany) && Objects.equals( this.openinvoicedataLineItemNrReturnTrackingNumber, additionalDataOpenInvoice.openinvoicedataLineItemNrReturnTrackingNumber) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrReturnTrackingNumber, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrReturnTrackingNumber) && Objects.equals( this.openinvoicedataLineItemNrReturnTrackingUri, additionalDataOpenInvoice.openinvoicedataLineItemNrReturnTrackingUri) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrReturnTrackingUri, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrReturnTrackingUri) && Objects.equals( this.openinvoicedataLineItemNrShippingCompany, additionalDataOpenInvoice.openinvoicedataLineItemNrShippingCompany) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrShippingCompany, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrShippingCompany) && Objects.equals( this.openinvoicedataLineItemNrShippingMethod, additionalDataOpenInvoice.openinvoicedataLineItemNrShippingMethod) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrShippingMethod, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrShippingMethod) && Objects.equals( this.openinvoicedataLineItemNrTrackingNumber, additionalDataOpenInvoice.openinvoicedataLineItemNrTrackingNumber) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrTrackingNumber, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrTrackingNumber) && Objects.equals( this.openinvoicedataLineItemNrTrackingUri, - additionalDataOpenInvoice.openinvoicedataLineItemNrTrackingUri); + additionalDataOpenInvoice.openinvoicedataLineItemNrTrackingUri) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrTrackingUri, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrTrackingUri); } @Override public int hashCode() { return Objects.hash( openinvoicedataMerchantData, + isSetOpeninvoicedataMerchantData, openinvoicedataNumberOfLines, + isSetOpeninvoicedataNumberOfLines, openinvoicedataRecipientFirstName, + isSetOpeninvoicedataRecipientFirstName, openinvoicedataRecipientLastName, + isSetOpeninvoicedataRecipientLastName, openinvoicedataLineItemNrCurrencyCode, + isSetOpeninvoicedataLineItemNrCurrencyCode, openinvoicedataLineItemNrDescription, + isSetOpeninvoicedataLineItemNrDescription, openinvoicedataLineItemNrItemAmount, + isSetOpeninvoicedataLineItemNrItemAmount, openinvoicedataLineItemNrItemId, + isSetOpeninvoicedataLineItemNrItemId, openinvoicedataLineItemNrItemVatAmount, + isSetOpeninvoicedataLineItemNrItemVatAmount, openinvoicedataLineItemNrItemVatPercentage, + isSetOpeninvoicedataLineItemNrItemVatPercentage, openinvoicedataLineItemNrNumberOfItems, + isSetOpeninvoicedataLineItemNrNumberOfItems, openinvoicedataLineItemNrReturnShippingCompany, + isSetOpeninvoicedataLineItemNrReturnShippingCompany, openinvoicedataLineItemNrReturnTrackingNumber, + isSetOpeninvoicedataLineItemNrReturnTrackingNumber, openinvoicedataLineItemNrReturnTrackingUri, + isSetOpeninvoicedataLineItemNrReturnTrackingUri, openinvoicedataLineItemNrShippingCompany, + isSetOpeninvoicedataLineItemNrShippingCompany, openinvoicedataLineItemNrShippingMethod, + isSetOpeninvoicedataLineItemNrShippingMethod, openinvoicedataLineItemNrTrackingNumber, - openinvoicedataLineItemNrTrackingUri); + isSetOpeninvoicedataLineItemNrTrackingNumber, + openinvoicedataLineItemNrTrackingUri, + isSetOpeninvoicedataLineItemNrTrackingUri); } @Override @@ -1000,6 +1190,131 @@ 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 (isSetOpeninvoicedataMerchantData) { + addIfNull( + nulls, JSON_PROPERTY_OPENINVOICEDATA_MERCHANT_DATA, this.openinvoicedataMerchantData); + } + if (isSetOpeninvoicedataNumberOfLines) { + addIfNull( + nulls, JSON_PROPERTY_OPENINVOICEDATA_NUMBER_OF_LINES, this.openinvoicedataNumberOfLines); + } + if (isSetOpeninvoicedataRecipientFirstName) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_RECIPIENT_FIRST_NAME, + this.openinvoicedataRecipientFirstName); + } + if (isSetOpeninvoicedataRecipientLastName) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_RECIPIENT_LAST_NAME, + this.openinvoicedataRecipientLastName); + } + if (isSetOpeninvoicedataLineItemNrCurrencyCode) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_CURRENCY_CODE, + this.openinvoicedataLineItemNrCurrencyCode); + } + if (isSetOpeninvoicedataLineItemNrDescription) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_DESCRIPTION, + this.openinvoicedataLineItemNrDescription); + } + if (isSetOpeninvoicedataLineItemNrItemAmount) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_ITEM_AMOUNT, + this.openinvoicedataLineItemNrItemAmount); + } + if (isSetOpeninvoicedataLineItemNrItemId) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_ITEM_ID, + this.openinvoicedataLineItemNrItemId); + } + if (isSetOpeninvoicedataLineItemNrItemVatAmount) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_ITEM_VAT_AMOUNT, + this.openinvoicedataLineItemNrItemVatAmount); + } + if (isSetOpeninvoicedataLineItemNrItemVatPercentage) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_ITEM_VAT_PERCENTAGE, + this.openinvoicedataLineItemNrItemVatPercentage); + } + if (isSetOpeninvoicedataLineItemNrNumberOfItems) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_NUMBER_OF_ITEMS, + this.openinvoicedataLineItemNrNumberOfItems); + } + if (isSetOpeninvoicedataLineItemNrReturnShippingCompany) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_RETURN_SHIPPING_COMPANY, + this.openinvoicedataLineItemNrReturnShippingCompany); + } + if (isSetOpeninvoicedataLineItemNrReturnTrackingNumber) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_RETURN_TRACKING_NUMBER, + this.openinvoicedataLineItemNrReturnTrackingNumber); + } + if (isSetOpeninvoicedataLineItemNrReturnTrackingUri) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_RETURN_TRACKING_URI, + this.openinvoicedataLineItemNrReturnTrackingUri); + } + if (isSetOpeninvoicedataLineItemNrShippingCompany) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_SHIPPING_COMPANY, + this.openinvoicedataLineItemNrShippingCompany); + } + if (isSetOpeninvoicedataLineItemNrShippingMethod) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_SHIPPING_METHOD, + this.openinvoicedataLineItemNrShippingMethod); + } + if (isSetOpeninvoicedataLineItemNrTrackingNumber) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_TRACKING_NUMBER, + this.openinvoicedataLineItemNrTrackingNumber); + } + if (isSetOpeninvoicedataLineItemNrTrackingUri) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_TRACKING_URI, + this.openinvoicedataLineItemNrTrackingUri); + } + + 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 AdditionalDataOpenInvoice given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataOpi.java b/src/main/java/com/adyen/model/payment/AdditionalDataOpi.java index 1bd4169c1..ce5aace2a 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataOpi.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataOpi.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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 AdditionalDataOpi { public static final String JSON_PROPERTY_OPI_INCLUDE_TRANS_TOKEN = "opi.includeTransToken"; private String opiIncludeTransToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpiIncludeTransToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataOpi() {} /** @@ -40,6 +51,7 @@ public AdditionalDataOpi() {} */ public AdditionalDataOpi opiIncludeTransToken(String opiIncludeTransToken) { this.opiIncludeTransToken = opiIncludeTransToken; + isSetOpiIncludeTransToken = true; // mark as set return this; } @@ -77,6 +89,27 @@ public String getOpiIncludeTransToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpiIncludeTransToken(String opiIncludeTransToken) { this.opiIncludeTransToken = opiIncludeTransToken; + isSetOpiIncludeTransToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataOpi 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 AdditionalDataOpi object is equal to o. */ @@ -89,12 +122,14 @@ public boolean equals(Object o) { return false; } AdditionalDataOpi additionalDataOpi = (AdditionalDataOpi) o; - return Objects.equals(this.opiIncludeTransToken, additionalDataOpi.opiIncludeTransToken); + return Objects.equals(this.opiIncludeTransToken, additionalDataOpi.opiIncludeTransToken) + && Objects.equals( + this.isSetOpiIncludeTransToken, additionalDataOpi.isSetOpiIncludeTransToken); } @Override public int hashCode() { - return Objects.hash(opiIncludeTransToken); + return Objects.hash(opiIncludeTransToken, isSetOpiIncludeTransToken); } @Override @@ -118,6 +153,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 (isSetOpiIncludeTransToken) { + addIfNull(nulls, JSON_PROPERTY_OPI_INCLUDE_TRANS_TOKEN, this.opiIncludeTransToken); + } + + 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 AdditionalDataOpi given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataRatepay.java b/src/main/java/com/adyen/model/payment/AdditionalDataRatepay.java index d5f232973..c409a3513 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataRatepay.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataRatepay.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -32,28 +34,58 @@ public class AdditionalDataRatepay { public static final String JSON_PROPERTY_RATEPAY_INSTALLMENT_AMOUNT = "ratepay.installmentAmount"; private String ratepayInstallmentAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRatepayInstallmentAmount = false; + public static final String JSON_PROPERTY_RATEPAY_INTEREST_RATE = "ratepay.interestRate"; private String ratepayInterestRate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRatepayInterestRate = false; + public static final String JSON_PROPERTY_RATEPAY_LAST_INSTALLMENT_AMOUNT = "ratepay.lastInstallmentAmount"; private String ratepayLastInstallmentAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRatepayLastInstallmentAmount = false; + public static final String JSON_PROPERTY_RATEPAY_PAYMENT_FIRSTDAY = "ratepay.paymentFirstday"; private String ratepayPaymentFirstday; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRatepayPaymentFirstday = false; + public static final String JSON_PROPERTY_RATEPAYDATA_DELIVERY_DATE = "ratepaydata.deliveryDate"; private String ratepaydataDeliveryDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRatepaydataDeliveryDate = false; + public static final String JSON_PROPERTY_RATEPAYDATA_DUE_DATE = "ratepaydata.dueDate"; private String ratepaydataDueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRatepaydataDueDate = false; + public static final String JSON_PROPERTY_RATEPAYDATA_INVOICE_DATE = "ratepaydata.invoiceDate"; private String ratepaydataInvoiceDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRatepaydataInvoiceDate = false; + public static final String JSON_PROPERTY_RATEPAYDATA_INVOICE_ID = "ratepaydata.invoiceId"; private String ratepaydataInvoiceId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRatepaydataInvoiceId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataRatepay() {} /** @@ -64,6 +96,7 @@ public AdditionalDataRatepay() {} */ public AdditionalDataRatepay ratepayInstallmentAmount(String ratepayInstallmentAmount) { this.ratepayInstallmentAmount = ratepayInstallmentAmount; + isSetRatepayInstallmentAmount = true; // mark as set return this; } @@ -87,6 +120,7 @@ public String getRatepayInstallmentAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRatepayInstallmentAmount(String ratepayInstallmentAmount) { this.ratepayInstallmentAmount = ratepayInstallmentAmount; + isSetRatepayInstallmentAmount = true; // mark as set } /** @@ -97,6 +131,7 @@ public void setRatepayInstallmentAmount(String ratepayInstallmentAmount) { */ public AdditionalDataRatepay ratepayInterestRate(String ratepayInterestRate) { this.ratepayInterestRate = ratepayInterestRate; + isSetRatepayInterestRate = true; // mark as set return this; } @@ -120,6 +155,7 @@ public String getRatepayInterestRate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRatepayInterestRate(String ratepayInterestRate) { this.ratepayInterestRate = ratepayInterestRate; + isSetRatepayInterestRate = true; // mark as set } /** @@ -130,6 +166,7 @@ public void setRatepayInterestRate(String ratepayInterestRate) { */ public AdditionalDataRatepay ratepayLastInstallmentAmount(String ratepayLastInstallmentAmount) { this.ratepayLastInstallmentAmount = ratepayLastInstallmentAmount; + isSetRatepayLastInstallmentAmount = true; // mark as set return this; } @@ -153,6 +190,7 @@ public String getRatepayLastInstallmentAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRatepayLastInstallmentAmount(String ratepayLastInstallmentAmount) { this.ratepayLastInstallmentAmount = ratepayLastInstallmentAmount; + isSetRatepayLastInstallmentAmount = true; // mark as set } /** @@ -163,6 +201,7 @@ public void setRatepayLastInstallmentAmount(String ratepayLastInstallmentAmount) */ public AdditionalDataRatepay ratepayPaymentFirstday(String ratepayPaymentFirstday) { this.ratepayPaymentFirstday = ratepayPaymentFirstday; + isSetRatepayPaymentFirstday = true; // mark as set return this; } @@ -186,6 +225,7 @@ public String getRatepayPaymentFirstday() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRatepayPaymentFirstday(String ratepayPaymentFirstday) { this.ratepayPaymentFirstday = ratepayPaymentFirstday; + isSetRatepayPaymentFirstday = true; // mark as set } /** @@ -196,6 +236,7 @@ public void setRatepayPaymentFirstday(String ratepayPaymentFirstday) { */ public AdditionalDataRatepay ratepaydataDeliveryDate(String ratepaydataDeliveryDate) { this.ratepaydataDeliveryDate = ratepaydataDeliveryDate; + isSetRatepaydataDeliveryDate = true; // mark as set return this; } @@ -219,6 +260,7 @@ public String getRatepaydataDeliveryDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRatepaydataDeliveryDate(String ratepaydataDeliveryDate) { this.ratepaydataDeliveryDate = ratepaydataDeliveryDate; + isSetRatepaydataDeliveryDate = true; // mark as set } /** @@ -229,6 +271,7 @@ public void setRatepaydataDeliveryDate(String ratepaydataDeliveryDate) { */ public AdditionalDataRatepay ratepaydataDueDate(String ratepaydataDueDate) { this.ratepaydataDueDate = ratepaydataDueDate; + isSetRatepaydataDueDate = true; // mark as set return this; } @@ -252,6 +295,7 @@ public String getRatepaydataDueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRatepaydataDueDate(String ratepaydataDueDate) { this.ratepaydataDueDate = ratepaydataDueDate; + isSetRatepaydataDueDate = true; // mark as set } /** @@ -264,6 +308,7 @@ public void setRatepaydataDueDate(String ratepaydataDueDate) { */ public AdditionalDataRatepay ratepaydataInvoiceDate(String ratepaydataInvoiceDate) { this.ratepaydataInvoiceDate = ratepaydataInvoiceDate; + isSetRatepaydataInvoiceDate = true; // mark as set return this; } @@ -291,6 +336,7 @@ public String getRatepaydataInvoiceDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRatepaydataInvoiceDate(String ratepaydataInvoiceDate) { this.ratepaydataInvoiceDate = ratepaydataInvoiceDate; + isSetRatepaydataInvoiceDate = true; // mark as set } /** @@ -302,6 +348,7 @@ public void setRatepaydataInvoiceDate(String ratepaydataInvoiceDate) { */ public AdditionalDataRatepay ratepaydataInvoiceId(String ratepaydataInvoiceId) { this.ratepaydataInvoiceId = ratepaydataInvoiceId; + isSetRatepaydataInvoiceId = true; // mark as set return this; } @@ -327,6 +374,27 @@ public String getRatepaydataInvoiceId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRatepaydataInvoiceId(String ratepaydataInvoiceId) { this.ratepaydataInvoiceId = ratepaydataInvoiceId; + isSetRatepaydataInvoiceId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataRatepay 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 AdditionalDataRatepay object is equal to o. */ @@ -341,28 +409,53 @@ public boolean equals(Object o) { AdditionalDataRatepay additionalDataRatepay = (AdditionalDataRatepay) o; return Objects.equals( this.ratepayInstallmentAmount, additionalDataRatepay.ratepayInstallmentAmount) + && Objects.equals( + this.isSetRatepayInstallmentAmount, additionalDataRatepay.isSetRatepayInstallmentAmount) && Objects.equals(this.ratepayInterestRate, additionalDataRatepay.ratepayInterestRate) + && Objects.equals( + this.isSetRatepayInterestRate, additionalDataRatepay.isSetRatepayInterestRate) && Objects.equals( this.ratepayLastInstallmentAmount, additionalDataRatepay.ratepayLastInstallmentAmount) + && Objects.equals( + this.isSetRatepayLastInstallmentAmount, + additionalDataRatepay.isSetRatepayLastInstallmentAmount) && Objects.equals(this.ratepayPaymentFirstday, additionalDataRatepay.ratepayPaymentFirstday) + && Objects.equals( + this.isSetRatepayPaymentFirstday, additionalDataRatepay.isSetRatepayPaymentFirstday) && Objects.equals( this.ratepaydataDeliveryDate, additionalDataRatepay.ratepaydataDeliveryDate) + && Objects.equals( + this.isSetRatepaydataDeliveryDate, additionalDataRatepay.isSetRatepaydataDeliveryDate) && Objects.equals(this.ratepaydataDueDate, additionalDataRatepay.ratepaydataDueDate) + && Objects.equals( + this.isSetRatepaydataDueDate, additionalDataRatepay.isSetRatepaydataDueDate) && Objects.equals(this.ratepaydataInvoiceDate, additionalDataRatepay.ratepaydataInvoiceDate) - && Objects.equals(this.ratepaydataInvoiceId, additionalDataRatepay.ratepaydataInvoiceId); + && Objects.equals( + this.isSetRatepaydataInvoiceDate, additionalDataRatepay.isSetRatepaydataInvoiceDate) + && Objects.equals(this.ratepaydataInvoiceId, additionalDataRatepay.ratepaydataInvoiceId) + && Objects.equals( + this.isSetRatepaydataInvoiceId, additionalDataRatepay.isSetRatepaydataInvoiceId); } @Override public int hashCode() { return Objects.hash( ratepayInstallmentAmount, + isSetRatepayInstallmentAmount, ratepayInterestRate, + isSetRatepayInterestRate, ratepayLastInstallmentAmount, + isSetRatepayLastInstallmentAmount, ratepayPaymentFirstday, + isSetRatepayPaymentFirstday, ratepaydataDeliveryDate, + isSetRatepaydataDeliveryDate, ratepaydataDueDate, + isSetRatepaydataDueDate, ratepaydataInvoiceDate, - ratepaydataInvoiceId); + isSetRatepaydataInvoiceDate, + ratepaydataInvoiceId, + isSetRatepaydataInvoiceId); } @Override @@ -405,6 +498,52 @@ 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 (isSetRatepayInstallmentAmount) { + addIfNull(nulls, JSON_PROPERTY_RATEPAY_INSTALLMENT_AMOUNT, this.ratepayInstallmentAmount); + } + if (isSetRatepayInterestRate) { + addIfNull(nulls, JSON_PROPERTY_RATEPAY_INTEREST_RATE, this.ratepayInterestRate); + } + if (isSetRatepayLastInstallmentAmount) { + addIfNull( + nulls, JSON_PROPERTY_RATEPAY_LAST_INSTALLMENT_AMOUNT, this.ratepayLastInstallmentAmount); + } + if (isSetRatepayPaymentFirstday) { + addIfNull(nulls, JSON_PROPERTY_RATEPAY_PAYMENT_FIRSTDAY, this.ratepayPaymentFirstday); + } + if (isSetRatepaydataDeliveryDate) { + addIfNull(nulls, JSON_PROPERTY_RATEPAYDATA_DELIVERY_DATE, this.ratepaydataDeliveryDate); + } + if (isSetRatepaydataDueDate) { + addIfNull(nulls, JSON_PROPERTY_RATEPAYDATA_DUE_DATE, this.ratepaydataDueDate); + } + if (isSetRatepaydataInvoiceDate) { + addIfNull(nulls, JSON_PROPERTY_RATEPAYDATA_INVOICE_DATE, this.ratepaydataInvoiceDate); + } + if (isSetRatepaydataInvoiceId) { + addIfNull(nulls, JSON_PROPERTY_RATEPAYDATA_INVOICE_ID, this.ratepaydataInvoiceId); + } + + 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 AdditionalDataRatepay given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataRetry.java b/src/main/java/com/adyen/model/payment/AdditionalDataRetry.java index f88a6388e..f95289f5c 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataRetry.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataRetry.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -27,12 +29,27 @@ public class AdditionalDataRetry { public static final String JSON_PROPERTY_RETRY_CHAIN_ATTEMPT_NUMBER = "retry.chainAttemptNumber"; private String retryChainAttemptNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRetryChainAttemptNumber = false; + public static final String JSON_PROPERTY_RETRY_ORDER_ATTEMPT_NUMBER = "retry.orderAttemptNumber"; private String retryOrderAttemptNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRetryOrderAttemptNumber = false; + public static final String JSON_PROPERTY_RETRY_SKIP_RETRY = "retry.skipRetry"; private String retrySkipRetry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRetrySkipRetry = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataRetry() {} /** @@ -54,6 +71,7 @@ public AdditionalDataRetry() {} */ public AdditionalDataRetry retryChainAttemptNumber(String retryChainAttemptNumber) { this.retryChainAttemptNumber = retryChainAttemptNumber; + isSetRetryChainAttemptNumber = true; // mark as set return this; } @@ -99,6 +117,7 @@ public String getRetryChainAttemptNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRetryChainAttemptNumber(String retryChainAttemptNumber) { this.retryChainAttemptNumber = retryChainAttemptNumber; + isSetRetryChainAttemptNumber = true; // mark as set } /** @@ -120,6 +139,7 @@ public void setRetryChainAttemptNumber(String retryChainAttemptNumber) { */ public AdditionalDataRetry retryOrderAttemptNumber(String retryOrderAttemptNumber) { this.retryOrderAttemptNumber = retryOrderAttemptNumber; + isSetRetryOrderAttemptNumber = true; // mark as set return this; } @@ -165,6 +185,7 @@ public String getRetryOrderAttemptNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRetryOrderAttemptNumber(String retryOrderAttemptNumber) { this.retryOrderAttemptNumber = retryOrderAttemptNumber; + isSetRetryOrderAttemptNumber = true; // mark as set } /** @@ -182,6 +203,7 @@ public void setRetryOrderAttemptNumber(String retryOrderAttemptNumber) { */ public AdditionalDataRetry retrySkipRetry(String retrySkipRetry) { this.retrySkipRetry = retrySkipRetry; + isSetRetrySkipRetry = true; // mark as set return this; } @@ -219,6 +241,27 @@ public String getRetrySkipRetry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRetrySkipRetry(String retrySkipRetry) { this.retrySkipRetry = retrySkipRetry; + isSetRetrySkipRetry = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataRetry 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 AdditionalDataRetry object is equal to o. */ @@ -232,13 +275,24 @@ public boolean equals(Object o) { } AdditionalDataRetry additionalDataRetry = (AdditionalDataRetry) o; return Objects.equals(this.retryChainAttemptNumber, additionalDataRetry.retryChainAttemptNumber) + && Objects.equals( + this.isSetRetryChainAttemptNumber, additionalDataRetry.isSetRetryChainAttemptNumber) && Objects.equals(this.retryOrderAttemptNumber, additionalDataRetry.retryOrderAttemptNumber) - && Objects.equals(this.retrySkipRetry, additionalDataRetry.retrySkipRetry); + && Objects.equals( + this.isSetRetryOrderAttemptNumber, additionalDataRetry.isSetRetryOrderAttemptNumber) + && Objects.equals(this.retrySkipRetry, additionalDataRetry.retrySkipRetry) + && Objects.equals(this.isSetRetrySkipRetry, additionalDataRetry.isSetRetrySkipRetry); } @Override public int hashCode() { - return Objects.hash(retryChainAttemptNumber, retryOrderAttemptNumber, retrySkipRetry); + return Objects.hash( + retryChainAttemptNumber, + isSetRetryChainAttemptNumber, + retryOrderAttemptNumber, + isSetRetryOrderAttemptNumber, + retrySkipRetry, + isSetRetrySkipRetry); } @Override @@ -266,6 +320,36 @@ 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 (isSetRetryChainAttemptNumber) { + addIfNull(nulls, JSON_PROPERTY_RETRY_CHAIN_ATTEMPT_NUMBER, this.retryChainAttemptNumber); + } + if (isSetRetryOrderAttemptNumber) { + addIfNull(nulls, JSON_PROPERTY_RETRY_ORDER_ATTEMPT_NUMBER, this.retryOrderAttemptNumber); + } + if (isSetRetrySkipRetry) { + addIfNull(nulls, JSON_PROPERTY_RETRY_SKIP_RETRY, this.retrySkipRetry); + } + + 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 AdditionalDataRetry given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataRisk.java b/src/main/java/com/adyen/model/payment/AdditionalDataRisk.java index 89c8a58a4..b5cd2bb41 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataRisk.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataRisk.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -48,88 +50,157 @@ public class AdditionalDataRisk { "riskdata.[customFieldName]"; private String riskdataCustomFieldName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataCustomFieldName = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_AMOUNT_PER_ITEM = "riskdata.basket.item[itemNr].amountPerItem"; private String riskdataBasketItemItemNrAmountPerItem; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrAmountPerItem = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_BRAND = "riskdata.basket.item[itemNr].brand"; private String riskdataBasketItemItemNrBrand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrBrand = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_CATEGORY = "riskdata.basket.item[itemNr].category"; private String riskdataBasketItemItemNrCategory; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrCategory = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_COLOR = "riskdata.basket.item[itemNr].color"; private String riskdataBasketItemItemNrColor; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrColor = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_CURRENCY = "riskdata.basket.item[itemNr].currency"; private String riskdataBasketItemItemNrCurrency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrCurrency = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_ITEM_I_D = "riskdata.basket.item[itemNr].itemID"; private String riskdataBasketItemItemNrItemID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrItemID = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_MANUFACTURER = "riskdata.basket.item[itemNr].manufacturer"; private String riskdataBasketItemItemNrManufacturer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrManufacturer = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_PRODUCT_TITLE = "riskdata.basket.item[itemNr].productTitle"; private String riskdataBasketItemItemNrProductTitle; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrProductTitle = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_QUANTITY = "riskdata.basket.item[itemNr].quantity"; private String riskdataBasketItemItemNrQuantity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrQuantity = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_RECEIVER_EMAIL = "riskdata.basket.item[itemNr].receiverEmail"; private String riskdataBasketItemItemNrReceiverEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrReceiverEmail = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_SIZE = "riskdata.basket.item[itemNr].size"; private String riskdataBasketItemItemNrSize; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrSize = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_SKU = "riskdata.basket.item[itemNr].sku"; private String riskdataBasketItemItemNrSku; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrSku = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_UPC = "riskdata.basket.item[itemNr].upc"; private String riskdataBasketItemItemNrUpc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrUpc = false; + public static final String JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_CODE = "riskdata.promotions.promotion[itemNr].promotionCode"; private String riskdataPromotionsPromotionItemNrPromotionCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataPromotionsPromotionItemNrPromotionCode = false; + public static final String JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_DISCOUNT_AMOUNT = "riskdata.promotions.promotion[itemNr].promotionDiscountAmount"; private String riskdataPromotionsPromotionItemNrPromotionDiscountAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataPromotionsPromotionItemNrPromotionDiscountAmount = false; + public static final String JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_DISCOUNT_CURRENCY = "riskdata.promotions.promotion[itemNr].promotionDiscountCurrency"; private String riskdataPromotionsPromotionItemNrPromotionDiscountCurrency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency = false; + public static final String JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_DISCOUNT_PERCENTAGE = "riskdata.promotions.promotion[itemNr].promotionDiscountPercentage"; private String riskdataPromotionsPromotionItemNrPromotionDiscountPercentage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage = false; + public static final String JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_NAME = "riskdata.promotions.promotion[itemNr].promotionName"; private String riskdataPromotionsPromotionItemNrPromotionName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataPromotionsPromotionItemNrPromotionName = false; + public static final String JSON_PROPERTY_RISKDATA_RISK_PROFILE_REFERENCE = "riskdata.riskProfileReference"; private String riskdataRiskProfileReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataRiskProfileReference = false; + public static final String JSON_PROPERTY_RISKDATA_SKIP_RISK = "riskdata.skipRisk"; private String riskdataSkipRisk; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataSkipRisk = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataRisk() {} /** @@ -143,6 +214,7 @@ public AdditionalDataRisk() {} */ public AdditionalDataRisk riskdataCustomFieldName(String riskdataCustomFieldName) { this.riskdataCustomFieldName = riskdataCustomFieldName; + isSetRiskdataCustomFieldName = true; // mark as set return this; } @@ -172,6 +244,7 @@ public String getRiskdataCustomFieldName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataCustomFieldName(String riskdataCustomFieldName) { this.riskdataCustomFieldName = riskdataCustomFieldName; + isSetRiskdataCustomFieldName = true; // mark as set } /** @@ -185,6 +258,7 @@ public void setRiskdataCustomFieldName(String riskdataCustomFieldName) { public AdditionalDataRisk riskdataBasketItemItemNrAmountPerItem( String riskdataBasketItemItemNrAmountPerItem) { this.riskdataBasketItemItemNrAmountPerItem = riskdataBasketItemItemNrAmountPerItem; + isSetRiskdataBasketItemItemNrAmountPerItem = true; // mark as set return this; } @@ -213,6 +287,7 @@ public String getRiskdataBasketItemItemNrAmountPerItem() { public void setRiskdataBasketItemItemNrAmountPerItem( String riskdataBasketItemItemNrAmountPerItem) { this.riskdataBasketItemItemNrAmountPerItem = riskdataBasketItemItemNrAmountPerItem; + isSetRiskdataBasketItemItemNrAmountPerItem = true; // mark as set } /** @@ -223,6 +298,7 @@ public void setRiskdataBasketItemItemNrAmountPerItem( */ public AdditionalDataRisk riskdataBasketItemItemNrBrand(String riskdataBasketItemItemNrBrand) { this.riskdataBasketItemItemNrBrand = riskdataBasketItemItemNrBrand; + isSetRiskdataBasketItemItemNrBrand = true; // mark as set return this; } @@ -246,6 +322,7 @@ public String getRiskdataBasketItemItemNrBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrBrand(String riskdataBasketItemItemNrBrand) { this.riskdataBasketItemItemNrBrand = riskdataBasketItemItemNrBrand; + isSetRiskdataBasketItemItemNrBrand = true; // mark as set } /** @@ -257,6 +334,7 @@ public void setRiskdataBasketItemItemNrBrand(String riskdataBasketItemItemNrBran public AdditionalDataRisk riskdataBasketItemItemNrCategory( String riskdataBasketItemItemNrCategory) { this.riskdataBasketItemItemNrCategory = riskdataBasketItemItemNrCategory; + isSetRiskdataBasketItemItemNrCategory = true; // mark as set return this; } @@ -280,6 +358,7 @@ public String getRiskdataBasketItemItemNrCategory() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrCategory(String riskdataBasketItemItemNrCategory) { this.riskdataBasketItemItemNrCategory = riskdataBasketItemItemNrCategory; + isSetRiskdataBasketItemItemNrCategory = true; // mark as set } /** @@ -290,6 +369,7 @@ public void setRiskdataBasketItemItemNrCategory(String riskdataBasketItemItemNrC */ public AdditionalDataRisk riskdataBasketItemItemNrColor(String riskdataBasketItemItemNrColor) { this.riskdataBasketItemItemNrColor = riskdataBasketItemItemNrColor; + isSetRiskdataBasketItemItemNrColor = true; // mark as set return this; } @@ -313,6 +393,7 @@ public String getRiskdataBasketItemItemNrColor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrColor(String riskdataBasketItemItemNrColor) { this.riskdataBasketItemItemNrColor = riskdataBasketItemItemNrColor; + isSetRiskdataBasketItemItemNrColor = true; // mark as set } /** @@ -325,6 +406,7 @@ public void setRiskdataBasketItemItemNrColor(String riskdataBasketItemItemNrColo public AdditionalDataRisk riskdataBasketItemItemNrCurrency( String riskdataBasketItemItemNrCurrency) { this.riskdataBasketItemItemNrCurrency = riskdataBasketItemItemNrCurrency; + isSetRiskdataBasketItemItemNrCurrency = true; // mark as set return this; } @@ -350,6 +432,7 @@ public String getRiskdataBasketItemItemNrCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrCurrency(String riskdataBasketItemItemNrCurrency) { this.riskdataBasketItemItemNrCurrency = riskdataBasketItemItemNrCurrency; + isSetRiskdataBasketItemItemNrCurrency = true; // mark as set } /** @@ -360,6 +443,7 @@ public void setRiskdataBasketItemItemNrCurrency(String riskdataBasketItemItemNrC */ public AdditionalDataRisk riskdataBasketItemItemNrItemID(String riskdataBasketItemItemNrItemID) { this.riskdataBasketItemItemNrItemID = riskdataBasketItemItemNrItemID; + isSetRiskdataBasketItemItemNrItemID = true; // mark as set return this; } @@ -383,6 +467,7 @@ public String getRiskdataBasketItemItemNrItemID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrItemID(String riskdataBasketItemItemNrItemID) { this.riskdataBasketItemItemNrItemID = riskdataBasketItemItemNrItemID; + isSetRiskdataBasketItemItemNrItemID = true; // mark as set } /** @@ -394,6 +479,7 @@ public void setRiskdataBasketItemItemNrItemID(String riskdataBasketItemItemNrIte public AdditionalDataRisk riskdataBasketItemItemNrManufacturer( String riskdataBasketItemItemNrManufacturer) { this.riskdataBasketItemItemNrManufacturer = riskdataBasketItemItemNrManufacturer; + isSetRiskdataBasketItemItemNrManufacturer = true; // mark as set return this; } @@ -417,6 +503,7 @@ public String getRiskdataBasketItemItemNrManufacturer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrManufacturer(String riskdataBasketItemItemNrManufacturer) { this.riskdataBasketItemItemNrManufacturer = riskdataBasketItemItemNrManufacturer; + isSetRiskdataBasketItemItemNrManufacturer = true; // mark as set } /** @@ -429,6 +516,7 @@ public void setRiskdataBasketItemItemNrManufacturer(String riskdataBasketItemIte public AdditionalDataRisk riskdataBasketItemItemNrProductTitle( String riskdataBasketItemItemNrProductTitle) { this.riskdataBasketItemItemNrProductTitle = riskdataBasketItemItemNrProductTitle; + isSetRiskdataBasketItemItemNrProductTitle = true; // mark as set return this; } @@ -454,6 +542,7 @@ public String getRiskdataBasketItemItemNrProductTitle() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrProductTitle(String riskdataBasketItemItemNrProductTitle) { this.riskdataBasketItemItemNrProductTitle = riskdataBasketItemItemNrProductTitle; + isSetRiskdataBasketItemItemNrProductTitle = true; // mark as set } /** @@ -465,6 +554,7 @@ public void setRiskdataBasketItemItemNrProductTitle(String riskdataBasketItemIte public AdditionalDataRisk riskdataBasketItemItemNrQuantity( String riskdataBasketItemItemNrQuantity) { this.riskdataBasketItemItemNrQuantity = riskdataBasketItemItemNrQuantity; + isSetRiskdataBasketItemItemNrQuantity = true; // mark as set return this; } @@ -488,6 +578,7 @@ public String getRiskdataBasketItemItemNrQuantity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrQuantity(String riskdataBasketItemItemNrQuantity) { this.riskdataBasketItemItemNrQuantity = riskdataBasketItemItemNrQuantity; + isSetRiskdataBasketItemItemNrQuantity = true; // mark as set } /** @@ -500,6 +591,7 @@ public void setRiskdataBasketItemItemNrQuantity(String riskdataBasketItemItemNrQ public AdditionalDataRisk riskdataBasketItemItemNrReceiverEmail( String riskdataBasketItemItemNrReceiverEmail) { this.riskdataBasketItemItemNrReceiverEmail = riskdataBasketItemItemNrReceiverEmail; + isSetRiskdataBasketItemItemNrReceiverEmail = true; // mark as set return this; } @@ -526,6 +618,7 @@ public String getRiskdataBasketItemItemNrReceiverEmail() { public void setRiskdataBasketItemItemNrReceiverEmail( String riskdataBasketItemItemNrReceiverEmail) { this.riskdataBasketItemItemNrReceiverEmail = riskdataBasketItemItemNrReceiverEmail; + isSetRiskdataBasketItemItemNrReceiverEmail = true; // mark as set } /** @@ -536,6 +629,7 @@ public void setRiskdataBasketItemItemNrReceiverEmail( */ public AdditionalDataRisk riskdataBasketItemItemNrSize(String riskdataBasketItemItemNrSize) { this.riskdataBasketItemItemNrSize = riskdataBasketItemItemNrSize; + isSetRiskdataBasketItemItemNrSize = true; // mark as set return this; } @@ -559,6 +653,7 @@ public String getRiskdataBasketItemItemNrSize() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrSize(String riskdataBasketItemItemNrSize) { this.riskdataBasketItemItemNrSize = riskdataBasketItemItemNrSize; + isSetRiskdataBasketItemItemNrSize = true; // mark as set } /** @@ -570,6 +665,7 @@ public void setRiskdataBasketItemItemNrSize(String riskdataBasketItemItemNrSize) */ public AdditionalDataRisk riskdataBasketItemItemNrSku(String riskdataBasketItemItemNrSku) { this.riskdataBasketItemItemNrSku = riskdataBasketItemItemNrSku; + isSetRiskdataBasketItemItemNrSku = true; // mark as set return this; } @@ -595,6 +691,7 @@ public String getRiskdataBasketItemItemNrSku() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrSku(String riskdataBasketItemItemNrSku) { this.riskdataBasketItemItemNrSku = riskdataBasketItemItemNrSku; + isSetRiskdataBasketItemItemNrSku = true; // mark as set } /** @@ -606,6 +703,7 @@ public void setRiskdataBasketItemItemNrSku(String riskdataBasketItemItemNrSku) { */ public AdditionalDataRisk riskdataBasketItemItemNrUpc(String riskdataBasketItemItemNrUpc) { this.riskdataBasketItemItemNrUpc = riskdataBasketItemItemNrUpc; + isSetRiskdataBasketItemItemNrUpc = true; // mark as set return this; } @@ -631,6 +729,7 @@ public String getRiskdataBasketItemItemNrUpc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrUpc(String riskdataBasketItemItemNrUpc) { this.riskdataBasketItemItemNrUpc = riskdataBasketItemItemNrUpc; + isSetRiskdataBasketItemItemNrUpc = true; // mark as set } /** @@ -643,6 +742,7 @@ public AdditionalDataRisk riskdataPromotionsPromotionItemNrPromotionCode( String riskdataPromotionsPromotionItemNrPromotionCode) { this.riskdataPromotionsPromotionItemNrPromotionCode = riskdataPromotionsPromotionItemNrPromotionCode; + isSetRiskdataPromotionsPromotionItemNrPromotionCode = true; // mark as set return this; } @@ -668,6 +768,7 @@ public void setRiskdataPromotionsPromotionItemNrPromotionCode( String riskdataPromotionsPromotionItemNrPromotionCode) { this.riskdataPromotionsPromotionItemNrPromotionCode = riskdataPromotionsPromotionItemNrPromotionCode; + isSetRiskdataPromotionsPromotionItemNrPromotionCode = true; // mark as set } /** @@ -683,6 +784,7 @@ public AdditionalDataRisk riskdataPromotionsPromotionItemNrPromotionDiscountAmou String riskdataPromotionsPromotionItemNrPromotionDiscountAmount) { this.riskdataPromotionsPromotionItemNrPromotionDiscountAmount = riskdataPromotionsPromotionItemNrPromotionDiscountAmount; + isSetRiskdataPromotionsPromotionItemNrPromotionDiscountAmount = true; // mark as set return this; } @@ -714,6 +816,7 @@ public void setRiskdataPromotionsPromotionItemNrPromotionDiscountAmount( String riskdataPromotionsPromotionItemNrPromotionDiscountAmount) { this.riskdataPromotionsPromotionItemNrPromotionDiscountAmount = riskdataPromotionsPromotionItemNrPromotionDiscountAmount; + isSetRiskdataPromotionsPromotionItemNrPromotionDiscountAmount = true; // mark as set } /** @@ -727,6 +830,7 @@ public AdditionalDataRisk riskdataPromotionsPromotionItemNrPromotionDiscountCurr String riskdataPromotionsPromotionItemNrPromotionDiscountCurrency) { this.riskdataPromotionsPromotionItemNrPromotionDiscountCurrency = riskdataPromotionsPromotionItemNrPromotionDiscountCurrency; + isSetRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency = true; // mark as set return this; } @@ -754,6 +858,7 @@ public void setRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency( String riskdataPromotionsPromotionItemNrPromotionDiscountCurrency) { this.riskdataPromotionsPromotionItemNrPromotionDiscountCurrency = riskdataPromotionsPromotionItemNrPromotionDiscountCurrency; + isSetRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency = true; // mark as set } /** @@ -771,6 +876,7 @@ public AdditionalDataRisk riskdataPromotionsPromotionItemNrPromotionDiscountPerc String riskdataPromotionsPromotionItemNrPromotionDiscountPercentage) { this.riskdataPromotionsPromotionItemNrPromotionDiscountPercentage = riskdataPromotionsPromotionItemNrPromotionDiscountPercentage; + isSetRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage = true; // mark as set return this; } @@ -806,6 +912,7 @@ public void setRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage( String riskdataPromotionsPromotionItemNrPromotionDiscountPercentage) { this.riskdataPromotionsPromotionItemNrPromotionDiscountPercentage = riskdataPromotionsPromotionItemNrPromotionDiscountPercentage; + isSetRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage = true; // mark as set } /** @@ -818,6 +925,7 @@ public AdditionalDataRisk riskdataPromotionsPromotionItemNrPromotionName( String riskdataPromotionsPromotionItemNrPromotionName) { this.riskdataPromotionsPromotionItemNrPromotionName = riskdataPromotionsPromotionItemNrPromotionName; + isSetRiskdataPromotionsPromotionItemNrPromotionName = true; // mark as set return this; } @@ -843,6 +951,7 @@ public void setRiskdataPromotionsPromotionItemNrPromotionName( String riskdataPromotionsPromotionItemNrPromotionName) { this.riskdataPromotionsPromotionItemNrPromotionName = riskdataPromotionsPromotionItemNrPromotionName; + isSetRiskdataPromotionsPromotionItemNrPromotionName = true; // mark as set } /** @@ -860,6 +969,7 @@ public void setRiskdataPromotionsPromotionItemNrPromotionName( */ public AdditionalDataRisk riskdataRiskProfileReference(String riskdataRiskProfileReference) { this.riskdataRiskProfileReference = riskdataRiskProfileReference; + isSetRiskdataRiskProfileReference = true; // mark as set return this; } @@ -897,6 +1007,7 @@ public String getRiskdataRiskProfileReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataRiskProfileReference(String riskdataRiskProfileReference) { this.riskdataRiskProfileReference = riskdataRiskProfileReference; + isSetRiskdataRiskProfileReference = true; // mark as set } /** @@ -909,6 +1020,7 @@ public void setRiskdataRiskProfileReference(String riskdataRiskProfileReference) */ public AdditionalDataRisk riskdataSkipRisk(String riskdataSkipRisk) { this.riskdataSkipRisk = riskdataSkipRisk; + isSetRiskdataSkipRisk = true; // mark as set return this; } @@ -936,6 +1048,27 @@ public String getRiskdataSkipRisk() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataSkipRisk(String riskdataSkipRisk) { this.riskdataSkipRisk = riskdataSkipRisk; + isSetRiskdataSkipRisk = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataRisk 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 AdditionalDataRisk object is equal to o. */ @@ -949,83 +1082,164 @@ public boolean equals(Object o) { } AdditionalDataRisk additionalDataRisk = (AdditionalDataRisk) o; return Objects.equals(this.riskdataCustomFieldName, additionalDataRisk.riskdataCustomFieldName) + && Objects.equals( + this.isSetRiskdataCustomFieldName, additionalDataRisk.isSetRiskdataCustomFieldName) && Objects.equals( this.riskdataBasketItemItemNrAmountPerItem, additionalDataRisk.riskdataBasketItemItemNrAmountPerItem) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrAmountPerItem, + additionalDataRisk.isSetRiskdataBasketItemItemNrAmountPerItem) && Objects.equals( this.riskdataBasketItemItemNrBrand, additionalDataRisk.riskdataBasketItemItemNrBrand) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrBrand, + additionalDataRisk.isSetRiskdataBasketItemItemNrBrand) && Objects.equals( this.riskdataBasketItemItemNrCategory, additionalDataRisk.riskdataBasketItemItemNrCategory) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrCategory, + additionalDataRisk.isSetRiskdataBasketItemItemNrCategory) && Objects.equals( this.riskdataBasketItemItemNrColor, additionalDataRisk.riskdataBasketItemItemNrColor) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrColor, + additionalDataRisk.isSetRiskdataBasketItemItemNrColor) && Objects.equals( this.riskdataBasketItemItemNrCurrency, additionalDataRisk.riskdataBasketItemItemNrCurrency) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrCurrency, + additionalDataRisk.isSetRiskdataBasketItemItemNrCurrency) && Objects.equals( this.riskdataBasketItemItemNrItemID, additionalDataRisk.riskdataBasketItemItemNrItemID) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrItemID, + additionalDataRisk.isSetRiskdataBasketItemItemNrItemID) && Objects.equals( this.riskdataBasketItemItemNrManufacturer, additionalDataRisk.riskdataBasketItemItemNrManufacturer) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrManufacturer, + additionalDataRisk.isSetRiskdataBasketItemItemNrManufacturer) && Objects.equals( this.riskdataBasketItemItemNrProductTitle, additionalDataRisk.riskdataBasketItemItemNrProductTitle) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrProductTitle, + additionalDataRisk.isSetRiskdataBasketItemItemNrProductTitle) && Objects.equals( this.riskdataBasketItemItemNrQuantity, additionalDataRisk.riskdataBasketItemItemNrQuantity) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrQuantity, + additionalDataRisk.isSetRiskdataBasketItemItemNrQuantity) && Objects.equals( this.riskdataBasketItemItemNrReceiverEmail, additionalDataRisk.riskdataBasketItemItemNrReceiverEmail) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrReceiverEmail, + additionalDataRisk.isSetRiskdataBasketItemItemNrReceiverEmail) && Objects.equals( this.riskdataBasketItemItemNrSize, additionalDataRisk.riskdataBasketItemItemNrSize) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrSize, + additionalDataRisk.isSetRiskdataBasketItemItemNrSize) && Objects.equals( this.riskdataBasketItemItemNrSku, additionalDataRisk.riskdataBasketItemItemNrSku) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrSku, + additionalDataRisk.isSetRiskdataBasketItemItemNrSku) && Objects.equals( this.riskdataBasketItemItemNrUpc, additionalDataRisk.riskdataBasketItemItemNrUpc) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrUpc, + additionalDataRisk.isSetRiskdataBasketItemItemNrUpc) && Objects.equals( this.riskdataPromotionsPromotionItemNrPromotionCode, additionalDataRisk.riskdataPromotionsPromotionItemNrPromotionCode) + && Objects.equals( + this.isSetRiskdataPromotionsPromotionItemNrPromotionCode, + additionalDataRisk.isSetRiskdataPromotionsPromotionItemNrPromotionCode) && Objects.equals( this.riskdataPromotionsPromotionItemNrPromotionDiscountAmount, additionalDataRisk.riskdataPromotionsPromotionItemNrPromotionDiscountAmount) + && Objects.equals( + this.isSetRiskdataPromotionsPromotionItemNrPromotionDiscountAmount, + additionalDataRisk.isSetRiskdataPromotionsPromotionItemNrPromotionDiscountAmount) && Objects.equals( this.riskdataPromotionsPromotionItemNrPromotionDiscountCurrency, additionalDataRisk.riskdataPromotionsPromotionItemNrPromotionDiscountCurrency) + && Objects.equals( + this.isSetRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency, + additionalDataRisk.isSetRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency) && Objects.equals( this.riskdataPromotionsPromotionItemNrPromotionDiscountPercentage, additionalDataRisk.riskdataPromotionsPromotionItemNrPromotionDiscountPercentage) + && Objects.equals( + this.isSetRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage, + additionalDataRisk.isSetRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage) && Objects.equals( this.riskdataPromotionsPromotionItemNrPromotionName, additionalDataRisk.riskdataPromotionsPromotionItemNrPromotionName) + && Objects.equals( + this.isSetRiskdataPromotionsPromotionItemNrPromotionName, + additionalDataRisk.isSetRiskdataPromotionsPromotionItemNrPromotionName) && Objects.equals( this.riskdataRiskProfileReference, additionalDataRisk.riskdataRiskProfileReference) - && Objects.equals(this.riskdataSkipRisk, additionalDataRisk.riskdataSkipRisk); + && Objects.equals( + this.isSetRiskdataRiskProfileReference, + additionalDataRisk.isSetRiskdataRiskProfileReference) + && Objects.equals(this.riskdataSkipRisk, additionalDataRisk.riskdataSkipRisk) + && Objects.equals(this.isSetRiskdataSkipRisk, additionalDataRisk.isSetRiskdataSkipRisk); } @Override public int hashCode() { return Objects.hash( riskdataCustomFieldName, + isSetRiskdataCustomFieldName, riskdataBasketItemItemNrAmountPerItem, + isSetRiskdataBasketItemItemNrAmountPerItem, riskdataBasketItemItemNrBrand, + isSetRiskdataBasketItemItemNrBrand, riskdataBasketItemItemNrCategory, + isSetRiskdataBasketItemItemNrCategory, riskdataBasketItemItemNrColor, + isSetRiskdataBasketItemItemNrColor, riskdataBasketItemItemNrCurrency, + isSetRiskdataBasketItemItemNrCurrency, riskdataBasketItemItemNrItemID, + isSetRiskdataBasketItemItemNrItemID, riskdataBasketItemItemNrManufacturer, + isSetRiskdataBasketItemItemNrManufacturer, riskdataBasketItemItemNrProductTitle, + isSetRiskdataBasketItemItemNrProductTitle, riskdataBasketItemItemNrQuantity, + isSetRiskdataBasketItemItemNrQuantity, riskdataBasketItemItemNrReceiverEmail, + isSetRiskdataBasketItemItemNrReceiverEmail, riskdataBasketItemItemNrSize, + isSetRiskdataBasketItemItemNrSize, riskdataBasketItemItemNrSku, + isSetRiskdataBasketItemItemNrSku, riskdataBasketItemItemNrUpc, + isSetRiskdataBasketItemItemNrUpc, riskdataPromotionsPromotionItemNrPromotionCode, + isSetRiskdataPromotionsPromotionItemNrPromotionCode, riskdataPromotionsPromotionItemNrPromotionDiscountAmount, + isSetRiskdataPromotionsPromotionItemNrPromotionDiscountAmount, riskdataPromotionsPromotionItemNrPromotionDiscountCurrency, + isSetRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency, riskdataPromotionsPromotionItemNrPromotionDiscountPercentage, + isSetRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage, riskdataPromotionsPromotionItemNrPromotionName, + isSetRiskdataPromotionsPromotionItemNrPromotionName, riskdataRiskProfileReference, - riskdataSkipRisk); + isSetRiskdataRiskProfileReference, + riskdataSkipRisk, + isSetRiskdataSkipRisk); } @Override @@ -1107,6 +1321,141 @@ 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 (isSetRiskdataCustomFieldName) { + addIfNull(nulls, JSON_PROPERTY_RISKDATA_CUSTOM_FIELD_NAME, this.riskdataCustomFieldName); + } + if (isSetRiskdataBasketItemItemNrAmountPerItem) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_AMOUNT_PER_ITEM, + this.riskdataBasketItemItemNrAmountPerItem); + } + if (isSetRiskdataBasketItemItemNrBrand) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_BRAND, + this.riskdataBasketItemItemNrBrand); + } + if (isSetRiskdataBasketItemItemNrCategory) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_CATEGORY, + this.riskdataBasketItemItemNrCategory); + } + if (isSetRiskdataBasketItemItemNrColor) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_COLOR, + this.riskdataBasketItemItemNrColor); + } + if (isSetRiskdataBasketItemItemNrCurrency) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_CURRENCY, + this.riskdataBasketItemItemNrCurrency); + } + if (isSetRiskdataBasketItemItemNrItemID) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_ITEM_I_D, + this.riskdataBasketItemItemNrItemID); + } + if (isSetRiskdataBasketItemItemNrManufacturer) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_MANUFACTURER, + this.riskdataBasketItemItemNrManufacturer); + } + if (isSetRiskdataBasketItemItemNrProductTitle) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_PRODUCT_TITLE, + this.riskdataBasketItemItemNrProductTitle); + } + if (isSetRiskdataBasketItemItemNrQuantity) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_QUANTITY, + this.riskdataBasketItemItemNrQuantity); + } + if (isSetRiskdataBasketItemItemNrReceiverEmail) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_RECEIVER_EMAIL, + this.riskdataBasketItemItemNrReceiverEmail); + } + if (isSetRiskdataBasketItemItemNrSize) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_SIZE, + this.riskdataBasketItemItemNrSize); + } + if (isSetRiskdataBasketItemItemNrSku) { + addIfNull( + nulls, JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_SKU, this.riskdataBasketItemItemNrSku); + } + if (isSetRiskdataBasketItemItemNrUpc) { + addIfNull( + nulls, JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_UPC, this.riskdataBasketItemItemNrUpc); + } + if (isSetRiskdataPromotionsPromotionItemNrPromotionCode) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_CODE, + this.riskdataPromotionsPromotionItemNrPromotionCode); + } + if (isSetRiskdataPromotionsPromotionItemNrPromotionDiscountAmount) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_DISCOUNT_AMOUNT, + this.riskdataPromotionsPromotionItemNrPromotionDiscountAmount); + } + if (isSetRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_DISCOUNT_CURRENCY, + this.riskdataPromotionsPromotionItemNrPromotionDiscountCurrency); + } + if (isSetRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_DISCOUNT_PERCENTAGE, + this.riskdataPromotionsPromotionItemNrPromotionDiscountPercentage); + } + if (isSetRiskdataPromotionsPromotionItemNrPromotionName) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_NAME, + this.riskdataPromotionsPromotionItemNrPromotionName); + } + if (isSetRiskdataRiskProfileReference) { + addIfNull( + nulls, JSON_PROPERTY_RISKDATA_RISK_PROFILE_REFERENCE, this.riskdataRiskProfileReference); + } + if (isSetRiskdataSkipRisk) { + addIfNull(nulls, JSON_PROPERTY_RISKDATA_SKIP_RISK, this.riskdataSkipRisk); + } + + 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 AdditionalDataRisk given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataRiskStandalone.java b/src/main/java/com/adyen/model/payment/AdditionalDataRiskStandalone.java index 9e5d22ccd..0a0d995b1 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataRiskStandalone.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataRiskStandalone.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -39,49 +41,100 @@ public class AdditionalDataRiskStandalone { public static final String JSON_PROPERTY_PAY_PAL_COUNTRY_CODE = "PayPal.CountryCode"; private String payPalCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayPalCountryCode = false; + public static final String JSON_PROPERTY_PAY_PAL_EMAIL_ID = "PayPal.EmailId"; private String payPalEmailId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayPalEmailId = false; + public static final String JSON_PROPERTY_PAY_PAL_FIRST_NAME = "PayPal.FirstName"; private String payPalFirstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayPalFirstName = false; + public static final String JSON_PROPERTY_PAY_PAL_LAST_NAME = "PayPal.LastName"; private String payPalLastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayPalLastName = false; + public static final String JSON_PROPERTY_PAY_PAL_PAYER_ID = "PayPal.PayerId"; private String payPalPayerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayPalPayerId = false; + public static final String JSON_PROPERTY_PAY_PAL_PHONE = "PayPal.Phone"; private String payPalPhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayPalPhone = false; + public static final String JSON_PROPERTY_PAY_PAL_PROTECTION_ELIGIBILITY = "PayPal.ProtectionEligibility"; private String payPalProtectionEligibility; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayPalProtectionEligibility = false; + public static final String JSON_PROPERTY_PAY_PAL_TRANSACTION_ID = "PayPal.TransactionId"; private String payPalTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayPalTransactionId = false; + public static final String JSON_PROPERTY_AVS_RESULT_RAW = "avsResultRaw"; private String avsResultRaw; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAvsResultRaw = false; + public static final String JSON_PROPERTY_BIN = "bin"; private String bin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBin = false; + public static final String JSON_PROPERTY_CVC_RESULT_RAW = "cvcResultRaw"; private String cvcResultRaw; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCvcResultRaw = false; + public static final String JSON_PROPERTY_RISK_TOKEN = "riskToken"; private String riskToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskToken = false; + public static final String JSON_PROPERTY_THREE_D_AUTHENTICATED = "threeDAuthenticated"; private String threeDAuthenticated; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDAuthenticated = false; + public static final String JSON_PROPERTY_THREE_D_OFFERED = "threeDOffered"; private String threeDOffered; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDOffered = false; + public static final String JSON_PROPERTY_TOKEN_DATA_TYPE = "tokenDataType"; private String tokenDataType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenDataType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataRiskStandalone() {} /** @@ -93,6 +146,7 @@ public AdditionalDataRiskStandalone() {} */ public AdditionalDataRiskStandalone payPalCountryCode(String payPalCountryCode) { this.payPalCountryCode = payPalCountryCode; + isSetPayPalCountryCode = true; // mark as set return this; } @@ -118,6 +172,7 @@ public String getPayPalCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayPalCountryCode(String payPalCountryCode) { this.payPalCountryCode = payPalCountryCode; + isSetPayPalCountryCode = true; // mark as set } /** @@ -128,6 +183,7 @@ public void setPayPalCountryCode(String payPalCountryCode) { */ public AdditionalDataRiskStandalone payPalEmailId(String payPalEmailId) { this.payPalEmailId = payPalEmailId; + isSetPayPalEmailId = true; // mark as set return this; } @@ -151,6 +207,7 @@ public String getPayPalEmailId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayPalEmailId(String payPalEmailId) { this.payPalEmailId = payPalEmailId; + isSetPayPalEmailId = true; // mark as set } /** @@ -161,6 +218,7 @@ public void setPayPalEmailId(String payPalEmailId) { */ public AdditionalDataRiskStandalone payPalFirstName(String payPalFirstName) { this.payPalFirstName = payPalFirstName; + isSetPayPalFirstName = true; // mark as set return this; } @@ -184,6 +242,7 @@ public String getPayPalFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayPalFirstName(String payPalFirstName) { this.payPalFirstName = payPalFirstName; + isSetPayPalFirstName = true; // mark as set } /** @@ -194,6 +253,7 @@ public void setPayPalFirstName(String payPalFirstName) { */ public AdditionalDataRiskStandalone payPalLastName(String payPalLastName) { this.payPalLastName = payPalLastName; + isSetPayPalLastName = true; // mark as set return this; } @@ -217,6 +277,7 @@ public String getPayPalLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayPalLastName(String payPalLastName) { this.payPalLastName = payPalLastName; + isSetPayPalLastName = true; // mark as set } /** @@ -229,6 +290,7 @@ public void setPayPalLastName(String payPalLastName) { */ public AdditionalDataRiskStandalone payPalPayerId(String payPalPayerId) { this.payPalPayerId = payPalPayerId; + isSetPayPalPayerId = true; // mark as set return this; } @@ -256,6 +318,7 @@ public String getPayPalPayerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayPalPayerId(String payPalPayerId) { this.payPalPayerId = payPalPayerId; + isSetPayPalPayerId = true; // mark as set } /** @@ -266,6 +329,7 @@ public void setPayPalPayerId(String payPalPayerId) { */ public AdditionalDataRiskStandalone payPalPhone(String payPalPhone) { this.payPalPhone = payPalPhone; + isSetPayPalPhone = true; // mark as set return this; } @@ -289,6 +353,7 @@ public String getPayPalPhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayPalPhone(String payPalPhone) { this.payPalPhone = payPalPhone; + isSetPayPalPhone = true; // mark as set } /** @@ -307,6 +372,7 @@ public void setPayPalPhone(String payPalPhone) { public AdditionalDataRiskStandalone payPalProtectionEligibility( String payPalProtectionEligibility) { this.payPalProtectionEligibility = payPalProtectionEligibility; + isSetPayPalProtectionEligibility = true; // mark as set return this; } @@ -344,6 +410,7 @@ public String getPayPalProtectionEligibility() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayPalProtectionEligibility(String payPalProtectionEligibility) { this.payPalProtectionEligibility = payPalProtectionEligibility; + isSetPayPalProtectionEligibility = true; // mark as set } /** @@ -354,6 +421,7 @@ public void setPayPalProtectionEligibility(String payPalProtectionEligibility) { */ public AdditionalDataRiskStandalone payPalTransactionId(String payPalTransactionId) { this.payPalTransactionId = payPalTransactionId; + isSetPayPalTransactionId = true; // mark as set return this; } @@ -377,6 +445,7 @@ public String getPayPalTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayPalTransactionId(String payPalTransactionId) { this.payPalTransactionId = payPalTransactionId; + isSetPayPalTransactionId = true; // mark as set } /** @@ -387,6 +456,7 @@ public void setPayPalTransactionId(String payPalTransactionId) { */ public AdditionalDataRiskStandalone avsResultRaw(String avsResultRaw) { this.avsResultRaw = avsResultRaw; + isSetAvsResultRaw = true; // mark as set return this; } @@ -410,6 +480,7 @@ public String getAvsResultRaw() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAvsResultRaw(String avsResultRaw) { this.avsResultRaw = avsResultRaw; + isSetAvsResultRaw = true; // mark as set } /** @@ -424,6 +495,7 @@ public void setAvsResultRaw(String avsResultRaw) { */ public AdditionalDataRiskStandalone bin(String bin) { this.bin = bin; + isSetBin = true; // mark as set return this; } @@ -455,6 +527,7 @@ public String getBin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBin(String bin) { this.bin = bin; + isSetBin = true; // mark as set } /** @@ -465,6 +538,7 @@ public void setBin(String bin) { */ public AdditionalDataRiskStandalone cvcResultRaw(String cvcResultRaw) { this.cvcResultRaw = cvcResultRaw; + isSetCvcResultRaw = true; // mark as set return this; } @@ -488,6 +562,7 @@ public String getCvcResultRaw() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvcResultRaw(String cvcResultRaw) { this.cvcResultRaw = cvcResultRaw; + isSetCvcResultRaw = true; // mark as set } /** @@ -498,6 +573,7 @@ public void setCvcResultRaw(String cvcResultRaw) { */ public AdditionalDataRiskStandalone riskToken(String riskToken) { this.riskToken = riskToken; + isSetRiskToken = true; // mark as set return this; } @@ -521,6 +597,7 @@ public String getRiskToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskToken(String riskToken) { this.riskToken = riskToken; + isSetRiskToken = true; // mark as set } /** @@ -533,6 +610,7 @@ public void setRiskToken(String riskToken) { */ public AdditionalDataRiskStandalone threeDAuthenticated(String threeDAuthenticated) { this.threeDAuthenticated = threeDAuthenticated; + isSetThreeDAuthenticated = true; // mark as set return this; } @@ -560,6 +638,7 @@ public String getThreeDAuthenticated() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDAuthenticated(String threeDAuthenticated) { this.threeDAuthenticated = threeDAuthenticated; + isSetThreeDAuthenticated = true; // mark as set } /** @@ -571,6 +650,7 @@ public void setThreeDAuthenticated(String threeDAuthenticated) { */ public AdditionalDataRiskStandalone threeDOffered(String threeDOffered) { this.threeDOffered = threeDOffered; + isSetThreeDOffered = true; // mark as set return this; } @@ -596,6 +676,7 @@ public String getThreeDOffered() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDOffered(String threeDOffered) { this.threeDOffered = threeDOffered; + isSetThreeDOffered = true; // mark as set } /** @@ -607,6 +688,7 @@ public void setThreeDOffered(String threeDOffered) { */ public AdditionalDataRiskStandalone tokenDataType(String tokenDataType) { this.tokenDataType = tokenDataType; + isSetTokenDataType = true; // mark as set return this; } @@ -632,6 +714,27 @@ public String getTokenDataType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenDataType(String tokenDataType) { this.tokenDataType = tokenDataType; + isSetTokenDataType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataRiskStandalone 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 AdditionalDataRiskStandalone object is equal to o. */ @@ -645,44 +748,81 @@ public boolean equals(Object o) { } AdditionalDataRiskStandalone additionalDataRiskStandalone = (AdditionalDataRiskStandalone) o; return Objects.equals(this.payPalCountryCode, additionalDataRiskStandalone.payPalCountryCode) + && Objects.equals( + this.isSetPayPalCountryCode, additionalDataRiskStandalone.isSetPayPalCountryCode) && Objects.equals(this.payPalEmailId, additionalDataRiskStandalone.payPalEmailId) + && Objects.equals(this.isSetPayPalEmailId, additionalDataRiskStandalone.isSetPayPalEmailId) && Objects.equals(this.payPalFirstName, additionalDataRiskStandalone.payPalFirstName) + && Objects.equals( + this.isSetPayPalFirstName, additionalDataRiskStandalone.isSetPayPalFirstName) && Objects.equals(this.payPalLastName, additionalDataRiskStandalone.payPalLastName) + && Objects.equals( + this.isSetPayPalLastName, additionalDataRiskStandalone.isSetPayPalLastName) && Objects.equals(this.payPalPayerId, additionalDataRiskStandalone.payPalPayerId) + && Objects.equals(this.isSetPayPalPayerId, additionalDataRiskStandalone.isSetPayPalPayerId) && Objects.equals(this.payPalPhone, additionalDataRiskStandalone.payPalPhone) + && Objects.equals(this.isSetPayPalPhone, additionalDataRiskStandalone.isSetPayPalPhone) && Objects.equals( this.payPalProtectionEligibility, additionalDataRiskStandalone.payPalProtectionEligibility) + && Objects.equals( + this.isSetPayPalProtectionEligibility, + additionalDataRiskStandalone.isSetPayPalProtectionEligibility) && Objects.equals( this.payPalTransactionId, additionalDataRiskStandalone.payPalTransactionId) + && Objects.equals( + this.isSetPayPalTransactionId, additionalDataRiskStandalone.isSetPayPalTransactionId) && Objects.equals(this.avsResultRaw, additionalDataRiskStandalone.avsResultRaw) + && Objects.equals(this.isSetAvsResultRaw, additionalDataRiskStandalone.isSetAvsResultRaw) && Objects.equals(this.bin, additionalDataRiskStandalone.bin) + && Objects.equals(this.isSetBin, additionalDataRiskStandalone.isSetBin) && Objects.equals(this.cvcResultRaw, additionalDataRiskStandalone.cvcResultRaw) + && Objects.equals(this.isSetCvcResultRaw, additionalDataRiskStandalone.isSetCvcResultRaw) && Objects.equals(this.riskToken, additionalDataRiskStandalone.riskToken) + && Objects.equals(this.isSetRiskToken, additionalDataRiskStandalone.isSetRiskToken) && Objects.equals( this.threeDAuthenticated, additionalDataRiskStandalone.threeDAuthenticated) + && Objects.equals( + this.isSetThreeDAuthenticated, additionalDataRiskStandalone.isSetThreeDAuthenticated) && Objects.equals(this.threeDOffered, additionalDataRiskStandalone.threeDOffered) - && Objects.equals(this.tokenDataType, additionalDataRiskStandalone.tokenDataType); + && Objects.equals(this.isSetThreeDOffered, additionalDataRiskStandalone.isSetThreeDOffered) + && Objects.equals(this.tokenDataType, additionalDataRiskStandalone.tokenDataType) + && Objects.equals(this.isSetTokenDataType, additionalDataRiskStandalone.isSetTokenDataType); } @Override public int hashCode() { return Objects.hash( payPalCountryCode, + isSetPayPalCountryCode, payPalEmailId, + isSetPayPalEmailId, payPalFirstName, + isSetPayPalFirstName, payPalLastName, + isSetPayPalLastName, payPalPayerId, + isSetPayPalPayerId, payPalPhone, + isSetPayPalPhone, payPalProtectionEligibility, + isSetPayPalProtectionEligibility, payPalTransactionId, + isSetPayPalTransactionId, avsResultRaw, + isSetAvsResultRaw, bin, + isSetBin, cvcResultRaw, + isSetCvcResultRaw, riskToken, + isSetRiskToken, threeDAuthenticated, + isSetThreeDAuthenticated, threeDOffered, - tokenDataType); + isSetThreeDOffered, + tokenDataType, + isSetTokenDataType); } @Override @@ -724,6 +864,73 @@ 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 (isSetPayPalCountryCode) { + addIfNull(nulls, JSON_PROPERTY_PAY_PAL_COUNTRY_CODE, this.payPalCountryCode); + } + if (isSetPayPalEmailId) { + addIfNull(nulls, JSON_PROPERTY_PAY_PAL_EMAIL_ID, this.payPalEmailId); + } + if (isSetPayPalFirstName) { + addIfNull(nulls, JSON_PROPERTY_PAY_PAL_FIRST_NAME, this.payPalFirstName); + } + if (isSetPayPalLastName) { + addIfNull(nulls, JSON_PROPERTY_PAY_PAL_LAST_NAME, this.payPalLastName); + } + if (isSetPayPalPayerId) { + addIfNull(nulls, JSON_PROPERTY_PAY_PAL_PAYER_ID, this.payPalPayerId); + } + if (isSetPayPalPhone) { + addIfNull(nulls, JSON_PROPERTY_PAY_PAL_PHONE, this.payPalPhone); + } + if (isSetPayPalProtectionEligibility) { + addIfNull( + nulls, JSON_PROPERTY_PAY_PAL_PROTECTION_ELIGIBILITY, this.payPalProtectionEligibility); + } + if (isSetPayPalTransactionId) { + addIfNull(nulls, JSON_PROPERTY_PAY_PAL_TRANSACTION_ID, this.payPalTransactionId); + } + if (isSetAvsResultRaw) { + addIfNull(nulls, JSON_PROPERTY_AVS_RESULT_RAW, this.avsResultRaw); + } + if (isSetBin) { + addIfNull(nulls, JSON_PROPERTY_BIN, this.bin); + } + if (isSetCvcResultRaw) { + addIfNull(nulls, JSON_PROPERTY_CVC_RESULT_RAW, this.cvcResultRaw); + } + if (isSetRiskToken) { + addIfNull(nulls, JSON_PROPERTY_RISK_TOKEN, this.riskToken); + } + if (isSetThreeDAuthenticated) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_AUTHENTICATED, this.threeDAuthenticated); + } + if (isSetThreeDOffered) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_OFFERED, this.threeDOffered); + } + if (isSetTokenDataType) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_DATA_TYPE, this.tokenDataType); + } + + 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 AdditionalDataRiskStandalone given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataSubMerchant.java b/src/main/java/com/adyen/model/payment/AdditionalDataSubMerchant.java index 67b48d956..5e5049e0c 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataSubMerchant.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataSubMerchant.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -37,50 +39,92 @@ public class AdditionalDataSubMerchant { "subMerchant.numberOfSubSellers"; private String subMerchantNumberOfSubSellers; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantNumberOfSubSellers = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_CITY = "subMerchant.subSeller[subSellerNr].city"; private String subMerchantSubSellerSubSellerNrCity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrCity = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_COUNTRY = "subMerchant.subSeller[subSellerNr].country"; private String subMerchantSubSellerSubSellerNrCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrCountry = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_EMAIL = "subMerchant.subSeller[subSellerNr].email"; private String subMerchantSubSellerSubSellerNrEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrEmail = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_ID = "subMerchant.subSeller[subSellerNr].id"; private String subMerchantSubSellerSubSellerNrId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrId = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_MCC = "subMerchant.subSeller[subSellerNr].mcc"; private String subMerchantSubSellerSubSellerNrMcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrMcc = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_NAME = "subMerchant.subSeller[subSellerNr].name"; private String subMerchantSubSellerSubSellerNrName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrName = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_PHONE_NUMBER = "subMerchant.subSeller[subSellerNr].phoneNumber"; private String subMerchantSubSellerSubSellerNrPhoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrPhoneNumber = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_POSTAL_CODE = "subMerchant.subSeller[subSellerNr].postalCode"; private String subMerchantSubSellerSubSellerNrPostalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrPostalCode = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_STATE = "subMerchant.subSeller[subSellerNr].state"; private String subMerchantSubSellerSubSellerNrState; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrState = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_STREET = "subMerchant.subSeller[subSellerNr].street"; private String subMerchantSubSellerSubSellerNrStreet; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrStreet = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_TAX_ID = "subMerchant.subSeller[subSellerNr].taxId"; private String subMerchantSubSellerSubSellerNrTaxId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrTaxId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataSubMerchant() {} /** @@ -95,6 +139,7 @@ public AdditionalDataSubMerchant() {} public AdditionalDataSubMerchant subMerchantNumberOfSubSellers( String subMerchantNumberOfSubSellers) { this.subMerchantNumberOfSubSellers = subMerchantNumberOfSubSellers; + isSetSubMerchantNumberOfSubSellers = true; // mark as set return this; } @@ -124,6 +169,7 @@ public String getSubMerchantNumberOfSubSellers() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantNumberOfSubSellers(String subMerchantNumberOfSubSellers) { this.subMerchantNumberOfSubSellers = subMerchantNumberOfSubSellers; + isSetSubMerchantNumberOfSubSellers = true; // mark as set } /** @@ -138,6 +184,7 @@ public void setSubMerchantNumberOfSubSellers(String subMerchantNumberOfSubSeller public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrCity( String subMerchantSubSellerSubSellerNrCity) { this.subMerchantSubSellerSubSellerNrCity = subMerchantSubSellerSubSellerNrCity; + isSetSubMerchantSubSellerSubSellerNrCity = true; // mark as set return this; } @@ -167,6 +214,7 @@ public String getSubMerchantSubSellerSubSellerNrCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantSubSellerSubSellerNrCity(String subMerchantSubSellerSubSellerNrCity) { this.subMerchantSubSellerSubSellerNrCity = subMerchantSubSellerSubSellerNrCity; + isSetSubMerchantSubSellerSubSellerNrCity = true; // mark as set } /** @@ -183,6 +231,7 @@ public void setSubMerchantSubSellerSubSellerNrCity(String subMerchantSubSellerSu public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrCountry( String subMerchantSubSellerSubSellerNrCountry) { this.subMerchantSubSellerSubSellerNrCountry = subMerchantSubSellerSubSellerNrCountry; + isSetSubMerchantSubSellerSubSellerNrCountry = true; // mark as set return this; } @@ -217,6 +266,7 @@ public String getSubMerchantSubSellerSubSellerNrCountry() { public void setSubMerchantSubSellerSubSellerNrCountry( String subMerchantSubSellerSubSellerNrCountry) { this.subMerchantSubSellerSubSellerNrCountry = subMerchantSubSellerSubSellerNrCountry; + isSetSubMerchantSubSellerSubSellerNrCountry = true; // mark as set } /** @@ -231,6 +281,7 @@ public void setSubMerchantSubSellerSubSellerNrCountry( public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrEmail( String subMerchantSubSellerSubSellerNrEmail) { this.subMerchantSubSellerSubSellerNrEmail = subMerchantSubSellerSubSellerNrEmail; + isSetSubMerchantSubSellerSubSellerNrEmail = true; // mark as set return this; } @@ -260,6 +311,7 @@ public String getSubMerchantSubSellerSubSellerNrEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantSubSellerSubSellerNrEmail(String subMerchantSubSellerSubSellerNrEmail) { this.subMerchantSubSellerSubSellerNrEmail = subMerchantSubSellerSubSellerNrEmail; + isSetSubMerchantSubSellerSubSellerNrEmail = true; // mark as set } /** @@ -276,6 +328,7 @@ public void setSubMerchantSubSellerSubSellerNrEmail(String subMerchantSubSellerS public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrId( String subMerchantSubSellerSubSellerNrId) { this.subMerchantSubSellerSubSellerNrId = subMerchantSubSellerSubSellerNrId; + isSetSubMerchantSubSellerSubSellerNrId = true; // mark as set return this; } @@ -309,6 +362,7 @@ public String getSubMerchantSubSellerSubSellerNrId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantSubSellerSubSellerNrId(String subMerchantSubSellerSubSellerNrId) { this.subMerchantSubSellerSubSellerNrId = subMerchantSubSellerSubSellerNrId; + isSetSubMerchantSubSellerSubSellerNrId = true; // mark as set } /** @@ -323,6 +377,7 @@ public void setSubMerchantSubSellerSubSellerNrId(String subMerchantSubSellerSubS public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrMcc( String subMerchantSubSellerSubSellerNrMcc) { this.subMerchantSubSellerSubSellerNrMcc = subMerchantSubSellerSubSellerNrMcc; + isSetSubMerchantSubSellerSubSellerNrMcc = true; // mark as set return this; } @@ -352,6 +407,7 @@ public String getSubMerchantSubSellerSubSellerNrMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantSubSellerSubSellerNrMcc(String subMerchantSubSellerSubSellerNrMcc) { this.subMerchantSubSellerSubSellerNrMcc = subMerchantSubSellerSubSellerNrMcc; + isSetSubMerchantSubSellerSubSellerNrMcc = true; // mark as set } /** @@ -370,6 +426,7 @@ public void setSubMerchantSubSellerSubSellerNrMcc(String subMerchantSubSellerSub public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrName( String subMerchantSubSellerSubSellerNrName) { this.subMerchantSubSellerSubSellerNrName = subMerchantSubSellerSubSellerNrName; + isSetSubMerchantSubSellerSubSellerNrName = true; // mark as set return this; } @@ -407,6 +464,7 @@ public String getSubMerchantSubSellerSubSellerNrName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantSubSellerSubSellerNrName(String subMerchantSubSellerSubSellerNrName) { this.subMerchantSubSellerSubSellerNrName = subMerchantSubSellerSubSellerNrName; + isSetSubMerchantSubSellerSubSellerNrName = true; // mark as set } /** @@ -421,6 +479,7 @@ public void setSubMerchantSubSellerSubSellerNrName(String subMerchantSubSellerSu public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrPhoneNumber( String subMerchantSubSellerSubSellerNrPhoneNumber) { this.subMerchantSubSellerSubSellerNrPhoneNumber = subMerchantSubSellerSubSellerNrPhoneNumber; + isSetSubMerchantSubSellerSubSellerNrPhoneNumber = true; // mark as set return this; } @@ -451,6 +510,7 @@ public String getSubMerchantSubSellerSubSellerNrPhoneNumber() { public void setSubMerchantSubSellerSubSellerNrPhoneNumber( String subMerchantSubSellerSubSellerNrPhoneNumber) { this.subMerchantSubSellerSubSellerNrPhoneNumber = subMerchantSubSellerSubSellerNrPhoneNumber; + isSetSubMerchantSubSellerSubSellerNrPhoneNumber = true; // mark as set } /** @@ -465,6 +525,7 @@ public void setSubMerchantSubSellerSubSellerNrPhoneNumber( public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrPostalCode( String subMerchantSubSellerSubSellerNrPostalCode) { this.subMerchantSubSellerSubSellerNrPostalCode = subMerchantSubSellerSubSellerNrPostalCode; + isSetSubMerchantSubSellerSubSellerNrPostalCode = true; // mark as set return this; } @@ -495,6 +556,7 @@ public String getSubMerchantSubSellerSubSellerNrPostalCode() { public void setSubMerchantSubSellerSubSellerNrPostalCode( String subMerchantSubSellerSubSellerNrPostalCode) { this.subMerchantSubSellerSubSellerNrPostalCode = subMerchantSubSellerSubSellerNrPostalCode; + isSetSubMerchantSubSellerSubSellerNrPostalCode = true; // mark as set } /** @@ -510,6 +572,7 @@ public void setSubMerchantSubSellerSubSellerNrPostalCode( public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrState( String subMerchantSubSellerSubSellerNrState) { this.subMerchantSubSellerSubSellerNrState = subMerchantSubSellerSubSellerNrState; + isSetSubMerchantSubSellerSubSellerNrState = true; // mark as set return this; } @@ -541,6 +604,7 @@ public String getSubMerchantSubSellerSubSellerNrState() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantSubSellerSubSellerNrState(String subMerchantSubSellerSubSellerNrState) { this.subMerchantSubSellerSubSellerNrState = subMerchantSubSellerSubSellerNrState; + isSetSubMerchantSubSellerSubSellerNrState = true; // mark as set } /** @@ -556,6 +620,7 @@ public void setSubMerchantSubSellerSubSellerNrState(String subMerchantSubSellerS public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrStreet( String subMerchantSubSellerSubSellerNrStreet) { this.subMerchantSubSellerSubSellerNrStreet = subMerchantSubSellerSubSellerNrStreet; + isSetSubMerchantSubSellerSubSellerNrStreet = true; // mark as set return this; } @@ -588,6 +653,7 @@ public String getSubMerchantSubSellerSubSellerNrStreet() { public void setSubMerchantSubSellerSubSellerNrStreet( String subMerchantSubSellerSubSellerNrStreet) { this.subMerchantSubSellerSubSellerNrStreet = subMerchantSubSellerSubSellerNrStreet; + isSetSubMerchantSubSellerSubSellerNrStreet = true; // mark as set } /** @@ -602,6 +668,7 @@ public void setSubMerchantSubSellerSubSellerNrStreet( public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrTaxId( String subMerchantSubSellerSubSellerNrTaxId) { this.subMerchantSubSellerSubSellerNrTaxId = subMerchantSubSellerSubSellerNrTaxId; + isSetSubMerchantSubSellerSubSellerNrTaxId = true; // mark as set return this; } @@ -631,6 +698,27 @@ public String getSubMerchantSubSellerSubSellerNrTaxId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantSubSellerSubSellerNrTaxId(String subMerchantSubSellerSubSellerNrTaxId) { this.subMerchantSubSellerSubSellerNrTaxId = subMerchantSubSellerSubSellerNrTaxId; + isSetSubMerchantSubSellerSubSellerNrTaxId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataSubMerchant 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 AdditionalDataSubMerchant object is equal to o. */ @@ -646,56 +734,104 @@ public boolean equals(Object o) { return Objects.equals( this.subMerchantNumberOfSubSellers, additionalDataSubMerchant.subMerchantNumberOfSubSellers) + && Objects.equals( + this.isSetSubMerchantNumberOfSubSellers, + additionalDataSubMerchant.isSetSubMerchantNumberOfSubSellers) && Objects.equals( this.subMerchantSubSellerSubSellerNrCity, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrCity) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrCity, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrCity) && Objects.equals( this.subMerchantSubSellerSubSellerNrCountry, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrCountry) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrCountry, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrCountry) && Objects.equals( this.subMerchantSubSellerSubSellerNrEmail, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrEmail) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrEmail, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrEmail) && Objects.equals( this.subMerchantSubSellerSubSellerNrId, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrId) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrId, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrId) && Objects.equals( this.subMerchantSubSellerSubSellerNrMcc, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrMcc) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrMcc, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrMcc) && Objects.equals( this.subMerchantSubSellerSubSellerNrName, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrName) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrName, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrName) && Objects.equals( this.subMerchantSubSellerSubSellerNrPhoneNumber, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrPhoneNumber) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrPhoneNumber, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrPhoneNumber) && Objects.equals( this.subMerchantSubSellerSubSellerNrPostalCode, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrPostalCode) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrPostalCode, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrPostalCode) && Objects.equals( this.subMerchantSubSellerSubSellerNrState, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrState) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrState, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrState) && Objects.equals( this.subMerchantSubSellerSubSellerNrStreet, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrStreet) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrStreet, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrStreet) && Objects.equals( this.subMerchantSubSellerSubSellerNrTaxId, - additionalDataSubMerchant.subMerchantSubSellerSubSellerNrTaxId); + additionalDataSubMerchant.subMerchantSubSellerSubSellerNrTaxId) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrTaxId, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrTaxId); } @Override public int hashCode() { return Objects.hash( subMerchantNumberOfSubSellers, + isSetSubMerchantNumberOfSubSellers, subMerchantSubSellerSubSellerNrCity, + isSetSubMerchantSubSellerSubSellerNrCity, subMerchantSubSellerSubSellerNrCountry, + isSetSubMerchantSubSellerSubSellerNrCountry, subMerchantSubSellerSubSellerNrEmail, + isSetSubMerchantSubSellerSubSellerNrEmail, subMerchantSubSellerSubSellerNrId, + isSetSubMerchantSubSellerSubSellerNrId, subMerchantSubSellerSubSellerNrMcc, + isSetSubMerchantSubSellerSubSellerNrMcc, subMerchantSubSellerSubSellerNrName, + isSetSubMerchantSubSellerSubSellerNrName, subMerchantSubSellerSubSellerNrPhoneNumber, + isSetSubMerchantSubSellerSubSellerNrPhoneNumber, subMerchantSubSellerSubSellerNrPostalCode, + isSetSubMerchantSubSellerSubSellerNrPostalCode, subMerchantSubSellerSubSellerNrState, + isSetSubMerchantSubSellerSubSellerNrState, subMerchantSubSellerSubSellerNrStreet, - subMerchantSubSellerSubSellerNrTaxId); + isSetSubMerchantSubSellerSubSellerNrStreet, + subMerchantSubSellerSubSellerNrTaxId, + isSetSubMerchantSubSellerSubSellerNrTaxId); } @Override @@ -752,6 +888,99 @@ 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 (isSetSubMerchantNumberOfSubSellers) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_NUMBER_OF_SUB_SELLERS, + this.subMerchantNumberOfSubSellers); + } + if (isSetSubMerchantSubSellerSubSellerNrCity) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_CITY, + this.subMerchantSubSellerSubSellerNrCity); + } + if (isSetSubMerchantSubSellerSubSellerNrCountry) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_COUNTRY, + this.subMerchantSubSellerSubSellerNrCountry); + } + if (isSetSubMerchantSubSellerSubSellerNrEmail) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_EMAIL, + this.subMerchantSubSellerSubSellerNrEmail); + } + if (isSetSubMerchantSubSellerSubSellerNrId) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_ID, + this.subMerchantSubSellerSubSellerNrId); + } + if (isSetSubMerchantSubSellerSubSellerNrMcc) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_MCC, + this.subMerchantSubSellerSubSellerNrMcc); + } + if (isSetSubMerchantSubSellerSubSellerNrName) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_NAME, + this.subMerchantSubSellerSubSellerNrName); + } + if (isSetSubMerchantSubSellerSubSellerNrPhoneNumber) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_PHONE_NUMBER, + this.subMerchantSubSellerSubSellerNrPhoneNumber); + } + if (isSetSubMerchantSubSellerSubSellerNrPostalCode) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_POSTAL_CODE, + this.subMerchantSubSellerSubSellerNrPostalCode); + } + if (isSetSubMerchantSubSellerSubSellerNrState) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_STATE, + this.subMerchantSubSellerSubSellerNrState); + } + if (isSetSubMerchantSubSellerSubSellerNrStreet) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_STREET, + this.subMerchantSubSellerSubSellerNrStreet); + } + if (isSetSubMerchantSubSellerSubSellerNrTaxId) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_TAX_ID, + this.subMerchantSubSellerSubSellerNrTaxId); + } + + 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 AdditionalDataSubMerchant given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataTemporaryServices.java b/src/main/java/com/adyen/model/payment/AdditionalDataTemporaryServices.java index edd7dda11..5842eb94f 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataTemporaryServices.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataTemporaryServices.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -34,38 +36,71 @@ public class AdditionalDataTemporaryServices { "enhancedSchemeData.customerReference"; private String enhancedSchemeDataCustomerReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataCustomerReference = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_EMPLOYEE_NAME = "enhancedSchemeData.employeeName"; private String enhancedSchemeDataEmployeeName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataEmployeeName = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_JOB_DESCRIPTION = "enhancedSchemeData.jobDescription"; private String enhancedSchemeDataJobDescription; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataJobDescription = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_REGULAR_HOURS_RATE = "enhancedSchemeData.regularHoursRate"; private String enhancedSchemeDataRegularHoursRate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataRegularHoursRate = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_REGULAR_HOURS_WORKED = "enhancedSchemeData.regularHoursWorked"; private String enhancedSchemeDataRegularHoursWorked; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataRegularHoursWorked = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_REQUEST_NAME = "enhancedSchemeData.requestName"; private String enhancedSchemeDataRequestName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataRequestName = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_TEMP_START_DATE = "enhancedSchemeData.tempStartDate"; private String enhancedSchemeDataTempStartDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataTempStartDate = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_TEMP_WEEK_ENDING = "enhancedSchemeData.tempWeekEnding"; private String enhancedSchemeDataTempWeekEnding; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataTempWeekEnding = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_TOTAL_TAX_AMOUNT = "enhancedSchemeData.totalTaxAmount"; private String enhancedSchemeDataTotalTaxAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataTotalTaxAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataTemporaryServices() {} /** @@ -79,6 +114,7 @@ public AdditionalDataTemporaryServices() {} public AdditionalDataTemporaryServices enhancedSchemeDataCustomerReference( String enhancedSchemeDataCustomerReference) { this.enhancedSchemeDataCustomerReference = enhancedSchemeDataCustomerReference; + isSetEnhancedSchemeDataCustomerReference = true; // mark as set return this; } @@ -104,6 +140,7 @@ public String getEnhancedSchemeDataCustomerReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataCustomerReference(String enhancedSchemeDataCustomerReference) { this.enhancedSchemeDataCustomerReference = enhancedSchemeDataCustomerReference; + isSetEnhancedSchemeDataCustomerReference = true; // mark as set } /** @@ -118,6 +155,7 @@ public void setEnhancedSchemeDataCustomerReference(String enhancedSchemeDataCust public AdditionalDataTemporaryServices enhancedSchemeDataEmployeeName( String enhancedSchemeDataEmployeeName) { this.enhancedSchemeDataEmployeeName = enhancedSchemeDataEmployeeName; + isSetEnhancedSchemeDataEmployeeName = true; // mark as set return this; } @@ -145,6 +183,7 @@ public String getEnhancedSchemeDataEmployeeName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataEmployeeName(String enhancedSchemeDataEmployeeName) { this.enhancedSchemeDataEmployeeName = enhancedSchemeDataEmployeeName; + isSetEnhancedSchemeDataEmployeeName = true; // mark as set } /** @@ -159,6 +198,7 @@ public void setEnhancedSchemeDataEmployeeName(String enhancedSchemeDataEmployeeN public AdditionalDataTemporaryServices enhancedSchemeDataJobDescription( String enhancedSchemeDataJobDescription) { this.enhancedSchemeDataJobDescription = enhancedSchemeDataJobDescription; + isSetEnhancedSchemeDataJobDescription = true; // mark as set return this; } @@ -186,6 +226,7 @@ public String getEnhancedSchemeDataJobDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataJobDescription(String enhancedSchemeDataJobDescription) { this.enhancedSchemeDataJobDescription = enhancedSchemeDataJobDescription; + isSetEnhancedSchemeDataJobDescription = true; // mark as set } /** @@ -202,6 +243,7 @@ public void setEnhancedSchemeDataJobDescription(String enhancedSchemeDataJobDesc public AdditionalDataTemporaryServices enhancedSchemeDataRegularHoursRate( String enhancedSchemeDataRegularHoursRate) { this.enhancedSchemeDataRegularHoursRate = enhancedSchemeDataRegularHoursRate; + isSetEnhancedSchemeDataRegularHoursRate = true; // mark as set return this; } @@ -233,6 +275,7 @@ public String getEnhancedSchemeDataRegularHoursRate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataRegularHoursRate(String enhancedSchemeDataRegularHoursRate) { this.enhancedSchemeDataRegularHoursRate = enhancedSchemeDataRegularHoursRate; + isSetEnhancedSchemeDataRegularHoursRate = true; // mark as set } /** @@ -246,6 +289,7 @@ public void setEnhancedSchemeDataRegularHoursRate(String enhancedSchemeDataRegul public AdditionalDataTemporaryServices enhancedSchemeDataRegularHoursWorked( String enhancedSchemeDataRegularHoursWorked) { this.enhancedSchemeDataRegularHoursWorked = enhancedSchemeDataRegularHoursWorked; + isSetEnhancedSchemeDataRegularHoursWorked = true; // mark as set return this; } @@ -271,6 +315,7 @@ public String getEnhancedSchemeDataRegularHoursWorked() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataRegularHoursWorked(String enhancedSchemeDataRegularHoursWorked) { this.enhancedSchemeDataRegularHoursWorked = enhancedSchemeDataRegularHoursWorked; + isSetEnhancedSchemeDataRegularHoursWorked = true; // mark as set } /** @@ -285,6 +330,7 @@ public void setEnhancedSchemeDataRegularHoursWorked(String enhancedSchemeDataReg public AdditionalDataTemporaryServices enhancedSchemeDataRequestName( String enhancedSchemeDataRequestName) { this.enhancedSchemeDataRequestName = enhancedSchemeDataRequestName; + isSetEnhancedSchemeDataRequestName = true; // mark as set return this; } @@ -312,6 +358,7 @@ public String getEnhancedSchemeDataRequestName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataRequestName(String enhancedSchemeDataRequestName) { this.enhancedSchemeDataRequestName = enhancedSchemeDataRequestName; + isSetEnhancedSchemeDataRequestName = true; // mark as set } /** @@ -325,6 +372,7 @@ public void setEnhancedSchemeDataRequestName(String enhancedSchemeDataRequestNam public AdditionalDataTemporaryServices enhancedSchemeDataTempStartDate( String enhancedSchemeDataTempStartDate) { this.enhancedSchemeDataTempStartDate = enhancedSchemeDataTempStartDate; + isSetEnhancedSchemeDataTempStartDate = true; // mark as set return this; } @@ -350,6 +398,7 @@ public String getEnhancedSchemeDataTempStartDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataTempStartDate(String enhancedSchemeDataTempStartDate) { this.enhancedSchemeDataTempStartDate = enhancedSchemeDataTempStartDate; + isSetEnhancedSchemeDataTempStartDate = true; // mark as set } /** @@ -363,6 +412,7 @@ public void setEnhancedSchemeDataTempStartDate(String enhancedSchemeDataTempStar public AdditionalDataTemporaryServices enhancedSchemeDataTempWeekEnding( String enhancedSchemeDataTempWeekEnding) { this.enhancedSchemeDataTempWeekEnding = enhancedSchemeDataTempWeekEnding; + isSetEnhancedSchemeDataTempWeekEnding = true; // mark as set return this; } @@ -388,6 +438,7 @@ public String getEnhancedSchemeDataTempWeekEnding() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataTempWeekEnding(String enhancedSchemeDataTempWeekEnding) { this.enhancedSchemeDataTempWeekEnding = enhancedSchemeDataTempWeekEnding; + isSetEnhancedSchemeDataTempWeekEnding = true; // mark as set } /** @@ -404,6 +455,7 @@ public void setEnhancedSchemeDataTempWeekEnding(String enhancedSchemeDataTempWee public AdditionalDataTemporaryServices enhancedSchemeDataTotalTaxAmount( String enhancedSchemeDataTotalTaxAmount) { this.enhancedSchemeDataTotalTaxAmount = enhancedSchemeDataTotalTaxAmount; + isSetEnhancedSchemeDataTotalTaxAmount = true; // mark as set return this; } @@ -435,6 +487,27 @@ public String getEnhancedSchemeDataTotalTaxAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataTotalTaxAmount(String enhancedSchemeDataTotalTaxAmount) { this.enhancedSchemeDataTotalTaxAmount = enhancedSchemeDataTotalTaxAmount; + isSetEnhancedSchemeDataTotalTaxAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataTemporaryServices 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 AdditionalDataTemporaryServices object is equal to o. */ @@ -451,44 +524,80 @@ public boolean equals(Object o) { return Objects.equals( this.enhancedSchemeDataCustomerReference, additionalDataTemporaryServices.enhancedSchemeDataCustomerReference) + && Objects.equals( + this.isSetEnhancedSchemeDataCustomerReference, + additionalDataTemporaryServices.isSetEnhancedSchemeDataCustomerReference) && Objects.equals( this.enhancedSchemeDataEmployeeName, additionalDataTemporaryServices.enhancedSchemeDataEmployeeName) + && Objects.equals( + this.isSetEnhancedSchemeDataEmployeeName, + additionalDataTemporaryServices.isSetEnhancedSchemeDataEmployeeName) && Objects.equals( this.enhancedSchemeDataJobDescription, additionalDataTemporaryServices.enhancedSchemeDataJobDescription) + && Objects.equals( + this.isSetEnhancedSchemeDataJobDescription, + additionalDataTemporaryServices.isSetEnhancedSchemeDataJobDescription) && Objects.equals( this.enhancedSchemeDataRegularHoursRate, additionalDataTemporaryServices.enhancedSchemeDataRegularHoursRate) + && Objects.equals( + this.isSetEnhancedSchemeDataRegularHoursRate, + additionalDataTemporaryServices.isSetEnhancedSchemeDataRegularHoursRate) && Objects.equals( this.enhancedSchemeDataRegularHoursWorked, additionalDataTemporaryServices.enhancedSchemeDataRegularHoursWorked) + && Objects.equals( + this.isSetEnhancedSchemeDataRegularHoursWorked, + additionalDataTemporaryServices.isSetEnhancedSchemeDataRegularHoursWorked) && Objects.equals( this.enhancedSchemeDataRequestName, additionalDataTemporaryServices.enhancedSchemeDataRequestName) + && Objects.equals( + this.isSetEnhancedSchemeDataRequestName, + additionalDataTemporaryServices.isSetEnhancedSchemeDataRequestName) && Objects.equals( this.enhancedSchemeDataTempStartDate, additionalDataTemporaryServices.enhancedSchemeDataTempStartDate) + && Objects.equals( + this.isSetEnhancedSchemeDataTempStartDate, + additionalDataTemporaryServices.isSetEnhancedSchemeDataTempStartDate) && Objects.equals( this.enhancedSchemeDataTempWeekEnding, additionalDataTemporaryServices.enhancedSchemeDataTempWeekEnding) + && Objects.equals( + this.isSetEnhancedSchemeDataTempWeekEnding, + additionalDataTemporaryServices.isSetEnhancedSchemeDataTempWeekEnding) && Objects.equals( this.enhancedSchemeDataTotalTaxAmount, - additionalDataTemporaryServices.enhancedSchemeDataTotalTaxAmount); + additionalDataTemporaryServices.enhancedSchemeDataTotalTaxAmount) + && Objects.equals( + this.isSetEnhancedSchemeDataTotalTaxAmount, + additionalDataTemporaryServices.isSetEnhancedSchemeDataTotalTaxAmount); } @Override public int hashCode() { return Objects.hash( enhancedSchemeDataCustomerReference, + isSetEnhancedSchemeDataCustomerReference, enhancedSchemeDataEmployeeName, + isSetEnhancedSchemeDataEmployeeName, enhancedSchemeDataJobDescription, + isSetEnhancedSchemeDataJobDescription, enhancedSchemeDataRegularHoursRate, + isSetEnhancedSchemeDataRegularHoursRate, enhancedSchemeDataRegularHoursWorked, + isSetEnhancedSchemeDataRegularHoursWorked, enhancedSchemeDataRequestName, + isSetEnhancedSchemeDataRequestName, enhancedSchemeDataTempStartDate, + isSetEnhancedSchemeDataTempStartDate, enhancedSchemeDataTempWeekEnding, - enhancedSchemeDataTotalTaxAmount); + isSetEnhancedSchemeDataTempWeekEnding, + enhancedSchemeDataTotalTaxAmount, + isSetEnhancedSchemeDataTotalTaxAmount); } @Override @@ -536,6 +645,81 @@ 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 (isSetEnhancedSchemeDataCustomerReference) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_CUSTOMER_REFERENCE, + this.enhancedSchemeDataCustomerReference); + } + if (isSetEnhancedSchemeDataEmployeeName) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_EMPLOYEE_NAME, + this.enhancedSchemeDataEmployeeName); + } + if (isSetEnhancedSchemeDataJobDescription) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_JOB_DESCRIPTION, + this.enhancedSchemeDataJobDescription); + } + if (isSetEnhancedSchemeDataRegularHoursRate) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_REGULAR_HOURS_RATE, + this.enhancedSchemeDataRegularHoursRate); + } + if (isSetEnhancedSchemeDataRegularHoursWorked) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_REGULAR_HOURS_WORKED, + this.enhancedSchemeDataRegularHoursWorked); + } + if (isSetEnhancedSchemeDataRequestName) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_REQUEST_NAME, + this.enhancedSchemeDataRequestName); + } + if (isSetEnhancedSchemeDataTempStartDate) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_TEMP_START_DATE, + this.enhancedSchemeDataTempStartDate); + } + if (isSetEnhancedSchemeDataTempWeekEnding) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_TEMP_WEEK_ENDING, + this.enhancedSchemeDataTempWeekEnding); + } + if (isSetEnhancedSchemeDataTotalTaxAmount) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_TOTAL_TAX_AMOUNT, + this.enhancedSchemeDataTotalTaxAmount); + } + + 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 AdditionalDataTemporaryServices given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataWallets.java b/src/main/java/com/adyen/model/payment/AdditionalDataWallets.java index cee8c6606..645480c97 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataWallets.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataWallets.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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,21 +32,45 @@ public class AdditionalDataWallets { public static final String JSON_PROPERTY_ANDROIDPAY_TOKEN = "androidpay.token"; private String androidpayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAndroidpayToken = false; + public static final String JSON_PROPERTY_MASTERPASS_TRANSACTION_ID = "masterpass.transactionId"; private String masterpassTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMasterpassTransactionId = false; + public static final String JSON_PROPERTY_PAYMENT_TOKEN = "payment.token"; private String paymentToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentToken = false; + public static final String JSON_PROPERTY_PAYWITHGOOGLE_TOKEN = "paywithgoogle.token"; private String paywithgoogleToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaywithgoogleToken = false; + public static final String JSON_PROPERTY_SAMSUNGPAY_TOKEN = "samsungpay.token"; private String samsungpayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSamsungpayToken = false; + public static final String JSON_PROPERTY_VISACHECKOUT_CALL_ID = "visacheckout.callId"; private String visacheckoutCallId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVisacheckoutCallId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataWallets() {} /** @@ -55,6 +81,7 @@ public AdditionalDataWallets() {} */ public AdditionalDataWallets androidpayToken(String androidpayToken) { this.androidpayToken = androidpayToken; + isSetAndroidpayToken = true; // mark as set return this; } @@ -78,6 +105,7 @@ public String getAndroidpayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAndroidpayToken(String androidpayToken) { this.androidpayToken = androidpayToken; + isSetAndroidpayToken = true; // mark as set } /** @@ -88,6 +116,7 @@ public void setAndroidpayToken(String androidpayToken) { */ public AdditionalDataWallets masterpassTransactionId(String masterpassTransactionId) { this.masterpassTransactionId = masterpassTransactionId; + isSetMasterpassTransactionId = true; // mark as set return this; } @@ -112,6 +141,7 @@ public String getMasterpassTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMasterpassTransactionId(String masterpassTransactionId) { this.masterpassTransactionId = masterpassTransactionId; + isSetMasterpassTransactionId = true; // mark as set } /** @@ -122,6 +152,7 @@ public void setMasterpassTransactionId(String masterpassTransactionId) { */ public AdditionalDataWallets paymentToken(String paymentToken) { this.paymentToken = paymentToken; + isSetPaymentToken = true; // mark as set return this; } @@ -145,6 +176,7 @@ public String getPaymentToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentToken(String paymentToken) { this.paymentToken = paymentToken; + isSetPaymentToken = true; // mark as set } /** @@ -155,6 +187,7 @@ public void setPaymentToken(String paymentToken) { */ public AdditionalDataWallets paywithgoogleToken(String paywithgoogleToken) { this.paywithgoogleToken = paywithgoogleToken; + isSetPaywithgoogleToken = true; // mark as set return this; } @@ -178,6 +211,7 @@ public String getPaywithgoogleToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaywithgoogleToken(String paywithgoogleToken) { this.paywithgoogleToken = paywithgoogleToken; + isSetPaywithgoogleToken = true; // mark as set } /** @@ -188,6 +222,7 @@ public void setPaywithgoogleToken(String paywithgoogleToken) { */ public AdditionalDataWallets samsungpayToken(String samsungpayToken) { this.samsungpayToken = samsungpayToken; + isSetSamsungpayToken = true; // mark as set return this; } @@ -211,6 +246,7 @@ public String getSamsungpayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSamsungpayToken(String samsungpayToken) { this.samsungpayToken = samsungpayToken; + isSetSamsungpayToken = true; // mark as set } /** @@ -221,6 +257,7 @@ public void setSamsungpayToken(String samsungpayToken) { */ public AdditionalDataWallets visacheckoutCallId(String visacheckoutCallId) { this.visacheckoutCallId = visacheckoutCallId; + isSetVisacheckoutCallId = true; // mark as set return this; } @@ -244,6 +281,27 @@ public String getVisacheckoutCallId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVisacheckoutCallId(String visacheckoutCallId) { this.visacheckoutCallId = visacheckoutCallId; + isSetVisacheckoutCallId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataWallets 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 AdditionalDataWallets object is equal to o. */ @@ -257,23 +315,38 @@ public boolean equals(Object o) { } AdditionalDataWallets additionalDataWallets = (AdditionalDataWallets) o; return Objects.equals(this.androidpayToken, additionalDataWallets.androidpayToken) + && Objects.equals(this.isSetAndroidpayToken, additionalDataWallets.isSetAndroidpayToken) && Objects.equals( this.masterpassTransactionId, additionalDataWallets.masterpassTransactionId) + && Objects.equals( + this.isSetMasterpassTransactionId, additionalDataWallets.isSetMasterpassTransactionId) && Objects.equals(this.paymentToken, additionalDataWallets.paymentToken) + && Objects.equals(this.isSetPaymentToken, additionalDataWallets.isSetPaymentToken) && Objects.equals(this.paywithgoogleToken, additionalDataWallets.paywithgoogleToken) + && Objects.equals( + this.isSetPaywithgoogleToken, additionalDataWallets.isSetPaywithgoogleToken) && Objects.equals(this.samsungpayToken, additionalDataWallets.samsungpayToken) - && Objects.equals(this.visacheckoutCallId, additionalDataWallets.visacheckoutCallId); + && Objects.equals(this.isSetSamsungpayToken, additionalDataWallets.isSetSamsungpayToken) + && Objects.equals(this.visacheckoutCallId, additionalDataWallets.visacheckoutCallId) + && Objects.equals( + this.isSetVisacheckoutCallId, additionalDataWallets.isSetVisacheckoutCallId); } @Override public int hashCode() { return Objects.hash( androidpayToken, + isSetAndroidpayToken, masterpassTransactionId, + isSetMasterpassTransactionId, paymentToken, + isSetPaymentToken, paywithgoogleToken, + isSetPaywithgoogleToken, samsungpayToken, - visacheckoutCallId); + isSetSamsungpayToken, + visacheckoutCallId, + isSetVisacheckoutCallId); } @Override @@ -302,6 +375,45 @@ 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 (isSetAndroidpayToken) { + addIfNull(nulls, JSON_PROPERTY_ANDROIDPAY_TOKEN, this.androidpayToken); + } + if (isSetMasterpassTransactionId) { + addIfNull(nulls, JSON_PROPERTY_MASTERPASS_TRANSACTION_ID, this.masterpassTransactionId); + } + if (isSetPaymentToken) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_TOKEN, this.paymentToken); + } + if (isSetPaywithgoogleToken) { + addIfNull(nulls, JSON_PROPERTY_PAYWITHGOOGLE_TOKEN, this.paywithgoogleToken); + } + if (isSetSamsungpayToken) { + addIfNull(nulls, JSON_PROPERTY_SAMSUNGPAY_TOKEN, this.samsungpayToken); + } + if (isSetVisacheckoutCallId) { + addIfNull(nulls, JSON_PROPERTY_VISACHECKOUT_CALL_ID, this.visacheckoutCallId); + } + + 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 AdditionalDataWallets given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/Address.java b/src/main/java/com/adyen/model/payment/Address.java index 3bbf60562..14113eb5f 100644 --- a/src/main/java/com/adyen/model/payment/Address.java +++ b/src/main/java/com/adyen/model/payment/Address.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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,21 +32,45 @@ public class Address { public static final String JSON_PROPERTY_CITY = "city"; private String city; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_HOUSE_NUMBER_OR_NAME = "houseNumberOrName"; private String houseNumberOrName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHouseNumberOrName = false; + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; private String postalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + public static final String JSON_PROPERTY_STATE_OR_PROVINCE = "stateOrProvince"; private String stateOrProvince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStateOrProvince = false; + public static final String JSON_PROPERTY_STREET = "street"; private String street; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStreet = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Address() {} /** @@ -55,6 +81,7 @@ public Address() {} */ public Address city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -78,6 +105,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -92,6 +120,7 @@ public void setCity(String city) { */ public Address country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -123,6 +152,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -133,6 +163,7 @@ public void setCountry(String country) { */ public Address houseNumberOrName(String houseNumberOrName) { this.houseNumberOrName = houseNumberOrName; + isSetHouseNumberOrName = true; // mark as set return this; } @@ -156,6 +187,7 @@ public String getHouseNumberOrName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHouseNumberOrName(String houseNumberOrName) { this.houseNumberOrName = houseNumberOrName; + isSetHouseNumberOrName = true; // mark as set } /** @@ -168,6 +200,7 @@ public void setHouseNumberOrName(String houseNumberOrName) { */ public Address postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -195,6 +228,7 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set } /** @@ -207,6 +241,7 @@ public void setPostalCode(String postalCode) { */ public Address stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set return this; } @@ -234,6 +269,7 @@ public String getStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set } /** @@ -247,6 +283,7 @@ public void setStateOrProvince(String stateOrProvince) { */ public Address street(String street) { this.street = street; + isSetStreet = true; // mark as set return this; } @@ -276,6 +313,27 @@ public String getStreet() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStreet(String street) { this.street = street; + isSetStreet = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Address 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 Address object is equal to o. */ @@ -289,16 +347,34 @@ public boolean equals(Object o) { } Address address = (Address) o; return Objects.equals(this.city, address.city) + && Objects.equals(this.isSetCity, address.isSetCity) && Objects.equals(this.country, address.country) + && Objects.equals(this.isSetCountry, address.isSetCountry) && Objects.equals(this.houseNumberOrName, address.houseNumberOrName) + && Objects.equals(this.isSetHouseNumberOrName, address.isSetHouseNumberOrName) && Objects.equals(this.postalCode, address.postalCode) + && Objects.equals(this.isSetPostalCode, address.isSetPostalCode) && Objects.equals(this.stateOrProvince, address.stateOrProvince) - && Objects.equals(this.street, address.street); + && Objects.equals(this.isSetStateOrProvince, address.isSetStateOrProvince) + && Objects.equals(this.street, address.street) + && Objects.equals(this.isSetStreet, address.isSetStreet); } @Override public int hashCode() { - return Objects.hash(city, country, houseNumberOrName, postalCode, stateOrProvince, street); + return Objects.hash( + city, + isSetCity, + country, + isSetCountry, + houseNumberOrName, + isSetHouseNumberOrName, + postalCode, + isSetPostalCode, + stateOrProvince, + isSetStateOrProvince, + street, + isSetStreet); } @Override @@ -325,6 +401,45 @@ 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 (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetHouseNumberOrName) { + addIfNull(nulls, JSON_PROPERTY_HOUSE_NUMBER_OR_NAME, this.houseNumberOrName); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + if (isSetStateOrProvince) { + addIfNull(nulls, JSON_PROPERTY_STATE_OR_PROVINCE, this.stateOrProvince); + } + if (isSetStreet) { + addIfNull(nulls, JSON_PROPERTY_STREET, this.street); + } + + 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 Address given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AdjustAuthorisationRequest.java b/src/main/java/com/adyen/model/payment/AdjustAuthorisationRequest.java index 3675c8279..151e87c2f 100644 --- a/src/main/java/com/adyen/model/payment/AdjustAuthorisationRequest.java +++ b/src/main/java/com/adyen/model/payment/AdjustAuthorisationRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -39,37 +41,76 @@ public class AdjustAuthorisationRequest { public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_MODIFICATION_AMOUNT = "modificationAmount"; private Amount modificationAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationAmount = false; + public static final String JSON_PROPERTY_MPI_DATA = "mpiData"; private ThreeDSecureData mpiData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMpiData = false; + public static final String JSON_PROPERTY_ORIGINAL_MERCHANT_REFERENCE = "originalMerchantReference"; private String originalMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalMerchantReference = false; + public static final String JSON_PROPERTY_ORIGINAL_REFERENCE = "originalReference"; private String originalReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalReference = false; + public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; private PlatformChargebackLogic platformChargebackLogic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformChargebackLogic = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + public static final String JSON_PROPERTY_TENDER_REFERENCE = "tenderReference"; private String tenderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTenderReference = false; + public static final String JSON_PROPERTY_UNIQUE_TERMINAL_ID = "uniqueTerminalId"; private String uniqueTerminalId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUniqueTerminalId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdjustAuthorisationRequest() {} /** @@ -84,6 +125,7 @@ public AdjustAuthorisationRequest() {} */ public AdjustAuthorisationRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -123,6 +165,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -133,6 +176,7 @@ public void setAdditionalData(Map additionalData) { */ public AdjustAuthorisationRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -156,6 +200,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -166,6 +211,7 @@ public void setMerchantAccount(String merchantAccount) { */ public AdjustAuthorisationRequest modificationAmount(Amount modificationAmount) { this.modificationAmount = modificationAmount; + isSetModificationAmount = true; // mark as set return this; } @@ -189,6 +235,7 @@ public Amount getModificationAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationAmount(Amount modificationAmount) { this.modificationAmount = modificationAmount; + isSetModificationAmount = true; // mark as set } /** @@ -199,6 +246,7 @@ public void setModificationAmount(Amount modificationAmount) { */ public AdjustAuthorisationRequest mpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set return this; } @@ -222,6 +270,7 @@ public ThreeDSecureData getMpiData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set } /** @@ -232,6 +281,7 @@ public void setMpiData(ThreeDSecureData mpiData) { */ public AdjustAuthorisationRequest originalMerchantReference(String originalMerchantReference) { this.originalMerchantReference = originalMerchantReference; + isSetOriginalMerchantReference = true; // mark as set return this; } @@ -255,6 +305,7 @@ public String getOriginalMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalMerchantReference(String originalMerchantReference) { this.originalMerchantReference = originalMerchantReference; + isSetOriginalMerchantReference = true; // mark as set } /** @@ -267,6 +318,7 @@ public void setOriginalMerchantReference(String originalMerchantReference) { */ public AdjustAuthorisationRequest originalReference(String originalReference) { this.originalReference = originalReference; + isSetOriginalReference = true; // mark as set return this; } @@ -294,6 +346,7 @@ public String getOriginalReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalReference(String originalReference) { this.originalReference = originalReference; + isSetOriginalReference = true; // mark as set } /** @@ -305,6 +358,7 @@ public void setOriginalReference(String originalReference) { public AdjustAuthorisationRequest platformChargebackLogic( PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -328,6 +382,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -340,6 +395,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public AdjustAuthorisationRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -367,6 +423,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -381,6 +438,7 @@ public void setReference(String reference) { */ public AdjustAuthorisationRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -420,6 +478,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -431,6 +490,7 @@ public void setSplits(List splits) { */ public AdjustAuthorisationRequest tenderReference(String tenderReference) { this.tenderReference = tenderReference; + isSetTenderReference = true; // mark as set return this; } @@ -456,6 +516,7 @@ public String getTenderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTenderReference(String tenderReference) { this.tenderReference = tenderReference; + isSetTenderReference = true; // mark as set } /** @@ -468,6 +529,7 @@ public void setTenderReference(String tenderReference) { */ public AdjustAuthorisationRequest uniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set return this; } @@ -495,6 +557,27 @@ public String getUniqueTerminalId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdjustAuthorisationRequest 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 AdjustAuthorisationRequest object is equal to o. */ @@ -508,34 +591,65 @@ public boolean equals(Object o) { } AdjustAuthorisationRequest adjustAuthorisationRequest = (AdjustAuthorisationRequest) o; return Objects.equals(this.additionalData, adjustAuthorisationRequest.additionalData) + && Objects.equals(this.isSetAdditionalData, adjustAuthorisationRequest.isSetAdditionalData) && Objects.equals(this.merchantAccount, adjustAuthorisationRequest.merchantAccount) + && Objects.equals( + this.isSetMerchantAccount, adjustAuthorisationRequest.isSetMerchantAccount) && Objects.equals(this.modificationAmount, adjustAuthorisationRequest.modificationAmount) + && Objects.equals( + this.isSetModificationAmount, adjustAuthorisationRequest.isSetModificationAmount) && Objects.equals(this.mpiData, adjustAuthorisationRequest.mpiData) + && Objects.equals(this.isSetMpiData, adjustAuthorisationRequest.isSetMpiData) && Objects.equals( this.originalMerchantReference, adjustAuthorisationRequest.originalMerchantReference) + && Objects.equals( + this.isSetOriginalMerchantReference, + adjustAuthorisationRequest.isSetOriginalMerchantReference) && Objects.equals(this.originalReference, adjustAuthorisationRequest.originalReference) + && Objects.equals( + this.isSetOriginalReference, adjustAuthorisationRequest.isSetOriginalReference) && Objects.equals( this.platformChargebackLogic, adjustAuthorisationRequest.platformChargebackLogic) + && Objects.equals( + this.isSetPlatformChargebackLogic, + adjustAuthorisationRequest.isSetPlatformChargebackLogic) && Objects.equals(this.reference, adjustAuthorisationRequest.reference) + && Objects.equals(this.isSetReference, adjustAuthorisationRequest.isSetReference) && Objects.equals(this.splits, adjustAuthorisationRequest.splits) + && Objects.equals(this.isSetSplits, adjustAuthorisationRequest.isSetSplits) && Objects.equals(this.tenderReference, adjustAuthorisationRequest.tenderReference) - && Objects.equals(this.uniqueTerminalId, adjustAuthorisationRequest.uniqueTerminalId); + && Objects.equals( + this.isSetTenderReference, adjustAuthorisationRequest.isSetTenderReference) + && Objects.equals(this.uniqueTerminalId, adjustAuthorisationRequest.uniqueTerminalId) + && Objects.equals( + this.isSetUniqueTerminalId, adjustAuthorisationRequest.isSetUniqueTerminalId); } @Override public int hashCode() { return Objects.hash( additionalData, + isSetAdditionalData, merchantAccount, + isSetMerchantAccount, modificationAmount, + isSetModificationAmount, mpiData, + isSetMpiData, originalMerchantReference, + isSetOriginalMerchantReference, originalReference, + isSetOriginalReference, platformChargebackLogic, + isSetPlatformChargebackLogic, reference, + isSetReference, splits, + isSetSplits, tenderReference, - uniqueTerminalId); + isSetTenderReference, + uniqueTerminalId, + isSetUniqueTerminalId); } @Override @@ -571,6 +685,60 @@ 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 (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetModificationAmount) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_AMOUNT, this.modificationAmount); + } + if (isSetMpiData) { + addIfNull(nulls, JSON_PROPERTY_MPI_DATA, this.mpiData); + } + if (isSetOriginalMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_MERCHANT_REFERENCE, this.originalMerchantReference); + } + if (isSetOriginalReference) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_REFERENCE, this.originalReference); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetTenderReference) { + addIfNull(nulls, JSON_PROPERTY_TENDER_REFERENCE, this.tenderReference); + } + if (isSetUniqueTerminalId) { + addIfNull(nulls, JSON_PROPERTY_UNIQUE_TERMINAL_ID, this.uniqueTerminalId); + } + + 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 AdjustAuthorisationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/Amount.java b/src/main/java/com/adyen/model/payment/Amount.java index 2c26f1286..043e64318 100644 --- a/src/main/java/com/adyen/model/payment/Amount.java +++ b/src/main/java/com/adyen/model/payment/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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,30 +25,47 @@ 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). + * 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). + * 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). + * 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). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -56,35 +75,39 @@ public String getCurrency() { /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * 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). + * 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 amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @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 amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @return value The amount of the transaction, in [minor + * @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) @@ -94,16 +117,37 @@ public Long getValue() { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @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. */ @@ -117,12 +161,14 @@ public boolean equals(Object o) { } Amount amount = (Amount) o; return Objects.equals(this.currency, amount.currency) - && Objects.equals(this.value, amount.value); + && Objects.equals(this.isSetCurrency, amount.isSetCurrency) + && Objects.equals(this.value, amount.value) + && Objects.equals(this.isSetValue, amount.isSetValue); } @Override public int hashCode() { - return Objects.hash(currency, value); + return Objects.hash(currency, isSetCurrency, value, isSetValue); } @Override @@ -145,6 +191,33 @@ 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/payment/ApplicationInfo.java b/src/main/java/com/adyen/model/payment/ApplicationInfo.java index 17fa4cd7f..00005981d 100644 --- a/src/main/java/com/adyen/model/payment/ApplicationInfo.java +++ b/src/main/java/com/adyen/model/payment/ApplicationInfo.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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,21 +32,45 @@ public class ApplicationInfo { public static final String JSON_PROPERTY_ADYEN_LIBRARY = "adyenLibrary"; private CommonField adyenLibrary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdyenLibrary = false; + public static final String JSON_PROPERTY_ADYEN_PAYMENT_SOURCE = "adyenPaymentSource"; private CommonField adyenPaymentSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdyenPaymentSource = false; + public static final String JSON_PROPERTY_EXTERNAL_PLATFORM = "externalPlatform"; private ExternalPlatform externalPlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExternalPlatform = false; + public static final String JSON_PROPERTY_MERCHANT_APPLICATION = "merchantApplication"; private CommonField merchantApplication; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantApplication = false; + public static final String JSON_PROPERTY_MERCHANT_DEVICE = "merchantDevice"; private MerchantDevice merchantDevice; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantDevice = false; + public static final String JSON_PROPERTY_SHOPPER_INTERACTION_DEVICE = "shopperInteractionDevice"; private ShopperInteractionDevice shopperInteractionDevice; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperInteractionDevice = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ApplicationInfo() {} /** @@ -55,6 +81,7 @@ public ApplicationInfo() {} */ public ApplicationInfo adyenLibrary(CommonField adyenLibrary) { this.adyenLibrary = adyenLibrary; + isSetAdyenLibrary = true; // mark as set return this; } @@ -78,6 +105,7 @@ public CommonField getAdyenLibrary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdyenLibrary(CommonField adyenLibrary) { this.adyenLibrary = adyenLibrary; + isSetAdyenLibrary = true; // mark as set } /** @@ -88,6 +116,7 @@ public void setAdyenLibrary(CommonField adyenLibrary) { */ public ApplicationInfo adyenPaymentSource(CommonField adyenPaymentSource) { this.adyenPaymentSource = adyenPaymentSource; + isSetAdyenPaymentSource = true; // mark as set return this; } @@ -111,6 +140,7 @@ public CommonField getAdyenPaymentSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdyenPaymentSource(CommonField adyenPaymentSource) { this.adyenPaymentSource = adyenPaymentSource; + isSetAdyenPaymentSource = true; // mark as set } /** @@ -121,6 +151,7 @@ public void setAdyenPaymentSource(CommonField adyenPaymentSource) { */ public ApplicationInfo externalPlatform(ExternalPlatform externalPlatform) { this.externalPlatform = externalPlatform; + isSetExternalPlatform = true; // mark as set return this; } @@ -144,6 +175,7 @@ public ExternalPlatform getExternalPlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExternalPlatform(ExternalPlatform externalPlatform) { this.externalPlatform = externalPlatform; + isSetExternalPlatform = true; // mark as set } /** @@ -154,6 +186,7 @@ public void setExternalPlatform(ExternalPlatform externalPlatform) { */ public ApplicationInfo merchantApplication(CommonField merchantApplication) { this.merchantApplication = merchantApplication; + isSetMerchantApplication = true; // mark as set return this; } @@ -177,6 +210,7 @@ public CommonField getMerchantApplication() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantApplication(CommonField merchantApplication) { this.merchantApplication = merchantApplication; + isSetMerchantApplication = true; // mark as set } /** @@ -187,6 +221,7 @@ public void setMerchantApplication(CommonField merchantApplication) { */ public ApplicationInfo merchantDevice(MerchantDevice merchantDevice) { this.merchantDevice = merchantDevice; + isSetMerchantDevice = true; // mark as set return this; } @@ -210,6 +245,7 @@ public MerchantDevice getMerchantDevice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantDevice(MerchantDevice merchantDevice) { this.merchantDevice = merchantDevice; + isSetMerchantDevice = true; // mark as set } /** @@ -221,6 +257,7 @@ public void setMerchantDevice(MerchantDevice merchantDevice) { public ApplicationInfo shopperInteractionDevice( ShopperInteractionDevice shopperInteractionDevice) { this.shopperInteractionDevice = shopperInteractionDevice; + isSetShopperInteractionDevice = true; // mark as set return this; } @@ -244,6 +281,27 @@ public ShopperInteractionDevice getShopperInteractionDevice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteractionDevice(ShopperInteractionDevice shopperInteractionDevice) { this.shopperInteractionDevice = shopperInteractionDevice; + isSetShopperInteractionDevice = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ApplicationInfo 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 ApplicationInfo object is equal to o. */ @@ -257,22 +315,35 @@ public boolean equals(Object o) { } ApplicationInfo applicationInfo = (ApplicationInfo) o; return Objects.equals(this.adyenLibrary, applicationInfo.adyenLibrary) + && Objects.equals(this.isSetAdyenLibrary, applicationInfo.isSetAdyenLibrary) && Objects.equals(this.adyenPaymentSource, applicationInfo.adyenPaymentSource) + && Objects.equals(this.isSetAdyenPaymentSource, applicationInfo.isSetAdyenPaymentSource) && Objects.equals(this.externalPlatform, applicationInfo.externalPlatform) + && Objects.equals(this.isSetExternalPlatform, applicationInfo.isSetExternalPlatform) && Objects.equals(this.merchantApplication, applicationInfo.merchantApplication) + && Objects.equals(this.isSetMerchantApplication, applicationInfo.isSetMerchantApplication) && Objects.equals(this.merchantDevice, applicationInfo.merchantDevice) - && Objects.equals(this.shopperInteractionDevice, applicationInfo.shopperInteractionDevice); + && Objects.equals(this.isSetMerchantDevice, applicationInfo.isSetMerchantDevice) + && Objects.equals(this.shopperInteractionDevice, applicationInfo.shopperInteractionDevice) + && Objects.equals( + this.isSetShopperInteractionDevice, applicationInfo.isSetShopperInteractionDevice); } @Override public int hashCode() { return Objects.hash( adyenLibrary, + isSetAdyenLibrary, adyenPaymentSource, + isSetAdyenPaymentSource, externalPlatform, + isSetExternalPlatform, merchantApplication, + isSetMerchantApplication, merchantDevice, - shopperInteractionDevice); + isSetMerchantDevice, + shopperInteractionDevice, + isSetShopperInteractionDevice); } @Override @@ -303,6 +374,45 @@ 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 (isSetAdyenLibrary) { + addIfNull(nulls, JSON_PROPERTY_ADYEN_LIBRARY, this.adyenLibrary); + } + if (isSetAdyenPaymentSource) { + addIfNull(nulls, JSON_PROPERTY_ADYEN_PAYMENT_SOURCE, this.adyenPaymentSource); + } + if (isSetExternalPlatform) { + addIfNull(nulls, JSON_PROPERTY_EXTERNAL_PLATFORM, this.externalPlatform); + } + if (isSetMerchantApplication) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_APPLICATION, this.merchantApplication); + } + if (isSetMerchantDevice) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_DEVICE, this.merchantDevice); + } + if (isSetShopperInteractionDevice) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION_DEVICE, this.shopperInteractionDevice); + } + + 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 ApplicationInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AuthenticationResultRequest.java b/src/main/java/com/adyen/model/payment/AuthenticationResultRequest.java index 75c8d5179..0978af286 100644 --- a/src/main/java/com/adyen/model/payment/AuthenticationResultRequest.java +++ b/src/main/java/com/adyen/model/payment/AuthenticationResultRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -26,9 +28,21 @@ public class AuthenticationResultRequest { public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AuthenticationResultRequest() {} /** @@ -40,6 +54,7 @@ public AuthenticationResultRequest() {} */ public AuthenticationResultRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -65,6 +80,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -75,6 +91,7 @@ public void setMerchantAccount(String merchantAccount) { */ public AuthenticationResultRequest pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -98,6 +115,27 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AuthenticationResultRequest 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 AuthenticationResultRequest object is equal to o. */ @@ -111,12 +149,15 @@ public boolean equals(Object o) { } AuthenticationResultRequest authenticationResultRequest = (AuthenticationResultRequest) o; return Objects.equals(this.merchantAccount, authenticationResultRequest.merchantAccount) - && Objects.equals(this.pspReference, authenticationResultRequest.pspReference); + && Objects.equals( + this.isSetMerchantAccount, authenticationResultRequest.isSetMerchantAccount) + && Objects.equals(this.pspReference, authenticationResultRequest.pspReference) + && Objects.equals(this.isSetPspReference, authenticationResultRequest.isSetPspReference); } @Override public int hashCode() { - return Objects.hash(merchantAccount, pspReference); + return Objects.hash(merchantAccount, isSetMerchantAccount, pspReference, isSetPspReference); } @Override @@ -139,6 +180,33 @@ 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 (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + + 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 AuthenticationResultRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AuthenticationResultResponse.java b/src/main/java/com/adyen/model/payment/AuthenticationResultResponse.java index 485e49190..e54c19816 100644 --- a/src/main/java/com/adyen/model/payment/AuthenticationResultResponse.java +++ b/src/main/java/com/adyen/model/payment/AuthenticationResultResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -26,9 +28,21 @@ public class AuthenticationResultResponse { public static final String JSON_PROPERTY_THREE_D_S1_RESULT = "threeDS1Result"; private ThreeDS1Result threeDS1Result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS1Result = false; + public static final String JSON_PROPERTY_THREE_D_S2_RESULT = "threeDS2Result"; private ThreeDS2Result threeDS2Result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2Result = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AuthenticationResultResponse() {} /** @@ -39,6 +53,7 @@ public AuthenticationResultResponse() {} */ public AuthenticationResultResponse threeDS1Result(ThreeDS1Result threeDS1Result) { this.threeDS1Result = threeDS1Result; + isSetThreeDS1Result = true; // mark as set return this; } @@ -62,6 +77,7 @@ public ThreeDS1Result getThreeDS1Result() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS1Result(ThreeDS1Result threeDS1Result) { this.threeDS1Result = threeDS1Result; + isSetThreeDS1Result = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setThreeDS1Result(ThreeDS1Result threeDS1Result) { */ public AuthenticationResultResponse threeDS2Result(ThreeDS2Result threeDS2Result) { this.threeDS2Result = threeDS2Result; + isSetThreeDS2Result = true; // mark as set return this; } @@ -95,6 +112,27 @@ public ThreeDS2Result getThreeDS2Result() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2Result(ThreeDS2Result threeDS2Result) { this.threeDS2Result = threeDS2Result; + isSetThreeDS2Result = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AuthenticationResultResponse 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 AuthenticationResultResponse object is equal to o. */ @@ -108,12 +146,16 @@ public boolean equals(Object o) { } AuthenticationResultResponse authenticationResultResponse = (AuthenticationResultResponse) o; return Objects.equals(this.threeDS1Result, authenticationResultResponse.threeDS1Result) - && Objects.equals(this.threeDS2Result, authenticationResultResponse.threeDS2Result); + && Objects.equals( + this.isSetThreeDS1Result, authenticationResultResponse.isSetThreeDS1Result) + && Objects.equals(this.threeDS2Result, authenticationResultResponse.threeDS2Result) + && Objects.equals( + this.isSetThreeDS2Result, authenticationResultResponse.isSetThreeDS2Result); } @Override public int hashCode() { - return Objects.hash(threeDS1Result, threeDS2Result); + return Objects.hash(threeDS1Result, isSetThreeDS1Result, threeDS2Result, isSetThreeDS2Result); } @Override @@ -136,6 +178,33 @@ 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 (isSetThreeDS1Result) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S1_RESULT, this.threeDS1Result); + } + if (isSetThreeDS2Result) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_RESULT, this.threeDS2Result); + } + + 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 AuthenticationResultResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/BankAccount.java b/src/main/java/com/adyen/model/payment/BankAccount.java index eec81c39a..31f66d3b7 100644 --- a/src/main/java/com/adyen/model/payment/BankAccount.java +++ b/src/main/java/com/adyen/model/payment/BankAccount.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -33,30 +35,63 @@ public class BankAccount { public static final String JSON_PROPERTY_BANK_ACCOUNT_NUMBER = "bankAccountNumber"; private String bankAccountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CITY = "bankCity"; private String bankCity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCity = false; + public static final String JSON_PROPERTY_BANK_LOCATION_ID = "bankLocationId"; private String bankLocationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankLocationId = false; + public static final String JSON_PROPERTY_BANK_NAME = "bankName"; private String bankName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankName = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + public static final String JSON_PROPERTY_COUNTRY_CODE = "countryCode"; private String countryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryCode = false; + public static final String JSON_PROPERTY_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + public static final String JSON_PROPERTY_OWNER_NAME = "ownerName"; private String ownerName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOwnerName = false; + public static final String JSON_PROPERTY_TAX_ID = "taxId"; private String taxId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BankAccount() {} /** @@ -67,6 +102,7 @@ public BankAccount() {} */ public BankAccount bankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set return this; } @@ -90,6 +126,7 @@ public String getBankAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set } /** @@ -100,6 +137,7 @@ public void setBankAccountNumber(String bankAccountNumber) { */ public BankAccount bankCity(String bankCity) { this.bankCity = bankCity; + isSetBankCity = true; // mark as set return this; } @@ -123,6 +161,7 @@ public String getBankCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCity(String bankCity) { this.bankCity = bankCity; + isSetBankCity = true; // mark as set } /** @@ -134,6 +173,7 @@ public void setBankCity(String bankCity) { */ public BankAccount bankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set return this; } @@ -159,6 +199,7 @@ public String getBankLocationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set } /** @@ -169,6 +210,7 @@ public void setBankLocationId(String bankLocationId) { */ public BankAccount bankName(String bankName) { this.bankName = bankName; + isSetBankName = true; // mark as set return this; } @@ -192,6 +234,7 @@ public String getBankName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankName(String bankName) { this.bankName = bankName; + isSetBankName = true; // mark as set } /** @@ -204,6 +247,7 @@ public void setBankName(String bankName) { */ public BankAccount bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -231,6 +275,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -243,6 +288,7 @@ public void setBic(String bic) { */ public BankAccount countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -270,6 +316,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -282,6 +329,7 @@ public void setCountryCode(String countryCode) { */ public BankAccount iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -309,6 +357,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -335,6 +384,7 @@ public void setIban(String iban) { */ public BankAccount ownerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set return this; } @@ -390,6 +440,7 @@ public String getOwnerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwnerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set } /** @@ -400,6 +451,7 @@ public void setOwnerName(String ownerName) { */ public BankAccount taxId(String taxId) { this.taxId = taxId; + isSetTaxId = true; // mark as set return this; } @@ -423,6 +475,27 @@ public String getTaxId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxId(String taxId) { this.taxId = taxId; + isSetTaxId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankAccount 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 BankAccount object is equal to o. */ @@ -436,28 +509,46 @@ public boolean equals(Object o) { } BankAccount bankAccount = (BankAccount) o; return Objects.equals(this.bankAccountNumber, bankAccount.bankAccountNumber) + && Objects.equals(this.isSetBankAccountNumber, bankAccount.isSetBankAccountNumber) && Objects.equals(this.bankCity, bankAccount.bankCity) + && Objects.equals(this.isSetBankCity, bankAccount.isSetBankCity) && Objects.equals(this.bankLocationId, bankAccount.bankLocationId) + && Objects.equals(this.isSetBankLocationId, bankAccount.isSetBankLocationId) && Objects.equals(this.bankName, bankAccount.bankName) + && Objects.equals(this.isSetBankName, bankAccount.isSetBankName) && Objects.equals(this.bic, bankAccount.bic) + && Objects.equals(this.isSetBic, bankAccount.isSetBic) && Objects.equals(this.countryCode, bankAccount.countryCode) + && Objects.equals(this.isSetCountryCode, bankAccount.isSetCountryCode) && Objects.equals(this.iban, bankAccount.iban) + && Objects.equals(this.isSetIban, bankAccount.isSetIban) && Objects.equals(this.ownerName, bankAccount.ownerName) - && Objects.equals(this.taxId, bankAccount.taxId); + && Objects.equals(this.isSetOwnerName, bankAccount.isSetOwnerName) + && Objects.equals(this.taxId, bankAccount.taxId) + && Objects.equals(this.isSetTaxId, bankAccount.isSetTaxId); } @Override public int hashCode() { return Objects.hash( bankAccountNumber, + isSetBankAccountNumber, bankCity, + isSetBankCity, bankLocationId, + isSetBankLocationId, bankName, + isSetBankName, bic, + isSetBic, countryCode, + isSetCountryCode, iban, + isSetIban, ownerName, - taxId); + isSetOwnerName, + taxId, + isSetTaxId); } @Override @@ -487,6 +578,54 @@ 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 (isSetBankAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT_NUMBER, this.bankAccountNumber); + } + if (isSetBankCity) { + addIfNull(nulls, JSON_PROPERTY_BANK_CITY, this.bankCity); + } + if (isSetBankLocationId) { + addIfNull(nulls, JSON_PROPERTY_BANK_LOCATION_ID, this.bankLocationId); + } + if (isSetBankName) { + addIfNull(nulls, JSON_PROPERTY_BANK_NAME, this.bankName); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetOwnerName) { + addIfNull(nulls, JSON_PROPERTY_OWNER_NAME, this.ownerName); + } + if (isSetTaxId) { + addIfNull(nulls, JSON_PROPERTY_TAX_ID, this.taxId); + } + + 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 BankAccount given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/BrowserInfo.java b/src/main/java/com/adyen/model/payment/BrowserInfo.java index dc1912f00..c06d2fa07 100644 --- a/src/main/java/com/adyen/model/payment/BrowserInfo.java +++ b/src/main/java/com/adyen/model/payment/BrowserInfo.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -33,30 +35,63 @@ public class BrowserInfo { public static final String JSON_PROPERTY_ACCEPT_HEADER = "acceptHeader"; private String acceptHeader; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcceptHeader = false; + public static final String JSON_PROPERTY_COLOR_DEPTH = "colorDepth"; private Integer colorDepth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetColorDepth = false; + public static final String JSON_PROPERTY_JAVA_ENABLED = "javaEnabled"; private Boolean javaEnabled; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetJavaEnabled = false; + public static final String JSON_PROPERTY_JAVA_SCRIPT_ENABLED = "javaScriptEnabled"; private Boolean javaScriptEnabled; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetJavaScriptEnabled = false; + public static final String JSON_PROPERTY_LANGUAGE = "language"; private String language; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLanguage = false; + public static final String JSON_PROPERTY_SCREEN_HEIGHT = "screenHeight"; private Integer screenHeight; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScreenHeight = false; + public static final String JSON_PROPERTY_SCREEN_WIDTH = "screenWidth"; private Integer screenWidth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScreenWidth = false; + public static final String JSON_PROPERTY_TIME_ZONE_OFFSET = "timeZoneOffset"; private Integer timeZoneOffset; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZoneOffset = false; + public static final String JSON_PROPERTY_USER_AGENT = "userAgent"; private String userAgent; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUserAgent = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BrowserInfo() {} /** @@ -67,6 +102,7 @@ public BrowserInfo() {} */ public BrowserInfo acceptHeader(String acceptHeader) { this.acceptHeader = acceptHeader; + isSetAcceptHeader = true; // mark as set return this; } @@ -90,6 +126,7 @@ public String getAcceptHeader() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcceptHeader(String acceptHeader) { this.acceptHeader = acceptHeader; + isSetAcceptHeader = true; // mark as set } /** @@ -104,6 +141,7 @@ public void setAcceptHeader(String acceptHeader) { */ public BrowserInfo colorDepth(Integer colorDepth) { this.colorDepth = colorDepth; + isSetColorDepth = true; // mark as set return this; } @@ -135,6 +173,7 @@ public Integer getColorDepth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setColorDepth(Integer colorDepth) { this.colorDepth = colorDepth; + isSetColorDepth = true; // mark as set } /** @@ -146,6 +185,7 @@ public void setColorDepth(Integer colorDepth) { */ public BrowserInfo javaEnabled(Boolean javaEnabled) { this.javaEnabled = javaEnabled; + isSetJavaEnabled = true; // mark as set return this; } @@ -171,6 +211,7 @@ public Boolean getJavaEnabled() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setJavaEnabled(Boolean javaEnabled) { this.javaEnabled = javaEnabled; + isSetJavaEnabled = true; // mark as set } /** @@ -183,6 +224,7 @@ public void setJavaEnabled(Boolean javaEnabled) { */ public BrowserInfo javaScriptEnabled(Boolean javaScriptEnabled) { this.javaScriptEnabled = javaScriptEnabled; + isSetJavaScriptEnabled = true; // mark as set return this; } @@ -210,6 +252,7 @@ public Boolean getJavaScriptEnabled() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setJavaScriptEnabled(Boolean javaScriptEnabled) { this.javaScriptEnabled = javaScriptEnabled; + isSetJavaScriptEnabled = true; // mark as set } /** @@ -222,6 +265,7 @@ public void setJavaScriptEnabled(Boolean javaScriptEnabled) { */ public BrowserInfo language(String language) { this.language = language; + isSetLanguage = true; // mark as set return this; } @@ -249,6 +293,7 @@ public String getLanguage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLanguage(String language) { this.language = language; + isSetLanguage = true; // mark as set } /** @@ -259,6 +304,7 @@ public void setLanguage(String language) { */ public BrowserInfo screenHeight(Integer screenHeight) { this.screenHeight = screenHeight; + isSetScreenHeight = true; // mark as set return this; } @@ -282,6 +328,7 @@ public Integer getScreenHeight() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScreenHeight(Integer screenHeight) { this.screenHeight = screenHeight; + isSetScreenHeight = true; // mark as set } /** @@ -292,6 +339,7 @@ public void setScreenHeight(Integer screenHeight) { */ public BrowserInfo screenWidth(Integer screenWidth) { this.screenWidth = screenWidth; + isSetScreenWidth = true; // mark as set return this; } @@ -315,6 +363,7 @@ public Integer getScreenWidth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScreenWidth(Integer screenWidth) { this.screenWidth = screenWidth; + isSetScreenWidth = true; // mark as set } /** @@ -326,6 +375,7 @@ public void setScreenWidth(Integer screenWidth) { */ public BrowserInfo timeZoneOffset(Integer timeZoneOffset) { this.timeZoneOffset = timeZoneOffset; + isSetTimeZoneOffset = true; // mark as set return this; } @@ -351,6 +401,7 @@ public Integer getTimeZoneOffset() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZoneOffset(Integer timeZoneOffset) { this.timeZoneOffset = timeZoneOffset; + isSetTimeZoneOffset = true; // mark as set } /** @@ -361,6 +412,7 @@ public void setTimeZoneOffset(Integer timeZoneOffset) { */ public BrowserInfo userAgent(String userAgent) { this.userAgent = userAgent; + isSetUserAgent = true; // mark as set return this; } @@ -384,6 +436,27 @@ public String getUserAgent() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUserAgent(String userAgent) { this.userAgent = userAgent; + isSetUserAgent = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BrowserInfo 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 BrowserInfo object is equal to o. */ @@ -397,28 +470,46 @@ public boolean equals(Object o) { } BrowserInfo browserInfo = (BrowserInfo) o; return Objects.equals(this.acceptHeader, browserInfo.acceptHeader) + && Objects.equals(this.isSetAcceptHeader, browserInfo.isSetAcceptHeader) && Objects.equals(this.colorDepth, browserInfo.colorDepth) + && Objects.equals(this.isSetColorDepth, browserInfo.isSetColorDepth) && Objects.equals(this.javaEnabled, browserInfo.javaEnabled) + && Objects.equals(this.isSetJavaEnabled, browserInfo.isSetJavaEnabled) && Objects.equals(this.javaScriptEnabled, browserInfo.javaScriptEnabled) + && Objects.equals(this.isSetJavaScriptEnabled, browserInfo.isSetJavaScriptEnabled) && Objects.equals(this.language, browserInfo.language) + && Objects.equals(this.isSetLanguage, browserInfo.isSetLanguage) && Objects.equals(this.screenHeight, browserInfo.screenHeight) + && Objects.equals(this.isSetScreenHeight, browserInfo.isSetScreenHeight) && Objects.equals(this.screenWidth, browserInfo.screenWidth) + && Objects.equals(this.isSetScreenWidth, browserInfo.isSetScreenWidth) && Objects.equals(this.timeZoneOffset, browserInfo.timeZoneOffset) - && Objects.equals(this.userAgent, browserInfo.userAgent); + && Objects.equals(this.isSetTimeZoneOffset, browserInfo.isSetTimeZoneOffset) + && Objects.equals(this.userAgent, browserInfo.userAgent) + && Objects.equals(this.isSetUserAgent, browserInfo.isSetUserAgent); } @Override public int hashCode() { return Objects.hash( acceptHeader, + isSetAcceptHeader, colorDepth, + isSetColorDepth, javaEnabled, + isSetJavaEnabled, javaScriptEnabled, + isSetJavaScriptEnabled, language, + isSetLanguage, screenHeight, + isSetScreenHeight, screenWidth, + isSetScreenWidth, timeZoneOffset, - userAgent); + isSetTimeZoneOffset, + userAgent, + isSetUserAgent); } @Override @@ -448,6 +539,54 @@ 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 (isSetAcceptHeader) { + addIfNull(nulls, JSON_PROPERTY_ACCEPT_HEADER, this.acceptHeader); + } + if (isSetColorDepth) { + addIfNull(nulls, JSON_PROPERTY_COLOR_DEPTH, this.colorDepth); + } + if (isSetJavaEnabled) { + addIfNull(nulls, JSON_PROPERTY_JAVA_ENABLED, this.javaEnabled); + } + if (isSetJavaScriptEnabled) { + addIfNull(nulls, JSON_PROPERTY_JAVA_SCRIPT_ENABLED, this.javaScriptEnabled); + } + if (isSetLanguage) { + addIfNull(nulls, JSON_PROPERTY_LANGUAGE, this.language); + } + if (isSetScreenHeight) { + addIfNull(nulls, JSON_PROPERTY_SCREEN_HEIGHT, this.screenHeight); + } + if (isSetScreenWidth) { + addIfNull(nulls, JSON_PROPERTY_SCREEN_WIDTH, this.screenWidth); + } + if (isSetTimeZoneOffset) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE_OFFSET, this.timeZoneOffset); + } + if (isSetUserAgent) { + addIfNull(nulls, JSON_PROPERTY_USER_AGENT, this.userAgent); + } + + 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 BrowserInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/CancelOrRefundRequest.java b/src/main/java/com/adyen/model/payment/CancelOrRefundRequest.java index ee3dd3324..e13cbd3ac 100644 --- a/src/main/java/com/adyen/model/payment/CancelOrRefundRequest.java +++ b/src/main/java/com/adyen/model/payment/CancelOrRefundRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -35,31 +37,64 @@ public class CancelOrRefundRequest { public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_MPI_DATA = "mpiData"; private ThreeDSecureData mpiData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMpiData = false; + public static final String JSON_PROPERTY_ORIGINAL_MERCHANT_REFERENCE = "originalMerchantReference"; private String originalMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalMerchantReference = false; + public static final String JSON_PROPERTY_ORIGINAL_REFERENCE = "originalReference"; private String originalReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalReference = false; + public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; private PlatformChargebackLogic platformChargebackLogic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformChargebackLogic = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_TENDER_REFERENCE = "tenderReference"; private String tenderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTenderReference = false; + public static final String JSON_PROPERTY_UNIQUE_TERMINAL_ID = "uniqueTerminalId"; private String uniqueTerminalId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUniqueTerminalId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CancelOrRefundRequest() {} /** @@ -74,6 +109,7 @@ public CancelOrRefundRequest() {} */ public CancelOrRefundRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -113,6 +149,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -123,6 +160,7 @@ public void setAdditionalData(Map additionalData) { */ public CancelOrRefundRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -146,6 +184,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -156,6 +195,7 @@ public void setMerchantAccount(String merchantAccount) { */ public CancelOrRefundRequest mpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set return this; } @@ -179,6 +219,7 @@ public ThreeDSecureData getMpiData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set } /** @@ -189,6 +230,7 @@ public void setMpiData(ThreeDSecureData mpiData) { */ public CancelOrRefundRequest originalMerchantReference(String originalMerchantReference) { this.originalMerchantReference = originalMerchantReference; + isSetOriginalMerchantReference = true; // mark as set return this; } @@ -212,6 +254,7 @@ public String getOriginalMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalMerchantReference(String originalMerchantReference) { this.originalMerchantReference = originalMerchantReference; + isSetOriginalMerchantReference = true; // mark as set } /** @@ -224,6 +267,7 @@ public void setOriginalMerchantReference(String originalMerchantReference) { */ public CancelOrRefundRequest originalReference(String originalReference) { this.originalReference = originalReference; + isSetOriginalReference = true; // mark as set return this; } @@ -251,6 +295,7 @@ public String getOriginalReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalReference(String originalReference) { this.originalReference = originalReference; + isSetOriginalReference = true; // mark as set } /** @@ -262,6 +307,7 @@ public void setOriginalReference(String originalReference) { public CancelOrRefundRequest platformChargebackLogic( PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -285,6 +331,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -297,6 +344,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public CancelOrRefundRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -324,6 +372,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -335,6 +384,7 @@ public void setReference(String reference) { */ public CancelOrRefundRequest tenderReference(String tenderReference) { this.tenderReference = tenderReference; + isSetTenderReference = true; // mark as set return this; } @@ -360,6 +410,7 @@ public String getTenderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTenderReference(String tenderReference) { this.tenderReference = tenderReference; + isSetTenderReference = true; // mark as set } /** @@ -372,6 +423,7 @@ public void setTenderReference(String tenderReference) { */ public CancelOrRefundRequest uniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set return this; } @@ -399,6 +451,27 @@ public String getUniqueTerminalId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CancelOrRefundRequest 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 CancelOrRefundRequest object is equal to o. */ @@ -412,30 +485,51 @@ public boolean equals(Object o) { } CancelOrRefundRequest cancelOrRefundRequest = (CancelOrRefundRequest) o; return Objects.equals(this.additionalData, cancelOrRefundRequest.additionalData) + && Objects.equals(this.isSetAdditionalData, cancelOrRefundRequest.isSetAdditionalData) && Objects.equals(this.merchantAccount, cancelOrRefundRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, cancelOrRefundRequest.isSetMerchantAccount) && Objects.equals(this.mpiData, cancelOrRefundRequest.mpiData) + && Objects.equals(this.isSetMpiData, cancelOrRefundRequest.isSetMpiData) && Objects.equals( this.originalMerchantReference, cancelOrRefundRequest.originalMerchantReference) + && Objects.equals( + this.isSetOriginalMerchantReference, + cancelOrRefundRequest.isSetOriginalMerchantReference) && Objects.equals(this.originalReference, cancelOrRefundRequest.originalReference) + && Objects.equals(this.isSetOriginalReference, cancelOrRefundRequest.isSetOriginalReference) && Objects.equals( this.platformChargebackLogic, cancelOrRefundRequest.platformChargebackLogic) + && Objects.equals( + this.isSetPlatformChargebackLogic, cancelOrRefundRequest.isSetPlatformChargebackLogic) && Objects.equals(this.reference, cancelOrRefundRequest.reference) + && Objects.equals(this.isSetReference, cancelOrRefundRequest.isSetReference) && Objects.equals(this.tenderReference, cancelOrRefundRequest.tenderReference) - && Objects.equals(this.uniqueTerminalId, cancelOrRefundRequest.uniqueTerminalId); + && Objects.equals(this.isSetTenderReference, cancelOrRefundRequest.isSetTenderReference) + && Objects.equals(this.uniqueTerminalId, cancelOrRefundRequest.uniqueTerminalId) + && Objects.equals(this.isSetUniqueTerminalId, cancelOrRefundRequest.isSetUniqueTerminalId); } @Override public int hashCode() { return Objects.hash( additionalData, + isSetAdditionalData, merchantAccount, + isSetMerchantAccount, mpiData, + isSetMpiData, originalMerchantReference, + isSetOriginalMerchantReference, originalReference, + isSetOriginalReference, platformChargebackLogic, + isSetPlatformChargebackLogic, reference, + isSetReference, tenderReference, - uniqueTerminalId); + isSetTenderReference, + uniqueTerminalId, + isSetUniqueTerminalId); } @Override @@ -469,6 +563,54 @@ 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 (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetMpiData) { + addIfNull(nulls, JSON_PROPERTY_MPI_DATA, this.mpiData); + } + if (isSetOriginalMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_MERCHANT_REFERENCE, this.originalMerchantReference); + } + if (isSetOriginalReference) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_REFERENCE, this.originalReference); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetTenderReference) { + addIfNull(nulls, JSON_PROPERTY_TENDER_REFERENCE, this.tenderReference); + } + if (isSetUniqueTerminalId) { + addIfNull(nulls, JSON_PROPERTY_UNIQUE_TERMINAL_ID, this.uniqueTerminalId); + } + + 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 CancelOrRefundRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/CancelRequest.java b/src/main/java/com/adyen/model/payment/CancelRequest.java index deabb1959..db89b575e 100644 --- a/src/main/java/com/adyen/model/payment/CancelRequest.java +++ b/src/main/java/com/adyen/model/payment/CancelRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -38,34 +40,70 @@ public class CancelRequest { public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_MPI_DATA = "mpiData"; private ThreeDSecureData mpiData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMpiData = false; + public static final String JSON_PROPERTY_ORIGINAL_MERCHANT_REFERENCE = "originalMerchantReference"; private String originalMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalMerchantReference = false; + public static final String JSON_PROPERTY_ORIGINAL_REFERENCE = "originalReference"; private String originalReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalReference = false; + public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; private PlatformChargebackLogic platformChargebackLogic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformChargebackLogic = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + public static final String JSON_PROPERTY_TENDER_REFERENCE = "tenderReference"; private String tenderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTenderReference = false; + public static final String JSON_PROPERTY_UNIQUE_TERMINAL_ID = "uniqueTerminalId"; private String uniqueTerminalId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUniqueTerminalId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CancelRequest() {} /** @@ -80,6 +118,7 @@ public CancelRequest() {} */ public CancelRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -119,6 +158,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -129,6 +169,7 @@ public void setAdditionalData(Map additionalData) { */ public CancelRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -152,6 +193,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -162,6 +204,7 @@ public void setMerchantAccount(String merchantAccount) { */ public CancelRequest mpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set return this; } @@ -185,6 +228,7 @@ public ThreeDSecureData getMpiData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set } /** @@ -195,6 +239,7 @@ public void setMpiData(ThreeDSecureData mpiData) { */ public CancelRequest originalMerchantReference(String originalMerchantReference) { this.originalMerchantReference = originalMerchantReference; + isSetOriginalMerchantReference = true; // mark as set return this; } @@ -218,6 +263,7 @@ public String getOriginalMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalMerchantReference(String originalMerchantReference) { this.originalMerchantReference = originalMerchantReference; + isSetOriginalMerchantReference = true; // mark as set } /** @@ -230,6 +276,7 @@ public void setOriginalMerchantReference(String originalMerchantReference) { */ public CancelRequest originalReference(String originalReference) { this.originalReference = originalReference; + isSetOriginalReference = true; // mark as set return this; } @@ -257,6 +304,7 @@ public String getOriginalReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalReference(String originalReference) { this.originalReference = originalReference; + isSetOriginalReference = true; // mark as set } /** @@ -267,6 +315,7 @@ public void setOriginalReference(String originalReference) { */ public CancelRequest platformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -290,6 +339,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -302,6 +352,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public CancelRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -329,6 +380,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -343,6 +395,7 @@ public void setReference(String reference) { */ public CancelRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -382,6 +435,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -393,6 +447,7 @@ public void setSplits(List splits) { */ public CancelRequest tenderReference(String tenderReference) { this.tenderReference = tenderReference; + isSetTenderReference = true; // mark as set return this; } @@ -418,6 +473,7 @@ public String getTenderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTenderReference(String tenderReference) { this.tenderReference = tenderReference; + isSetTenderReference = true; // mark as set } /** @@ -430,6 +486,7 @@ public void setTenderReference(String tenderReference) { */ public CancelRequest uniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set return this; } @@ -457,6 +514,27 @@ public String getUniqueTerminalId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CancelRequest 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 CancelRequest object is equal to o. */ @@ -470,30 +548,52 @@ public boolean equals(Object o) { } CancelRequest cancelRequest = (CancelRequest) o; return Objects.equals(this.additionalData, cancelRequest.additionalData) + && Objects.equals(this.isSetAdditionalData, cancelRequest.isSetAdditionalData) && Objects.equals(this.merchantAccount, cancelRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, cancelRequest.isSetMerchantAccount) && Objects.equals(this.mpiData, cancelRequest.mpiData) + && Objects.equals(this.isSetMpiData, cancelRequest.isSetMpiData) && Objects.equals(this.originalMerchantReference, cancelRequest.originalMerchantReference) + && Objects.equals( + this.isSetOriginalMerchantReference, cancelRequest.isSetOriginalMerchantReference) && Objects.equals(this.originalReference, cancelRequest.originalReference) + && Objects.equals(this.isSetOriginalReference, cancelRequest.isSetOriginalReference) && Objects.equals(this.platformChargebackLogic, cancelRequest.platformChargebackLogic) + && Objects.equals( + this.isSetPlatformChargebackLogic, cancelRequest.isSetPlatformChargebackLogic) && Objects.equals(this.reference, cancelRequest.reference) + && Objects.equals(this.isSetReference, cancelRequest.isSetReference) && Objects.equals(this.splits, cancelRequest.splits) + && Objects.equals(this.isSetSplits, cancelRequest.isSetSplits) && Objects.equals(this.tenderReference, cancelRequest.tenderReference) - && Objects.equals(this.uniqueTerminalId, cancelRequest.uniqueTerminalId); + && Objects.equals(this.isSetTenderReference, cancelRequest.isSetTenderReference) + && Objects.equals(this.uniqueTerminalId, cancelRequest.uniqueTerminalId) + && Objects.equals(this.isSetUniqueTerminalId, cancelRequest.isSetUniqueTerminalId); } @Override public int hashCode() { return Objects.hash( additionalData, + isSetAdditionalData, merchantAccount, + isSetMerchantAccount, mpiData, + isSetMpiData, originalMerchantReference, + isSetOriginalMerchantReference, originalReference, + isSetOriginalReference, platformChargebackLogic, + isSetPlatformChargebackLogic, reference, + isSetReference, splits, + isSetSplits, tenderReference, - uniqueTerminalId); + isSetTenderReference, + uniqueTerminalId, + isSetUniqueTerminalId); } @Override @@ -528,6 +628,57 @@ 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 (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetMpiData) { + addIfNull(nulls, JSON_PROPERTY_MPI_DATA, this.mpiData); + } + if (isSetOriginalMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_MERCHANT_REFERENCE, this.originalMerchantReference); + } + if (isSetOriginalReference) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_REFERENCE, this.originalReference); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetTenderReference) { + addIfNull(nulls, JSON_PROPERTY_TENDER_REFERENCE, this.tenderReference); + } + if (isSetUniqueTerminalId) { + addIfNull(nulls, JSON_PROPERTY_UNIQUE_TERMINAL_ID, this.uniqueTerminalId); + } + + 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 CancelRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/CaptureRequest.java b/src/main/java/com/adyen/model/payment/CaptureRequest.java index 8d7fb019d..531dbce8d 100644 --- a/src/main/java/com/adyen/model/payment/CaptureRequest.java +++ b/src/main/java/com/adyen/model/payment/CaptureRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -39,37 +41,76 @@ public class CaptureRequest { public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_MODIFICATION_AMOUNT = "modificationAmount"; private Amount modificationAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationAmount = false; + public static final String JSON_PROPERTY_MPI_DATA = "mpiData"; private ThreeDSecureData mpiData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMpiData = false; + public static final String JSON_PROPERTY_ORIGINAL_MERCHANT_REFERENCE = "originalMerchantReference"; private String originalMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalMerchantReference = false; + public static final String JSON_PROPERTY_ORIGINAL_REFERENCE = "originalReference"; private String originalReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalReference = false; + public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; private PlatformChargebackLogic platformChargebackLogic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformChargebackLogic = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + public static final String JSON_PROPERTY_TENDER_REFERENCE = "tenderReference"; private String tenderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTenderReference = false; + public static final String JSON_PROPERTY_UNIQUE_TERMINAL_ID = "uniqueTerminalId"; private String uniqueTerminalId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUniqueTerminalId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CaptureRequest() {} /** @@ -84,6 +125,7 @@ public CaptureRequest() {} */ public CaptureRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -123,6 +165,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -133,6 +176,7 @@ public void setAdditionalData(Map additionalData) { */ public CaptureRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -156,6 +200,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -166,6 +211,7 @@ public void setMerchantAccount(String merchantAccount) { */ public CaptureRequest modificationAmount(Amount modificationAmount) { this.modificationAmount = modificationAmount; + isSetModificationAmount = true; // mark as set return this; } @@ -189,6 +235,7 @@ public Amount getModificationAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationAmount(Amount modificationAmount) { this.modificationAmount = modificationAmount; + isSetModificationAmount = true; // mark as set } /** @@ -199,6 +246,7 @@ public void setModificationAmount(Amount modificationAmount) { */ public CaptureRequest mpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set return this; } @@ -222,6 +270,7 @@ public ThreeDSecureData getMpiData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set } /** @@ -232,6 +281,7 @@ public void setMpiData(ThreeDSecureData mpiData) { */ public CaptureRequest originalMerchantReference(String originalMerchantReference) { this.originalMerchantReference = originalMerchantReference; + isSetOriginalMerchantReference = true; // mark as set return this; } @@ -255,6 +305,7 @@ public String getOriginalMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalMerchantReference(String originalMerchantReference) { this.originalMerchantReference = originalMerchantReference; + isSetOriginalMerchantReference = true; // mark as set } /** @@ -267,6 +318,7 @@ public void setOriginalMerchantReference(String originalMerchantReference) { */ public CaptureRequest originalReference(String originalReference) { this.originalReference = originalReference; + isSetOriginalReference = true; // mark as set return this; } @@ -294,6 +346,7 @@ public String getOriginalReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalReference(String originalReference) { this.originalReference = originalReference; + isSetOriginalReference = true; // mark as set } /** @@ -304,6 +357,7 @@ public void setOriginalReference(String originalReference) { */ public CaptureRequest platformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -327,6 +381,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -339,6 +394,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public CaptureRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -366,6 +422,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -380,6 +437,7 @@ public void setReference(String reference) { */ public CaptureRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -419,6 +477,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -430,6 +489,7 @@ public void setSplits(List splits) { */ public CaptureRequest tenderReference(String tenderReference) { this.tenderReference = tenderReference; + isSetTenderReference = true; // mark as set return this; } @@ -455,6 +515,7 @@ public String getTenderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTenderReference(String tenderReference) { this.tenderReference = tenderReference; + isSetTenderReference = true; // mark as set } /** @@ -467,6 +528,7 @@ public void setTenderReference(String tenderReference) { */ public CaptureRequest uniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set return this; } @@ -494,6 +556,27 @@ public String getUniqueTerminalId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CaptureRequest 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 CaptureRequest object is equal to o. */ @@ -507,32 +590,56 @@ public boolean equals(Object o) { } CaptureRequest captureRequest = (CaptureRequest) o; return Objects.equals(this.additionalData, captureRequest.additionalData) + && Objects.equals(this.isSetAdditionalData, captureRequest.isSetAdditionalData) && Objects.equals(this.merchantAccount, captureRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, captureRequest.isSetMerchantAccount) && Objects.equals(this.modificationAmount, captureRequest.modificationAmount) + && Objects.equals(this.isSetModificationAmount, captureRequest.isSetModificationAmount) && Objects.equals(this.mpiData, captureRequest.mpiData) + && Objects.equals(this.isSetMpiData, captureRequest.isSetMpiData) && Objects.equals(this.originalMerchantReference, captureRequest.originalMerchantReference) + && Objects.equals( + this.isSetOriginalMerchantReference, captureRequest.isSetOriginalMerchantReference) && Objects.equals(this.originalReference, captureRequest.originalReference) + && Objects.equals(this.isSetOriginalReference, captureRequest.isSetOriginalReference) && Objects.equals(this.platformChargebackLogic, captureRequest.platformChargebackLogic) + && Objects.equals( + this.isSetPlatformChargebackLogic, captureRequest.isSetPlatformChargebackLogic) && Objects.equals(this.reference, captureRequest.reference) + && Objects.equals(this.isSetReference, captureRequest.isSetReference) && Objects.equals(this.splits, captureRequest.splits) + && Objects.equals(this.isSetSplits, captureRequest.isSetSplits) && Objects.equals(this.tenderReference, captureRequest.tenderReference) - && Objects.equals(this.uniqueTerminalId, captureRequest.uniqueTerminalId); + && Objects.equals(this.isSetTenderReference, captureRequest.isSetTenderReference) + && Objects.equals(this.uniqueTerminalId, captureRequest.uniqueTerminalId) + && Objects.equals(this.isSetUniqueTerminalId, captureRequest.isSetUniqueTerminalId); } @Override public int hashCode() { return Objects.hash( additionalData, + isSetAdditionalData, merchantAccount, + isSetMerchantAccount, modificationAmount, + isSetModificationAmount, mpiData, + isSetMpiData, originalMerchantReference, + isSetOriginalMerchantReference, originalReference, + isSetOriginalReference, platformChargebackLogic, + isSetPlatformChargebackLogic, reference, + isSetReference, splits, + isSetSplits, tenderReference, - uniqueTerminalId); + isSetTenderReference, + uniqueTerminalId, + isSetUniqueTerminalId); } @Override @@ -568,6 +675,60 @@ 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 (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetModificationAmount) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_AMOUNT, this.modificationAmount); + } + if (isSetMpiData) { + addIfNull(nulls, JSON_PROPERTY_MPI_DATA, this.mpiData); + } + if (isSetOriginalMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_MERCHANT_REFERENCE, this.originalMerchantReference); + } + if (isSetOriginalReference) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_REFERENCE, this.originalReference); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetTenderReference) { + addIfNull(nulls, JSON_PROPERTY_TENDER_REFERENCE, this.tenderReference); + } + if (isSetUniqueTerminalId) { + addIfNull(nulls, JSON_PROPERTY_UNIQUE_TERMINAL_ID, this.uniqueTerminalId); + } + + 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 CaptureRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/Card.java b/src/main/java/com/adyen/model/payment/Card.java index b80b78b22..aa24b02cf 100644 --- a/src/main/java/com/adyen/model/payment/Card.java +++ b/src/main/java/com/adyen/model/payment/Card.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -32,27 +34,57 @@ public class Card { public static final String JSON_PROPERTY_CVC = "cvc"; private String cvc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCvc = false; + public static final String JSON_PROPERTY_EXPIRY_MONTH = "expiryMonth"; private String expiryMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryMonth = false; + public static final String JSON_PROPERTY_EXPIRY_YEAR = "expiryYear"; private String expiryYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryYear = false; + public static final String JSON_PROPERTY_HOLDER_NAME = "holderName"; private String holderName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHolderName = false; + public static final String JSON_PROPERTY_ISSUE_NUMBER = "issueNumber"; private String issueNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssueNumber = false; + public static final String JSON_PROPERTY_NUMBER = "number"; private String number; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + public static final String JSON_PROPERTY_START_MONTH = "startMonth"; private String startMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartMonth = false; + public static final String JSON_PROPERTY_START_YEAR = "startYear"; private String startYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartYear = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Card() {} /** @@ -79,6 +111,7 @@ public Card() {} */ public Card cvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set return this; } @@ -134,6 +167,7 @@ public String getCvc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set } /** @@ -146,6 +180,7 @@ public void setCvc(String cvc) { */ public Card expiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set return this; } @@ -173,6 +208,7 @@ public String getExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set } /** @@ -183,6 +219,7 @@ public void setExpiryMonth(String expiryMonth) { */ public Card expiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set return this; } @@ -206,6 +243,7 @@ public String getExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set } /** @@ -216,6 +254,7 @@ public void setExpiryYear(String expiryYear) { */ public Card holderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set return this; } @@ -239,6 +278,7 @@ public String getHolderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHolderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set } /** @@ -249,6 +289,7 @@ public void setHolderName(String holderName) { */ public Card issueNumber(String issueNumber) { this.issueNumber = issueNumber; + isSetIssueNumber = true; // mark as set return this; } @@ -272,6 +313,7 @@ public String getIssueNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssueNumber(String issueNumber) { this.issueNumber = issueNumber; + isSetIssueNumber = true; // mark as set } /** @@ -284,6 +326,7 @@ public void setIssueNumber(String issueNumber) { */ public Card number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -311,6 +354,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -321,6 +365,7 @@ public void setNumber(String number) { */ public Card startMonth(String startMonth) { this.startMonth = startMonth; + isSetStartMonth = true; // mark as set return this; } @@ -344,6 +389,7 @@ public String getStartMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartMonth(String startMonth) { this.startMonth = startMonth; + isSetStartMonth = true; // mark as set } /** @@ -354,6 +400,7 @@ public void setStartMonth(String startMonth) { */ public Card startYear(String startYear) { this.startYear = startYear; + isSetStartYear = true; // mark as set return this; } @@ -377,6 +424,27 @@ public String getStartYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartYear(String startYear) { this.startYear = startYear; + isSetStartYear = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Card 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 Card object is equal to o. */ @@ -390,19 +458,42 @@ public boolean equals(Object o) { } Card card = (Card) o; return Objects.equals(this.cvc, card.cvc) + && Objects.equals(this.isSetCvc, card.isSetCvc) && Objects.equals(this.expiryMonth, card.expiryMonth) + && Objects.equals(this.isSetExpiryMonth, card.isSetExpiryMonth) && Objects.equals(this.expiryYear, card.expiryYear) + && Objects.equals(this.isSetExpiryYear, card.isSetExpiryYear) && Objects.equals(this.holderName, card.holderName) + && Objects.equals(this.isSetHolderName, card.isSetHolderName) && Objects.equals(this.issueNumber, card.issueNumber) + && Objects.equals(this.isSetIssueNumber, card.isSetIssueNumber) && Objects.equals(this.number, card.number) + && Objects.equals(this.isSetNumber, card.isSetNumber) && Objects.equals(this.startMonth, card.startMonth) - && Objects.equals(this.startYear, card.startYear); + && Objects.equals(this.isSetStartMonth, card.isSetStartMonth) + && Objects.equals(this.startYear, card.startYear) + && Objects.equals(this.isSetStartYear, card.isSetStartYear); } @Override public int hashCode() { return Objects.hash( - cvc, expiryMonth, expiryYear, holderName, issueNumber, number, startMonth, startYear); + cvc, + isSetCvc, + expiryMonth, + isSetExpiryMonth, + expiryYear, + isSetExpiryYear, + holderName, + isSetHolderName, + issueNumber, + isSetIssueNumber, + number, + isSetNumber, + startMonth, + isSetStartMonth, + startYear, + isSetStartYear); } @Override @@ -431,6 +522,51 @@ 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 (isSetCvc) { + addIfNull(nulls, JSON_PROPERTY_CVC, this.cvc); + } + if (isSetExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_MONTH, this.expiryMonth); + } + if (isSetExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_YEAR, this.expiryYear); + } + if (isSetHolderName) { + addIfNull(nulls, JSON_PROPERTY_HOLDER_NAME, this.holderName); + } + if (isSetIssueNumber) { + addIfNull(nulls, JSON_PROPERTY_ISSUE_NUMBER, this.issueNumber); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + if (isSetStartMonth) { + addIfNull(nulls, JSON_PROPERTY_START_MONTH, this.startMonth); + } + if (isSetStartYear) { + addIfNull(nulls, JSON_PROPERTY_START_YEAR, this.startYear); + } + + 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 Card given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/CommonField.java b/src/main/java/com/adyen/model/payment/CommonField.java index 6a9f8dd6a..1811e352e 100644 --- a/src/main/java/com/adyen/model/payment/CommonField.java +++ b/src/main/java/com/adyen/model/payment/CommonField.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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,9 +25,21 @@ public class CommonField { public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_VERSION = "version"; private String version; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVersion = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CommonField() {} /** @@ -36,6 +50,7 @@ public CommonField() {} */ public CommonField name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setName(String name) { */ public CommonField version(String version) { this.version = version; + isSetVersion = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVersion(String version) { this.version = version; + isSetVersion = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CommonField 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 CommonField object is equal to o. */ @@ -105,12 +143,14 @@ public boolean equals(Object o) { } CommonField commonField = (CommonField) o; return Objects.equals(this.name, commonField.name) - && Objects.equals(this.version, commonField.version); + && Objects.equals(this.isSetName, commonField.isSetName) + && Objects.equals(this.version, commonField.version) + && Objects.equals(this.isSetVersion, commonField.isSetVersion); } @Override public int hashCode() { - return Objects.hash(name, version); + return Objects.hash(name, isSetName, version, isSetVersion); } @Override @@ -133,6 +173,33 @@ 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 (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetVersion) { + addIfNull(nulls, JSON_PROPERTY_VERSION, this.version); + } + + 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 CommonField given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/DeviceRenderOptions.java b/src/main/java/com/adyen/model/payment/DeviceRenderOptions.java index 001c1f0cf..5b87e423e 100644 --- a/src/main/java/com/adyen/model/payment/DeviceRenderOptions.java +++ b/src/main/java/com/adyen/model/payment/DeviceRenderOptions.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -75,6 +77,9 @@ public static SdkInterfaceEnum fromValue(String value) { public static final String JSON_PROPERTY_SDK_INTERFACE = "sdkInterface"; private SdkInterfaceEnum sdkInterface; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkInterface = false; + /** Gets or Sets sdkUiType */ public enum SdkUiTypeEnum { MULTISELECT(String.valueOf("multiSelect")), @@ -125,6 +130,15 @@ public static SdkUiTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_SDK_UI_TYPE = "sdkUiType"; private List sdkUiType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkUiType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DeviceRenderOptions() {} /** @@ -135,6 +149,7 @@ public DeviceRenderOptions() {} */ public DeviceRenderOptions sdkInterface(SdkInterfaceEnum sdkInterface) { this.sdkInterface = sdkInterface; + isSetSdkInterface = true; // mark as set return this; } @@ -158,6 +173,7 @@ public SdkInterfaceEnum getSdkInterface() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkInterface(SdkInterfaceEnum sdkInterface) { this.sdkInterface = sdkInterface; + isSetSdkInterface = true; // mark as set } /** @@ -170,6 +186,7 @@ public void setSdkInterface(SdkInterfaceEnum sdkInterface) { */ public DeviceRenderOptions sdkUiType(List sdkUiType) { this.sdkUiType = sdkUiType; + isSetSdkUiType = true; // mark as set return this; } @@ -205,6 +222,27 @@ public List getSdkUiType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkUiType(List sdkUiType) { this.sdkUiType = sdkUiType; + isSetSdkUiType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DeviceRenderOptions 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 DeviceRenderOptions object is equal to o. */ @@ -218,12 +256,14 @@ public boolean equals(Object o) { } DeviceRenderOptions deviceRenderOptions = (DeviceRenderOptions) o; return Objects.equals(this.sdkInterface, deviceRenderOptions.sdkInterface) - && Objects.equals(this.sdkUiType, deviceRenderOptions.sdkUiType); + && Objects.equals(this.isSetSdkInterface, deviceRenderOptions.isSetSdkInterface) + && Objects.equals(this.sdkUiType, deviceRenderOptions.sdkUiType) + && Objects.equals(this.isSetSdkUiType, deviceRenderOptions.isSetSdkUiType); } @Override public int hashCode() { - return Objects.hash(sdkInterface, sdkUiType); + return Objects.hash(sdkInterface, isSetSdkInterface, sdkUiType, isSetSdkUiType); } @Override @@ -246,6 +286,33 @@ 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 (isSetSdkInterface) { + addIfNull(nulls, JSON_PROPERTY_SDK_INTERFACE, this.sdkInterface); + } + if (isSetSdkUiType) { + addIfNull(nulls, JSON_PROPERTY_SDK_UI_TYPE, this.sdkUiType); + } + + 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 DeviceRenderOptions given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/DonationRequest.java b/src/main/java/com/adyen/model/payment/DonationRequest.java index 994521ff8..b4ed5f39b 100644 --- a/src/main/java/com/adyen/model/payment/DonationRequest.java +++ b/src/main/java/com/adyen/model/payment/DonationRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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,21 +32,45 @@ public class DonationRequest { public static final String JSON_PROPERTY_DONATION_ACCOUNT = "donationAccount"; private String donationAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationAccount = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_MODIFICATION_AMOUNT = "modificationAmount"; private Amount modificationAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationAmount = false; + public static final String JSON_PROPERTY_ORIGINAL_REFERENCE = "originalReference"; private String originalReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalReference = false; + public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; private PlatformChargebackLogic platformChargebackLogic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformChargebackLogic = 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 DonationRequest() {} /** @@ -55,6 +81,7 @@ public DonationRequest() {} */ public DonationRequest donationAccount(String donationAccount) { this.donationAccount = donationAccount; + isSetDonationAccount = true; // mark as set return this; } @@ -78,6 +105,7 @@ public String getDonationAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationAccount(String donationAccount) { this.donationAccount = donationAccount; + isSetDonationAccount = true; // mark as set } /** @@ -88,6 +116,7 @@ public void setDonationAccount(String donationAccount) { */ public DonationRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -111,6 +140,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -121,6 +151,7 @@ public void setMerchantAccount(String merchantAccount) { */ public DonationRequest modificationAmount(Amount modificationAmount) { this.modificationAmount = modificationAmount; + isSetModificationAmount = true; // mark as set return this; } @@ -144,6 +175,7 @@ public Amount getModificationAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationAmount(Amount modificationAmount) { this.modificationAmount = modificationAmount; + isSetModificationAmount = true; // mark as set } /** @@ -156,6 +188,7 @@ public void setModificationAmount(Amount modificationAmount) { */ public DonationRequest originalReference(String originalReference) { this.originalReference = originalReference; + isSetOriginalReference = true; // mark as set return this; } @@ -183,6 +216,7 @@ public String getOriginalReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalReference(String originalReference) { this.originalReference = originalReference; + isSetOriginalReference = true; // mark as set } /** @@ -193,6 +227,7 @@ public void setOriginalReference(String originalReference) { */ public DonationRequest platformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -216,6 +251,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -228,6 +264,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public DonationRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -255,6 +292,27 @@ 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 DonationRequest 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 DonationRequest object is equal to o. */ @@ -268,22 +326,35 @@ public boolean equals(Object o) { } DonationRequest donationRequest = (DonationRequest) o; return Objects.equals(this.donationAccount, donationRequest.donationAccount) + && Objects.equals(this.isSetDonationAccount, donationRequest.isSetDonationAccount) && Objects.equals(this.merchantAccount, donationRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, donationRequest.isSetMerchantAccount) && Objects.equals(this.modificationAmount, donationRequest.modificationAmount) + && Objects.equals(this.isSetModificationAmount, donationRequest.isSetModificationAmount) && Objects.equals(this.originalReference, donationRequest.originalReference) + && Objects.equals(this.isSetOriginalReference, donationRequest.isSetOriginalReference) && Objects.equals(this.platformChargebackLogic, donationRequest.platformChargebackLogic) - && Objects.equals(this.reference, donationRequest.reference); + && Objects.equals( + this.isSetPlatformChargebackLogic, donationRequest.isSetPlatformChargebackLogic) + && Objects.equals(this.reference, donationRequest.reference) + && Objects.equals(this.isSetReference, donationRequest.isSetReference); } @Override public int hashCode() { return Objects.hash( donationAccount, + isSetDonationAccount, merchantAccount, + isSetMerchantAccount, modificationAmount, + isSetModificationAmount, originalReference, + isSetOriginalReference, platformChargebackLogic, - reference); + isSetPlatformChargebackLogic, + reference, + isSetReference); } @Override @@ -312,6 +383,45 @@ 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 (isSetDonationAccount) { + addIfNull(nulls, JSON_PROPERTY_DONATION_ACCOUNT, this.donationAccount); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetModificationAmount) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_AMOUNT, this.modificationAmount); + } + if (isSetOriginalReference) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_REFERENCE, this.originalReference); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + 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 DonationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ExternalPlatform.java b/src/main/java/com/adyen/model/payment/ExternalPlatform.java index a14e838eb..696ce89c8 100644 --- a/src/main/java/com/adyen/model/payment/ExternalPlatform.java +++ b/src/main/java/com/adyen/model/payment/ExternalPlatform.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -27,12 +29,27 @@ public class ExternalPlatform { public static final String JSON_PROPERTY_INTEGRATOR = "integrator"; private String integrator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIntegrator = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_VERSION = "version"; private String version; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVersion = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ExternalPlatform() {} /** @@ -43,6 +60,7 @@ public ExternalPlatform() {} */ public ExternalPlatform integrator(String integrator) { this.integrator = integrator; + isSetIntegrator = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getIntegrator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIntegrator(String integrator) { this.integrator = integrator; + isSetIntegrator = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setIntegrator(String integrator) { */ public ExternalPlatform name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setName(String name) { */ public ExternalPlatform version(String version) { this.version = version; + isSetVersion = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVersion(String version) { this.version = version; + isSetVersion = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ExternalPlatform 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 ExternalPlatform object is equal to o. */ @@ -145,13 +188,16 @@ public boolean equals(Object o) { } ExternalPlatform externalPlatform = (ExternalPlatform) o; return Objects.equals(this.integrator, externalPlatform.integrator) + && Objects.equals(this.isSetIntegrator, externalPlatform.isSetIntegrator) && Objects.equals(this.name, externalPlatform.name) - && Objects.equals(this.version, externalPlatform.version); + && Objects.equals(this.isSetName, externalPlatform.isSetName) + && Objects.equals(this.version, externalPlatform.version) + && Objects.equals(this.isSetVersion, externalPlatform.isSetVersion); } @Override public int hashCode() { - return Objects.hash(integrator, name, version); + return Objects.hash(integrator, isSetIntegrator, name, isSetName, version, isSetVersion); } @Override @@ -175,6 +221,36 @@ 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 (isSetIntegrator) { + addIfNull(nulls, JSON_PROPERTY_INTEGRATOR, this.integrator); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetVersion) { + addIfNull(nulls, JSON_PROPERTY_VERSION, this.version); + } + + 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 ExternalPlatform given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ForexQuote.java b/src/main/java/com/adyen/model/payment/ForexQuote.java index 6294c4457..7d1eb1c48 100644 --- a/src/main/java/com/adyen/model/payment/ForexQuote.java +++ b/src/main/java/com/adyen/model/payment/ForexQuote.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -37,39 +39,81 @@ public class ForexQuote { public static final String JSON_PROPERTY_ACCOUNT = "account"; private String account; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccount = false; + public static final String JSON_PROPERTY_ACCOUNT_TYPE = "accountType"; private String accountType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountType = false; + public static final String JSON_PROPERTY_BASE_AMOUNT = "baseAmount"; private Amount baseAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBaseAmount = false; + public static final String JSON_PROPERTY_BASE_POINTS = "basePoints"; private Integer basePoints; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasePoints = false; + public static final String JSON_PROPERTY_BUY = "buy"; private Amount buy; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBuy = false; + public static final String JSON_PROPERTY_INTERBANK = "interbank"; private Amount interbank; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInterbank = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SELL = "sell"; private Amount sell; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSell = false; + public static final String JSON_PROPERTY_SIGNATURE = "signature"; private String signature; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSignature = false; + public static final String JSON_PROPERTY_SOURCE = "source"; private String source; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSource = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_VALID_TILL = "validTill"; private OffsetDateTime validTill; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValidTill = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ForexQuote() {} /** @@ -80,6 +124,7 @@ public ForexQuote() {} */ public ForexQuote account(String account) { this.account = account; + isSetAccount = true; // mark as set return this; } @@ -103,6 +148,7 @@ public String getAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccount(String account) { this.account = account; + isSetAccount = true; // mark as set } /** @@ -113,6 +159,7 @@ public void setAccount(String account) { */ public ForexQuote accountType(String accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -136,6 +183,7 @@ public String getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(String accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -146,6 +194,7 @@ public void setAccountType(String accountType) { */ public ForexQuote baseAmount(Amount baseAmount) { this.baseAmount = baseAmount; + isSetBaseAmount = true; // mark as set return this; } @@ -169,6 +218,7 @@ public Amount getBaseAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBaseAmount(Amount baseAmount) { this.baseAmount = baseAmount; + isSetBaseAmount = true; // mark as set } /** @@ -179,6 +229,7 @@ public void setBaseAmount(Amount baseAmount) { */ public ForexQuote basePoints(Integer basePoints) { this.basePoints = basePoints; + isSetBasePoints = true; // mark as set return this; } @@ -202,6 +253,7 @@ public Integer getBasePoints() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBasePoints(Integer basePoints) { this.basePoints = basePoints; + isSetBasePoints = true; // mark as set } /** @@ -212,6 +264,7 @@ public void setBasePoints(Integer basePoints) { */ public ForexQuote buy(Amount buy) { this.buy = buy; + isSetBuy = true; // mark as set return this; } @@ -235,6 +288,7 @@ public Amount getBuy() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBuy(Amount buy) { this.buy = buy; + isSetBuy = true; // mark as set } /** @@ -245,6 +299,7 @@ public void setBuy(Amount buy) { */ public ForexQuote interbank(Amount interbank) { this.interbank = interbank; + isSetInterbank = true; // mark as set return this; } @@ -268,6 +323,7 @@ public Amount getInterbank() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInterbank(Amount interbank) { this.interbank = interbank; + isSetInterbank = true; // mark as set } /** @@ -278,6 +334,7 @@ public void setInterbank(Amount interbank) { */ public ForexQuote reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -301,6 +358,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -311,6 +369,7 @@ public void setReference(String reference) { */ public ForexQuote sell(Amount sell) { this.sell = sell; + isSetSell = true; // mark as set return this; } @@ -334,6 +393,7 @@ public Amount getSell() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSell(Amount sell) { this.sell = sell; + isSetSell = true; // mark as set } /** @@ -344,6 +404,7 @@ public void setSell(Amount sell) { */ public ForexQuote signature(String signature) { this.signature = signature; + isSetSignature = true; // mark as set return this; } @@ -367,6 +428,7 @@ public String getSignature() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSignature(String signature) { this.signature = signature; + isSetSignature = true; // mark as set } /** @@ -377,6 +439,7 @@ public void setSignature(String signature) { */ public ForexQuote source(String source) { this.source = source; + isSetSource = true; // mark as set return this; } @@ -400,6 +463,7 @@ public String getSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSource(String source) { this.source = source; + isSetSource = true; // mark as set } /** @@ -410,6 +474,7 @@ public void setSource(String source) { */ public ForexQuote type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -433,6 +498,7 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set } /** @@ -443,6 +509,7 @@ public void setType(String type) { */ public ForexQuote validTill(OffsetDateTime validTill) { this.validTill = validTill; + isSetValidTill = true; // mark as set return this; } @@ -466,6 +533,27 @@ public OffsetDateTime getValidTill() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValidTill(OffsetDateTime validTill) { this.validTill = validTill; + isSetValidTill = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ForexQuote 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 ForexQuote object is equal to o. */ @@ -479,34 +567,58 @@ public boolean equals(Object o) { } ForexQuote forexQuote = (ForexQuote) o; return Objects.equals(this.account, forexQuote.account) + && Objects.equals(this.isSetAccount, forexQuote.isSetAccount) && Objects.equals(this.accountType, forexQuote.accountType) + && Objects.equals(this.isSetAccountType, forexQuote.isSetAccountType) && Objects.equals(this.baseAmount, forexQuote.baseAmount) + && Objects.equals(this.isSetBaseAmount, forexQuote.isSetBaseAmount) && Objects.equals(this.basePoints, forexQuote.basePoints) + && Objects.equals(this.isSetBasePoints, forexQuote.isSetBasePoints) && Objects.equals(this.buy, forexQuote.buy) + && Objects.equals(this.isSetBuy, forexQuote.isSetBuy) && Objects.equals(this.interbank, forexQuote.interbank) + && Objects.equals(this.isSetInterbank, forexQuote.isSetInterbank) && Objects.equals(this.reference, forexQuote.reference) + && Objects.equals(this.isSetReference, forexQuote.isSetReference) && Objects.equals(this.sell, forexQuote.sell) + && Objects.equals(this.isSetSell, forexQuote.isSetSell) && Objects.equals(this.signature, forexQuote.signature) + && Objects.equals(this.isSetSignature, forexQuote.isSetSignature) && Objects.equals(this.source, forexQuote.source) + && Objects.equals(this.isSetSource, forexQuote.isSetSource) && Objects.equals(this.type, forexQuote.type) - && Objects.equals(this.validTill, forexQuote.validTill); + && Objects.equals(this.isSetType, forexQuote.isSetType) + && Objects.equals(this.validTill, forexQuote.validTill) + && Objects.equals(this.isSetValidTill, forexQuote.isSetValidTill); } @Override public int hashCode() { return Objects.hash( account, + isSetAccount, accountType, + isSetAccountType, baseAmount, + isSetBaseAmount, basePoints, + isSetBasePoints, buy, + isSetBuy, interbank, + isSetInterbank, reference, + isSetReference, sell, + isSetSell, signature, + isSetSignature, source, + isSetSource, type, - validTill); + isSetType, + validTill, + isSetValidTill); } @Override @@ -539,6 +651,63 @@ 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 (isSetAccount) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT, this.account); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetBaseAmount) { + addIfNull(nulls, JSON_PROPERTY_BASE_AMOUNT, this.baseAmount); + } + if (isSetBasePoints) { + addIfNull(nulls, JSON_PROPERTY_BASE_POINTS, this.basePoints); + } + if (isSetBuy) { + addIfNull(nulls, JSON_PROPERTY_BUY, this.buy); + } + if (isSetInterbank) { + addIfNull(nulls, JSON_PROPERTY_INTERBANK, this.interbank); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSell) { + addIfNull(nulls, JSON_PROPERTY_SELL, this.sell); + } + if (isSetSignature) { + addIfNull(nulls, JSON_PROPERTY_SIGNATURE, this.signature); + } + if (isSetSource) { + addIfNull(nulls, JSON_PROPERTY_SOURCE, this.source); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetValidTill) { + addIfNull(nulls, JSON_PROPERTY_VALID_TILL, this.validTill); + } + + 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 ForexQuote given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/FraudCheckResult.java b/src/main/java/com/adyen/model/payment/FraudCheckResult.java index b07bd0e82..bc98a8075 100644 --- a/src/main/java/com/adyen/model/payment/FraudCheckResult.java +++ b/src/main/java/com/adyen/model/payment/FraudCheckResult.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -27,12 +29,27 @@ public class FraudCheckResult { public static final String JSON_PROPERTY_ACCOUNT_SCORE = "accountScore"; private Integer accountScore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountScore = false; + public static final String JSON_PROPERTY_CHECK_ID = "checkId"; private Integer checkId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckId = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public FraudCheckResult() {} /** @@ -43,6 +60,7 @@ public FraudCheckResult() {} */ public FraudCheckResult accountScore(Integer accountScore) { this.accountScore = accountScore; + isSetAccountScore = true; // mark as set return this; } @@ -66,6 +84,7 @@ public Integer getAccountScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountScore(Integer accountScore) { this.accountScore = accountScore; + isSetAccountScore = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setAccountScore(Integer accountScore) { */ public FraudCheckResult checkId(Integer checkId) { this.checkId = checkId; + isSetCheckId = true; // mark as set return this; } @@ -99,6 +119,7 @@ public Integer getCheckId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckId(Integer checkId) { this.checkId = checkId; + isSetCheckId = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setCheckId(Integer checkId) { */ public FraudCheckResult name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FraudCheckResult 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 FraudCheckResult object is equal to o. */ @@ -145,13 +188,16 @@ public boolean equals(Object o) { } FraudCheckResult fraudCheckResult = (FraudCheckResult) o; return Objects.equals(this.accountScore, fraudCheckResult.accountScore) + && Objects.equals(this.isSetAccountScore, fraudCheckResult.isSetAccountScore) && Objects.equals(this.checkId, fraudCheckResult.checkId) - && Objects.equals(this.name, fraudCheckResult.name); + && Objects.equals(this.isSetCheckId, fraudCheckResult.isSetCheckId) + && Objects.equals(this.name, fraudCheckResult.name) + && Objects.equals(this.isSetName, fraudCheckResult.isSetName); } @Override public int hashCode() { - return Objects.hash(accountScore, checkId, name); + return Objects.hash(accountScore, isSetAccountScore, checkId, isSetCheckId, name, isSetName); } @Override @@ -175,6 +221,36 @@ 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 (isSetAccountScore) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_SCORE, this.accountScore); + } + if (isSetCheckId) { + addIfNull(nulls, JSON_PROPERTY_CHECK_ID, this.checkId); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + + 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 FraudCheckResult given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/FraudCheckResultWrapper.java b/src/main/java/com/adyen/model/payment/FraudCheckResultWrapper.java index 841a7f724..78763d5bd 100644 --- a/src/main/java/com/adyen/model/payment/FraudCheckResultWrapper.java +++ b/src/main/java/com/adyen/model/payment/FraudCheckResultWrapper.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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 FraudCheckResultWrapper { public static final String JSON_PROPERTY_FRAUD_CHECK_RESULT = "FraudCheckResult"; private FraudCheckResult fraudCheckResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudCheckResult = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public FraudCheckResultWrapper() {} /** @@ -33,6 +44,7 @@ public FraudCheckResultWrapper() {} */ public FraudCheckResultWrapper fraudCheckResult(FraudCheckResult fraudCheckResult) { this.fraudCheckResult = fraudCheckResult; + isSetFraudCheckResult = true; // mark as set return this; } @@ -56,6 +68,27 @@ public FraudCheckResult getFraudCheckResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudCheckResult(FraudCheckResult fraudCheckResult) { this.fraudCheckResult = fraudCheckResult; + isSetFraudCheckResult = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FraudCheckResultWrapper 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 FraudCheckResultWrapper object is equal to o. */ @@ -68,12 +101,14 @@ public boolean equals(Object o) { return false; } FraudCheckResultWrapper fraudCheckResultWrapper = (FraudCheckResultWrapper) o; - return Objects.equals(this.fraudCheckResult, fraudCheckResultWrapper.fraudCheckResult); + return Objects.equals(this.fraudCheckResult, fraudCheckResultWrapper.fraudCheckResult) + && Objects.equals( + this.isSetFraudCheckResult, fraudCheckResultWrapper.isSetFraudCheckResult); } @Override public int hashCode() { - return Objects.hash(fraudCheckResult); + return Objects.hash(fraudCheckResult, isSetFraudCheckResult); } @Override @@ -95,6 +130,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 (isSetFraudCheckResult) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_CHECK_RESULT, this.fraudCheckResult); + } + + 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 FraudCheckResultWrapper given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/FraudResult.java b/src/main/java/com/adyen/model/payment/FraudResult.java index 11e1153ee..44d3a1394 100644 --- a/src/main/java/com/adyen/model/payment/FraudResult.java +++ b/src/main/java/com/adyen/model/payment/FraudResult.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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,9 +27,21 @@ public class FraudResult { public static final String JSON_PROPERTY_ACCOUNT_SCORE = "accountScore"; private Integer accountScore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountScore = false; + public static final String JSON_PROPERTY_RESULTS = "results"; private List results; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResults = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public FraudResult() {} /** @@ -38,6 +52,7 @@ public FraudResult() {} */ public FraudResult accountScore(Integer accountScore) { this.accountScore = accountScore; + isSetAccountScore = true; // mark as set return this; } @@ -61,6 +76,7 @@ public Integer getAccountScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountScore(Integer accountScore) { this.accountScore = accountScore; + isSetAccountScore = true; // mark as set } /** @@ -71,6 +87,7 @@ public void setAccountScore(Integer accountScore) { */ public FraudResult results(List results) { this.results = results; + isSetResults = true; // mark as set return this; } @@ -102,6 +119,27 @@ public List getResults() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResults(List results) { this.results = results; + isSetResults = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FraudResult 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 FraudResult object is equal to o. */ @@ -115,12 +153,14 @@ public boolean equals(Object o) { } FraudResult fraudResult = (FraudResult) o; return Objects.equals(this.accountScore, fraudResult.accountScore) - && Objects.equals(this.results, fraudResult.results); + && Objects.equals(this.isSetAccountScore, fraudResult.isSetAccountScore) + && Objects.equals(this.results, fraudResult.results) + && Objects.equals(this.isSetResults, fraudResult.isSetResults); } @Override public int hashCode() { - return Objects.hash(accountScore, results); + return Objects.hash(accountScore, isSetAccountScore, results, isSetResults); } @Override @@ -143,6 +183,33 @@ 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 (isSetAccountScore) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_SCORE, this.accountScore); + } + if (isSetResults) { + addIfNull(nulls, JSON_PROPERTY_RESULTS, this.results); + } + + 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 FraudResult given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/FundDestination.java b/src/main/java/com/adyen/model/payment/FundDestination.java index 580dd2371..aa0b486e0 100644 --- a/src/main/java/com/adyen/model/payment/FundDestination.java +++ b/src/main/java/com/adyen/model/payment/FundDestination.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -37,37 +39,76 @@ public class FundDestination { public static final String JSON_PROPERTY_I_B_A_N = "IBAN"; private String IBAN; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIBAN = false; + public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private Address billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_CARD = "card"; private Card card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = false; + public static final String JSON_PROPERTY_SELECTED_RECURRING_DETAIL_REFERENCE = "selectedRecurringDetailReference"; private String selectedRecurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSelectedRecurringDetailReference = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_NAME = "shopperName"; private Name shopperName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperName = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_SUB_MERCHANT = "subMerchant"; private SubMerchant subMerchant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchant = false; + public static final String JSON_PROPERTY_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + public static final String JSON_PROPERTY_WALLET_PURPOSE = "walletPurpose"; private String walletPurpose; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWalletPurpose = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public FundDestination() {} /** @@ -78,6 +119,7 @@ public FundDestination() {} */ public FundDestination IBAN(String IBAN) { this.IBAN = IBAN; + isSetIBAN = true; // mark as set return this; } @@ -101,6 +143,7 @@ public String getIBAN() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIBAN(String IBAN) { this.IBAN = IBAN; + isSetIBAN = true; // mark as set } /** @@ -112,6 +155,7 @@ public void setIBAN(String IBAN) { */ public FundDestination additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -145,6 +189,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -155,6 +200,7 @@ public void setAdditionalData(Map additionalData) { */ public FundDestination billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -178,6 +224,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -188,6 +235,7 @@ public void setBillingAddress(Address billingAddress) { */ public FundDestination card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -211,6 +259,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -224,6 +273,7 @@ public void setCard(Card card) { */ public FundDestination selectedRecurringDetailReference(String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set return this; } @@ -253,6 +303,7 @@ public String getSelectedRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelectedRecurringDetailReference(String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set } /** @@ -263,6 +314,7 @@ public void setSelectedRecurringDetailReference(String selectedRecurringDetailRe */ public FundDestination shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -286,6 +338,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -296,6 +349,7 @@ public void setShopperEmail(String shopperEmail) { */ public FundDestination shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -319,6 +373,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -335,6 +390,7 @@ public void setShopperName(Name shopperName) { */ public FundDestination shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -370,6 +426,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -380,6 +437,7 @@ public void setShopperReference(String shopperReference) { */ public FundDestination subMerchant(SubMerchant subMerchant) { this.subMerchant = subMerchant; + isSetSubMerchant = true; // mark as set return this; } @@ -403,6 +461,7 @@ public SubMerchant getSubMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchant(SubMerchant subMerchant) { this.subMerchant = subMerchant; + isSetSubMerchant = true; // mark as set } /** @@ -413,6 +472,7 @@ public void setSubMerchant(SubMerchant subMerchant) { */ public FundDestination telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -436,6 +496,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -446,6 +507,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public FundDestination walletPurpose(String walletPurpose) { this.walletPurpose = walletPurpose; + isSetWalletPurpose = true; // mark as set return this; } @@ -469,6 +531,27 @@ public String getWalletPurpose() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWalletPurpose(String walletPurpose) { this.walletPurpose = walletPurpose; + isSetWalletPurpose = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FundDestination 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 FundDestination object is equal to o. */ @@ -482,33 +565,57 @@ public boolean equals(Object o) { } FundDestination fundDestination = (FundDestination) o; return Objects.equals(this.IBAN, fundDestination.IBAN) + && Objects.equals(this.isSetIBAN, fundDestination.isSetIBAN) && Objects.equals(this.additionalData, fundDestination.additionalData) + && Objects.equals(this.isSetAdditionalData, fundDestination.isSetAdditionalData) && Objects.equals(this.billingAddress, fundDestination.billingAddress) + && Objects.equals(this.isSetBillingAddress, fundDestination.isSetBillingAddress) && Objects.equals(this.card, fundDestination.card) + && Objects.equals(this.isSetCard, fundDestination.isSetCard) && Objects.equals( this.selectedRecurringDetailReference, fundDestination.selectedRecurringDetailReference) + && Objects.equals( + this.isSetSelectedRecurringDetailReference, + fundDestination.isSetSelectedRecurringDetailReference) && Objects.equals(this.shopperEmail, fundDestination.shopperEmail) + && Objects.equals(this.isSetShopperEmail, fundDestination.isSetShopperEmail) && Objects.equals(this.shopperName, fundDestination.shopperName) + && Objects.equals(this.isSetShopperName, fundDestination.isSetShopperName) && Objects.equals(this.shopperReference, fundDestination.shopperReference) + && Objects.equals(this.isSetShopperReference, fundDestination.isSetShopperReference) && Objects.equals(this.subMerchant, fundDestination.subMerchant) + && Objects.equals(this.isSetSubMerchant, fundDestination.isSetSubMerchant) && Objects.equals(this.telephoneNumber, fundDestination.telephoneNumber) - && Objects.equals(this.walletPurpose, fundDestination.walletPurpose); + && Objects.equals(this.isSetTelephoneNumber, fundDestination.isSetTelephoneNumber) + && Objects.equals(this.walletPurpose, fundDestination.walletPurpose) + && Objects.equals(this.isSetWalletPurpose, fundDestination.isSetWalletPurpose); } @Override public int hashCode() { return Objects.hash( IBAN, + isSetIBAN, additionalData, + isSetAdditionalData, billingAddress, + isSetBillingAddress, card, + isSetCard, selectedRecurringDetailReference, + isSetSelectedRecurringDetailReference, shopperEmail, + isSetShopperEmail, shopperName, + isSetShopperName, shopperReference, + isSetShopperReference, subMerchant, + isSetSubMerchant, telephoneNumber, - walletPurpose); + isSetTelephoneNumber, + walletPurpose, + isSetWalletPurpose); } @Override @@ -542,6 +649,63 @@ 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 (isSetIBAN) { + addIfNull(nulls, JSON_PROPERTY_I_B_A_N, this.IBAN); + } + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetSelectedRecurringDetailReference) { + addIfNull( + nulls, + JSON_PROPERTY_SELECTED_RECURRING_DETAIL_REFERENCE, + this.selectedRecurringDetailReference); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperName) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_NAME, this.shopperName); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetSubMerchant) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT, this.subMerchant); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetWalletPurpose) { + addIfNull(nulls, JSON_PROPERTY_WALLET_PURPOSE, this.walletPurpose); + } + + 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 FundDestination given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/FundSource.java b/src/main/java/com/adyen/model/payment/FundSource.java index ef44f3d60..fbf2d458a 100644 --- a/src/main/java/com/adyen/model/payment/FundSource.java +++ b/src/main/java/com/adyen/model/payment/FundSource.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -32,21 +34,45 @@ public class FundSource { public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private Address billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_CARD = "card"; private Card card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_NAME = "shopperName"; private Name shopperName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperName = false; + public static final String JSON_PROPERTY_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public FundSource() {} /** @@ -58,6 +84,7 @@ public FundSource() {} */ public FundSource additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -91,6 +118,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -101,6 +129,7 @@ public void setAdditionalData(Map additionalData) { */ public FundSource billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -124,6 +153,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -134,6 +164,7 @@ public void setBillingAddress(Address billingAddress) { */ public FundSource card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -157,6 +188,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -167,6 +199,7 @@ public void setCard(Card card) { */ public FundSource shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -190,6 +223,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -200,6 +234,7 @@ public void setShopperEmail(String shopperEmail) { */ public FundSource shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -223,6 +258,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -233,6 +269,7 @@ public void setShopperName(Name shopperName) { */ public FundSource telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -256,6 +293,27 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FundSource 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 FundSource object is equal to o. */ @@ -269,17 +327,34 @@ public boolean equals(Object o) { } FundSource fundSource = (FundSource) o; return Objects.equals(this.additionalData, fundSource.additionalData) + && Objects.equals(this.isSetAdditionalData, fundSource.isSetAdditionalData) && Objects.equals(this.billingAddress, fundSource.billingAddress) + && Objects.equals(this.isSetBillingAddress, fundSource.isSetBillingAddress) && Objects.equals(this.card, fundSource.card) + && Objects.equals(this.isSetCard, fundSource.isSetCard) && Objects.equals(this.shopperEmail, fundSource.shopperEmail) + && Objects.equals(this.isSetShopperEmail, fundSource.isSetShopperEmail) && Objects.equals(this.shopperName, fundSource.shopperName) - && Objects.equals(this.telephoneNumber, fundSource.telephoneNumber); + && Objects.equals(this.isSetShopperName, fundSource.isSetShopperName) + && Objects.equals(this.telephoneNumber, fundSource.telephoneNumber) + && Objects.equals(this.isSetTelephoneNumber, fundSource.isSetTelephoneNumber); } @Override public int hashCode() { return Objects.hash( - additionalData, billingAddress, card, shopperEmail, shopperName, telephoneNumber); + additionalData, + isSetAdditionalData, + billingAddress, + isSetBillingAddress, + card, + isSetCard, + shopperEmail, + isSetShopperEmail, + shopperName, + isSetShopperName, + telephoneNumber, + isSetTelephoneNumber); } @Override @@ -306,6 +381,45 @@ 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 (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperName) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_NAME, this.shopperName); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + + 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 FundSource given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/Installments.java b/src/main/java/com/adyen/model/payment/Installments.java index d8be1106a..57150f88c 100644 --- a/src/main/java/com/adyen/model/payment/Installments.java +++ b/src/main/java/com/adyen/model/payment/Installments.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -31,6 +33,9 @@ public class Installments { public static final String JSON_PROPERTY_EXTRA = "extra"; private Integer extra; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExtra = false; + /** * The installment plan, used for [card installments in * Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). @@ -97,9 +102,21 @@ public static PlanEnum fromValue(String value) { public static final String JSON_PROPERTY_PLAN = "plan"; private PlanEnum plan; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlan = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Integer 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 Installments() {} /** @@ -114,6 +131,7 @@ public Installments() {} */ public Installments extra(Integer extra) { this.extra = extra; + isSetExtra = true; // mark as set return this; } @@ -145,6 +163,7 @@ public Integer getExtra() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExtra(Integer extra) { this.extra = extra; + isSetExtra = true; // mark as set } /** @@ -163,6 +182,7 @@ public void setExtra(Integer extra) { */ public Installments plan(PlanEnum plan) { this.plan = plan; + isSetPlan = true; // mark as set return this; } @@ -202,6 +222,7 @@ public PlanEnum getPlan() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlan(PlanEnum plan) { this.plan = plan; + isSetPlan = true; // mark as set } /** @@ -218,6 +239,7 @@ public void setPlan(PlanEnum plan) { */ public Installments value(Integer value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -253,6 +275,27 @@ public Integer getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Integer value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Installments 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 Installments object is equal to o. */ @@ -266,13 +309,16 @@ public boolean equals(Object o) { } Installments installments = (Installments) o; return Objects.equals(this.extra, installments.extra) + && Objects.equals(this.isSetExtra, installments.isSetExtra) && Objects.equals(this.plan, installments.plan) - && Objects.equals(this.value, installments.value); + && Objects.equals(this.isSetPlan, installments.isSetPlan) + && Objects.equals(this.value, installments.value) + && Objects.equals(this.isSetValue, installments.isSetValue); } @Override public int hashCode() { - return Objects.hash(extra, plan, value); + return Objects.hash(extra, isSetExtra, plan, isSetPlan, value, isSetValue); } @Override @@ -296,6 +342,36 @@ 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 (isSetExtra) { + addIfNull(nulls, JSON_PROPERTY_EXTRA, this.extra); + } + if (isSetPlan) { + addIfNull(nulls, JSON_PROPERTY_PLAN, this.plan); + } + 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 Installments given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/Mandate.java b/src/main/java/com/adyen/model/payment/Mandate.java index 463cfc872..5caa3a317 100644 --- a/src/main/java/com/adyen/model/payment/Mandate.java +++ b/src/main/java/com/adyen/model/payment/Mandate.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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,6 +39,9 @@ public class Mandate { public static final String JSON_PROPERTY_AMOUNT = "amount"; private String amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + /** * The limitation rule of the billing amount. Possible values: * **max**: The transaction amount * can not exceed the `amount`. * **exact**: The transaction amount should be the same @@ -85,6 +90,9 @@ public static AmountRuleEnum fromValue(String value) { public static final String JSON_PROPERTY_AMOUNT_RULE = "amountRule"; private AmountRuleEnum amountRule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountRule = false; + /** * The rule to specify the period, within which the recurring debit can happen, relative to the * mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and @@ -135,15 +143,27 @@ public static BillingAttemptsRuleEnum fromValue(String value) { public static final String JSON_PROPERTY_BILLING_ATTEMPTS_RULE = "billingAttemptsRule"; private BillingAttemptsRuleEnum billingAttemptsRule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAttemptsRule = false; + public static final String JSON_PROPERTY_BILLING_DAY = "billingDay"; private String billingDay; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingDay = false; + public static final String JSON_PROPERTY_COUNT = "count"; private String count; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCount = false; + public static final String JSON_PROPERTY_ENDS_AT = "endsAt"; private String endsAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndsAt = false; + /** * The frequency with which a shopper should be charged. Possible values: **daily**, **weekly**, * **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. @@ -203,12 +223,27 @@ public static FrequencyEnum fromValue(String value) { public static final String JSON_PROPERTY_FREQUENCY = "frequency"; private FrequencyEnum frequency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFrequency = false; + public static final String JSON_PROPERTY_REMARKS = "remarks"; private String remarks; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemarks = false; + public static final String JSON_PROPERTY_STARTS_AT = "startsAt"; private String startsAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartsAt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Mandate() {} /** @@ -219,6 +254,7 @@ public Mandate() {} */ public Mandate amount(String amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -242,6 +278,7 @@ public String getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(String amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -256,6 +293,7 @@ public void setAmount(String amount) { */ public Mandate amountRule(AmountRuleEnum amountRule) { this.amountRule = amountRule; + isSetAmountRule = true; // mark as set return this; } @@ -287,6 +325,7 @@ public AmountRuleEnum getAmountRule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountRule(AmountRuleEnum amountRule) { this.amountRule = amountRule; + isSetAmountRule = true; // mark as set } /** @@ -302,6 +341,7 @@ public void setAmountRule(AmountRuleEnum amountRule) { */ public Mandate billingAttemptsRule(BillingAttemptsRuleEnum billingAttemptsRule) { this.billingAttemptsRule = billingAttemptsRule; + isSetBillingAttemptsRule = true; // mark as set return this; } @@ -335,6 +375,7 @@ public BillingAttemptsRuleEnum getBillingAttemptsRule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAttemptsRule(BillingAttemptsRuleEnum billingAttemptsRule) { this.billingAttemptsRule = billingAttemptsRule; + isSetBillingAttemptsRule = true; // mark as set } /** @@ -349,6 +390,7 @@ public void setBillingAttemptsRule(BillingAttemptsRuleEnum billingAttemptsRule) */ public Mandate billingDay(String billingDay) { this.billingDay = billingDay; + isSetBillingDay = true; // mark as set return this; } @@ -380,6 +422,7 @@ public String getBillingDay() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingDay(String billingDay) { this.billingDay = billingDay; + isSetBillingDay = true; // mark as set } /** @@ -390,6 +433,7 @@ public void setBillingDay(String billingDay) { */ public Mandate count(String count) { this.count = count; + isSetCount = true; // mark as set return this; } @@ -413,6 +457,7 @@ public String getCount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCount(String count) { this.count = count; + isSetCount = true; // mark as set } /** @@ -423,6 +468,7 @@ public void setCount(String count) { */ public Mandate endsAt(String endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set return this; } @@ -446,6 +492,7 @@ public String getEndsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndsAt(String endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set } /** @@ -459,6 +506,7 @@ public void setEndsAt(String endsAt) { */ public Mandate frequency(FrequencyEnum frequency) { this.frequency = frequency; + isSetFrequency = true; // mark as set return this; } @@ -488,6 +536,7 @@ public FrequencyEnum getFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFrequency(FrequencyEnum frequency) { this.frequency = frequency; + isSetFrequency = true; // mark as set } /** @@ -498,6 +547,7 @@ public void setFrequency(FrequencyEnum frequency) { */ public Mandate remarks(String remarks) { this.remarks = remarks; + isSetRemarks = true; // mark as set return this; } @@ -521,6 +571,7 @@ public String getRemarks() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemarks(String remarks) { this.remarks = remarks; + isSetRemarks = true; // mark as set } /** @@ -532,6 +583,7 @@ public void setRemarks(String remarks) { */ public Mandate startsAt(String startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set return this; } @@ -557,6 +609,27 @@ public String getStartsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartsAt(String startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Mandate 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 Mandate object is equal to o. */ @@ -570,28 +643,46 @@ public boolean equals(Object o) { } Mandate mandate = (Mandate) o; return Objects.equals(this.amount, mandate.amount) + && Objects.equals(this.isSetAmount, mandate.isSetAmount) && Objects.equals(this.amountRule, mandate.amountRule) + && Objects.equals(this.isSetAmountRule, mandate.isSetAmountRule) && Objects.equals(this.billingAttemptsRule, mandate.billingAttemptsRule) + && Objects.equals(this.isSetBillingAttemptsRule, mandate.isSetBillingAttemptsRule) && Objects.equals(this.billingDay, mandate.billingDay) + && Objects.equals(this.isSetBillingDay, mandate.isSetBillingDay) && Objects.equals(this.count, mandate.count) + && Objects.equals(this.isSetCount, mandate.isSetCount) && Objects.equals(this.endsAt, mandate.endsAt) + && Objects.equals(this.isSetEndsAt, mandate.isSetEndsAt) && Objects.equals(this.frequency, mandate.frequency) + && Objects.equals(this.isSetFrequency, mandate.isSetFrequency) && Objects.equals(this.remarks, mandate.remarks) - && Objects.equals(this.startsAt, mandate.startsAt); + && Objects.equals(this.isSetRemarks, mandate.isSetRemarks) + && Objects.equals(this.startsAt, mandate.startsAt) + && Objects.equals(this.isSetStartsAt, mandate.isSetStartsAt); } @Override public int hashCode() { return Objects.hash( amount, + isSetAmount, amountRule, + isSetAmountRule, billingAttemptsRule, + isSetBillingAttemptsRule, billingDay, + isSetBillingDay, count, + isSetCount, endsAt, + isSetEndsAt, frequency, + isSetFrequency, remarks, - startsAt); + isSetRemarks, + startsAt, + isSetStartsAt); } @Override @@ -623,6 +714,54 @@ 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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetAmountRule) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_RULE, this.amountRule); + } + if (isSetBillingAttemptsRule) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ATTEMPTS_RULE, this.billingAttemptsRule); + } + if (isSetBillingDay) { + addIfNull(nulls, JSON_PROPERTY_BILLING_DAY, this.billingDay); + } + if (isSetCount) { + addIfNull(nulls, JSON_PROPERTY_COUNT, this.count); + } + if (isSetEndsAt) { + addIfNull(nulls, JSON_PROPERTY_ENDS_AT, this.endsAt); + } + if (isSetFrequency) { + addIfNull(nulls, JSON_PROPERTY_FREQUENCY, this.frequency); + } + if (isSetRemarks) { + addIfNull(nulls, JSON_PROPERTY_REMARKS, this.remarks); + } + if (isSetStartsAt) { + addIfNull(nulls, JSON_PROPERTY_STARTS_AT, this.startsAt); + } + + 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 Mandate given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/MerchantDevice.java b/src/main/java/com/adyen/model/payment/MerchantDevice.java index 98c112b19..7a4dc2fce 100644 --- a/src/main/java/com/adyen/model/payment/MerchantDevice.java +++ b/src/main/java/com/adyen/model/payment/MerchantDevice.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -27,12 +29,27 @@ public class MerchantDevice { public static final String JSON_PROPERTY_OS = "os"; private String os; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOs = false; + public static final String JSON_PROPERTY_OS_VERSION = "osVersion"; private String osVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOsVersion = 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 MerchantDevice() {} /** @@ -43,6 +60,7 @@ public MerchantDevice() {} */ public MerchantDevice os(String os) { this.os = os; + isSetOs = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getOs() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOs(String os) { this.os = os; + isSetOs = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setOs(String os) { */ public MerchantDevice osVersion(String osVersion) { this.osVersion = osVersion; + isSetOsVersion = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getOsVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOsVersion(String osVersion) { this.osVersion = osVersion; + isSetOsVersion = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setOsVersion(String osVersion) { */ public MerchantDevice reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -132,6 +154,27 @@ 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 MerchantDevice 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 MerchantDevice object is equal to o. */ @@ -145,13 +188,16 @@ public boolean equals(Object o) { } MerchantDevice merchantDevice = (MerchantDevice) o; return Objects.equals(this.os, merchantDevice.os) + && Objects.equals(this.isSetOs, merchantDevice.isSetOs) && Objects.equals(this.osVersion, merchantDevice.osVersion) - && Objects.equals(this.reference, merchantDevice.reference); + && Objects.equals(this.isSetOsVersion, merchantDevice.isSetOsVersion) + && Objects.equals(this.reference, merchantDevice.reference) + && Objects.equals(this.isSetReference, merchantDevice.isSetReference); } @Override public int hashCode() { - return Objects.hash(os, osVersion, reference); + return Objects.hash(os, isSetOs, osVersion, isSetOsVersion, reference, isSetReference); } @Override @@ -175,6 +221,36 @@ 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 (isSetOs) { + addIfNull(nulls, JSON_PROPERTY_OS, this.os); + } + if (isSetOsVersion) { + addIfNull(nulls, JSON_PROPERTY_OS_VERSION, this.osVersion); + } + 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 MerchantDevice given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/MerchantRiskIndicator.java b/src/main/java/com/adyen/model/payment/MerchantRiskIndicator.java index 7925fe38e..fbcb31d2b 100644 --- a/src/main/java/com/adyen/model/payment/MerchantRiskIndicator.java +++ b/src/main/java/com/adyen/model/payment/MerchantRiskIndicator.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -43,6 +45,9 @@ public class MerchantRiskIndicator { public static final String JSON_PROPERTY_ADDRESS_MATCH = "addressMatch"; private Boolean addressMatch; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddressMatch = false; + /** * Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * @@ -102,13 +107,22 @@ public static DeliveryAddressIndicatorEnum fromValue(String value) { public static final String JSON_PROPERTY_DELIVERY_ADDRESS_INDICATOR = "deliveryAddressIndicator"; private DeliveryAddressIndicatorEnum deliveryAddressIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddressIndicator = false; + public static final String JSON_PROPERTY_DELIVERY_EMAIL = "deliveryEmail"; @Deprecated // deprecated since Adyen Payment API v68: Use `deliveryEmailAddress` instead. private String deliveryEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryEmail = false; + public static final String JSON_PROPERTY_DELIVERY_EMAIL_ADDRESS = "deliveryEmailAddress"; private String deliveryEmailAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryEmailAddress = false; + /** * The estimated delivery time for the shopper to receive the goods. Allowed values: * * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * @@ -161,33 +175,69 @@ public static DeliveryTimeframeEnum fromValue(String value) { public static final String JSON_PROPERTY_DELIVERY_TIMEFRAME = "deliveryTimeframe"; private DeliveryTimeframeEnum deliveryTimeframe; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryTimeframe = false; + public static final String JSON_PROPERTY_GIFT_CARD_AMOUNT = "giftCardAmount"; private Amount giftCardAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGiftCardAmount = false; + public static final String JSON_PROPERTY_GIFT_CARD_COUNT = "giftCardCount"; private Integer giftCardCount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGiftCardCount = false; + public static final String JSON_PROPERTY_GIFT_CARD_CURR = "giftCardCurr"; private String giftCardCurr; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGiftCardCurr = false; + public static final String JSON_PROPERTY_PRE_ORDER_DATE = "preOrderDate"; private OffsetDateTime preOrderDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPreOrderDate = false; + public static final String JSON_PROPERTY_PRE_ORDER_PURCHASE = "preOrderPurchase"; private Boolean preOrderPurchase; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPreOrderPurchase = false; + public static final String JSON_PROPERTY_PRE_ORDER_PURCHASE_IND = "preOrderPurchaseInd"; private String preOrderPurchaseInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPreOrderPurchaseInd = false; + public static final String JSON_PROPERTY_REORDER_ITEMS = "reorderItems"; private Boolean reorderItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReorderItems = false; + public static final String JSON_PROPERTY_REORDER_ITEMS_IND = "reorderItemsInd"; private String reorderItemsInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReorderItemsInd = false; + public static final String JSON_PROPERTY_SHIP_INDICATOR = "shipIndicator"; private String shipIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShipIndicator = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantRiskIndicator() {} /** @@ -198,6 +248,7 @@ public MerchantRiskIndicator() {} */ public MerchantRiskIndicator addressMatch(Boolean addressMatch) { this.addressMatch = addressMatch; + isSetAddressMatch = true; // mark as set return this; } @@ -221,6 +272,7 @@ public Boolean getAddressMatch() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddressMatch(Boolean addressMatch) { this.addressMatch = addressMatch; + isSetAddressMatch = true; // mark as set } /** @@ -237,6 +289,7 @@ public void setAddressMatch(Boolean addressMatch) { public MerchantRiskIndicator deliveryAddressIndicator( DeliveryAddressIndicatorEnum deliveryAddressIndicator) { this.deliveryAddressIndicator = deliveryAddressIndicator; + isSetDeliveryAddressIndicator = true; // mark as set return this; } @@ -270,6 +323,7 @@ public DeliveryAddressIndicatorEnum getDeliveryAddressIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddressIndicator(DeliveryAddressIndicatorEnum deliveryAddressIndicator) { this.deliveryAddressIndicator = deliveryAddressIndicator; + isSetDeliveryAddressIndicator = true; // mark as set } /** @@ -282,6 +336,7 @@ public void setDeliveryAddressIndicator(DeliveryAddressIndicatorEnum deliveryAdd @Deprecated // deprecated since Adyen Payment API v68: Use `deliveryEmailAddress` instead. public MerchantRiskIndicator deliveryEmail(String deliveryEmail) { this.deliveryEmail = deliveryEmail; + isSetDeliveryEmail = true; // mark as set return this; } @@ -309,6 +364,7 @@ public String getDeliveryEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryEmail(String deliveryEmail) { this.deliveryEmail = deliveryEmail; + isSetDeliveryEmail = true; // mark as set } /** @@ -321,6 +377,7 @@ public void setDeliveryEmail(String deliveryEmail) { */ public MerchantRiskIndicator deliveryEmailAddress(String deliveryEmailAddress) { this.deliveryEmailAddress = deliveryEmailAddress; + isSetDeliveryEmailAddress = true; // mark as set return this; } @@ -348,6 +405,7 @@ public String getDeliveryEmailAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryEmailAddress(String deliveryEmailAddress) { this.deliveryEmailAddress = deliveryEmailAddress; + isSetDeliveryEmailAddress = true; // mark as set } /** @@ -362,6 +420,7 @@ public void setDeliveryEmailAddress(String deliveryEmailAddress) { */ public MerchantRiskIndicator deliveryTimeframe(DeliveryTimeframeEnum deliveryTimeframe) { this.deliveryTimeframe = deliveryTimeframe; + isSetDeliveryTimeframe = true; // mark as set return this; } @@ -393,6 +452,7 @@ public DeliveryTimeframeEnum getDeliveryTimeframe() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryTimeframe(DeliveryTimeframeEnum deliveryTimeframe) { this.deliveryTimeframe = deliveryTimeframe; + isSetDeliveryTimeframe = true; // mark as set } /** @@ -403,6 +463,7 @@ public void setDeliveryTimeframe(DeliveryTimeframeEnum deliveryTimeframe) { */ public MerchantRiskIndicator giftCardAmount(Amount giftCardAmount) { this.giftCardAmount = giftCardAmount; + isSetGiftCardAmount = true; // mark as set return this; } @@ -426,6 +487,7 @@ public Amount getGiftCardAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGiftCardAmount(Amount giftCardAmount) { this.giftCardAmount = giftCardAmount; + isSetGiftCardAmount = true; // mark as set } /** @@ -438,6 +500,7 @@ public void setGiftCardAmount(Amount giftCardAmount) { */ public MerchantRiskIndicator giftCardCount(Integer giftCardCount) { this.giftCardCount = giftCardCount; + isSetGiftCardCount = true; // mark as set return this; } @@ -465,6 +528,7 @@ public Integer getGiftCardCount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGiftCardCount(Integer giftCardCount) { this.giftCardCount = giftCardCount; + isSetGiftCardCount = true; // mark as set } /** @@ -480,6 +544,7 @@ public void setGiftCardCount(Integer giftCardCount) { */ public MerchantRiskIndicator giftCardCurr(String giftCardCurr) { this.giftCardCurr = giftCardCurr; + isSetGiftCardCurr = true; // mark as set return this; } @@ -513,6 +578,7 @@ public String getGiftCardCurr() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGiftCardCurr(String giftCardCurr) { this.giftCardCurr = giftCardCurr; + isSetGiftCardCurr = true; // mark as set } /** @@ -524,6 +590,7 @@ public void setGiftCardCurr(String giftCardCurr) { */ public MerchantRiskIndicator preOrderDate(OffsetDateTime preOrderDate) { this.preOrderDate = preOrderDate; + isSetPreOrderDate = true; // mark as set return this; } @@ -549,6 +616,7 @@ public OffsetDateTime getPreOrderDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPreOrderDate(OffsetDateTime preOrderDate) { this.preOrderDate = preOrderDate; + isSetPreOrderDate = true; // mark as set } /** @@ -559,6 +627,7 @@ public void setPreOrderDate(OffsetDateTime preOrderDate) { */ public MerchantRiskIndicator preOrderPurchase(Boolean preOrderPurchase) { this.preOrderPurchase = preOrderPurchase; + isSetPreOrderPurchase = true; // mark as set return this; } @@ -582,6 +651,7 @@ public Boolean getPreOrderPurchase() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPreOrderPurchase(Boolean preOrderPurchase) { this.preOrderPurchase = preOrderPurchase; + isSetPreOrderPurchase = true; // mark as set } /** @@ -594,6 +664,7 @@ public void setPreOrderPurchase(Boolean preOrderPurchase) { */ public MerchantRiskIndicator preOrderPurchaseInd(String preOrderPurchaseInd) { this.preOrderPurchaseInd = preOrderPurchaseInd; + isSetPreOrderPurchaseInd = true; // mark as set return this; } @@ -621,6 +692,7 @@ public String getPreOrderPurchaseInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPreOrderPurchaseInd(String preOrderPurchaseInd) { this.preOrderPurchaseInd = preOrderPurchaseInd; + isSetPreOrderPurchaseInd = true; // mark as set } /** @@ -632,6 +704,7 @@ public void setPreOrderPurchaseInd(String preOrderPurchaseInd) { */ public MerchantRiskIndicator reorderItems(Boolean reorderItems) { this.reorderItems = reorderItems; + isSetReorderItems = true; // mark as set return this; } @@ -657,6 +730,7 @@ public Boolean getReorderItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReorderItems(Boolean reorderItems) { this.reorderItems = reorderItems; + isSetReorderItems = true; // mark as set } /** @@ -668,6 +742,7 @@ public void setReorderItems(Boolean reorderItems) { */ public MerchantRiskIndicator reorderItemsInd(String reorderItemsInd) { this.reorderItemsInd = reorderItemsInd; + isSetReorderItemsInd = true; // mark as set return this; } @@ -693,6 +768,7 @@ public String getReorderItemsInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReorderItemsInd(String reorderItemsInd) { this.reorderItemsInd = reorderItemsInd; + isSetReorderItemsInd = true; // mark as set } /** @@ -703,6 +779,7 @@ public void setReorderItemsInd(String reorderItemsInd) { */ public MerchantRiskIndicator shipIndicator(String shipIndicator) { this.shipIndicator = shipIndicator; + isSetShipIndicator = true; // mark as set return this; } @@ -726,6 +803,27 @@ public String getShipIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShipIndicator(String shipIndicator) { this.shipIndicator = shipIndicator; + isSetShipIndicator = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantRiskIndicator 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 MerchantRiskIndicator object is equal to o. */ @@ -739,39 +837,70 @@ public boolean equals(Object o) { } MerchantRiskIndicator merchantRiskIndicator = (MerchantRiskIndicator) o; return Objects.equals(this.addressMatch, merchantRiskIndicator.addressMatch) + && Objects.equals(this.isSetAddressMatch, merchantRiskIndicator.isSetAddressMatch) && Objects.equals( this.deliveryAddressIndicator, merchantRiskIndicator.deliveryAddressIndicator) + && Objects.equals( + this.isSetDeliveryAddressIndicator, merchantRiskIndicator.isSetDeliveryAddressIndicator) && Objects.equals(this.deliveryEmail, merchantRiskIndicator.deliveryEmail) + && Objects.equals(this.isSetDeliveryEmail, merchantRiskIndicator.isSetDeliveryEmail) && Objects.equals(this.deliveryEmailAddress, merchantRiskIndicator.deliveryEmailAddress) + && Objects.equals( + this.isSetDeliveryEmailAddress, merchantRiskIndicator.isSetDeliveryEmailAddress) && Objects.equals(this.deliveryTimeframe, merchantRiskIndicator.deliveryTimeframe) + && Objects.equals(this.isSetDeliveryTimeframe, merchantRiskIndicator.isSetDeliveryTimeframe) && Objects.equals(this.giftCardAmount, merchantRiskIndicator.giftCardAmount) + && Objects.equals(this.isSetGiftCardAmount, merchantRiskIndicator.isSetGiftCardAmount) && Objects.equals(this.giftCardCount, merchantRiskIndicator.giftCardCount) + && Objects.equals(this.isSetGiftCardCount, merchantRiskIndicator.isSetGiftCardCount) && Objects.equals(this.giftCardCurr, merchantRiskIndicator.giftCardCurr) + && Objects.equals(this.isSetGiftCardCurr, merchantRiskIndicator.isSetGiftCardCurr) && Objects.equals(this.preOrderDate, merchantRiskIndicator.preOrderDate) + && Objects.equals(this.isSetPreOrderDate, merchantRiskIndicator.isSetPreOrderDate) && Objects.equals(this.preOrderPurchase, merchantRiskIndicator.preOrderPurchase) + && Objects.equals(this.isSetPreOrderPurchase, merchantRiskIndicator.isSetPreOrderPurchase) && Objects.equals(this.preOrderPurchaseInd, merchantRiskIndicator.preOrderPurchaseInd) + && Objects.equals( + this.isSetPreOrderPurchaseInd, merchantRiskIndicator.isSetPreOrderPurchaseInd) && Objects.equals(this.reorderItems, merchantRiskIndicator.reorderItems) + && Objects.equals(this.isSetReorderItems, merchantRiskIndicator.isSetReorderItems) && Objects.equals(this.reorderItemsInd, merchantRiskIndicator.reorderItemsInd) - && Objects.equals(this.shipIndicator, merchantRiskIndicator.shipIndicator); + && Objects.equals(this.isSetReorderItemsInd, merchantRiskIndicator.isSetReorderItemsInd) + && Objects.equals(this.shipIndicator, merchantRiskIndicator.shipIndicator) + && Objects.equals(this.isSetShipIndicator, merchantRiskIndicator.isSetShipIndicator); } @Override public int hashCode() { return Objects.hash( addressMatch, + isSetAddressMatch, deliveryAddressIndicator, + isSetDeliveryAddressIndicator, deliveryEmail, + isSetDeliveryEmail, deliveryEmailAddress, + isSetDeliveryEmailAddress, deliveryTimeframe, + isSetDeliveryTimeframe, giftCardAmount, + isSetGiftCardAmount, giftCardCount, + isSetGiftCardCount, giftCardCurr, + isSetGiftCardCurr, preOrderDate, + isSetPreOrderDate, preOrderPurchase, + isSetPreOrderPurchase, preOrderPurchaseInd, + isSetPreOrderPurchaseInd, reorderItems, + isSetReorderItems, reorderItemsInd, - shipIndicator); + isSetReorderItemsInd, + shipIndicator, + isSetShipIndicator); } @Override @@ -812,6 +941,69 @@ 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 (isSetAddressMatch) { + addIfNull(nulls, JSON_PROPERTY_ADDRESS_MATCH, this.addressMatch); + } + if (isSetDeliveryAddressIndicator) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS_INDICATOR, this.deliveryAddressIndicator); + } + if (isSetDeliveryEmail) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_EMAIL, this.deliveryEmail); + } + if (isSetDeliveryEmailAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_EMAIL_ADDRESS, this.deliveryEmailAddress); + } + if (isSetDeliveryTimeframe) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_TIMEFRAME, this.deliveryTimeframe); + } + if (isSetGiftCardAmount) { + addIfNull(nulls, JSON_PROPERTY_GIFT_CARD_AMOUNT, this.giftCardAmount); + } + if (isSetGiftCardCount) { + addIfNull(nulls, JSON_PROPERTY_GIFT_CARD_COUNT, this.giftCardCount); + } + if (isSetGiftCardCurr) { + addIfNull(nulls, JSON_PROPERTY_GIFT_CARD_CURR, this.giftCardCurr); + } + if (isSetPreOrderDate) { + addIfNull(nulls, JSON_PROPERTY_PRE_ORDER_DATE, this.preOrderDate); + } + if (isSetPreOrderPurchase) { + addIfNull(nulls, JSON_PROPERTY_PRE_ORDER_PURCHASE, this.preOrderPurchase); + } + if (isSetPreOrderPurchaseInd) { + addIfNull(nulls, JSON_PROPERTY_PRE_ORDER_PURCHASE_IND, this.preOrderPurchaseInd); + } + if (isSetReorderItems) { + addIfNull(nulls, JSON_PROPERTY_REORDER_ITEMS, this.reorderItems); + } + if (isSetReorderItemsInd) { + addIfNull(nulls, JSON_PROPERTY_REORDER_ITEMS_IND, this.reorderItemsInd); + } + if (isSetShipIndicator) { + addIfNull(nulls, JSON_PROPERTY_SHIP_INDICATOR, this.shipIndicator); + } + + 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 MerchantRiskIndicator given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ModificationResult.java b/src/main/java/com/adyen/model/payment/ModificationResult.java index ac7520e2a..c4468a25a 100644 --- a/src/main/java/com/adyen/model/payment/ModificationResult.java +++ b/src/main/java/com/adyen/model/payment/ModificationResult.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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,9 +35,15 @@ public class ModificationResult { public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + /** Indicates if the modification request has been received for processing. */ public enum ResponseEnum { _CAPTURE_RECEIVED_(String.valueOf("[capture-received]")), @@ -94,6 +102,15 @@ public static ResponseEnum fromValue(String value) { public static final String JSON_PROPERTY_RESPONSE = "response"; private ResponseEnum response; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ModificationResult() {} /** @@ -106,6 +123,7 @@ public ModificationResult() {} */ public ModificationResult additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -141,6 +159,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -154,6 +173,7 @@ public void setAdditionalData(Map additionalData) { */ public ModificationResult pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -183,6 +203,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -193,6 +214,7 @@ public void setPspReference(String pspReference) { */ public ModificationResult response(ResponseEnum response) { this.response = response; + isSetResponse = true; // mark as set return this; } @@ -216,6 +238,27 @@ public ResponseEnum getResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResponse(ResponseEnum response) { this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ModificationResult 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 ModificationResult object is equal to o. */ @@ -229,13 +272,22 @@ public boolean equals(Object o) { } ModificationResult modificationResult = (ModificationResult) o; return Objects.equals(this.additionalData, modificationResult.additionalData) + && Objects.equals(this.isSetAdditionalData, modificationResult.isSetAdditionalData) && Objects.equals(this.pspReference, modificationResult.pspReference) - && Objects.equals(this.response, modificationResult.response); + && Objects.equals(this.isSetPspReference, modificationResult.isSetPspReference) + && Objects.equals(this.response, modificationResult.response) + && Objects.equals(this.isSetResponse, modificationResult.isSetResponse); } @Override public int hashCode() { - return Objects.hash(additionalData, pspReference, response); + return Objects.hash( + additionalData, + isSetAdditionalData, + pspReference, + isSetPspReference, + response, + isSetResponse); } @Override @@ -259,6 +311,36 @@ 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 (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + + 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 ModificationResult given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/Name.java b/src/main/java/com/adyen/model/payment/Name.java index 26a769518..665216f5b 100644 --- a/src/main/java/com/adyen/model/payment/Name.java +++ b/src/main/java/com/adyen/model/payment/Name.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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,9 +25,21 @@ public class Name { public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; private String firstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirstName = false; + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; private String lastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Name() {} /** @@ -36,6 +50,7 @@ public Name() {} */ public Name firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setFirstName(String firstName) { */ public Name lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Name 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 Name object is equal to o. */ @@ -105,12 +143,14 @@ public boolean equals(Object o) { } Name name = (Name) o; return Objects.equals(this.firstName, name.firstName) - && Objects.equals(this.lastName, name.lastName); + && Objects.equals(this.isSetFirstName, name.isSetFirstName) + && Objects.equals(this.lastName, name.lastName) + && Objects.equals(this.isSetLastName, name.isSetLastName); } @Override public int hashCode() { - return Objects.hash(firstName, lastName); + return Objects.hash(firstName, isSetFirstName, lastName, isSetLastName); } @Override @@ -133,6 +173,33 @@ 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 (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + + 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 Name given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/PaymentRequest.java b/src/main/java/com/adyen/model/payment/PaymentRequest.java index edd552a93..3b562ceb9 100644 --- a/src/main/java/com/adyen/model/payment/PaymentRequest.java +++ b/src/main/java/com/adyen/model/payment/PaymentRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -88,48 +90,93 @@ public class PaymentRequest { public static final String JSON_PROPERTY_ACCOUNT_INFO = "accountInfo"; private AccountInfo accountInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountInfo = false; + public static final String JSON_PROPERTY_ADDITIONAL_AMOUNT = "additionalAmount"; private Amount additionalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalAmount = false; + public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = 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_APPLICATION_INFO = "applicationInfo"; private ApplicationInfo applicationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplicationInfo = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccount bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private Address billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_BROWSER_INFO = "browserInfo"; private BrowserInfo browserInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrowserInfo = false; + public static final String JSON_PROPERTY_CAPTURE_DELAY_HOURS = "captureDelayHours"; private Integer captureDelayHours; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCaptureDelayHours = false; + public static final String JSON_PROPERTY_CARD = "card"; private Card card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = false; + public static final String JSON_PROPERTY_DATE_OF_BIRTH = "dateOfBirth"; private LocalDate dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + public static final String JSON_PROPERTY_DCC_QUOTE = "dccQuote"; private ForexQuote dccQuote; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDccQuote = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private Address deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_DELIVERY_DATE = "deliveryDate"; private OffsetDateTime deliveryDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryDate = false; + public static final String JSON_PROPERTY_DEVICE_FINGERPRINT = "deviceFingerprint"; private String deviceFingerprint; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceFingerprint = false; + /** The type of the entity the payment is processed for. */ public enum EntityTypeEnum { NATURALPERSON(String.valueOf("NaturalPerson")), @@ -174,15 +221,27 @@ public static EntityTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_ENTITY_TYPE = "entityType"; private EntityTypeEnum entityType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityType = false; + public static final String JSON_PROPERTY_FRAUD_OFFSET = "fraudOffset"; private Integer fraudOffset; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudOffset = false; + public static final String JSON_PROPERTY_FUND_DESTINATION = "fundDestination"; private FundDestination fundDestination; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundDestination = false; + public static final String JSON_PROPERTY_FUND_SOURCE = "fundSource"; private FundSource fundSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundSource = false; + /** * The funding source that should be used when multiple sources are available. For Brazilian combo * cards, by default the funding source is credit. To use debit, set this value to **debit**. @@ -232,46 +291,88 @@ public static FundingSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private FundingSourceEnum fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + public static final String JSON_PROPERTY_INSTALLMENTS = "installments"; private Installments installments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallments = false; + public static final String JSON_PROPERTY_LOCALIZED_SHOPPER_STATEMENT = "localizedShopperStatement"; private Map localizedShopperStatement; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLocalizedShopperStatement = false; + public static final String JSON_PROPERTY_MANDATE = "mandate"; private Mandate mandate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMandate = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_MERCHANT_ORDER_REFERENCE = "merchantOrderReference"; private String merchantOrderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantOrderReference = false; + public static final String JSON_PROPERTY_MERCHANT_RISK_INDICATOR = "merchantRiskIndicator"; private MerchantRiskIndicator merchantRiskIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantRiskIndicator = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_MPI_DATA = "mpiData"; private ThreeDSecureData mpiData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMpiData = false; + public static final String JSON_PROPERTY_NATIONALITY = "nationality"; private String nationality; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNationality = false; + public static final String JSON_PROPERTY_ORDER_REFERENCE = "orderReference"; private String orderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrderReference = false; + public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; private PlatformChargebackLogic platformChargebackLogic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformChargebackLogic = false; + public static final String JSON_PROPERTY_RECURRING = "recurring"; private Recurring recurring; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurring = false; + /** * Defines a recurring payment type. Required when creating a token to store payment details or * using stored payment details. Allowed values: * `Subscription` – A transaction for a @@ -329,29 +430,53 @@ public static RecurringProcessingModelEnum fromValue(String value) { public static final String JSON_PROPERTY_RECURRING_PROCESSING_MODEL = "recurringProcessingModel"; private RecurringProcessingModelEnum recurringProcessingModel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringProcessingModel = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SECURE_REMOTE_COMMERCE_CHECKOUT_DATA = "secureRemoteCommerceCheckoutData"; private SecureRemoteCommerceCheckoutData secureRemoteCommerceCheckoutData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSecureRemoteCommerceCheckoutData = false; + public static final String JSON_PROPERTY_SELECTED_BRAND = "selectedBrand"; private String selectedBrand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSelectedBrand = false; + public static final String JSON_PROPERTY_SELECTED_RECURRING_DETAIL_REFERENCE = "selectedRecurringDetailReference"; private String selectedRecurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSelectedRecurringDetailReference = false; + public static final String JSON_PROPERTY_SESSION_ID = "sessionId"; private String sessionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSessionId = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_I_P = "shopperIP"; private String shopperIP; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperIP = false; + /** * Specifies the sales channel, through which the shopper gives their card details, and whether * the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper @@ -412,43 +537,88 @@ public static ShopperInteractionEnum fromValue(String value) { public static final String JSON_PROPERTY_SHOPPER_INTERACTION = "shopperInteraction"; private ShopperInteractionEnum shopperInteraction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperInteraction = false; + public static final String JSON_PROPERTY_SHOPPER_LOCALE = "shopperLocale"; private String shopperLocale; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperLocale = false; + public static final String JSON_PROPERTY_SHOPPER_NAME = "shopperName"; private Name shopperName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperName = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_SHOPPER_STATEMENT = "shopperStatement"; private String shopperStatement; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperStatement = false; + public static final String JSON_PROPERTY_SOCIAL_SECURITY_NUMBER = "socialSecurityNumber"; private String socialSecurityNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSocialSecurityNumber = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + public static final String JSON_PROPERTY_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + public static final String JSON_PROPERTY_THREE_D_S2_REQUEST_DATA = "threeDS2RequestData"; private ThreeDS2RequestData threeDS2RequestData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2RequestData = false; + public static final String JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY = "threeDSAuthenticationOnly"; private Boolean threeDSAuthenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSAuthenticationOnly = false; + public static final String JSON_PROPERTY_TOTALS_GROUP = "totalsGroup"; private String totalsGroup; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalsGroup = false; + public static final String JSON_PROPERTY_TRUSTED_SHOPPER = "trustedShopper"; private Boolean trustedShopper; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrustedShopper = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentRequest() {} /** @@ -459,6 +629,7 @@ public PaymentRequest() {} */ public PaymentRequest accountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set return this; } @@ -482,6 +653,7 @@ public AccountInfo getAccountInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set } /** @@ -492,6 +664,7 @@ public void setAccountInfo(AccountInfo accountInfo) { */ public PaymentRequest additionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set return this; } @@ -515,6 +688,7 @@ public Amount getAdditionalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set } /** @@ -529,6 +703,7 @@ public void setAdditionalAmount(Amount additionalAmount) { */ public PaymentRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -568,6 +743,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -578,6 +754,7 @@ public void setAdditionalData(Map additionalData) { */ public PaymentRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -601,6 +778,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -611,6 +789,7 @@ public void setAmount(Amount amount) { */ public PaymentRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -634,6 +813,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -644,6 +824,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentRequest bankAccount(BankAccount bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -667,6 +848,7 @@ public BankAccount getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccount bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -677,6 +859,7 @@ public void setBankAccount(BankAccount bankAccount) { */ public PaymentRequest billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -700,6 +883,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -710,6 +894,7 @@ public void setBillingAddress(Address billingAddress) { */ public PaymentRequest browserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set return this; } @@ -733,6 +918,7 @@ public BrowserInfo getBrowserInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrowserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set } /** @@ -744,6 +930,7 @@ public void setBrowserInfo(BrowserInfo browserInfo) { */ public PaymentRequest captureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set return this; } @@ -769,6 +956,7 @@ public Integer getCaptureDelayHours() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set } /** @@ -779,6 +967,7 @@ public void setCaptureDelayHours(Integer captureDelayHours) { */ public PaymentRequest card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -802,6 +991,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -814,6 +1004,7 @@ public void setCard(Card card) { */ public PaymentRequest dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -841,6 +1032,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -851,6 +1043,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public PaymentRequest dccQuote(ForexQuote dccQuote) { this.dccQuote = dccQuote; + isSetDccQuote = true; // mark as set return this; } @@ -874,6 +1067,7 @@ public ForexQuote getDccQuote() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDccQuote(ForexQuote dccQuote) { this.dccQuote = dccQuote; + isSetDccQuote = true; // mark as set } /** @@ -884,6 +1078,7 @@ public void setDccQuote(ForexQuote dccQuote) { */ public PaymentRequest deliveryAddress(Address deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -907,6 +1102,7 @@ public Address getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(Address deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -921,6 +1117,7 @@ public void setDeliveryAddress(Address deliveryAddress) { */ public PaymentRequest deliveryDate(OffsetDateTime deliveryDate) { this.deliveryDate = deliveryDate; + isSetDeliveryDate = true; // mark as set return this; } @@ -952,6 +1149,7 @@ public OffsetDateTime getDeliveryDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryDate(OffsetDateTime deliveryDate) { this.deliveryDate = deliveryDate; + isSetDeliveryDate = true; // mark as set } /** @@ -965,6 +1163,7 @@ public void setDeliveryDate(OffsetDateTime deliveryDate) { */ public PaymentRequest deviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set return this; } @@ -994,6 +1193,7 @@ public String getDeviceFingerprint() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set } /** @@ -1004,6 +1204,7 @@ public void setDeviceFingerprint(String deviceFingerprint) { */ public PaymentRequest entityType(EntityTypeEnum entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set return this; } @@ -1027,6 +1228,7 @@ public EntityTypeEnum getEntityType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityType(EntityTypeEnum entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set } /** @@ -1039,6 +1241,7 @@ public void setEntityType(EntityTypeEnum entityType) { */ public PaymentRequest fraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set return this; } @@ -1066,6 +1269,7 @@ public Integer getFraudOffset() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set } /** @@ -1076,6 +1280,7 @@ public void setFraudOffset(Integer fraudOffset) { */ public PaymentRequest fundDestination(FundDestination fundDestination) { this.fundDestination = fundDestination; + isSetFundDestination = true; // mark as set return this; } @@ -1099,6 +1304,7 @@ public FundDestination getFundDestination() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundDestination(FundDestination fundDestination) { this.fundDestination = fundDestination; + isSetFundDestination = true; // mark as set } /** @@ -1109,6 +1315,7 @@ public void setFundDestination(FundDestination fundDestination) { */ public PaymentRequest fundSource(FundSource fundSource) { this.fundSource = fundSource; + isSetFundSource = true; // mark as set return this; } @@ -1132,6 +1339,7 @@ public FundSource getFundSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundSource(FundSource fundSource) { this.fundSource = fundSource; + isSetFundSource = true; // mark as set } /** @@ -1145,6 +1353,7 @@ public void setFundSource(FundSource fundSource) { */ public PaymentRequest fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -1174,6 +1383,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -1184,6 +1394,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public PaymentRequest installments(Installments installments) { this.installments = installments; + isSetInstallments = true; // mark as set return this; } @@ -1207,6 +1418,7 @@ public Installments getInstallments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallments(Installments installments) { this.installments = installments; + isSetInstallments = true; // mark as set } /** @@ -1227,6 +1439,7 @@ public void setInstallments(Installments installments) { */ public PaymentRequest localizedShopperStatement(Map localizedShopperStatement) { this.localizedShopperStatement = localizedShopperStatement; + isSetLocalizedShopperStatement = true; // mark as set return this; } @@ -1279,6 +1492,7 @@ public Map getLocalizedShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLocalizedShopperStatement(Map localizedShopperStatement) { this.localizedShopperStatement = localizedShopperStatement; + isSetLocalizedShopperStatement = true; // mark as set } /** @@ -1289,6 +1503,7 @@ public void setLocalizedShopperStatement(Map localizedShopperSta */ public PaymentRequest mandate(Mandate mandate) { this.mandate = mandate; + isSetMandate = true; // mark as set return this; } @@ -1312,6 +1527,7 @@ public Mandate getMandate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMandate(Mandate mandate) { this.mandate = mandate; + isSetMandate = true; // mark as set } /** @@ -1326,6 +1542,7 @@ public void setMandate(Mandate mandate) { */ public PaymentRequest mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -1357,6 +1574,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -1368,6 +1586,7 @@ public void setMcc(String mcc) { */ public PaymentRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -1393,6 +1612,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -1417,6 +1637,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentRequest merchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set return this; } @@ -1469,6 +1690,7 @@ public String getMerchantOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set } /** @@ -1479,6 +1701,7 @@ public void setMerchantOrderReference(String merchantOrderReference) { */ public PaymentRequest merchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator) { this.merchantRiskIndicator = merchantRiskIndicator; + isSetMerchantRiskIndicator = true; // mark as set return this; } @@ -1502,6 +1725,7 @@ public MerchantRiskIndicator getMerchantRiskIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator) { this.merchantRiskIndicator = merchantRiskIndicator; + isSetMerchantRiskIndicator = true; // mark as set } /** @@ -1518,6 +1742,7 @@ public void setMerchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator */ public PaymentRequest metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -1561,6 +1786,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -1571,6 +1797,7 @@ public void setMetadata(Map metadata) { */ public PaymentRequest mpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set return this; } @@ -1594,6 +1821,7 @@ public ThreeDSecureData getMpiData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set } /** @@ -1604,6 +1832,7 @@ public void setMpiData(ThreeDSecureData mpiData) { */ public PaymentRequest nationality(String nationality) { this.nationality = nationality; + isSetNationality = true; // mark as set return this; } @@ -1627,6 +1856,7 @@ public String getNationality() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNationality(String nationality) { this.nationality = nationality; + isSetNationality = true; // mark as set } /** @@ -1642,6 +1872,7 @@ public void setNationality(String nationality) { */ public PaymentRequest orderReference(String orderReference) { this.orderReference = orderReference; + isSetOrderReference = true; // mark as set return this; } @@ -1675,6 +1906,7 @@ public String getOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrderReference(String orderReference) { this.orderReference = orderReference; + isSetOrderReference = true; // mark as set } /** @@ -1685,6 +1917,7 @@ public void setOrderReference(String orderReference) { */ public PaymentRequest platformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -1708,6 +1941,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -1718,6 +1952,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public PaymentRequest recurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set return this; } @@ -1741,6 +1976,7 @@ public Recurring getRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set } /** @@ -1769,6 +2005,7 @@ public void setRecurring(Recurring recurring) { public PaymentRequest recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -1826,6 +2063,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -1842,6 +2080,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public PaymentRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -1877,6 +2116,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -1888,6 +2128,7 @@ public void setReference(String reference) { public PaymentRequest secureRemoteCommerceCheckoutData( SecureRemoteCommerceCheckoutData secureRemoteCommerceCheckoutData) { this.secureRemoteCommerceCheckoutData = secureRemoteCommerceCheckoutData; + isSetSecureRemoteCommerceCheckoutData = true; // mark as set return this; } @@ -1912,6 +2153,7 @@ public SecureRemoteCommerceCheckoutData getSecureRemoteCommerceCheckoutData() { public void setSecureRemoteCommerceCheckoutData( SecureRemoteCommerceCheckoutData secureRemoteCommerceCheckoutData) { this.secureRemoteCommerceCheckoutData = secureRemoteCommerceCheckoutData; + isSetSecureRemoteCommerceCheckoutData = true; // mark as set } /** @@ -1928,6 +2170,7 @@ public void setSecureRemoteCommerceCheckoutData( */ public PaymentRequest selectedBrand(String selectedBrand) { this.selectedBrand = selectedBrand; + isSetSelectedBrand = true; // mark as set return this; } @@ -1963,6 +2206,7 @@ public String getSelectedBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelectedBrand(String selectedBrand) { this.selectedBrand = selectedBrand; + isSetSelectedBrand = true; // mark as set } /** @@ -1976,6 +2220,7 @@ public void setSelectedBrand(String selectedBrand) { */ public PaymentRequest selectedRecurringDetailReference(String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set return this; } @@ -2005,6 +2250,7 @@ public String getSelectedRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelectedRecurringDetailReference(String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set } /** @@ -2015,6 +2261,7 @@ public void setSelectedRecurringDetailReference(String selectedRecurringDetailRe */ public PaymentRequest sessionId(String sessionId) { this.sessionId = sessionId; + isSetSessionId = true; // mark as set return this; } @@ -2038,6 +2285,7 @@ public String getSessionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSessionId(String sessionId) { this.sessionId = sessionId; + isSetSessionId = true; // mark as set } /** @@ -2052,6 +2300,7 @@ public void setSessionId(String sessionId) { */ public PaymentRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -2083,6 +2332,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -2106,6 +2356,7 @@ public void setShopperEmail(String shopperEmail) { */ public PaymentRequest shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -2155,6 +2406,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -2186,6 +2438,7 @@ public void setShopperIP(String shopperIP) { */ public PaymentRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -2251,6 +2504,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -2263,6 +2517,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public PaymentRequest shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -2290,6 +2545,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -2300,6 +2556,7 @@ public void setShopperLocale(String shopperLocale) { */ public PaymentRequest shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -2323,6 +2580,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -2339,6 +2597,7 @@ public void setShopperName(Name shopperName) { */ public PaymentRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -2374,6 +2633,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -2389,6 +2649,7 @@ public void setShopperReference(String shopperReference) { */ public PaymentRequest shopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set return this; } @@ -2422,6 +2683,7 @@ public String getShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set } /** @@ -2432,6 +2694,7 @@ public void setShopperStatement(String shopperStatement) { */ public PaymentRequest socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -2455,6 +2718,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -2471,6 +2735,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public PaymentRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -2514,6 +2779,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -2537,6 +2803,7 @@ public void setSplits(List splits) { */ public PaymentRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -2586,6 +2853,7 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set } /** @@ -2604,6 +2872,7 @@ public void setStore(String store) { */ public PaymentRequest telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -2643,6 +2912,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -2653,6 +2923,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public PaymentRequest threeDS2RequestData(ThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set return this; } @@ -2676,6 +2947,7 @@ public ThreeDS2RequestData getThreeDS2RequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2RequestData(ThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set } /** @@ -2692,6 +2964,7 @@ public void setThreeDS2RequestData(ThreeDS2RequestData threeDS2RequestData) { */ public PaymentRequest threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set return this; } @@ -2727,6 +3000,7 @@ public Boolean getThreeDSAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set } /** @@ -2739,6 +3013,7 @@ public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { */ public PaymentRequest totalsGroup(String totalsGroup) { this.totalsGroup = totalsGroup; + isSetTotalsGroup = true; // mark as set return this; } @@ -2766,6 +3041,7 @@ public String getTotalsGroup() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTotalsGroup(String totalsGroup) { this.totalsGroup = totalsGroup; + isSetTotalsGroup = true; // mark as set } /** @@ -2776,6 +3052,7 @@ public void setTotalsGroup(String totalsGroup) { */ public PaymentRequest trustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set return this; } @@ -2799,6 +3076,27 @@ public Boolean getTrustedShopper() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentRequest 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 PaymentRequest object is equal to o. */ @@ -2812,120 +3110,238 @@ public boolean equals(Object o) { } PaymentRequest paymentRequest = (PaymentRequest) o; return Objects.equals(this.accountInfo, paymentRequest.accountInfo) + && Objects.equals(this.isSetAccountInfo, paymentRequest.isSetAccountInfo) && Objects.equals(this.additionalAmount, paymentRequest.additionalAmount) + && Objects.equals(this.isSetAdditionalAmount, paymentRequest.isSetAdditionalAmount) && Objects.equals(this.additionalData, paymentRequest.additionalData) + && Objects.equals(this.isSetAdditionalData, paymentRequest.isSetAdditionalData) && Objects.equals(this.amount, paymentRequest.amount) + && Objects.equals(this.isSetAmount, paymentRequest.isSetAmount) && Objects.equals(this.applicationInfo, paymentRequest.applicationInfo) + && Objects.equals(this.isSetApplicationInfo, paymentRequest.isSetApplicationInfo) && Objects.equals(this.bankAccount, paymentRequest.bankAccount) + && Objects.equals(this.isSetBankAccount, paymentRequest.isSetBankAccount) && Objects.equals(this.billingAddress, paymentRequest.billingAddress) + && Objects.equals(this.isSetBillingAddress, paymentRequest.isSetBillingAddress) && Objects.equals(this.browserInfo, paymentRequest.browserInfo) + && Objects.equals(this.isSetBrowserInfo, paymentRequest.isSetBrowserInfo) && Objects.equals(this.captureDelayHours, paymentRequest.captureDelayHours) + && Objects.equals(this.isSetCaptureDelayHours, paymentRequest.isSetCaptureDelayHours) && Objects.equals(this.card, paymentRequest.card) + && Objects.equals(this.isSetCard, paymentRequest.isSetCard) && Objects.equals(this.dateOfBirth, paymentRequest.dateOfBirth) + && Objects.equals(this.isSetDateOfBirth, paymentRequest.isSetDateOfBirth) && Objects.equals(this.dccQuote, paymentRequest.dccQuote) + && Objects.equals(this.isSetDccQuote, paymentRequest.isSetDccQuote) && Objects.equals(this.deliveryAddress, paymentRequest.deliveryAddress) + && Objects.equals(this.isSetDeliveryAddress, paymentRequest.isSetDeliveryAddress) && Objects.equals(this.deliveryDate, paymentRequest.deliveryDate) + && Objects.equals(this.isSetDeliveryDate, paymentRequest.isSetDeliveryDate) && Objects.equals(this.deviceFingerprint, paymentRequest.deviceFingerprint) + && Objects.equals(this.isSetDeviceFingerprint, paymentRequest.isSetDeviceFingerprint) && Objects.equals(this.entityType, paymentRequest.entityType) + && Objects.equals(this.isSetEntityType, paymentRequest.isSetEntityType) && Objects.equals(this.fraudOffset, paymentRequest.fraudOffset) + && Objects.equals(this.isSetFraudOffset, paymentRequest.isSetFraudOffset) && Objects.equals(this.fundDestination, paymentRequest.fundDestination) + && Objects.equals(this.isSetFundDestination, paymentRequest.isSetFundDestination) && Objects.equals(this.fundSource, paymentRequest.fundSource) + && Objects.equals(this.isSetFundSource, paymentRequest.isSetFundSource) && Objects.equals(this.fundingSource, paymentRequest.fundingSource) + && Objects.equals(this.isSetFundingSource, paymentRequest.isSetFundingSource) && Objects.equals(this.installments, paymentRequest.installments) + && Objects.equals(this.isSetInstallments, paymentRequest.isSetInstallments) && Objects.equals(this.localizedShopperStatement, paymentRequest.localizedShopperStatement) + && Objects.equals( + this.isSetLocalizedShopperStatement, paymentRequest.isSetLocalizedShopperStatement) && Objects.equals(this.mandate, paymentRequest.mandate) + && Objects.equals(this.isSetMandate, paymentRequest.isSetMandate) && Objects.equals(this.mcc, paymentRequest.mcc) + && Objects.equals(this.isSetMcc, paymentRequest.isSetMcc) && Objects.equals(this.merchantAccount, paymentRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, paymentRequest.isSetMerchantAccount) && Objects.equals(this.merchantOrderReference, paymentRequest.merchantOrderReference) + && Objects.equals( + this.isSetMerchantOrderReference, paymentRequest.isSetMerchantOrderReference) && Objects.equals(this.merchantRiskIndicator, paymentRequest.merchantRiskIndicator) + && Objects.equals( + this.isSetMerchantRiskIndicator, paymentRequest.isSetMerchantRiskIndicator) && Objects.equals(this.metadata, paymentRequest.metadata) + && Objects.equals(this.isSetMetadata, paymentRequest.isSetMetadata) && Objects.equals(this.mpiData, paymentRequest.mpiData) + && Objects.equals(this.isSetMpiData, paymentRequest.isSetMpiData) && Objects.equals(this.nationality, paymentRequest.nationality) + && Objects.equals(this.isSetNationality, paymentRequest.isSetNationality) && Objects.equals(this.orderReference, paymentRequest.orderReference) + && Objects.equals(this.isSetOrderReference, paymentRequest.isSetOrderReference) && Objects.equals(this.platformChargebackLogic, paymentRequest.platformChargebackLogic) + && Objects.equals( + this.isSetPlatformChargebackLogic, paymentRequest.isSetPlatformChargebackLogic) && Objects.equals(this.recurring, paymentRequest.recurring) + && Objects.equals(this.isSetRecurring, paymentRequest.isSetRecurring) && Objects.equals(this.recurringProcessingModel, paymentRequest.recurringProcessingModel) + && Objects.equals( + this.isSetRecurringProcessingModel, paymentRequest.isSetRecurringProcessingModel) && Objects.equals(this.reference, paymentRequest.reference) + && Objects.equals(this.isSetReference, paymentRequest.isSetReference) && Objects.equals( this.secureRemoteCommerceCheckoutData, paymentRequest.secureRemoteCommerceCheckoutData) + && Objects.equals( + this.isSetSecureRemoteCommerceCheckoutData, + paymentRequest.isSetSecureRemoteCommerceCheckoutData) && Objects.equals(this.selectedBrand, paymentRequest.selectedBrand) + && Objects.equals(this.isSetSelectedBrand, paymentRequest.isSetSelectedBrand) && Objects.equals( this.selectedRecurringDetailReference, paymentRequest.selectedRecurringDetailReference) + && Objects.equals( + this.isSetSelectedRecurringDetailReference, + paymentRequest.isSetSelectedRecurringDetailReference) && Objects.equals(this.sessionId, paymentRequest.sessionId) + && Objects.equals(this.isSetSessionId, paymentRequest.isSetSessionId) && Objects.equals(this.shopperEmail, paymentRequest.shopperEmail) + && Objects.equals(this.isSetShopperEmail, paymentRequest.isSetShopperEmail) && Objects.equals(this.shopperIP, paymentRequest.shopperIP) + && Objects.equals(this.isSetShopperIP, paymentRequest.isSetShopperIP) && Objects.equals(this.shopperInteraction, paymentRequest.shopperInteraction) + && Objects.equals(this.isSetShopperInteraction, paymentRequest.isSetShopperInteraction) && Objects.equals(this.shopperLocale, paymentRequest.shopperLocale) + && Objects.equals(this.isSetShopperLocale, paymentRequest.isSetShopperLocale) && Objects.equals(this.shopperName, paymentRequest.shopperName) + && Objects.equals(this.isSetShopperName, paymentRequest.isSetShopperName) && Objects.equals(this.shopperReference, paymentRequest.shopperReference) + && Objects.equals(this.isSetShopperReference, paymentRequest.isSetShopperReference) && Objects.equals(this.shopperStatement, paymentRequest.shopperStatement) + && Objects.equals(this.isSetShopperStatement, paymentRequest.isSetShopperStatement) && Objects.equals(this.socialSecurityNumber, paymentRequest.socialSecurityNumber) + && Objects.equals(this.isSetSocialSecurityNumber, paymentRequest.isSetSocialSecurityNumber) && Objects.equals(this.splits, paymentRequest.splits) + && Objects.equals(this.isSetSplits, paymentRequest.isSetSplits) && Objects.equals(this.store, paymentRequest.store) + && Objects.equals(this.isSetStore, paymentRequest.isSetStore) && Objects.equals(this.telephoneNumber, paymentRequest.telephoneNumber) + && Objects.equals(this.isSetTelephoneNumber, paymentRequest.isSetTelephoneNumber) && Objects.equals(this.threeDS2RequestData, paymentRequest.threeDS2RequestData) + && Objects.equals(this.isSetThreeDS2RequestData, paymentRequest.isSetThreeDS2RequestData) && Objects.equals(this.threeDSAuthenticationOnly, paymentRequest.threeDSAuthenticationOnly) + && Objects.equals( + this.isSetThreeDSAuthenticationOnly, paymentRequest.isSetThreeDSAuthenticationOnly) && Objects.equals(this.totalsGroup, paymentRequest.totalsGroup) - && Objects.equals(this.trustedShopper, paymentRequest.trustedShopper); + && Objects.equals(this.isSetTotalsGroup, paymentRequest.isSetTotalsGroup) + && Objects.equals(this.trustedShopper, paymentRequest.trustedShopper) + && Objects.equals(this.isSetTrustedShopper, paymentRequest.isSetTrustedShopper); } @Override public int hashCode() { return Objects.hash( accountInfo, + isSetAccountInfo, additionalAmount, + isSetAdditionalAmount, additionalData, + isSetAdditionalData, amount, + isSetAmount, applicationInfo, + isSetApplicationInfo, bankAccount, + isSetBankAccount, billingAddress, + isSetBillingAddress, browserInfo, + isSetBrowserInfo, captureDelayHours, + isSetCaptureDelayHours, card, + isSetCard, dateOfBirth, + isSetDateOfBirth, dccQuote, + isSetDccQuote, deliveryAddress, + isSetDeliveryAddress, deliveryDate, + isSetDeliveryDate, deviceFingerprint, + isSetDeviceFingerprint, entityType, + isSetEntityType, fraudOffset, + isSetFraudOffset, fundDestination, + isSetFundDestination, fundSource, + isSetFundSource, fundingSource, + isSetFundingSource, installments, + isSetInstallments, localizedShopperStatement, + isSetLocalizedShopperStatement, mandate, + isSetMandate, mcc, + isSetMcc, merchantAccount, + isSetMerchantAccount, merchantOrderReference, + isSetMerchantOrderReference, merchantRiskIndicator, + isSetMerchantRiskIndicator, metadata, + isSetMetadata, mpiData, + isSetMpiData, nationality, + isSetNationality, orderReference, + isSetOrderReference, platformChargebackLogic, + isSetPlatformChargebackLogic, recurring, + isSetRecurring, recurringProcessingModel, + isSetRecurringProcessingModel, reference, + isSetReference, secureRemoteCommerceCheckoutData, + isSetSecureRemoteCommerceCheckoutData, selectedBrand, + isSetSelectedBrand, selectedRecurringDetailReference, + isSetSelectedRecurringDetailReference, sessionId, + isSetSessionId, shopperEmail, + isSetShopperEmail, shopperIP, + isSetShopperIP, shopperInteraction, + isSetShopperInteraction, shopperLocale, + isSetShopperLocale, shopperName, + isSetShopperName, shopperReference, + isSetShopperReference, shopperStatement, + isSetShopperStatement, socialSecurityNumber, + isSetSocialSecurityNumber, splits, + isSetSplits, store, + isSetStore, telephoneNumber, + isSetTelephoneNumber, threeDS2RequestData, + isSetThreeDS2RequestData, threeDSAuthenticationOnly, + isSetThreeDSAuthenticationOnly, totalsGroup, - trustedShopper); + isSetTotalsGroup, + trustedShopper, + isSetTrustedShopper); } @Override @@ -3020,6 +3436,195 @@ 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 (isSetAccountInfo) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_INFO, this.accountInfo); + } + if (isSetAdditionalAmount) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_AMOUNT, this.additionalAmount); + } + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetBrowserInfo) { + addIfNull(nulls, JSON_PROPERTY_BROWSER_INFO, this.browserInfo); + } + if (isSetCaptureDelayHours) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_DELAY_HOURS, this.captureDelayHours); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetDccQuote) { + addIfNull(nulls, JSON_PROPERTY_DCC_QUOTE, this.dccQuote); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetDeliveryDate) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_DATE, this.deliveryDate); + } + if (isSetDeviceFingerprint) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_FINGERPRINT, this.deviceFingerprint); + } + if (isSetEntityType) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_TYPE, this.entityType); + } + if (isSetFraudOffset) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_OFFSET, this.fraudOffset); + } + if (isSetFundDestination) { + addIfNull(nulls, JSON_PROPERTY_FUND_DESTINATION, this.fundDestination); + } + if (isSetFundSource) { + addIfNull(nulls, JSON_PROPERTY_FUND_SOURCE, this.fundSource); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetInstallments) { + addIfNull(nulls, JSON_PROPERTY_INSTALLMENTS, this.installments); + } + if (isSetLocalizedShopperStatement) { + addIfNull(nulls, JSON_PROPERTY_LOCALIZED_SHOPPER_STATEMENT, this.localizedShopperStatement); + } + if (isSetMandate) { + addIfNull(nulls, JSON_PROPERTY_MANDATE, this.mandate); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetMerchantOrderReference) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ORDER_REFERENCE, this.merchantOrderReference); + } + if (isSetMerchantRiskIndicator) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_RISK_INDICATOR, this.merchantRiskIndicator); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMpiData) { + addIfNull(nulls, JSON_PROPERTY_MPI_DATA, this.mpiData); + } + if (isSetNationality) { + addIfNull(nulls, JSON_PROPERTY_NATIONALITY, this.nationality); + } + if (isSetOrderReference) { + addIfNull(nulls, JSON_PROPERTY_ORDER_REFERENCE, this.orderReference); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetRecurring) { + addIfNull(nulls, JSON_PROPERTY_RECURRING, this.recurring); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSecureRemoteCommerceCheckoutData) { + addIfNull( + nulls, + JSON_PROPERTY_SECURE_REMOTE_COMMERCE_CHECKOUT_DATA, + this.secureRemoteCommerceCheckoutData); + } + if (isSetSelectedBrand) { + addIfNull(nulls, JSON_PROPERTY_SELECTED_BRAND, this.selectedBrand); + } + if (isSetSelectedRecurringDetailReference) { + addIfNull( + nulls, + JSON_PROPERTY_SELECTED_RECURRING_DETAIL_REFERENCE, + this.selectedRecurringDetailReference); + } + if (isSetSessionId) { + addIfNull(nulls, JSON_PROPERTY_SESSION_ID, this.sessionId); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperIP) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_I_P, this.shopperIP); + } + if (isSetShopperInteraction) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION, this.shopperInteraction); + } + if (isSetShopperLocale) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_LOCALE, this.shopperLocale); + } + if (isSetShopperName) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_NAME, this.shopperName); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetShopperStatement) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_STATEMENT, this.shopperStatement); + } + if (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetThreeDS2RequestData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_REQUEST_DATA, this.threeDS2RequestData); + } + if (isSetThreeDSAuthenticationOnly) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY, this.threeDSAuthenticationOnly); + } + if (isSetTotalsGroup) { + addIfNull(nulls, JSON_PROPERTY_TOTALS_GROUP, this.totalsGroup); + } + if (isSetTrustedShopper) { + addIfNull(nulls, JSON_PROPERTY_TRUSTED_SHOPPER, this.trustedShopper); + } + + 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 PaymentRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/PaymentRequest3d.java b/src/main/java/com/adyen/model/payment/PaymentRequest3d.java index 03030be1c..51db158fc 100644 --- a/src/main/java/com/adyen/model/payment/PaymentRequest3d.java +++ b/src/main/java/com/adyen/model/payment/PaymentRequest3d.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -79,79 +81,154 @@ public class PaymentRequest3d { public static final String JSON_PROPERTY_ACCOUNT_INFO = "accountInfo"; private AccountInfo accountInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountInfo = false; + public static final String JSON_PROPERTY_ADDITIONAL_AMOUNT = "additionalAmount"; private Amount additionalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalAmount = false; + public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = 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_APPLICATION_INFO = "applicationInfo"; private ApplicationInfo applicationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplicationInfo = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private Address billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_BROWSER_INFO = "browserInfo"; private BrowserInfo browserInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrowserInfo = false; + public static final String JSON_PROPERTY_CAPTURE_DELAY_HOURS = "captureDelayHours"; private Integer captureDelayHours; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCaptureDelayHours = false; + public static final String JSON_PROPERTY_DATE_OF_BIRTH = "dateOfBirth"; private LocalDate dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + public static final String JSON_PROPERTY_DCC_QUOTE = "dccQuote"; private ForexQuote dccQuote; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDccQuote = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private Address deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_DELIVERY_DATE = "deliveryDate"; private OffsetDateTime deliveryDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryDate = false; + public static final String JSON_PROPERTY_DEVICE_FINGERPRINT = "deviceFingerprint"; private String deviceFingerprint; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceFingerprint = false; + public static final String JSON_PROPERTY_FRAUD_OFFSET = "fraudOffset"; private Integer fraudOffset; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudOffset = false; + public static final String JSON_PROPERTY_INSTALLMENTS = "installments"; private Installments installments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallments = false; + public static final String JSON_PROPERTY_LOCALIZED_SHOPPER_STATEMENT = "localizedShopperStatement"; private Map localizedShopperStatement; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLocalizedShopperStatement = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_MD = "md"; private String md; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMd = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_MERCHANT_ORDER_REFERENCE = "merchantOrderReference"; private String merchantOrderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantOrderReference = false; + public static final String JSON_PROPERTY_MERCHANT_RISK_INDICATOR = "merchantRiskIndicator"; private MerchantRiskIndicator merchantRiskIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantRiskIndicator = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_ORDER_REFERENCE = "orderReference"; private String orderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrderReference = false; + public static final String JSON_PROPERTY_PA_RESPONSE = "paResponse"; private String paResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaResponse = false; + public static final String JSON_PROPERTY_RECURRING = "recurring"; private Recurring recurring; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurring = false; + /** * Defines a recurring payment type. Required when creating a token to store payment details or * using stored payment details. Allowed values: * `Subscription` – A transaction for a @@ -209,25 +286,46 @@ public static RecurringProcessingModelEnum fromValue(String value) { public static final String JSON_PROPERTY_RECURRING_PROCESSING_MODEL = "recurringProcessingModel"; private RecurringProcessingModelEnum recurringProcessingModel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringProcessingModel = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SELECTED_BRAND = "selectedBrand"; private String selectedBrand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSelectedBrand = false; + public static final String JSON_PROPERTY_SELECTED_RECURRING_DETAIL_REFERENCE = "selectedRecurringDetailReference"; private String selectedRecurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSelectedRecurringDetailReference = false; + public static final String JSON_PROPERTY_SESSION_ID = "sessionId"; private String sessionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSessionId = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_I_P = "shopperIP"; private String shopperIP; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperIP = false; + /** * Specifies the sales channel, through which the shopper gives their card details, and whether * the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper @@ -288,43 +386,88 @@ public static ShopperInteractionEnum fromValue(String value) { public static final String JSON_PROPERTY_SHOPPER_INTERACTION = "shopperInteraction"; private ShopperInteractionEnum shopperInteraction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperInteraction = false; + public static final String JSON_PROPERTY_SHOPPER_LOCALE = "shopperLocale"; private String shopperLocale; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperLocale = false; + public static final String JSON_PROPERTY_SHOPPER_NAME = "shopperName"; private Name shopperName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperName = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_SHOPPER_STATEMENT = "shopperStatement"; private String shopperStatement; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperStatement = false; + public static final String JSON_PROPERTY_SOCIAL_SECURITY_NUMBER = "socialSecurityNumber"; private String socialSecurityNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSocialSecurityNumber = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + public static final String JSON_PROPERTY_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + public static final String JSON_PROPERTY_THREE_D_S2_REQUEST_DATA = "threeDS2RequestData"; private ThreeDS2RequestData threeDS2RequestData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2RequestData = false; + public static final String JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY = "threeDSAuthenticationOnly"; private Boolean threeDSAuthenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSAuthenticationOnly = false; + public static final String JSON_PROPERTY_TOTALS_GROUP = "totalsGroup"; private String totalsGroup; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalsGroup = false; + public static final String JSON_PROPERTY_TRUSTED_SHOPPER = "trustedShopper"; private Boolean trustedShopper; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrustedShopper = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentRequest3d() {} /** @@ -335,6 +478,7 @@ public PaymentRequest3d() {} */ public PaymentRequest3d accountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set return this; } @@ -358,6 +502,7 @@ public AccountInfo getAccountInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set } /** @@ -368,6 +513,7 @@ public void setAccountInfo(AccountInfo accountInfo) { */ public PaymentRequest3d additionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set return this; } @@ -391,6 +537,7 @@ public Amount getAdditionalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set } /** @@ -405,6 +552,7 @@ public void setAdditionalAmount(Amount additionalAmount) { */ public PaymentRequest3d additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -444,6 +592,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -454,6 +603,7 @@ public void setAdditionalData(Map additionalData) { */ public PaymentRequest3d amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -477,6 +627,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -487,6 +638,7 @@ public void setAmount(Amount amount) { */ public PaymentRequest3d applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -510,6 +662,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -520,6 +673,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentRequest3d billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -543,6 +697,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -553,6 +708,7 @@ public void setBillingAddress(Address billingAddress) { */ public PaymentRequest3d browserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set return this; } @@ -576,6 +732,7 @@ public BrowserInfo getBrowserInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrowserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set } /** @@ -587,6 +744,7 @@ public void setBrowserInfo(BrowserInfo browserInfo) { */ public PaymentRequest3d captureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set return this; } @@ -612,6 +770,7 @@ public Integer getCaptureDelayHours() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set } /** @@ -624,6 +783,7 @@ public void setCaptureDelayHours(Integer captureDelayHours) { */ public PaymentRequest3d dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -651,6 +811,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -661,6 +822,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public PaymentRequest3d dccQuote(ForexQuote dccQuote) { this.dccQuote = dccQuote; + isSetDccQuote = true; // mark as set return this; } @@ -684,6 +846,7 @@ public ForexQuote getDccQuote() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDccQuote(ForexQuote dccQuote) { this.dccQuote = dccQuote; + isSetDccQuote = true; // mark as set } /** @@ -694,6 +857,7 @@ public void setDccQuote(ForexQuote dccQuote) { */ public PaymentRequest3d deliveryAddress(Address deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -717,6 +881,7 @@ public Address getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(Address deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -731,6 +896,7 @@ public void setDeliveryAddress(Address deliveryAddress) { */ public PaymentRequest3d deliveryDate(OffsetDateTime deliveryDate) { this.deliveryDate = deliveryDate; + isSetDeliveryDate = true; // mark as set return this; } @@ -762,6 +928,7 @@ public OffsetDateTime getDeliveryDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryDate(OffsetDateTime deliveryDate) { this.deliveryDate = deliveryDate; + isSetDeliveryDate = true; // mark as set } /** @@ -775,6 +942,7 @@ public void setDeliveryDate(OffsetDateTime deliveryDate) { */ public PaymentRequest3d deviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set return this; } @@ -804,6 +972,7 @@ public String getDeviceFingerprint() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set } /** @@ -816,6 +985,7 @@ public void setDeviceFingerprint(String deviceFingerprint) { */ public PaymentRequest3d fraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set return this; } @@ -843,6 +1013,7 @@ public Integer getFraudOffset() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set } /** @@ -853,6 +1024,7 @@ public void setFraudOffset(Integer fraudOffset) { */ public PaymentRequest3d installments(Installments installments) { this.installments = installments; + isSetInstallments = true; // mark as set return this; } @@ -876,6 +1048,7 @@ public Installments getInstallments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallments(Installments installments) { this.installments = installments; + isSetInstallments = true; // mark as set } /** @@ -896,6 +1069,7 @@ public void setInstallments(Installments installments) { */ public PaymentRequest3d localizedShopperStatement(Map localizedShopperStatement) { this.localizedShopperStatement = localizedShopperStatement; + isSetLocalizedShopperStatement = true; // mark as set return this; } @@ -948,6 +1122,7 @@ public Map getLocalizedShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLocalizedShopperStatement(Map localizedShopperStatement) { this.localizedShopperStatement = localizedShopperStatement; + isSetLocalizedShopperStatement = true; // mark as set } /** @@ -962,6 +1137,7 @@ public void setLocalizedShopperStatement(Map localizedShopperSta */ public PaymentRequest3d mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -993,6 +1169,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -1003,6 +1180,7 @@ public void setMcc(String mcc) { */ public PaymentRequest3d md(String md) { this.md = md; + isSetMd = true; // mark as set return this; } @@ -1026,6 +1204,7 @@ public String getMd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMd(String md) { this.md = md; + isSetMd = true; // mark as set } /** @@ -1037,6 +1216,7 @@ public void setMd(String md) { */ public PaymentRequest3d merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -1062,6 +1242,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -1086,6 +1267,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentRequest3d merchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set return this; } @@ -1138,6 +1320,7 @@ public String getMerchantOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set } /** @@ -1148,6 +1331,7 @@ public void setMerchantOrderReference(String merchantOrderReference) { */ public PaymentRequest3d merchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator) { this.merchantRiskIndicator = merchantRiskIndicator; + isSetMerchantRiskIndicator = true; // mark as set return this; } @@ -1171,6 +1355,7 @@ public MerchantRiskIndicator getMerchantRiskIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator) { this.merchantRiskIndicator = merchantRiskIndicator; + isSetMerchantRiskIndicator = true; // mark as set } /** @@ -1187,6 +1372,7 @@ public void setMerchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator */ public PaymentRequest3d metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -1230,6 +1416,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -1245,6 +1432,7 @@ public void setMetadata(Map metadata) { */ public PaymentRequest3d orderReference(String orderReference) { this.orderReference = orderReference; + isSetOrderReference = true; // mark as set return this; } @@ -1278,6 +1466,7 @@ public String getOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrderReference(String orderReference) { this.orderReference = orderReference; + isSetOrderReference = true; // mark as set } /** @@ -1290,6 +1479,7 @@ public void setOrderReference(String orderReference) { */ public PaymentRequest3d paResponse(String paResponse) { this.paResponse = paResponse; + isSetPaResponse = true; // mark as set return this; } @@ -1317,6 +1507,7 @@ public String getPaResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaResponse(String paResponse) { this.paResponse = paResponse; + isSetPaResponse = true; // mark as set } /** @@ -1327,6 +1518,7 @@ public void setPaResponse(String paResponse) { */ public PaymentRequest3d recurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set return this; } @@ -1350,6 +1542,7 @@ public Recurring getRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set } /** @@ -1378,6 +1571,7 @@ public void setRecurring(Recurring recurring) { public PaymentRequest3d recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -1435,6 +1629,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -1451,6 +1646,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public PaymentRequest3d reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -1486,6 +1682,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -1502,6 +1699,7 @@ public void setReference(String reference) { */ public PaymentRequest3d selectedBrand(String selectedBrand) { this.selectedBrand = selectedBrand; + isSetSelectedBrand = true; // mark as set return this; } @@ -1537,6 +1735,7 @@ public String getSelectedBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelectedBrand(String selectedBrand) { this.selectedBrand = selectedBrand; + isSetSelectedBrand = true; // mark as set } /** @@ -1551,6 +1750,7 @@ public void setSelectedBrand(String selectedBrand) { public PaymentRequest3d selectedRecurringDetailReference( String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set return this; } @@ -1580,6 +1780,7 @@ public String getSelectedRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelectedRecurringDetailReference(String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set } /** @@ -1590,6 +1791,7 @@ public void setSelectedRecurringDetailReference(String selectedRecurringDetailRe */ public PaymentRequest3d sessionId(String sessionId) { this.sessionId = sessionId; + isSetSessionId = true; // mark as set return this; } @@ -1613,6 +1815,7 @@ public String getSessionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSessionId(String sessionId) { this.sessionId = sessionId; + isSetSessionId = true; // mark as set } /** @@ -1627,6 +1830,7 @@ public void setSessionId(String sessionId) { */ public PaymentRequest3d shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -1658,6 +1862,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -1681,6 +1886,7 @@ public void setShopperEmail(String shopperEmail) { */ public PaymentRequest3d shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -1730,6 +1936,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -1761,6 +1968,7 @@ public void setShopperIP(String shopperIP) { */ public PaymentRequest3d shopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -1826,6 +2034,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -1838,6 +2047,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public PaymentRequest3d shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -1865,6 +2075,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -1875,6 +2086,7 @@ public void setShopperLocale(String shopperLocale) { */ public PaymentRequest3d shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -1898,6 +2110,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -1914,6 +2127,7 @@ public void setShopperName(Name shopperName) { */ public PaymentRequest3d shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -1949,6 +2163,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -1964,6 +2179,7 @@ public void setShopperReference(String shopperReference) { */ public PaymentRequest3d shopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set return this; } @@ -1997,6 +2213,7 @@ public String getShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set } /** @@ -2007,6 +2224,7 @@ public void setShopperStatement(String shopperStatement) { */ public PaymentRequest3d socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -2030,6 +2248,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -2046,6 +2265,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public PaymentRequest3d splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -2089,6 +2309,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -2112,6 +2333,7 @@ public void setSplits(List splits) { */ public PaymentRequest3d store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -2161,6 +2383,7 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set } /** @@ -2179,6 +2402,7 @@ public void setStore(String store) { */ public PaymentRequest3d telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -2218,6 +2442,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -2228,6 +2453,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public PaymentRequest3d threeDS2RequestData(ThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set return this; } @@ -2251,6 +2477,7 @@ public ThreeDS2RequestData getThreeDS2RequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2RequestData(ThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set } /** @@ -2267,6 +2494,7 @@ public void setThreeDS2RequestData(ThreeDS2RequestData threeDS2RequestData) { */ public PaymentRequest3d threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set return this; } @@ -2302,6 +2530,7 @@ public Boolean getThreeDSAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set } /** @@ -2314,6 +2543,7 @@ public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { */ public PaymentRequest3d totalsGroup(String totalsGroup) { this.totalsGroup = totalsGroup; + isSetTotalsGroup = true; // mark as set return this; } @@ -2341,6 +2571,7 @@ public String getTotalsGroup() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTotalsGroup(String totalsGroup) { this.totalsGroup = totalsGroup; + isSetTotalsGroup = true; // mark as set } /** @@ -2351,6 +2582,7 @@ public void setTotalsGroup(String totalsGroup) { */ public PaymentRequest3d trustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set return this; } @@ -2374,6 +2606,27 @@ public Boolean getTrustedShopper() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentRequest3d 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 PaymentRequest3d object is equal to o. */ @@ -2387,104 +2640,202 @@ public boolean equals(Object o) { } PaymentRequest3d paymentRequest3d = (PaymentRequest3d) o; return Objects.equals(this.accountInfo, paymentRequest3d.accountInfo) + && Objects.equals(this.isSetAccountInfo, paymentRequest3d.isSetAccountInfo) && Objects.equals(this.additionalAmount, paymentRequest3d.additionalAmount) + && Objects.equals(this.isSetAdditionalAmount, paymentRequest3d.isSetAdditionalAmount) && Objects.equals(this.additionalData, paymentRequest3d.additionalData) + && Objects.equals(this.isSetAdditionalData, paymentRequest3d.isSetAdditionalData) && Objects.equals(this.amount, paymentRequest3d.amount) + && Objects.equals(this.isSetAmount, paymentRequest3d.isSetAmount) && Objects.equals(this.applicationInfo, paymentRequest3d.applicationInfo) + && Objects.equals(this.isSetApplicationInfo, paymentRequest3d.isSetApplicationInfo) && Objects.equals(this.billingAddress, paymentRequest3d.billingAddress) + && Objects.equals(this.isSetBillingAddress, paymentRequest3d.isSetBillingAddress) && Objects.equals(this.browserInfo, paymentRequest3d.browserInfo) + && Objects.equals(this.isSetBrowserInfo, paymentRequest3d.isSetBrowserInfo) && Objects.equals(this.captureDelayHours, paymentRequest3d.captureDelayHours) + && Objects.equals(this.isSetCaptureDelayHours, paymentRequest3d.isSetCaptureDelayHours) && Objects.equals(this.dateOfBirth, paymentRequest3d.dateOfBirth) + && Objects.equals(this.isSetDateOfBirth, paymentRequest3d.isSetDateOfBirth) && Objects.equals(this.dccQuote, paymentRequest3d.dccQuote) + && Objects.equals(this.isSetDccQuote, paymentRequest3d.isSetDccQuote) && Objects.equals(this.deliveryAddress, paymentRequest3d.deliveryAddress) + && Objects.equals(this.isSetDeliveryAddress, paymentRequest3d.isSetDeliveryAddress) && Objects.equals(this.deliveryDate, paymentRequest3d.deliveryDate) + && Objects.equals(this.isSetDeliveryDate, paymentRequest3d.isSetDeliveryDate) && Objects.equals(this.deviceFingerprint, paymentRequest3d.deviceFingerprint) + && Objects.equals(this.isSetDeviceFingerprint, paymentRequest3d.isSetDeviceFingerprint) && Objects.equals(this.fraudOffset, paymentRequest3d.fraudOffset) + && Objects.equals(this.isSetFraudOffset, paymentRequest3d.isSetFraudOffset) && Objects.equals(this.installments, paymentRequest3d.installments) + && Objects.equals(this.isSetInstallments, paymentRequest3d.isSetInstallments) && Objects.equals( this.localizedShopperStatement, paymentRequest3d.localizedShopperStatement) + && Objects.equals( + this.isSetLocalizedShopperStatement, paymentRequest3d.isSetLocalizedShopperStatement) && Objects.equals(this.mcc, paymentRequest3d.mcc) + && Objects.equals(this.isSetMcc, paymentRequest3d.isSetMcc) && Objects.equals(this.md, paymentRequest3d.md) + && Objects.equals(this.isSetMd, paymentRequest3d.isSetMd) && Objects.equals(this.merchantAccount, paymentRequest3d.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, paymentRequest3d.isSetMerchantAccount) && Objects.equals(this.merchantOrderReference, paymentRequest3d.merchantOrderReference) + && Objects.equals( + this.isSetMerchantOrderReference, paymentRequest3d.isSetMerchantOrderReference) && Objects.equals(this.merchantRiskIndicator, paymentRequest3d.merchantRiskIndicator) + && Objects.equals( + this.isSetMerchantRiskIndicator, paymentRequest3d.isSetMerchantRiskIndicator) && Objects.equals(this.metadata, paymentRequest3d.metadata) + && Objects.equals(this.isSetMetadata, paymentRequest3d.isSetMetadata) && Objects.equals(this.orderReference, paymentRequest3d.orderReference) + && Objects.equals(this.isSetOrderReference, paymentRequest3d.isSetOrderReference) && Objects.equals(this.paResponse, paymentRequest3d.paResponse) + && Objects.equals(this.isSetPaResponse, paymentRequest3d.isSetPaResponse) && Objects.equals(this.recurring, paymentRequest3d.recurring) + && Objects.equals(this.isSetRecurring, paymentRequest3d.isSetRecurring) && Objects.equals(this.recurringProcessingModel, paymentRequest3d.recurringProcessingModel) + && Objects.equals( + this.isSetRecurringProcessingModel, paymentRequest3d.isSetRecurringProcessingModel) && Objects.equals(this.reference, paymentRequest3d.reference) + && Objects.equals(this.isSetReference, paymentRequest3d.isSetReference) && Objects.equals(this.selectedBrand, paymentRequest3d.selectedBrand) + && Objects.equals(this.isSetSelectedBrand, paymentRequest3d.isSetSelectedBrand) && Objects.equals( this.selectedRecurringDetailReference, paymentRequest3d.selectedRecurringDetailReference) + && Objects.equals( + this.isSetSelectedRecurringDetailReference, + paymentRequest3d.isSetSelectedRecurringDetailReference) && Objects.equals(this.sessionId, paymentRequest3d.sessionId) + && Objects.equals(this.isSetSessionId, paymentRequest3d.isSetSessionId) && Objects.equals(this.shopperEmail, paymentRequest3d.shopperEmail) + && Objects.equals(this.isSetShopperEmail, paymentRequest3d.isSetShopperEmail) && Objects.equals(this.shopperIP, paymentRequest3d.shopperIP) + && Objects.equals(this.isSetShopperIP, paymentRequest3d.isSetShopperIP) && Objects.equals(this.shopperInteraction, paymentRequest3d.shopperInteraction) + && Objects.equals(this.isSetShopperInteraction, paymentRequest3d.isSetShopperInteraction) && Objects.equals(this.shopperLocale, paymentRequest3d.shopperLocale) + && Objects.equals(this.isSetShopperLocale, paymentRequest3d.isSetShopperLocale) && Objects.equals(this.shopperName, paymentRequest3d.shopperName) + && Objects.equals(this.isSetShopperName, paymentRequest3d.isSetShopperName) && Objects.equals(this.shopperReference, paymentRequest3d.shopperReference) + && Objects.equals(this.isSetShopperReference, paymentRequest3d.isSetShopperReference) && Objects.equals(this.shopperStatement, paymentRequest3d.shopperStatement) + && Objects.equals(this.isSetShopperStatement, paymentRequest3d.isSetShopperStatement) && Objects.equals(this.socialSecurityNumber, paymentRequest3d.socialSecurityNumber) + && Objects.equals( + this.isSetSocialSecurityNumber, paymentRequest3d.isSetSocialSecurityNumber) && Objects.equals(this.splits, paymentRequest3d.splits) + && Objects.equals(this.isSetSplits, paymentRequest3d.isSetSplits) && Objects.equals(this.store, paymentRequest3d.store) + && Objects.equals(this.isSetStore, paymentRequest3d.isSetStore) && Objects.equals(this.telephoneNumber, paymentRequest3d.telephoneNumber) + && Objects.equals(this.isSetTelephoneNumber, paymentRequest3d.isSetTelephoneNumber) && Objects.equals(this.threeDS2RequestData, paymentRequest3d.threeDS2RequestData) + && Objects.equals(this.isSetThreeDS2RequestData, paymentRequest3d.isSetThreeDS2RequestData) && Objects.equals( this.threeDSAuthenticationOnly, paymentRequest3d.threeDSAuthenticationOnly) + && Objects.equals( + this.isSetThreeDSAuthenticationOnly, paymentRequest3d.isSetThreeDSAuthenticationOnly) && Objects.equals(this.totalsGroup, paymentRequest3d.totalsGroup) - && Objects.equals(this.trustedShopper, paymentRequest3d.trustedShopper); + && Objects.equals(this.isSetTotalsGroup, paymentRequest3d.isSetTotalsGroup) + && Objects.equals(this.trustedShopper, paymentRequest3d.trustedShopper) + && Objects.equals(this.isSetTrustedShopper, paymentRequest3d.isSetTrustedShopper); } @Override public int hashCode() { return Objects.hash( accountInfo, + isSetAccountInfo, additionalAmount, + isSetAdditionalAmount, additionalData, + isSetAdditionalData, amount, + isSetAmount, applicationInfo, + isSetApplicationInfo, billingAddress, + isSetBillingAddress, browserInfo, + isSetBrowserInfo, captureDelayHours, + isSetCaptureDelayHours, dateOfBirth, + isSetDateOfBirth, dccQuote, + isSetDccQuote, deliveryAddress, + isSetDeliveryAddress, deliveryDate, + isSetDeliveryDate, deviceFingerprint, + isSetDeviceFingerprint, fraudOffset, + isSetFraudOffset, installments, + isSetInstallments, localizedShopperStatement, + isSetLocalizedShopperStatement, mcc, + isSetMcc, md, + isSetMd, merchantAccount, + isSetMerchantAccount, merchantOrderReference, + isSetMerchantOrderReference, merchantRiskIndicator, + isSetMerchantRiskIndicator, metadata, + isSetMetadata, orderReference, + isSetOrderReference, paResponse, + isSetPaResponse, recurring, + isSetRecurring, recurringProcessingModel, + isSetRecurringProcessingModel, reference, + isSetReference, selectedBrand, + isSetSelectedBrand, selectedRecurringDetailReference, + isSetSelectedRecurringDetailReference, sessionId, + isSetSessionId, shopperEmail, + isSetShopperEmail, shopperIP, + isSetShopperIP, shopperInteraction, + isSetShopperInteraction, shopperLocale, + isSetShopperLocale, shopperName, + isSetShopperName, shopperReference, + isSetShopperReference, shopperStatement, + isSetShopperStatement, socialSecurityNumber, + isSetSocialSecurityNumber, splits, + isSetSplits, store, + isSetStore, telephoneNumber, + isSetTelephoneNumber, threeDS2RequestData, + isSetThreeDS2RequestData, threeDSAuthenticationOnly, + isSetThreeDSAuthenticationOnly, totalsGroup, - trustedShopper); + isSetTotalsGroup, + trustedShopper, + isSetTrustedShopper); } @Override @@ -2566,6 +2917,165 @@ 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 (isSetAccountInfo) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_INFO, this.accountInfo); + } + if (isSetAdditionalAmount) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_AMOUNT, this.additionalAmount); + } + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetBrowserInfo) { + addIfNull(nulls, JSON_PROPERTY_BROWSER_INFO, this.browserInfo); + } + if (isSetCaptureDelayHours) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_DELAY_HOURS, this.captureDelayHours); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetDccQuote) { + addIfNull(nulls, JSON_PROPERTY_DCC_QUOTE, this.dccQuote); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetDeliveryDate) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_DATE, this.deliveryDate); + } + if (isSetDeviceFingerprint) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_FINGERPRINT, this.deviceFingerprint); + } + if (isSetFraudOffset) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_OFFSET, this.fraudOffset); + } + if (isSetInstallments) { + addIfNull(nulls, JSON_PROPERTY_INSTALLMENTS, this.installments); + } + if (isSetLocalizedShopperStatement) { + addIfNull(nulls, JSON_PROPERTY_LOCALIZED_SHOPPER_STATEMENT, this.localizedShopperStatement); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMd) { + addIfNull(nulls, JSON_PROPERTY_MD, this.md); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetMerchantOrderReference) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ORDER_REFERENCE, this.merchantOrderReference); + } + if (isSetMerchantRiskIndicator) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_RISK_INDICATOR, this.merchantRiskIndicator); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetOrderReference) { + addIfNull(nulls, JSON_PROPERTY_ORDER_REFERENCE, this.orderReference); + } + if (isSetPaResponse) { + addIfNull(nulls, JSON_PROPERTY_PA_RESPONSE, this.paResponse); + } + if (isSetRecurring) { + addIfNull(nulls, JSON_PROPERTY_RECURRING, this.recurring); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSelectedBrand) { + addIfNull(nulls, JSON_PROPERTY_SELECTED_BRAND, this.selectedBrand); + } + if (isSetSelectedRecurringDetailReference) { + addIfNull( + nulls, + JSON_PROPERTY_SELECTED_RECURRING_DETAIL_REFERENCE, + this.selectedRecurringDetailReference); + } + if (isSetSessionId) { + addIfNull(nulls, JSON_PROPERTY_SESSION_ID, this.sessionId); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperIP) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_I_P, this.shopperIP); + } + if (isSetShopperInteraction) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION, this.shopperInteraction); + } + if (isSetShopperLocale) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_LOCALE, this.shopperLocale); + } + if (isSetShopperName) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_NAME, this.shopperName); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetShopperStatement) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_STATEMENT, this.shopperStatement); + } + if (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetThreeDS2RequestData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_REQUEST_DATA, this.threeDS2RequestData); + } + if (isSetThreeDSAuthenticationOnly) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY, this.threeDSAuthenticationOnly); + } + if (isSetTotalsGroup) { + addIfNull(nulls, JSON_PROPERTY_TOTALS_GROUP, this.totalsGroup); + } + if (isSetTrustedShopper) { + addIfNull(nulls, JSON_PROPERTY_TRUSTED_SHOPPER, this.trustedShopper); + } + + 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 PaymentRequest3d given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/PaymentRequest3ds2.java b/src/main/java/com/adyen/model/payment/PaymentRequest3ds2.java index 39c151bdd..782bae2ae 100644 --- a/src/main/java/com/adyen/model/payment/PaymentRequest3ds2.java +++ b/src/main/java/com/adyen/model/payment/PaymentRequest3ds2.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -79,73 +81,142 @@ public class PaymentRequest3ds2 { public static final String JSON_PROPERTY_ACCOUNT_INFO = "accountInfo"; private AccountInfo accountInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountInfo = false; + public static final String JSON_PROPERTY_ADDITIONAL_AMOUNT = "additionalAmount"; private Amount additionalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalAmount = false; + public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = 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_APPLICATION_INFO = "applicationInfo"; private ApplicationInfo applicationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplicationInfo = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private Address billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_BROWSER_INFO = "browserInfo"; private BrowserInfo browserInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrowserInfo = false; + public static final String JSON_PROPERTY_CAPTURE_DELAY_HOURS = "captureDelayHours"; private Integer captureDelayHours; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCaptureDelayHours = false; + public static final String JSON_PROPERTY_DATE_OF_BIRTH = "dateOfBirth"; private LocalDate dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + public static final String JSON_PROPERTY_DCC_QUOTE = "dccQuote"; private ForexQuote dccQuote; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDccQuote = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private Address deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_DELIVERY_DATE = "deliveryDate"; private OffsetDateTime deliveryDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryDate = false; + public static final String JSON_PROPERTY_DEVICE_FINGERPRINT = "deviceFingerprint"; private String deviceFingerprint; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceFingerprint = false; + public static final String JSON_PROPERTY_FRAUD_OFFSET = "fraudOffset"; private Integer fraudOffset; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudOffset = false; + public static final String JSON_PROPERTY_INSTALLMENTS = "installments"; private Installments installments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallments = false; + public static final String JSON_PROPERTY_LOCALIZED_SHOPPER_STATEMENT = "localizedShopperStatement"; private Map localizedShopperStatement; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLocalizedShopperStatement = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_MERCHANT_ORDER_REFERENCE = "merchantOrderReference"; private String merchantOrderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantOrderReference = false; + public static final String JSON_PROPERTY_MERCHANT_RISK_INDICATOR = "merchantRiskIndicator"; private MerchantRiskIndicator merchantRiskIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantRiskIndicator = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_ORDER_REFERENCE = "orderReference"; private String orderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrderReference = false; + public static final String JSON_PROPERTY_RECURRING = "recurring"; private Recurring recurring; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurring = false; + /** * Defines a recurring payment type. Required when creating a token to store payment details or * using stored payment details. Allowed values: * `Subscription` – A transaction for a @@ -203,25 +274,46 @@ public static RecurringProcessingModelEnum fromValue(String value) { public static final String JSON_PROPERTY_RECURRING_PROCESSING_MODEL = "recurringProcessingModel"; private RecurringProcessingModelEnum recurringProcessingModel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringProcessingModel = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SELECTED_BRAND = "selectedBrand"; private String selectedBrand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSelectedBrand = false; + public static final String JSON_PROPERTY_SELECTED_RECURRING_DETAIL_REFERENCE = "selectedRecurringDetailReference"; private String selectedRecurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSelectedRecurringDetailReference = false; + public static final String JSON_PROPERTY_SESSION_ID = "sessionId"; private String sessionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSessionId = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_I_P = "shopperIP"; private String shopperIP; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperIP = false; + /** * Specifies the sales channel, through which the shopper gives their card details, and whether * the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper @@ -282,49 +374,100 @@ public static ShopperInteractionEnum fromValue(String value) { public static final String JSON_PROPERTY_SHOPPER_INTERACTION = "shopperInteraction"; private ShopperInteractionEnum shopperInteraction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperInteraction = false; + public static final String JSON_PROPERTY_SHOPPER_LOCALE = "shopperLocale"; private String shopperLocale; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperLocale = false; + public static final String JSON_PROPERTY_SHOPPER_NAME = "shopperName"; private Name shopperName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperName = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_SHOPPER_STATEMENT = "shopperStatement"; private String shopperStatement; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperStatement = false; + public static final String JSON_PROPERTY_SOCIAL_SECURITY_NUMBER = "socialSecurityNumber"; private String socialSecurityNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSocialSecurityNumber = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + public static final String JSON_PROPERTY_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + public static final String JSON_PROPERTY_THREE_D_S2_REQUEST_DATA = "threeDS2RequestData"; private ThreeDS2RequestData threeDS2RequestData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2RequestData = false; + public static final String JSON_PROPERTY_THREE_D_S2_RESULT = "threeDS2Result"; private ThreeDS2Result threeDS2Result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2Result = false; + public static final String JSON_PROPERTY_THREE_D_S2_TOKEN = "threeDS2Token"; private String threeDS2Token; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2Token = false; + public static final String JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY = "threeDSAuthenticationOnly"; private Boolean threeDSAuthenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSAuthenticationOnly = false; + public static final String JSON_PROPERTY_TOTALS_GROUP = "totalsGroup"; private String totalsGroup; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalsGroup = false; + public static final String JSON_PROPERTY_TRUSTED_SHOPPER = "trustedShopper"; private Boolean trustedShopper; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrustedShopper = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentRequest3ds2() {} /** @@ -335,6 +478,7 @@ public PaymentRequest3ds2() {} */ public PaymentRequest3ds2 accountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set return this; } @@ -358,6 +502,7 @@ public AccountInfo getAccountInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set } /** @@ -368,6 +513,7 @@ public void setAccountInfo(AccountInfo accountInfo) { */ public PaymentRequest3ds2 additionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set return this; } @@ -391,6 +537,7 @@ public Amount getAdditionalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set } /** @@ -405,6 +552,7 @@ public void setAdditionalAmount(Amount additionalAmount) { */ public PaymentRequest3ds2 additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -444,6 +592,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -454,6 +603,7 @@ public void setAdditionalData(Map additionalData) { */ public PaymentRequest3ds2 amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -477,6 +627,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -487,6 +638,7 @@ public void setAmount(Amount amount) { */ public PaymentRequest3ds2 applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -510,6 +662,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -520,6 +673,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentRequest3ds2 billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -543,6 +697,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -553,6 +708,7 @@ public void setBillingAddress(Address billingAddress) { */ public PaymentRequest3ds2 browserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set return this; } @@ -576,6 +732,7 @@ public BrowserInfo getBrowserInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrowserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set } /** @@ -587,6 +744,7 @@ public void setBrowserInfo(BrowserInfo browserInfo) { */ public PaymentRequest3ds2 captureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set return this; } @@ -612,6 +770,7 @@ public Integer getCaptureDelayHours() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set } /** @@ -624,6 +783,7 @@ public void setCaptureDelayHours(Integer captureDelayHours) { */ public PaymentRequest3ds2 dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -651,6 +811,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -661,6 +822,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public PaymentRequest3ds2 dccQuote(ForexQuote dccQuote) { this.dccQuote = dccQuote; + isSetDccQuote = true; // mark as set return this; } @@ -684,6 +846,7 @@ public ForexQuote getDccQuote() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDccQuote(ForexQuote dccQuote) { this.dccQuote = dccQuote; + isSetDccQuote = true; // mark as set } /** @@ -694,6 +857,7 @@ public void setDccQuote(ForexQuote dccQuote) { */ public PaymentRequest3ds2 deliveryAddress(Address deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -717,6 +881,7 @@ public Address getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(Address deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -731,6 +896,7 @@ public void setDeliveryAddress(Address deliveryAddress) { */ public PaymentRequest3ds2 deliveryDate(OffsetDateTime deliveryDate) { this.deliveryDate = deliveryDate; + isSetDeliveryDate = true; // mark as set return this; } @@ -762,6 +928,7 @@ public OffsetDateTime getDeliveryDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryDate(OffsetDateTime deliveryDate) { this.deliveryDate = deliveryDate; + isSetDeliveryDate = true; // mark as set } /** @@ -775,6 +942,7 @@ public void setDeliveryDate(OffsetDateTime deliveryDate) { */ public PaymentRequest3ds2 deviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set return this; } @@ -804,6 +972,7 @@ public String getDeviceFingerprint() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set } /** @@ -816,6 +985,7 @@ public void setDeviceFingerprint(String deviceFingerprint) { */ public PaymentRequest3ds2 fraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set return this; } @@ -843,6 +1013,7 @@ public Integer getFraudOffset() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set } /** @@ -853,6 +1024,7 @@ public void setFraudOffset(Integer fraudOffset) { */ public PaymentRequest3ds2 installments(Installments installments) { this.installments = installments; + isSetInstallments = true; // mark as set return this; } @@ -876,6 +1048,7 @@ public Installments getInstallments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallments(Installments installments) { this.installments = installments; + isSetInstallments = true; // mark as set } /** @@ -897,6 +1070,7 @@ public void setInstallments(Installments installments) { public PaymentRequest3ds2 localizedShopperStatement( Map localizedShopperStatement) { this.localizedShopperStatement = localizedShopperStatement; + isSetLocalizedShopperStatement = true; // mark as set return this; } @@ -949,6 +1123,7 @@ public Map getLocalizedShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLocalizedShopperStatement(Map localizedShopperStatement) { this.localizedShopperStatement = localizedShopperStatement; + isSetLocalizedShopperStatement = true; // mark as set } /** @@ -963,6 +1138,7 @@ public void setLocalizedShopperStatement(Map localizedShopperSta */ public PaymentRequest3ds2 mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -994,6 +1170,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -1005,6 +1182,7 @@ public void setMcc(String mcc) { */ public PaymentRequest3ds2 merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -1030,6 +1208,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -1054,6 +1233,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentRequest3ds2 merchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set return this; } @@ -1106,6 +1286,7 @@ public String getMerchantOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set } /** @@ -1116,6 +1297,7 @@ public void setMerchantOrderReference(String merchantOrderReference) { */ public PaymentRequest3ds2 merchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator) { this.merchantRiskIndicator = merchantRiskIndicator; + isSetMerchantRiskIndicator = true; // mark as set return this; } @@ -1139,6 +1321,7 @@ public MerchantRiskIndicator getMerchantRiskIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator) { this.merchantRiskIndicator = merchantRiskIndicator; + isSetMerchantRiskIndicator = true; // mark as set } /** @@ -1155,6 +1338,7 @@ public void setMerchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator */ public PaymentRequest3ds2 metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -1198,6 +1382,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -1213,6 +1398,7 @@ public void setMetadata(Map metadata) { */ public PaymentRequest3ds2 orderReference(String orderReference) { this.orderReference = orderReference; + isSetOrderReference = true; // mark as set return this; } @@ -1246,6 +1432,7 @@ public String getOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrderReference(String orderReference) { this.orderReference = orderReference; + isSetOrderReference = true; // mark as set } /** @@ -1256,6 +1443,7 @@ public void setOrderReference(String orderReference) { */ public PaymentRequest3ds2 recurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set return this; } @@ -1279,6 +1467,7 @@ public Recurring getRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set } /** @@ -1307,6 +1496,7 @@ public void setRecurring(Recurring recurring) { public PaymentRequest3ds2 recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -1364,6 +1554,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -1380,6 +1571,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public PaymentRequest3ds2 reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -1415,6 +1607,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -1431,6 +1624,7 @@ public void setReference(String reference) { */ public PaymentRequest3ds2 selectedBrand(String selectedBrand) { this.selectedBrand = selectedBrand; + isSetSelectedBrand = true; // mark as set return this; } @@ -1466,6 +1660,7 @@ public String getSelectedBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelectedBrand(String selectedBrand) { this.selectedBrand = selectedBrand; + isSetSelectedBrand = true; // mark as set } /** @@ -1480,6 +1675,7 @@ public void setSelectedBrand(String selectedBrand) { public PaymentRequest3ds2 selectedRecurringDetailReference( String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set return this; } @@ -1509,6 +1705,7 @@ public String getSelectedRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelectedRecurringDetailReference(String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set } /** @@ -1519,6 +1716,7 @@ public void setSelectedRecurringDetailReference(String selectedRecurringDetailRe */ public PaymentRequest3ds2 sessionId(String sessionId) { this.sessionId = sessionId; + isSetSessionId = true; // mark as set return this; } @@ -1542,6 +1740,7 @@ public String getSessionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSessionId(String sessionId) { this.sessionId = sessionId; + isSetSessionId = true; // mark as set } /** @@ -1556,6 +1755,7 @@ public void setSessionId(String sessionId) { */ public PaymentRequest3ds2 shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -1587,6 +1787,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -1610,6 +1811,7 @@ public void setShopperEmail(String shopperEmail) { */ public PaymentRequest3ds2 shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -1659,6 +1861,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -1690,6 +1893,7 @@ public void setShopperIP(String shopperIP) { */ public PaymentRequest3ds2 shopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -1755,6 +1959,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -1767,6 +1972,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public PaymentRequest3ds2 shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -1794,6 +2000,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -1804,6 +2011,7 @@ public void setShopperLocale(String shopperLocale) { */ public PaymentRequest3ds2 shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -1827,6 +2035,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -1843,6 +2052,7 @@ public void setShopperName(Name shopperName) { */ public PaymentRequest3ds2 shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -1878,6 +2088,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -1893,6 +2104,7 @@ public void setShopperReference(String shopperReference) { */ public PaymentRequest3ds2 shopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set return this; } @@ -1926,6 +2138,7 @@ public String getShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set } /** @@ -1936,6 +2149,7 @@ public void setShopperStatement(String shopperStatement) { */ public PaymentRequest3ds2 socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -1959,6 +2173,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -1975,6 +2190,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public PaymentRequest3ds2 splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -2018,6 +2234,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -2041,6 +2258,7 @@ public void setSplits(List splits) { */ public PaymentRequest3ds2 store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -2090,6 +2308,7 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set } /** @@ -2108,6 +2327,7 @@ public void setStore(String store) { */ public PaymentRequest3ds2 telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -2147,6 +2367,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -2157,6 +2378,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public PaymentRequest3ds2 threeDS2RequestData(ThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set return this; } @@ -2180,6 +2402,7 @@ public ThreeDS2RequestData getThreeDS2RequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2RequestData(ThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set } /** @@ -2190,6 +2413,7 @@ public void setThreeDS2RequestData(ThreeDS2RequestData threeDS2RequestData) { */ public PaymentRequest3ds2 threeDS2Result(ThreeDS2Result threeDS2Result) { this.threeDS2Result = threeDS2Result; + isSetThreeDS2Result = true; // mark as set return this; } @@ -2213,6 +2437,7 @@ public ThreeDS2Result getThreeDS2Result() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2Result(ThreeDS2Result threeDS2Result) { this.threeDS2Result = threeDS2Result; + isSetThreeDS2Result = true; // mark as set } /** @@ -2223,6 +2448,7 @@ public void setThreeDS2Result(ThreeDS2Result threeDS2Result) { */ public PaymentRequest3ds2 threeDS2Token(String threeDS2Token) { this.threeDS2Token = threeDS2Token; + isSetThreeDS2Token = true; // mark as set return this; } @@ -2246,6 +2472,7 @@ public String getThreeDS2Token() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2Token(String threeDS2Token) { this.threeDS2Token = threeDS2Token; + isSetThreeDS2Token = true; // mark as set } /** @@ -2262,6 +2489,7 @@ public void setThreeDS2Token(String threeDS2Token) { */ public PaymentRequest3ds2 threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set return this; } @@ -2297,6 +2525,7 @@ public Boolean getThreeDSAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set } /** @@ -2309,6 +2538,7 @@ public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { */ public PaymentRequest3ds2 totalsGroup(String totalsGroup) { this.totalsGroup = totalsGroup; + isSetTotalsGroup = true; // mark as set return this; } @@ -2336,6 +2566,7 @@ public String getTotalsGroup() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTotalsGroup(String totalsGroup) { this.totalsGroup = totalsGroup; + isSetTotalsGroup = true; // mark as set } /** @@ -2346,6 +2577,7 @@ public void setTotalsGroup(String totalsGroup) { */ public PaymentRequest3ds2 trustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set return this; } @@ -2369,6 +2601,27 @@ public Boolean getTrustedShopper() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentRequest3ds2 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 PaymentRequest3ds2 object is equal to o. */ @@ -2382,105 +2635,204 @@ public boolean equals(Object o) { } PaymentRequest3ds2 paymentRequest3ds2 = (PaymentRequest3ds2) o; return Objects.equals(this.accountInfo, paymentRequest3ds2.accountInfo) + && Objects.equals(this.isSetAccountInfo, paymentRequest3ds2.isSetAccountInfo) && Objects.equals(this.additionalAmount, paymentRequest3ds2.additionalAmount) + && Objects.equals(this.isSetAdditionalAmount, paymentRequest3ds2.isSetAdditionalAmount) && Objects.equals(this.additionalData, paymentRequest3ds2.additionalData) + && Objects.equals(this.isSetAdditionalData, paymentRequest3ds2.isSetAdditionalData) && Objects.equals(this.amount, paymentRequest3ds2.amount) + && Objects.equals(this.isSetAmount, paymentRequest3ds2.isSetAmount) && Objects.equals(this.applicationInfo, paymentRequest3ds2.applicationInfo) + && Objects.equals(this.isSetApplicationInfo, paymentRequest3ds2.isSetApplicationInfo) && Objects.equals(this.billingAddress, paymentRequest3ds2.billingAddress) + && Objects.equals(this.isSetBillingAddress, paymentRequest3ds2.isSetBillingAddress) && Objects.equals(this.browserInfo, paymentRequest3ds2.browserInfo) + && Objects.equals(this.isSetBrowserInfo, paymentRequest3ds2.isSetBrowserInfo) && Objects.equals(this.captureDelayHours, paymentRequest3ds2.captureDelayHours) + && Objects.equals(this.isSetCaptureDelayHours, paymentRequest3ds2.isSetCaptureDelayHours) && Objects.equals(this.dateOfBirth, paymentRequest3ds2.dateOfBirth) + && Objects.equals(this.isSetDateOfBirth, paymentRequest3ds2.isSetDateOfBirth) && Objects.equals(this.dccQuote, paymentRequest3ds2.dccQuote) + && Objects.equals(this.isSetDccQuote, paymentRequest3ds2.isSetDccQuote) && Objects.equals(this.deliveryAddress, paymentRequest3ds2.deliveryAddress) + && Objects.equals(this.isSetDeliveryAddress, paymentRequest3ds2.isSetDeliveryAddress) && Objects.equals(this.deliveryDate, paymentRequest3ds2.deliveryDate) + && Objects.equals(this.isSetDeliveryDate, paymentRequest3ds2.isSetDeliveryDate) && Objects.equals(this.deviceFingerprint, paymentRequest3ds2.deviceFingerprint) + && Objects.equals(this.isSetDeviceFingerprint, paymentRequest3ds2.isSetDeviceFingerprint) && Objects.equals(this.fraudOffset, paymentRequest3ds2.fraudOffset) + && Objects.equals(this.isSetFraudOffset, paymentRequest3ds2.isSetFraudOffset) && Objects.equals(this.installments, paymentRequest3ds2.installments) + && Objects.equals(this.isSetInstallments, paymentRequest3ds2.isSetInstallments) && Objects.equals( this.localizedShopperStatement, paymentRequest3ds2.localizedShopperStatement) + && Objects.equals( + this.isSetLocalizedShopperStatement, paymentRequest3ds2.isSetLocalizedShopperStatement) && Objects.equals(this.mcc, paymentRequest3ds2.mcc) + && Objects.equals(this.isSetMcc, paymentRequest3ds2.isSetMcc) && Objects.equals(this.merchantAccount, paymentRequest3ds2.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, paymentRequest3ds2.isSetMerchantAccount) && Objects.equals(this.merchantOrderReference, paymentRequest3ds2.merchantOrderReference) + && Objects.equals( + this.isSetMerchantOrderReference, paymentRequest3ds2.isSetMerchantOrderReference) && Objects.equals(this.merchantRiskIndicator, paymentRequest3ds2.merchantRiskIndicator) + && Objects.equals( + this.isSetMerchantRiskIndicator, paymentRequest3ds2.isSetMerchantRiskIndicator) && Objects.equals(this.metadata, paymentRequest3ds2.metadata) + && Objects.equals(this.isSetMetadata, paymentRequest3ds2.isSetMetadata) && Objects.equals(this.orderReference, paymentRequest3ds2.orderReference) + && Objects.equals(this.isSetOrderReference, paymentRequest3ds2.isSetOrderReference) && Objects.equals(this.recurring, paymentRequest3ds2.recurring) + && Objects.equals(this.isSetRecurring, paymentRequest3ds2.isSetRecurring) && Objects.equals( this.recurringProcessingModel, paymentRequest3ds2.recurringProcessingModel) + && Objects.equals( + this.isSetRecurringProcessingModel, paymentRequest3ds2.isSetRecurringProcessingModel) && Objects.equals(this.reference, paymentRequest3ds2.reference) + && Objects.equals(this.isSetReference, paymentRequest3ds2.isSetReference) && Objects.equals(this.selectedBrand, paymentRequest3ds2.selectedBrand) + && Objects.equals(this.isSetSelectedBrand, paymentRequest3ds2.isSetSelectedBrand) && Objects.equals( this.selectedRecurringDetailReference, paymentRequest3ds2.selectedRecurringDetailReference) + && Objects.equals( + this.isSetSelectedRecurringDetailReference, + paymentRequest3ds2.isSetSelectedRecurringDetailReference) && Objects.equals(this.sessionId, paymentRequest3ds2.sessionId) + && Objects.equals(this.isSetSessionId, paymentRequest3ds2.isSetSessionId) && Objects.equals(this.shopperEmail, paymentRequest3ds2.shopperEmail) + && Objects.equals(this.isSetShopperEmail, paymentRequest3ds2.isSetShopperEmail) && Objects.equals(this.shopperIP, paymentRequest3ds2.shopperIP) + && Objects.equals(this.isSetShopperIP, paymentRequest3ds2.isSetShopperIP) && Objects.equals(this.shopperInteraction, paymentRequest3ds2.shopperInteraction) + && Objects.equals(this.isSetShopperInteraction, paymentRequest3ds2.isSetShopperInteraction) && Objects.equals(this.shopperLocale, paymentRequest3ds2.shopperLocale) + && Objects.equals(this.isSetShopperLocale, paymentRequest3ds2.isSetShopperLocale) && Objects.equals(this.shopperName, paymentRequest3ds2.shopperName) + && Objects.equals(this.isSetShopperName, paymentRequest3ds2.isSetShopperName) && Objects.equals(this.shopperReference, paymentRequest3ds2.shopperReference) + && Objects.equals(this.isSetShopperReference, paymentRequest3ds2.isSetShopperReference) && Objects.equals(this.shopperStatement, paymentRequest3ds2.shopperStatement) + && Objects.equals(this.isSetShopperStatement, paymentRequest3ds2.isSetShopperStatement) && Objects.equals(this.socialSecurityNumber, paymentRequest3ds2.socialSecurityNumber) + && Objects.equals( + this.isSetSocialSecurityNumber, paymentRequest3ds2.isSetSocialSecurityNumber) && Objects.equals(this.splits, paymentRequest3ds2.splits) + && Objects.equals(this.isSetSplits, paymentRequest3ds2.isSetSplits) && Objects.equals(this.store, paymentRequest3ds2.store) + && Objects.equals(this.isSetStore, paymentRequest3ds2.isSetStore) && Objects.equals(this.telephoneNumber, paymentRequest3ds2.telephoneNumber) + && Objects.equals(this.isSetTelephoneNumber, paymentRequest3ds2.isSetTelephoneNumber) && Objects.equals(this.threeDS2RequestData, paymentRequest3ds2.threeDS2RequestData) + && Objects.equals( + this.isSetThreeDS2RequestData, paymentRequest3ds2.isSetThreeDS2RequestData) && Objects.equals(this.threeDS2Result, paymentRequest3ds2.threeDS2Result) + && Objects.equals(this.isSetThreeDS2Result, paymentRequest3ds2.isSetThreeDS2Result) && Objects.equals(this.threeDS2Token, paymentRequest3ds2.threeDS2Token) + && Objects.equals(this.isSetThreeDS2Token, paymentRequest3ds2.isSetThreeDS2Token) && Objects.equals( this.threeDSAuthenticationOnly, paymentRequest3ds2.threeDSAuthenticationOnly) + && Objects.equals( + this.isSetThreeDSAuthenticationOnly, paymentRequest3ds2.isSetThreeDSAuthenticationOnly) && Objects.equals(this.totalsGroup, paymentRequest3ds2.totalsGroup) - && Objects.equals(this.trustedShopper, paymentRequest3ds2.trustedShopper); + && Objects.equals(this.isSetTotalsGroup, paymentRequest3ds2.isSetTotalsGroup) + && Objects.equals(this.trustedShopper, paymentRequest3ds2.trustedShopper) + && Objects.equals(this.isSetTrustedShopper, paymentRequest3ds2.isSetTrustedShopper); } @Override public int hashCode() { return Objects.hash( accountInfo, + isSetAccountInfo, additionalAmount, + isSetAdditionalAmount, additionalData, + isSetAdditionalData, amount, + isSetAmount, applicationInfo, + isSetApplicationInfo, billingAddress, + isSetBillingAddress, browserInfo, + isSetBrowserInfo, captureDelayHours, + isSetCaptureDelayHours, dateOfBirth, + isSetDateOfBirth, dccQuote, + isSetDccQuote, deliveryAddress, + isSetDeliveryAddress, deliveryDate, + isSetDeliveryDate, deviceFingerprint, + isSetDeviceFingerprint, fraudOffset, + isSetFraudOffset, installments, + isSetInstallments, localizedShopperStatement, + isSetLocalizedShopperStatement, mcc, + isSetMcc, merchantAccount, + isSetMerchantAccount, merchantOrderReference, + isSetMerchantOrderReference, merchantRiskIndicator, + isSetMerchantRiskIndicator, metadata, + isSetMetadata, orderReference, + isSetOrderReference, recurring, + isSetRecurring, recurringProcessingModel, + isSetRecurringProcessingModel, reference, + isSetReference, selectedBrand, + isSetSelectedBrand, selectedRecurringDetailReference, + isSetSelectedRecurringDetailReference, sessionId, + isSetSessionId, shopperEmail, + isSetShopperEmail, shopperIP, + isSetShopperIP, shopperInteraction, + isSetShopperInteraction, shopperLocale, + isSetShopperLocale, shopperName, + isSetShopperName, shopperReference, + isSetShopperReference, shopperStatement, + isSetShopperStatement, socialSecurityNumber, + isSetSocialSecurityNumber, splits, + isSetSplits, store, + isSetStore, telephoneNumber, + isSetTelephoneNumber, threeDS2RequestData, + isSetThreeDS2RequestData, threeDS2Result, + isSetThreeDS2Result, threeDS2Token, + isSetThreeDS2Token, threeDSAuthenticationOnly, + isSetThreeDSAuthenticationOnly, totalsGroup, - trustedShopper); + isSetTotalsGroup, + trustedShopper, + isSetTrustedShopper); } @Override @@ -2562,6 +2914,165 @@ 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 (isSetAccountInfo) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_INFO, this.accountInfo); + } + if (isSetAdditionalAmount) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_AMOUNT, this.additionalAmount); + } + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetBrowserInfo) { + addIfNull(nulls, JSON_PROPERTY_BROWSER_INFO, this.browserInfo); + } + if (isSetCaptureDelayHours) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_DELAY_HOURS, this.captureDelayHours); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetDccQuote) { + addIfNull(nulls, JSON_PROPERTY_DCC_QUOTE, this.dccQuote); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetDeliveryDate) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_DATE, this.deliveryDate); + } + if (isSetDeviceFingerprint) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_FINGERPRINT, this.deviceFingerprint); + } + if (isSetFraudOffset) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_OFFSET, this.fraudOffset); + } + if (isSetInstallments) { + addIfNull(nulls, JSON_PROPERTY_INSTALLMENTS, this.installments); + } + if (isSetLocalizedShopperStatement) { + addIfNull(nulls, JSON_PROPERTY_LOCALIZED_SHOPPER_STATEMENT, this.localizedShopperStatement); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetMerchantOrderReference) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ORDER_REFERENCE, this.merchantOrderReference); + } + if (isSetMerchantRiskIndicator) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_RISK_INDICATOR, this.merchantRiskIndicator); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetOrderReference) { + addIfNull(nulls, JSON_PROPERTY_ORDER_REFERENCE, this.orderReference); + } + if (isSetRecurring) { + addIfNull(nulls, JSON_PROPERTY_RECURRING, this.recurring); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSelectedBrand) { + addIfNull(nulls, JSON_PROPERTY_SELECTED_BRAND, this.selectedBrand); + } + if (isSetSelectedRecurringDetailReference) { + addIfNull( + nulls, + JSON_PROPERTY_SELECTED_RECURRING_DETAIL_REFERENCE, + this.selectedRecurringDetailReference); + } + if (isSetSessionId) { + addIfNull(nulls, JSON_PROPERTY_SESSION_ID, this.sessionId); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperIP) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_I_P, this.shopperIP); + } + if (isSetShopperInteraction) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION, this.shopperInteraction); + } + if (isSetShopperLocale) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_LOCALE, this.shopperLocale); + } + if (isSetShopperName) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_NAME, this.shopperName); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetShopperStatement) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_STATEMENT, this.shopperStatement); + } + if (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetThreeDS2RequestData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_REQUEST_DATA, this.threeDS2RequestData); + } + if (isSetThreeDS2Result) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_RESULT, this.threeDS2Result); + } + if (isSetThreeDS2Token) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_TOKEN, this.threeDS2Token); + } + if (isSetThreeDSAuthenticationOnly) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY, this.threeDSAuthenticationOnly); + } + if (isSetTotalsGroup) { + addIfNull(nulls, JSON_PROPERTY_TOTALS_GROUP, this.totalsGroup); + } + if (isSetTrustedShopper) { + addIfNull(nulls, JSON_PROPERTY_TRUSTED_SHOPPER, this.trustedShopper); + } + + 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 PaymentRequest3ds2 given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/PaymentResult.java b/src/main/java/com/adyen/model/payment/PaymentResult.java index 3f24ada0d..acee5a9e4 100644 --- a/src/main/java/com/adyen/model/payment/PaymentResult.java +++ b/src/main/java/com/adyen/model/payment/PaymentResult.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -41,33 +43,63 @@ public class PaymentResult { public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_AUTH_CODE = "authCode"; private String authCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthCode = false; + public static final String JSON_PROPERTY_DCC_AMOUNT = "dccAmount"; private Amount dccAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDccAmount = false; + public static final String JSON_PROPERTY_DCC_SIGNATURE = "dccSignature"; private String dccSignature; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDccSignature = false; + public static final String JSON_PROPERTY_FRAUD_RESULT = "fraudResult"; private FraudResult fraudResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudResult = false; + public static final String JSON_PROPERTY_ISSUER_URL = "issuerUrl"; private String issuerUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuerUrl = false; + public static final String JSON_PROPERTY_MD = "md"; private String md; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMd = false; + public static final String JSON_PROPERTY_PA_REQUEST = "paRequest"; private String paRequest; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaRequest = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + public static final String JSON_PROPERTY_REFUSAL_REASON = "refusalReason"; private String refusalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRefusalReason = false; + /** * The result of the payment. For more information, see [Result * codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * @@ -164,6 +196,15 @@ public static ResultCodeEnum fromValue(String value) { public static final String JSON_PROPERTY_RESULT_CODE = "resultCode"; private ResultCodeEnum resultCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResultCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentResult() {} /** @@ -177,6 +218,7 @@ public PaymentResult() {} */ public PaymentResult additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -214,6 +256,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -227,6 +270,7 @@ public void setAdditionalData(Map additionalData) { */ public PaymentResult authCode(String authCode) { this.authCode = authCode; + isSetAuthCode = true; // mark as set return this; } @@ -256,6 +300,7 @@ public String getAuthCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthCode(String authCode) { this.authCode = authCode; + isSetAuthCode = true; // mark as set } /** @@ -266,6 +311,7 @@ public void setAuthCode(String authCode) { */ public PaymentResult dccAmount(Amount dccAmount) { this.dccAmount = dccAmount; + isSetDccAmount = true; // mark as set return this; } @@ -289,6 +335,7 @@ public Amount getDccAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDccAmount(Amount dccAmount) { this.dccAmount = dccAmount; + isSetDccAmount = true; // mark as set } /** @@ -303,6 +350,7 @@ public void setDccAmount(Amount dccAmount) { */ public PaymentResult dccSignature(String dccSignature) { this.dccSignature = dccSignature; + isSetDccSignature = true; // mark as set return this; } @@ -334,6 +382,7 @@ public String getDccSignature() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDccSignature(String dccSignature) { this.dccSignature = dccSignature; + isSetDccSignature = true; // mark as set } /** @@ -344,6 +393,7 @@ public void setDccSignature(String dccSignature) { */ public PaymentResult fraudResult(FraudResult fraudResult) { this.fraudResult = fraudResult; + isSetFraudResult = true; // mark as set return this; } @@ -367,6 +417,7 @@ public FraudResult getFraudResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudResult(FraudResult fraudResult) { this.fraudResult = fraudResult; + isSetFraudResult = true; // mark as set } /** @@ -379,6 +430,7 @@ public void setFraudResult(FraudResult fraudResult) { */ public PaymentResult issuerUrl(String issuerUrl) { this.issuerUrl = issuerUrl; + isSetIssuerUrl = true; // mark as set return this; } @@ -406,6 +458,7 @@ public String getIssuerUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuerUrl(String issuerUrl) { this.issuerUrl = issuerUrl; + isSetIssuerUrl = true; // mark as set } /** @@ -416,6 +469,7 @@ public void setIssuerUrl(String issuerUrl) { */ public PaymentResult md(String md) { this.md = md; + isSetMd = true; // mark as set return this; } @@ -439,6 +493,7 @@ public String getMd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMd(String md) { this.md = md; + isSetMd = true; // mark as set } /** @@ -455,6 +510,7 @@ public void setMd(String md) { */ public PaymentResult paRequest(String paRequest) { this.paRequest = paRequest; + isSetPaRequest = true; // mark as set return this; } @@ -490,6 +546,7 @@ public String getPaRequest() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaRequest(String paRequest) { this.paRequest = paRequest; + isSetPaRequest = true; // mark as set } /** @@ -502,6 +559,7 @@ public void setPaRequest(String paRequest) { */ public PaymentResult pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -530,6 +588,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -548,6 +607,7 @@ public void setPspReference(String pspReference) { */ public PaymentResult refusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set return this; } @@ -587,6 +647,7 @@ public String getRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set } /** @@ -650,6 +711,7 @@ public void setRefusalReason(String refusalReason) { */ public PaymentResult resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -779,6 +841,27 @@ public ResultCodeEnum getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentResult 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 PaymentResult object is equal to o. */ @@ -792,32 +875,54 @@ public boolean equals(Object o) { } PaymentResult paymentResult = (PaymentResult) o; return Objects.equals(this.additionalData, paymentResult.additionalData) + && Objects.equals(this.isSetAdditionalData, paymentResult.isSetAdditionalData) && Objects.equals(this.authCode, paymentResult.authCode) + && Objects.equals(this.isSetAuthCode, paymentResult.isSetAuthCode) && Objects.equals(this.dccAmount, paymentResult.dccAmount) + && Objects.equals(this.isSetDccAmount, paymentResult.isSetDccAmount) && Objects.equals(this.dccSignature, paymentResult.dccSignature) + && Objects.equals(this.isSetDccSignature, paymentResult.isSetDccSignature) && Objects.equals(this.fraudResult, paymentResult.fraudResult) + && Objects.equals(this.isSetFraudResult, paymentResult.isSetFraudResult) && Objects.equals(this.issuerUrl, paymentResult.issuerUrl) + && Objects.equals(this.isSetIssuerUrl, paymentResult.isSetIssuerUrl) && Objects.equals(this.md, paymentResult.md) + && Objects.equals(this.isSetMd, paymentResult.isSetMd) && Objects.equals(this.paRequest, paymentResult.paRequest) + && Objects.equals(this.isSetPaRequest, paymentResult.isSetPaRequest) && Objects.equals(this.pspReference, paymentResult.pspReference) + && Objects.equals(this.isSetPspReference, paymentResult.isSetPspReference) && Objects.equals(this.refusalReason, paymentResult.refusalReason) - && Objects.equals(this.resultCode, paymentResult.resultCode); + && Objects.equals(this.isSetRefusalReason, paymentResult.isSetRefusalReason) + && Objects.equals(this.resultCode, paymentResult.resultCode) + && Objects.equals(this.isSetResultCode, paymentResult.isSetResultCode); } @Override public int hashCode() { return Objects.hash( additionalData, + isSetAdditionalData, authCode, + isSetAuthCode, dccAmount, + isSetDccAmount, dccSignature, + isSetDccSignature, fraudResult, + isSetFraudResult, issuerUrl, + isSetIssuerUrl, md, + isSetMd, paRequest, + isSetPaRequest, pspReference, + isSetPspReference, refusalReason, - resultCode); + isSetRefusalReason, + resultCode, + isSetResultCode); } @Override @@ -849,6 +954,60 @@ 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 (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetAuthCode) { + addIfNull(nulls, JSON_PROPERTY_AUTH_CODE, this.authCode); + } + if (isSetDccAmount) { + addIfNull(nulls, JSON_PROPERTY_DCC_AMOUNT, this.dccAmount); + } + if (isSetDccSignature) { + addIfNull(nulls, JSON_PROPERTY_DCC_SIGNATURE, this.dccSignature); + } + if (isSetFraudResult) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_RESULT, this.fraudResult); + } + if (isSetIssuerUrl) { + addIfNull(nulls, JSON_PROPERTY_ISSUER_URL, this.issuerUrl); + } + if (isSetMd) { + addIfNull(nulls, JSON_PROPERTY_MD, this.md); + } + if (isSetPaRequest) { + addIfNull(nulls, JSON_PROPERTY_PA_REQUEST, this.paRequest); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetRefusalReason) { + addIfNull(nulls, JSON_PROPERTY_REFUSAL_REASON, this.refusalReason); + } + if (isSetResultCode) { + addIfNull(nulls, JSON_PROPERTY_RESULT_CODE, this.resultCode); + } + + 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 PaymentResult given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/Phone.java b/src/main/java/com/adyen/model/payment/Phone.java index ebe7327ed..245cd2b96 100644 --- a/src/main/java/com/adyen/model/payment/Phone.java +++ b/src/main/java/com/adyen/model/payment/Phone.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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,9 +25,21 @@ public class Phone { public static final String JSON_PROPERTY_CC = "cc"; private String cc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCc = false; + public static final String JSON_PROPERTY_SUBSCRIBER = "subscriber"; private String subscriber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubscriber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Phone() {} /** @@ -36,6 +50,7 @@ public Phone() {} */ public Phone cc(String cc) { this.cc = cc; + isSetCc = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getCc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCc(String cc) { this.cc = cc; + isSetCc = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCc(String cc) { */ public Phone subscriber(String subscriber) { this.subscriber = subscriber; + isSetSubscriber = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getSubscriber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubscriber(String subscriber) { this.subscriber = subscriber; + isSetSubscriber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Phone 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 Phone object is equal to o. */ @@ -104,12 +142,15 @@ public boolean equals(Object o) { return false; } Phone phone = (Phone) o; - return Objects.equals(this.cc, phone.cc) && Objects.equals(this.subscriber, phone.subscriber); + return Objects.equals(this.cc, phone.cc) + && Objects.equals(this.isSetCc, phone.isSetCc) + && Objects.equals(this.subscriber, phone.subscriber) + && Objects.equals(this.isSetSubscriber, phone.isSetSubscriber); } @Override public int hashCode() { - return Objects.hash(cc, subscriber); + return Objects.hash(cc, isSetCc, subscriber, isSetSubscriber); } @Override @@ -132,6 +173,33 @@ 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 (isSetCc) { + addIfNull(nulls, JSON_PROPERTY_CC, this.cc); + } + if (isSetSubscriber) { + addIfNull(nulls, JSON_PROPERTY_SUBSCRIBER, this.subscriber); + } + + 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 Phone given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/PlatformChargebackLogic.java b/src/main/java/com/adyen/model/payment/PlatformChargebackLogic.java index 9527d5aae..98ed3f8d0 100644 --- a/src/main/java/com/adyen/model/payment/PlatformChargebackLogic.java +++ b/src/main/java/com/adyen/model/payment/PlatformChargebackLogic.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -77,12 +79,27 @@ public static BehaviorEnum fromValue(String value) { public static final String JSON_PROPERTY_BEHAVIOR = "behavior"; private BehaviorEnum behavior; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBehavior = false; + public static final String JSON_PROPERTY_COST_ALLOCATION_ACCOUNT = "costAllocationAccount"; private String costAllocationAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCostAllocationAccount = false; + public static final String JSON_PROPERTY_TARGET_ACCOUNT = "targetAccount"; private String targetAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTargetAccount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PlatformChargebackLogic() {} /** @@ -96,6 +113,7 @@ public PlatformChargebackLogic() {} */ public PlatformChargebackLogic behavior(BehaviorEnum behavior) { this.behavior = behavior; + isSetBehavior = true; // mark as set return this; } @@ -125,6 +143,7 @@ public BehaviorEnum getBehavior() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBehavior(BehaviorEnum behavior) { this.behavior = behavior; + isSetBehavior = true; // mark as set } /** @@ -138,6 +157,7 @@ public void setBehavior(BehaviorEnum behavior) { */ public PlatformChargebackLogic costAllocationAccount(String costAllocationAccount) { this.costAllocationAccount = costAllocationAccount; + isSetCostAllocationAccount = true; // mark as set return this; } @@ -167,6 +187,7 @@ public String getCostAllocationAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCostAllocationAccount(String costAllocationAccount) { this.costAllocationAccount = costAllocationAccount; + isSetCostAllocationAccount = true; // mark as set } /** @@ -179,6 +200,7 @@ public void setCostAllocationAccount(String costAllocationAccount) { */ public PlatformChargebackLogic targetAccount(String targetAccount) { this.targetAccount = targetAccount; + isSetTargetAccount = true; // mark as set return this; } @@ -206,6 +228,27 @@ public String getTargetAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTargetAccount(String targetAccount) { this.targetAccount = targetAccount; + isSetTargetAccount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PlatformChargebackLogic 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 PlatformChargebackLogic object is equal to o. */ @@ -219,13 +262,23 @@ public boolean equals(Object o) { } PlatformChargebackLogic platformChargebackLogic = (PlatformChargebackLogic) o; return Objects.equals(this.behavior, platformChargebackLogic.behavior) + && Objects.equals(this.isSetBehavior, platformChargebackLogic.isSetBehavior) && Objects.equals(this.costAllocationAccount, platformChargebackLogic.costAllocationAccount) - && Objects.equals(this.targetAccount, platformChargebackLogic.targetAccount); + && Objects.equals( + this.isSetCostAllocationAccount, platformChargebackLogic.isSetCostAllocationAccount) + && Objects.equals(this.targetAccount, platformChargebackLogic.targetAccount) + && Objects.equals(this.isSetTargetAccount, platformChargebackLogic.isSetTargetAccount); } @Override public int hashCode() { - return Objects.hash(behavior, costAllocationAccount, targetAccount); + return Objects.hash( + behavior, + isSetBehavior, + costAllocationAccount, + isSetCostAllocationAccount, + targetAccount, + isSetTargetAccount); } @Override @@ -251,6 +304,36 @@ 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 (isSetBehavior) { + addIfNull(nulls, JSON_PROPERTY_BEHAVIOR, this.behavior); + } + if (isSetCostAllocationAccount) { + addIfNull(nulls, JSON_PROPERTY_COST_ALLOCATION_ACCOUNT, this.costAllocationAccount); + } + if (isSetTargetAccount) { + addIfNull(nulls, JSON_PROPERTY_TARGET_ACCOUNT, this.targetAccount); + } + + 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 PlatformChargebackLogic given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/Recurring.java b/src/main/java/com/adyen/model/payment/Recurring.java index 53ddca058..32b459c99 100644 --- a/src/main/java/com/adyen/model/payment/Recurring.java +++ b/src/main/java/com/adyen/model/payment/Recurring.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -94,15 +96,27 @@ public static ContractEnum fromValue(String value) { public static final String JSON_PROPERTY_CONTRACT = "contract"; private ContractEnum contract; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContract = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_NAME = "recurringDetailName"; private String recurringDetailName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailName = false; + public static final String JSON_PROPERTY_RECURRING_EXPIRY = "recurringExpiry"; private OffsetDateTime recurringExpiry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringExpiry = false; + public static final String JSON_PROPERTY_RECURRING_FREQUENCY = "recurringFrequency"; private String recurringFrequency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringFrequency = false; + /** The name of the token service. */ public enum TokenServiceEnum { VISATOKENSERVICE(String.valueOf("VISATOKENSERVICE")), @@ -151,6 +165,15 @@ public static TokenServiceEnum fromValue(String value) { public static final String JSON_PROPERTY_TOKEN_SERVICE = "tokenService"; private TokenServiceEnum tokenService; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenService = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Recurring() {} /** @@ -183,6 +206,7 @@ public Recurring() {} */ public Recurring contract(ContractEnum contract) { this.contract = contract; + isSetContract = true; // mark as set return this; } @@ -250,6 +274,7 @@ public ContractEnum getContract() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContract(ContractEnum contract) { this.contract = contract; + isSetContract = true; // mark as set } /** @@ -260,6 +285,7 @@ public void setContract(ContractEnum contract) { */ public Recurring recurringDetailName(String recurringDetailName) { this.recurringDetailName = recurringDetailName; + isSetRecurringDetailName = true; // mark as set return this; } @@ -283,6 +309,7 @@ public String getRecurringDetailName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailName(String recurringDetailName) { this.recurringDetailName = recurringDetailName; + isSetRecurringDetailName = true; // mark as set } /** @@ -294,6 +321,7 @@ public void setRecurringDetailName(String recurringDetailName) { */ public Recurring recurringExpiry(OffsetDateTime recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set return this; } @@ -319,6 +347,7 @@ public OffsetDateTime getRecurringExpiry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringExpiry(OffsetDateTime recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set } /** @@ -329,6 +358,7 @@ public void setRecurringExpiry(OffsetDateTime recurringExpiry) { */ public Recurring recurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set return this; } @@ -352,6 +382,7 @@ public String getRecurringFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set } /** @@ -362,6 +393,7 @@ public void setRecurringFrequency(String recurringFrequency) { */ public Recurring tokenService(TokenServiceEnum tokenService) { this.tokenService = tokenService; + isSetTokenService = true; // mark as set return this; } @@ -385,6 +417,27 @@ public TokenServiceEnum getTokenService() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenService(TokenServiceEnum tokenService) { this.tokenService = tokenService; + isSetTokenService = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Recurring 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 Recurring object is equal to o. */ @@ -398,16 +451,30 @@ public boolean equals(Object o) { } Recurring recurring = (Recurring) o; return Objects.equals(this.contract, recurring.contract) + && Objects.equals(this.isSetContract, recurring.isSetContract) && Objects.equals(this.recurringDetailName, recurring.recurringDetailName) + && Objects.equals(this.isSetRecurringDetailName, recurring.isSetRecurringDetailName) && Objects.equals(this.recurringExpiry, recurring.recurringExpiry) + && Objects.equals(this.isSetRecurringExpiry, recurring.isSetRecurringExpiry) && Objects.equals(this.recurringFrequency, recurring.recurringFrequency) - && Objects.equals(this.tokenService, recurring.tokenService); + && Objects.equals(this.isSetRecurringFrequency, recurring.isSetRecurringFrequency) + && Objects.equals(this.tokenService, recurring.tokenService) + && Objects.equals(this.isSetTokenService, recurring.isSetTokenService); } @Override public int hashCode() { return Objects.hash( - contract, recurringDetailName, recurringExpiry, recurringFrequency, tokenService); + contract, + isSetContract, + recurringDetailName, + isSetRecurringDetailName, + recurringExpiry, + isSetRecurringExpiry, + recurringFrequency, + isSetRecurringFrequency, + tokenService, + isSetTokenService); } @Override @@ -435,6 +502,42 @@ 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 (isSetContract) { + addIfNull(nulls, JSON_PROPERTY_CONTRACT, this.contract); + } + if (isSetRecurringDetailName) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_NAME, this.recurringDetailName); + } + if (isSetRecurringExpiry) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_EXPIRY, this.recurringExpiry); + } + if (isSetRecurringFrequency) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_FREQUENCY, this.recurringFrequency); + } + if (isSetTokenService) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_SERVICE, this.tokenService); + } + + 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 Recurring given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/RefundRequest.java b/src/main/java/com/adyen/model/payment/RefundRequest.java index 16e5d8b43..3c1f2cbe0 100644 --- a/src/main/java/com/adyen/model/payment/RefundRequest.java +++ b/src/main/java/com/adyen/model/payment/RefundRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -39,37 +41,76 @@ public class RefundRequest { public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_MODIFICATION_AMOUNT = "modificationAmount"; private Amount modificationAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationAmount = false; + public static final String JSON_PROPERTY_MPI_DATA = "mpiData"; private ThreeDSecureData mpiData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMpiData = false; + public static final String JSON_PROPERTY_ORIGINAL_MERCHANT_REFERENCE = "originalMerchantReference"; private String originalMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalMerchantReference = false; + public static final String JSON_PROPERTY_ORIGINAL_REFERENCE = "originalReference"; private String originalReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalReference = false; + public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; private PlatformChargebackLogic platformChargebackLogic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformChargebackLogic = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + public static final String JSON_PROPERTY_TENDER_REFERENCE = "tenderReference"; private String tenderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTenderReference = false; + public static final String JSON_PROPERTY_UNIQUE_TERMINAL_ID = "uniqueTerminalId"; private String uniqueTerminalId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUniqueTerminalId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RefundRequest() {} /** @@ -84,6 +125,7 @@ public RefundRequest() {} */ public RefundRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -123,6 +165,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -133,6 +176,7 @@ public void setAdditionalData(Map additionalData) { */ public RefundRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -156,6 +200,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -166,6 +211,7 @@ public void setMerchantAccount(String merchantAccount) { */ public RefundRequest modificationAmount(Amount modificationAmount) { this.modificationAmount = modificationAmount; + isSetModificationAmount = true; // mark as set return this; } @@ -189,6 +235,7 @@ public Amount getModificationAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationAmount(Amount modificationAmount) { this.modificationAmount = modificationAmount; + isSetModificationAmount = true; // mark as set } /** @@ -199,6 +246,7 @@ public void setModificationAmount(Amount modificationAmount) { */ public RefundRequest mpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set return this; } @@ -222,6 +270,7 @@ public ThreeDSecureData getMpiData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set } /** @@ -232,6 +281,7 @@ public void setMpiData(ThreeDSecureData mpiData) { */ public RefundRequest originalMerchantReference(String originalMerchantReference) { this.originalMerchantReference = originalMerchantReference; + isSetOriginalMerchantReference = true; // mark as set return this; } @@ -255,6 +305,7 @@ public String getOriginalMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalMerchantReference(String originalMerchantReference) { this.originalMerchantReference = originalMerchantReference; + isSetOriginalMerchantReference = true; // mark as set } /** @@ -267,6 +318,7 @@ public void setOriginalMerchantReference(String originalMerchantReference) { */ public RefundRequest originalReference(String originalReference) { this.originalReference = originalReference; + isSetOriginalReference = true; // mark as set return this; } @@ -294,6 +346,7 @@ public String getOriginalReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalReference(String originalReference) { this.originalReference = originalReference; + isSetOriginalReference = true; // mark as set } /** @@ -304,6 +357,7 @@ public void setOriginalReference(String originalReference) { */ public RefundRequest platformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -327,6 +381,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -339,6 +394,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public RefundRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -366,6 +422,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -380,6 +437,7 @@ public void setReference(String reference) { */ public RefundRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -419,6 +477,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -430,6 +489,7 @@ public void setSplits(List splits) { */ public RefundRequest tenderReference(String tenderReference) { this.tenderReference = tenderReference; + isSetTenderReference = true; // mark as set return this; } @@ -455,6 +515,7 @@ public String getTenderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTenderReference(String tenderReference) { this.tenderReference = tenderReference; + isSetTenderReference = true; // mark as set } /** @@ -467,6 +528,7 @@ public void setTenderReference(String tenderReference) { */ public RefundRequest uniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set return this; } @@ -494,6 +556,27 @@ public String getUniqueTerminalId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RefundRequest 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 RefundRequest object is equal to o. */ @@ -507,32 +590,56 @@ public boolean equals(Object o) { } RefundRequest refundRequest = (RefundRequest) o; return Objects.equals(this.additionalData, refundRequest.additionalData) + && Objects.equals(this.isSetAdditionalData, refundRequest.isSetAdditionalData) && Objects.equals(this.merchantAccount, refundRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, refundRequest.isSetMerchantAccount) && Objects.equals(this.modificationAmount, refundRequest.modificationAmount) + && Objects.equals(this.isSetModificationAmount, refundRequest.isSetModificationAmount) && Objects.equals(this.mpiData, refundRequest.mpiData) + && Objects.equals(this.isSetMpiData, refundRequest.isSetMpiData) && Objects.equals(this.originalMerchantReference, refundRequest.originalMerchantReference) + && Objects.equals( + this.isSetOriginalMerchantReference, refundRequest.isSetOriginalMerchantReference) && Objects.equals(this.originalReference, refundRequest.originalReference) + && Objects.equals(this.isSetOriginalReference, refundRequest.isSetOriginalReference) && Objects.equals(this.platformChargebackLogic, refundRequest.platformChargebackLogic) + && Objects.equals( + this.isSetPlatformChargebackLogic, refundRequest.isSetPlatformChargebackLogic) && Objects.equals(this.reference, refundRequest.reference) + && Objects.equals(this.isSetReference, refundRequest.isSetReference) && Objects.equals(this.splits, refundRequest.splits) + && Objects.equals(this.isSetSplits, refundRequest.isSetSplits) && Objects.equals(this.tenderReference, refundRequest.tenderReference) - && Objects.equals(this.uniqueTerminalId, refundRequest.uniqueTerminalId); + && Objects.equals(this.isSetTenderReference, refundRequest.isSetTenderReference) + && Objects.equals(this.uniqueTerminalId, refundRequest.uniqueTerminalId) + && Objects.equals(this.isSetUniqueTerminalId, refundRequest.isSetUniqueTerminalId); } @Override public int hashCode() { return Objects.hash( additionalData, + isSetAdditionalData, merchantAccount, + isSetMerchantAccount, modificationAmount, + isSetModificationAmount, mpiData, + isSetMpiData, originalMerchantReference, + isSetOriginalMerchantReference, originalReference, + isSetOriginalReference, platformChargebackLogic, + isSetPlatformChargebackLogic, reference, + isSetReference, splits, + isSetSplits, tenderReference, - uniqueTerminalId); + isSetTenderReference, + uniqueTerminalId, + isSetUniqueTerminalId); } @Override @@ -568,6 +675,60 @@ 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 (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetModificationAmount) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_AMOUNT, this.modificationAmount); + } + if (isSetMpiData) { + addIfNull(nulls, JSON_PROPERTY_MPI_DATA, this.mpiData); + } + if (isSetOriginalMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_MERCHANT_REFERENCE, this.originalMerchantReference); + } + if (isSetOriginalReference) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_REFERENCE, this.originalReference); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetTenderReference) { + addIfNull(nulls, JSON_PROPERTY_TENDER_REFERENCE, this.tenderReference); + } + if (isSetUniqueTerminalId) { + addIfNull(nulls, JSON_PROPERTY_UNIQUE_TERMINAL_ID, this.uniqueTerminalId); + } + + 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 RefundRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalData3DSecure.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalData3DSecure.java index ce8a9fdd0..3c6550ccf 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalData3DSecure.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalData3DSecure.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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,18 +31,39 @@ public class ResponseAdditionalData3DSecure { public static final String JSON_PROPERTY_CARD_HOLDER_INFO = "cardHolderInfo"; private String cardHolderInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardHolderInfo = false; + public static final String JSON_PROPERTY_CAVV = "cavv"; private String cavv; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCavv = false; + public static final String JSON_PROPERTY_CAVV_ALGORITHM = "cavvAlgorithm"; private String cavvAlgorithm; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCavvAlgorithm = false; + public static final String JSON_PROPERTY_SCA_EXEMPTION_REQUESTED = "scaExemptionRequested"; private String scaExemptionRequested; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaExemptionRequested = false; + public static final String JSON_PROPERTY_THREEDS2_CARD_ENROLLED = "threeds2.cardEnrolled"; private Boolean threeds2CardEnrolled; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeds2CardEnrolled = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalData3DSecure() {} /** @@ -54,6 +77,7 @@ public ResponseAdditionalData3DSecure() {} */ public ResponseAdditionalData3DSecure cardHolderInfo(String cardHolderInfo) { this.cardHolderInfo = cardHolderInfo; + isSetCardHolderInfo = true; // mark as set return this; } @@ -81,6 +105,7 @@ public String getCardHolderInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardHolderInfo(String cardHolderInfo) { this.cardHolderInfo = cardHolderInfo; + isSetCardHolderInfo = true; // mark as set } /** @@ -94,6 +119,7 @@ public void setCardHolderInfo(String cardHolderInfo) { */ public ResponseAdditionalData3DSecure cavv(String cavv) { this.cavv = cavv; + isSetCavv = true; // mark as set return this; } @@ -121,6 +147,7 @@ public String getCavv() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCavv(String cavv) { this.cavv = cavv; + isSetCavv = true; // mark as set } /** @@ -132,6 +159,7 @@ public void setCavv(String cavv) { */ public ResponseAdditionalData3DSecure cavvAlgorithm(String cavvAlgorithm) { this.cavvAlgorithm = cavvAlgorithm; + isSetCavvAlgorithm = true; // mark as set return this; } @@ -155,6 +183,7 @@ public String getCavvAlgorithm() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCavvAlgorithm(String cavvAlgorithm) { this.cavvAlgorithm = cavvAlgorithm; + isSetCavvAlgorithm = true; // mark as set } /** @@ -172,6 +201,7 @@ public void setCavvAlgorithm(String cavvAlgorithm) { */ public ResponseAdditionalData3DSecure scaExemptionRequested(String scaExemptionRequested) { this.scaExemptionRequested = scaExemptionRequested; + isSetScaExemptionRequested = true; // mark as set return this; } @@ -207,6 +237,7 @@ public String getScaExemptionRequested() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaExemptionRequested(String scaExemptionRequested) { this.scaExemptionRequested = scaExemptionRequested; + isSetScaExemptionRequested = true; // mark as set } /** @@ -218,6 +249,7 @@ public void setScaExemptionRequested(String scaExemptionRequested) { */ public ResponseAdditionalData3DSecure threeds2CardEnrolled(Boolean threeds2CardEnrolled) { this.threeds2CardEnrolled = threeds2CardEnrolled; + isSetThreeds2CardEnrolled = true; // mark as set return this; } @@ -241,6 +273,27 @@ public Boolean getThreeds2CardEnrolled() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeds2CardEnrolled(Boolean threeds2CardEnrolled) { this.threeds2CardEnrolled = threeds2CardEnrolled; + isSetThreeds2CardEnrolled = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalData3DSecure 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 ResponseAdditionalData3DSecure object is equal to o. */ @@ -255,18 +308,38 @@ public boolean equals(Object o) { ResponseAdditionalData3DSecure responseAdditionalData3DSecure = (ResponseAdditionalData3DSecure) o; return Objects.equals(this.cardHolderInfo, responseAdditionalData3DSecure.cardHolderInfo) + && Objects.equals( + this.isSetCardHolderInfo, responseAdditionalData3DSecure.isSetCardHolderInfo) && Objects.equals(this.cavv, responseAdditionalData3DSecure.cavv) + && Objects.equals(this.isSetCavv, responseAdditionalData3DSecure.isSetCavv) && Objects.equals(this.cavvAlgorithm, responseAdditionalData3DSecure.cavvAlgorithm) + && Objects.equals( + this.isSetCavvAlgorithm, responseAdditionalData3DSecure.isSetCavvAlgorithm) && Objects.equals( this.scaExemptionRequested, responseAdditionalData3DSecure.scaExemptionRequested) && Objects.equals( - this.threeds2CardEnrolled, responseAdditionalData3DSecure.threeds2CardEnrolled); + this.isSetScaExemptionRequested, + responseAdditionalData3DSecure.isSetScaExemptionRequested) + && Objects.equals( + this.threeds2CardEnrolled, responseAdditionalData3DSecure.threeds2CardEnrolled) + && Objects.equals( + this.isSetThreeds2CardEnrolled, + responseAdditionalData3DSecure.isSetThreeds2CardEnrolled); } @Override public int hashCode() { return Objects.hash( - cardHolderInfo, cavv, cavvAlgorithm, scaExemptionRequested, threeds2CardEnrolled); + cardHolderInfo, + isSetCardHolderInfo, + cavv, + isSetCavv, + cavvAlgorithm, + isSetCavvAlgorithm, + scaExemptionRequested, + isSetScaExemptionRequested, + threeds2CardEnrolled, + isSetThreeds2CardEnrolled); } @Override @@ -296,6 +369,42 @@ 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 (isSetCardHolderInfo) { + addIfNull(nulls, JSON_PROPERTY_CARD_HOLDER_INFO, this.cardHolderInfo); + } + if (isSetCavv) { + addIfNull(nulls, JSON_PROPERTY_CAVV, this.cavv); + } + if (isSetCavvAlgorithm) { + addIfNull(nulls, JSON_PROPERTY_CAVV_ALGORITHM, this.cavvAlgorithm); + } + if (isSetScaExemptionRequested) { + addIfNull(nulls, JSON_PROPERTY_SCA_EXEMPTION_REQUESTED, this.scaExemptionRequested); + } + if (isSetThreeds2CardEnrolled) { + addIfNull(nulls, JSON_PROPERTY_THREEDS2_CARD_ENROLLED, this.threeds2CardEnrolled); + } + + 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 ResponseAdditionalData3DSecure given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataBillingAddress.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataBillingAddress.java index 44af067be..21c96aba3 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataBillingAddress.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataBillingAddress.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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,24 +32,48 @@ public class ResponseAdditionalDataBillingAddress { public static final String JSON_PROPERTY_BILLING_ADDRESS_CITY = "billingAddress.city"; private String billingAddressCity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddressCity = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS_COUNTRY = "billingAddress.country"; private String billingAddressCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddressCountry = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS_HOUSE_NUMBER_OR_NAME = "billingAddress.houseNumberOrName"; private String billingAddressHouseNumberOrName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddressHouseNumberOrName = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS_POSTAL_CODE = "billingAddress.postalCode"; private String billingAddressPostalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddressPostalCode = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS_STATE_OR_PROVINCE = "billingAddress.stateOrProvince"; private String billingAddressStateOrProvince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddressStateOrProvince = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS_STREET = "billingAddress.street"; private String billingAddressStreet; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddressStreet = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalDataBillingAddress() {} /** @@ -59,6 +85,7 @@ public ResponseAdditionalDataBillingAddress() {} */ public ResponseAdditionalDataBillingAddress billingAddressCity(String billingAddressCity) { this.billingAddressCity = billingAddressCity; + isSetBillingAddressCity = true; // mark as set return this; } @@ -82,6 +109,7 @@ public String getBillingAddressCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddressCity(String billingAddressCity) { this.billingAddressCity = billingAddressCity; + isSetBillingAddressCity = true; // mark as set } /** @@ -94,6 +122,7 @@ public void setBillingAddressCity(String billingAddressCity) { */ public ResponseAdditionalDataBillingAddress billingAddressCountry(String billingAddressCountry) { this.billingAddressCountry = billingAddressCountry; + isSetBillingAddressCountry = true; // mark as set return this; } @@ -119,6 +148,7 @@ public String getBillingAddressCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddressCountry(String billingAddressCountry) { this.billingAddressCountry = billingAddressCountry; + isSetBillingAddressCountry = true; // mark as set } /** @@ -132,6 +162,7 @@ public void setBillingAddressCountry(String billingAddressCountry) { public ResponseAdditionalDataBillingAddress billingAddressHouseNumberOrName( String billingAddressHouseNumberOrName) { this.billingAddressHouseNumberOrName = billingAddressHouseNumberOrName; + isSetBillingAddressHouseNumberOrName = true; // mark as set return this; } @@ -157,6 +188,7 @@ public String getBillingAddressHouseNumberOrName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddressHouseNumberOrName(String billingAddressHouseNumberOrName) { this.billingAddressHouseNumberOrName = billingAddressHouseNumberOrName; + isSetBillingAddressHouseNumberOrName = true; // mark as set } /** @@ -170,6 +202,7 @@ public void setBillingAddressHouseNumberOrName(String billingAddressHouseNumberO public ResponseAdditionalDataBillingAddress billingAddressPostalCode( String billingAddressPostalCode) { this.billingAddressPostalCode = billingAddressPostalCode; + isSetBillingAddressPostalCode = true; // mark as set return this; } @@ -195,6 +228,7 @@ public String getBillingAddressPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddressPostalCode(String billingAddressPostalCode) { this.billingAddressPostalCode = billingAddressPostalCode; + isSetBillingAddressPostalCode = true; // mark as set } /** @@ -208,6 +242,7 @@ public void setBillingAddressPostalCode(String billingAddressPostalCode) { public ResponseAdditionalDataBillingAddress billingAddressStateOrProvince( String billingAddressStateOrProvince) { this.billingAddressStateOrProvince = billingAddressStateOrProvince; + isSetBillingAddressStateOrProvince = true; // mark as set return this; } @@ -233,6 +268,7 @@ public String getBillingAddressStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddressStateOrProvince(String billingAddressStateOrProvince) { this.billingAddressStateOrProvince = billingAddressStateOrProvince; + isSetBillingAddressStateOrProvince = true; // mark as set } /** @@ -244,6 +280,7 @@ public void setBillingAddressStateOrProvince(String billingAddressStateOrProvinc */ public ResponseAdditionalDataBillingAddress billingAddressStreet(String billingAddressStreet) { this.billingAddressStreet = billingAddressStreet; + isSetBillingAddressStreet = true; // mark as set return this; } @@ -267,6 +304,27 @@ public String getBillingAddressStreet() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddressStreet(String billingAddressStreet) { this.billingAddressStreet = billingAddressStreet; + isSetBillingAddressStreet = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalDataBillingAddress 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 ResponseAdditionalDataBillingAddress object is equal to o. */ @@ -282,30 +340,54 @@ public boolean equals(Object o) { (ResponseAdditionalDataBillingAddress) o; return Objects.equals( this.billingAddressCity, responseAdditionalDataBillingAddress.billingAddressCity) + && Objects.equals( + this.isSetBillingAddressCity, + responseAdditionalDataBillingAddress.isSetBillingAddressCity) && Objects.equals( this.billingAddressCountry, responseAdditionalDataBillingAddress.billingAddressCountry) + && Objects.equals( + this.isSetBillingAddressCountry, + responseAdditionalDataBillingAddress.isSetBillingAddressCountry) && Objects.equals( this.billingAddressHouseNumberOrName, responseAdditionalDataBillingAddress.billingAddressHouseNumberOrName) + && Objects.equals( + this.isSetBillingAddressHouseNumberOrName, + responseAdditionalDataBillingAddress.isSetBillingAddressHouseNumberOrName) && Objects.equals( this.billingAddressPostalCode, responseAdditionalDataBillingAddress.billingAddressPostalCode) + && Objects.equals( + this.isSetBillingAddressPostalCode, + responseAdditionalDataBillingAddress.isSetBillingAddressPostalCode) && Objects.equals( this.billingAddressStateOrProvince, responseAdditionalDataBillingAddress.billingAddressStateOrProvince) && Objects.equals( - this.billingAddressStreet, responseAdditionalDataBillingAddress.billingAddressStreet); + this.isSetBillingAddressStateOrProvince, + responseAdditionalDataBillingAddress.isSetBillingAddressStateOrProvince) + && Objects.equals( + this.billingAddressStreet, responseAdditionalDataBillingAddress.billingAddressStreet) + && Objects.equals( + this.isSetBillingAddressStreet, + responseAdditionalDataBillingAddress.isSetBillingAddressStreet); } @Override public int hashCode() { return Objects.hash( billingAddressCity, + isSetBillingAddressCity, billingAddressCountry, + isSetBillingAddressCountry, billingAddressHouseNumberOrName, + isSetBillingAddressHouseNumberOrName, billingAddressPostalCode, + isSetBillingAddressPostalCode, billingAddressStateOrProvince, - billingAddressStreet); + isSetBillingAddressStateOrProvince, + billingAddressStreet, + isSetBillingAddressStreet); } @Override @@ -342,6 +424,51 @@ 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 (isSetBillingAddressCity) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS_CITY, this.billingAddressCity); + } + if (isSetBillingAddressCountry) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS_COUNTRY, this.billingAddressCountry); + } + if (isSetBillingAddressHouseNumberOrName) { + addIfNull( + nulls, + JSON_PROPERTY_BILLING_ADDRESS_HOUSE_NUMBER_OR_NAME, + this.billingAddressHouseNumberOrName); + } + if (isSetBillingAddressPostalCode) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS_POSTAL_CODE, this.billingAddressPostalCode); + } + if (isSetBillingAddressStateOrProvince) { + addIfNull( + nulls, + JSON_PROPERTY_BILLING_ADDRESS_STATE_OR_PROVINCE, + this.billingAddressStateOrProvince); + } + if (isSetBillingAddressStreet) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS_STREET, this.billingAddressStreet); + } + + 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 ResponseAdditionalDataBillingAddress given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCard.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCard.java index 8c47898d7..6cc34e12a 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCard.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCard.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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,21 +39,39 @@ public class ResponseAdditionalDataCard { public static final String JSON_PROPERTY_CARD_BIN = "cardBin"; private String cardBin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardBin = false; + public static final String JSON_PROPERTY_CARD_HOLDER_NAME = "cardHolderName"; private String cardHolderName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardHolderName = false; + public static final String JSON_PROPERTY_CARD_ISSUING_BANK = "cardIssuingBank"; private String cardIssuingBank; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardIssuingBank = false; + public static final String JSON_PROPERTY_CARD_ISSUING_COUNTRY = "cardIssuingCountry"; private String cardIssuingCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardIssuingCountry = false; + public static final String JSON_PROPERTY_CARD_ISSUING_CURRENCY = "cardIssuingCurrency"; private String cardIssuingCurrency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardIssuingCurrency = false; + public static final String JSON_PROPERTY_CARD_PAYMENT_METHOD = "cardPaymentMethod"; private String cardPaymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardPaymentMethod = false; + /** * The Card Product ID represents the type of card following card scheme product definitions and * can be returned for Adyen Acquiring service level payments. Possible values Visa: * **A** - @@ -122,12 +142,27 @@ public static CardProductIdEnum fromValue(String value) { public static final String JSON_PROPERTY_CARD_PRODUCT_ID = "cardProductId"; private CardProductIdEnum cardProductId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardProductId = false; + public static final String JSON_PROPERTY_CARD_SUMMARY = "cardSummary"; private String cardSummary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardSummary = false; + public static final String JSON_PROPERTY_ISSUER_BIN = "issuerBin"; private String issuerBin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuerBin = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalDataCard() {} /** @@ -142,6 +177,7 @@ public ResponseAdditionalDataCard() {} */ public ResponseAdditionalDataCard cardBin(String cardBin) { this.cardBin = cardBin; + isSetCardBin = true; // mark as set return this; } @@ -174,6 +210,7 @@ public String getCardBin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardBin(String cardBin) { this.cardBin = cardBin; + isSetCardBin = true; // mark as set } /** @@ -184,6 +221,7 @@ public void setCardBin(String cardBin) { */ public ResponseAdditionalDataCard cardHolderName(String cardHolderName) { this.cardHolderName = cardHolderName; + isSetCardHolderName = true; // mark as set return this; } @@ -207,6 +245,7 @@ public String getCardHolderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardHolderName(String cardHolderName) { this.cardHolderName = cardHolderName; + isSetCardHolderName = true; // mark as set } /** @@ -219,6 +258,7 @@ public void setCardHolderName(String cardHolderName) { */ public ResponseAdditionalDataCard cardIssuingBank(String cardIssuingBank) { this.cardIssuingBank = cardIssuingBank; + isSetCardIssuingBank = true; // mark as set return this; } @@ -246,6 +286,7 @@ public String getCardIssuingBank() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardIssuingBank(String cardIssuingBank) { this.cardIssuingBank = cardIssuingBank; + isSetCardIssuingBank = true; // mark as set } /** @@ -256,6 +297,7 @@ public void setCardIssuingBank(String cardIssuingBank) { */ public ResponseAdditionalDataCard cardIssuingCountry(String cardIssuingCountry) { this.cardIssuingCountry = cardIssuingCountry; + isSetCardIssuingCountry = true; // mark as set return this; } @@ -279,6 +321,7 @@ public String getCardIssuingCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardIssuingCountry(String cardIssuingCountry) { this.cardIssuingCountry = cardIssuingCountry; + isSetCardIssuingCountry = true; // mark as set } /** @@ -292,6 +335,7 @@ public void setCardIssuingCountry(String cardIssuingCountry) { */ public ResponseAdditionalDataCard cardIssuingCurrency(String cardIssuingCurrency) { this.cardIssuingCurrency = cardIssuingCurrency; + isSetCardIssuingCurrency = true; // mark as set return this; } @@ -321,6 +365,7 @@ public String getCardIssuingCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardIssuingCurrency(String cardIssuingCurrency) { this.cardIssuingCurrency = cardIssuingCurrency; + isSetCardIssuingCurrency = true; // mark as set } /** @@ -331,6 +376,7 @@ public void setCardIssuingCurrency(String cardIssuingCurrency) { */ public ResponseAdditionalDataCard cardPaymentMethod(String cardPaymentMethod) { this.cardPaymentMethod = cardPaymentMethod; + isSetCardPaymentMethod = true; // mark as set return this; } @@ -354,6 +400,7 @@ public String getCardPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardPaymentMethod(String cardPaymentMethod) { this.cardPaymentMethod = cardPaymentMethod; + isSetCardPaymentMethod = true; // mark as set } /** @@ -376,6 +423,7 @@ public void setCardPaymentMethod(String cardPaymentMethod) { */ public ResponseAdditionalDataCard cardProductId(CardProductIdEnum cardProductId) { this.cardProductId = cardProductId; + isSetCardProductId = true; // mark as set return this; } @@ -423,6 +471,7 @@ public CardProductIdEnum getCardProductId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardProductId(CardProductIdEnum cardProductId) { this.cardProductId = cardProductId; + isSetCardProductId = true; // mark as set } /** @@ -434,6 +483,7 @@ public void setCardProductId(CardProductIdEnum cardProductId) { */ public ResponseAdditionalDataCard cardSummary(String cardSummary) { this.cardSummary = cardSummary; + isSetCardSummary = true; // mark as set return this; } @@ -459,6 +509,7 @@ public String getCardSummary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardSummary(String cardSummary) { this.cardSummary = cardSummary; + isSetCardSummary = true; // mark as set } /** @@ -475,6 +526,7 @@ public void setCardSummary(String cardSummary) { */ public ResponseAdditionalDataCard issuerBin(String issuerBin) { this.issuerBin = issuerBin; + isSetIssuerBin = true; // mark as set return this; } @@ -510,6 +562,27 @@ public String getIssuerBin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuerBin(String issuerBin) { this.issuerBin = issuerBin; + isSetIssuerBin = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalDataCard 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 ResponseAdditionalDataCard object is equal to o. */ @@ -523,28 +596,50 @@ public boolean equals(Object o) { } ResponseAdditionalDataCard responseAdditionalDataCard = (ResponseAdditionalDataCard) o; return Objects.equals(this.cardBin, responseAdditionalDataCard.cardBin) + && Objects.equals(this.isSetCardBin, responseAdditionalDataCard.isSetCardBin) && Objects.equals(this.cardHolderName, responseAdditionalDataCard.cardHolderName) + && Objects.equals(this.isSetCardHolderName, responseAdditionalDataCard.isSetCardHolderName) && Objects.equals(this.cardIssuingBank, responseAdditionalDataCard.cardIssuingBank) + && Objects.equals( + this.isSetCardIssuingBank, responseAdditionalDataCard.isSetCardIssuingBank) && Objects.equals(this.cardIssuingCountry, responseAdditionalDataCard.cardIssuingCountry) + && Objects.equals( + this.isSetCardIssuingCountry, responseAdditionalDataCard.isSetCardIssuingCountry) && Objects.equals(this.cardIssuingCurrency, responseAdditionalDataCard.cardIssuingCurrency) + && Objects.equals( + this.isSetCardIssuingCurrency, responseAdditionalDataCard.isSetCardIssuingCurrency) && Objects.equals(this.cardPaymentMethod, responseAdditionalDataCard.cardPaymentMethod) + && Objects.equals( + this.isSetCardPaymentMethod, responseAdditionalDataCard.isSetCardPaymentMethod) && Objects.equals(this.cardProductId, responseAdditionalDataCard.cardProductId) + && Objects.equals(this.isSetCardProductId, responseAdditionalDataCard.isSetCardProductId) && Objects.equals(this.cardSummary, responseAdditionalDataCard.cardSummary) - && Objects.equals(this.issuerBin, responseAdditionalDataCard.issuerBin); + && Objects.equals(this.isSetCardSummary, responseAdditionalDataCard.isSetCardSummary) + && Objects.equals(this.issuerBin, responseAdditionalDataCard.issuerBin) + && Objects.equals(this.isSetIssuerBin, responseAdditionalDataCard.isSetIssuerBin); } @Override public int hashCode() { return Objects.hash( cardBin, + isSetCardBin, cardHolderName, + isSetCardHolderName, cardIssuingBank, + isSetCardIssuingBank, cardIssuingCountry, + isSetCardIssuingCountry, cardIssuingCurrency, + isSetCardIssuingCurrency, cardPaymentMethod, + isSetCardPaymentMethod, cardProductId, + isSetCardProductId, cardSummary, - issuerBin); + isSetCardSummary, + issuerBin, + isSetIssuerBin); } @Override @@ -576,6 +671,54 @@ 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 (isSetCardBin) { + addIfNull(nulls, JSON_PROPERTY_CARD_BIN, this.cardBin); + } + if (isSetCardHolderName) { + addIfNull(nulls, JSON_PROPERTY_CARD_HOLDER_NAME, this.cardHolderName); + } + if (isSetCardIssuingBank) { + addIfNull(nulls, JSON_PROPERTY_CARD_ISSUING_BANK, this.cardIssuingBank); + } + if (isSetCardIssuingCountry) { + addIfNull(nulls, JSON_PROPERTY_CARD_ISSUING_COUNTRY, this.cardIssuingCountry); + } + if (isSetCardIssuingCurrency) { + addIfNull(nulls, JSON_PROPERTY_CARD_ISSUING_CURRENCY, this.cardIssuingCurrency); + } + if (isSetCardPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_CARD_PAYMENT_METHOD, this.cardPaymentMethod); + } + if (isSetCardProductId) { + addIfNull(nulls, JSON_PROPERTY_CARD_PRODUCT_ID, this.cardProductId); + } + if (isSetCardSummary) { + addIfNull(nulls, JSON_PROPERTY_CARD_SUMMARY, this.cardSummary); + } + if (isSetIssuerBin) { + addIfNull(nulls, JSON_PROPERTY_ISSUER_BIN, this.issuerBin); + } + + 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 ResponseAdditionalDataCard given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCommon.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCommon.java index 89a7c1b64..0b3581904 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCommon.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCommon.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -91,70 +93,136 @@ public class ResponseAdditionalDataCommon { public static final String JSON_PROPERTY_ACQUIRER_ACCOUNT_CODE = "acquirerAccountCode"; private String acquirerAccountCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerAccountCode = false; + public static final String JSON_PROPERTY_ACQUIRER_CODE = "acquirerCode"; private String acquirerCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerCode = false; + public static final String JSON_PROPERTY_ACQUIRER_REFERENCE = "acquirerReference"; private String acquirerReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerReference = false; + public static final String JSON_PROPERTY_ALIAS = "alias"; private String alias; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAlias = false; + public static final String JSON_PROPERTY_ALIAS_TYPE = "aliasType"; private String aliasType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAliasType = false; + public static final String JSON_PROPERTY_AUTH_CODE = "authCode"; private String authCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthCode = false; + public static final String JSON_PROPERTY_AUTHORISATION_MID = "authorisationMid"; private String authorisationMid; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorisationMid = false; + public static final String JSON_PROPERTY_AUTHORISED_AMOUNT_CURRENCY = "authorisedAmountCurrency"; private String authorisedAmountCurrency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorisedAmountCurrency = false; + public static final String JSON_PROPERTY_AUTHORISED_AMOUNT_VALUE = "authorisedAmountValue"; private String authorisedAmountValue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorisedAmountValue = false; + public static final String JSON_PROPERTY_AVS_RESULT = "avsResult"; private String avsResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAvsResult = false; + public static final String JSON_PROPERTY_AVS_RESULT_RAW = "avsResultRaw"; private String avsResultRaw; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAvsResultRaw = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + public static final String JSON_PROPERTY_CO_BRANDED_WITH = "coBrandedWith"; private String coBrandedWith; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCoBrandedWith = false; + public static final String JSON_PROPERTY_CVC_RESULT = "cvcResult"; private String cvcResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCvcResult = false; + public static final String JSON_PROPERTY_CVC_RESULT_RAW = "cvcResultRaw"; private String cvcResultRaw; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCvcResultRaw = false; + public static final String JSON_PROPERTY_DS_TRANS_I_D = "dsTransID"; private String dsTransID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDsTransID = false; + public static final String JSON_PROPERTY_ECI = "eci"; private String eci; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEci = false; + public static final String JSON_PROPERTY_EXPIRY_DATE = "expiryDate"; private String expiryDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryDate = false; + public static final String JSON_PROPERTY_EXTRA_COSTS_CURRENCY = "extraCostsCurrency"; private String extraCostsCurrency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExtraCostsCurrency = false; + public static final String JSON_PROPERTY_EXTRA_COSTS_VALUE = "extraCostsValue"; private String extraCostsValue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExtraCostsValue = false; + public static final String JSON_PROPERTY_FRAUD_CHECK_ITEM_NR_FRAUD_CHECKNAME = "fraudCheck-[itemNr]-[FraudCheckname]"; private String fraudCheckItemNrFraudCheckname; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudCheckItemNrFraudCheckname = false; + public static final String JSON_PROPERTY_FRAUD_MANUAL_REVIEW = "fraudManualReview"; private String fraudManualReview; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudManualReview = false; + /** The fraud result properties of the payment. */ public enum FraudResultTypeEnum { GREEN(String.valueOf("GREEN")), @@ -199,6 +267,9 @@ public static FraudResultTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_FRAUD_RESULT_TYPE = "fraudResultType"; private FraudResultTypeEnum fraudResultType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudResultType = false; + /** * The risk level of the transaction as classified by the [machine * learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) @@ -254,77 +325,143 @@ public static FraudRiskLevelEnum fromValue(String value) { public static final String JSON_PROPERTY_FRAUD_RISK_LEVEL = "fraudRiskLevel"; private FraudRiskLevelEnum fraudRiskLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudRiskLevel = false; + public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private String fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + public static final String JSON_PROPERTY_FUNDS_AVAILABILITY = "fundsAvailability"; private String fundsAvailability; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundsAvailability = false; + public static final String JSON_PROPERTY_INFERRED_REFUSAL_REASON = "inferredRefusalReason"; private String inferredRefusalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInferredRefusalReason = false; + public static final String JSON_PROPERTY_IS_CARD_COMMERCIAL = "isCardCommercial"; private String isCardCommercial; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIsCardCommercial = false; + public static final String JSON_PROPERTY_ISSUER_COUNTRY = "issuerCountry"; private String issuerCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuerCountry = false; + public static final String JSON_PROPERTY_LIABILITY_SHIFT = "liabilityShift"; private String liabilityShift; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLiabilityShift = false; + public static final String JSON_PROPERTY_MC_BANK_NET_REFERENCE_NUMBER = "mcBankNetReferenceNumber"; private String mcBankNetReferenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcBankNetReferenceNumber = false; + public static final String JSON_PROPERTY_MERCHANT_ADVICE_CODE = "merchantAdviceCode"; private String merchantAdviceCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAdviceCode = false; + public static final String JSON_PROPERTY_MERCHANT_REFERENCE = "merchantReference"; private String merchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantReference = false; + public static final String JSON_PROPERTY_NETWORK_TX_REFERENCE = "networkTxReference"; private String networkTxReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkTxReference = false; + public static final String JSON_PROPERTY_OWNER_NAME = "ownerName"; private String ownerName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOwnerName = false; + public static final String JSON_PROPERTY_PAYMENT_ACCOUNT_REFERENCE = "paymentAccountReference"; private String paymentAccountReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentAccountReference = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private String paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_VARIANT = "paymentMethodVariant"; private String paymentMethodVariant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodVariant = false; + public static final String JSON_PROPERTY_PAYOUT_ELIGIBLE = "payoutEligible"; private String payoutEligible; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayoutEligible = false; + public static final String JSON_PROPERTY_REALTIME_ACCOUNT_UPDATER_STATUS = "realtimeAccountUpdaterStatus"; private String realtimeAccountUpdaterStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRealtimeAccountUpdaterStatus = false; + public static final String JSON_PROPERTY_RECEIPT_FREE_TEXT = "receiptFreeText"; private String receiptFreeText; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReceiptFreeText = false; + public static final String JSON_PROPERTY_RECURRING_CONTRACT_TYPES = "recurring.contractTypes"; private String recurringContractTypes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringContractTypes = false; + public static final String JSON_PROPERTY_RECURRING_FIRST_PSP_REFERENCE = "recurring.firstPspReference"; private String recurringFirstPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringFirstPspReference = false; + public static final String JSON_PROPERTY_RECURRING_RECURRING_DETAIL_REFERENCE = "recurring.recurringDetailReference"; @Deprecated // deprecated since Adyen Payment API v68: Use tokenization.storedPaymentMethodId // instead. private String recurringRecurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringRecurringDetailReference = false; + public static final String JSON_PROPERTY_RECURRING_SHOPPER_REFERENCE = "recurring.shopperReference"; @Deprecated // deprecated since Adyen Payment API v68: Use tokenization.shopperReference instead. private String recurringShopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringShopperReference = false; + /** The processing model used for the recurring transaction. */ public enum RecurringProcessingModelEnum { CARDONFILE(String.valueOf("CardOnFile")), @@ -372,47 +509,89 @@ public static RecurringProcessingModelEnum fromValue(String value) { public static final String JSON_PROPERTY_RECURRING_PROCESSING_MODEL = "recurringProcessingModel"; private RecurringProcessingModelEnum recurringProcessingModel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringProcessingModel = false; + public static final String JSON_PROPERTY_REFERRED = "referred"; private String referred; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferred = false; + public static final String JSON_PROPERTY_REFUSAL_REASON_RAW = "refusalReasonRaw"; private String refusalReasonRaw; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRefusalReasonRaw = false; + public static final String JSON_PROPERTY_REQUEST_AMOUNT = "requestAmount"; private String requestAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestAmount = false; + public static final String JSON_PROPERTY_REQUEST_CURRENCY_CODE = "requestCurrencyCode"; private String requestCurrencyCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestCurrencyCode = false; + public static final String JSON_PROPERTY_SHOPPER_INTERACTION = "shopperInteraction"; private String shopperInteraction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperInteraction = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_TERMINAL_ID = "terminalId"; private String terminalId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTerminalId = false; + public static final String JSON_PROPERTY_THREE_D_AUTHENTICATED = "threeDAuthenticated"; private String threeDAuthenticated; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDAuthenticated = false; + public static final String JSON_PROPERTY_THREE_D_AUTHENTICATED_RESPONSE = "threeDAuthenticatedResponse"; private String threeDAuthenticatedResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDAuthenticatedResponse = false; + public static final String JSON_PROPERTY_THREE_D_OFFERED = "threeDOffered"; private String threeDOffered; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDOffered = false; + public static final String JSON_PROPERTY_THREE_D_OFFERED_RESPONSE = "threeDOfferedResponse"; private String threeDOfferedResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDOfferedResponse = false; + public static final String JSON_PROPERTY_THREE_D_S_VERSION = "threeDSVersion"; private String threeDSVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSVersion = false; + public static final String JSON_PROPERTY_TOKENIZATION_SHOPPER_REFERENCE = "tokenization.shopperReference"; private String tokenizationShopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenizationShopperReference = false; + /** * The operation performed on the token. Possible values: * **created**: the token has been * created. * **updated**: the existing token has been updated. * **alreadyExisting**: the details @@ -465,16 +644,34 @@ public static TokenizationStoreOperationTypeEnum fromValue(String value) { "tokenization.store.operationType"; private TokenizationStoreOperationTypeEnum tokenizationStoreOperationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenizationStoreOperationType = false; + public static final String JSON_PROPERTY_TOKENIZATION_STORED_PAYMENT_METHOD_ID = "tokenization.storedPaymentMethodId"; private String tokenizationStoredPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenizationStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_VISA_TRANSACTION_ID = "visaTransactionId"; private String visaTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVisaTransactionId = false; + public static final String JSON_PROPERTY_XID = "xid"; private String xid; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetXid = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalDataCommon() {} /** @@ -487,6 +684,7 @@ public ResponseAdditionalDataCommon() {} */ public ResponseAdditionalDataCommon acquirerAccountCode(String acquirerAccountCode) { this.acquirerAccountCode = acquirerAccountCode; + isSetAcquirerAccountCode = true; // mark as set return this; } @@ -514,6 +712,7 @@ public String getAcquirerAccountCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerAccountCode(String acquirerAccountCode) { this.acquirerAccountCode = acquirerAccountCode; + isSetAcquirerAccountCode = true; // mark as set } /** @@ -525,6 +724,7 @@ public void setAcquirerAccountCode(String acquirerAccountCode) { */ public ResponseAdditionalDataCommon acquirerCode(String acquirerCode) { this.acquirerCode = acquirerCode; + isSetAcquirerCode = true; // mark as set return this; } @@ -550,6 +750,7 @@ public String getAcquirerCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerCode(String acquirerCode) { this.acquirerCode = acquirerCode; + isSetAcquirerCode = true; // mark as set } /** @@ -562,6 +763,7 @@ public void setAcquirerCode(String acquirerCode) { */ public ResponseAdditionalDataCommon acquirerReference(String acquirerReference) { this.acquirerReference = acquirerReference; + isSetAcquirerReference = true; // mark as set return this; } @@ -589,6 +791,7 @@ public String getAcquirerReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerReference(String acquirerReference) { this.acquirerReference = acquirerReference; + isSetAcquirerReference = true; // mark as set } /** @@ -599,6 +802,7 @@ public void setAcquirerReference(String acquirerReference) { */ public ResponseAdditionalDataCommon alias(String alias) { this.alias = alias; + isSetAlias = true; // mark as set return this; } @@ -622,6 +826,7 @@ public String getAlias() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAlias(String alias) { this.alias = alias; + isSetAlias = true; // mark as set } /** @@ -632,6 +837,7 @@ public void setAlias(String alias) { */ public ResponseAdditionalDataCommon aliasType(String aliasType) { this.aliasType = aliasType; + isSetAliasType = true; // mark as set return this; } @@ -655,6 +861,7 @@ public String getAliasType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAliasType(String aliasType) { this.aliasType = aliasType; + isSetAliasType = true; // mark as set } /** @@ -669,6 +876,7 @@ public void setAliasType(String aliasType) { */ public ResponseAdditionalDataCommon authCode(String authCode) { this.authCode = authCode; + isSetAuthCode = true; // mark as set return this; } @@ -700,6 +908,7 @@ public String getAuthCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthCode(String authCode) { this.authCode = authCode; + isSetAuthCode = true; // mark as set } /** @@ -710,6 +919,7 @@ public void setAuthCode(String authCode) { */ public ResponseAdditionalDataCommon authorisationMid(String authorisationMid) { this.authorisationMid = authorisationMid; + isSetAuthorisationMid = true; // mark as set return this; } @@ -733,6 +943,7 @@ public String getAuthorisationMid() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisationMid(String authorisationMid) { this.authorisationMid = authorisationMid; + isSetAuthorisationMid = true; // mark as set } /** @@ -745,6 +956,7 @@ public void setAuthorisationMid(String authorisationMid) { */ public ResponseAdditionalDataCommon authorisedAmountCurrency(String authorisedAmountCurrency) { this.authorisedAmountCurrency = authorisedAmountCurrency; + isSetAuthorisedAmountCurrency = true; // mark as set return this; } @@ -772,6 +984,7 @@ public String getAuthorisedAmountCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisedAmountCurrency(String authorisedAmountCurrency) { this.authorisedAmountCurrency = authorisedAmountCurrency; + isSetAuthorisedAmountCurrency = true; // mark as set } /** @@ -785,6 +998,7 @@ public void setAuthorisedAmountCurrency(String authorisedAmountCurrency) { */ public ResponseAdditionalDataCommon authorisedAmountValue(String authorisedAmountValue) { this.authorisedAmountValue = authorisedAmountValue; + isSetAuthorisedAmountValue = true; // mark as set return this; } @@ -814,6 +1028,7 @@ public String getAuthorisedAmountValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisedAmountValue(String authorisedAmountValue) { this.authorisedAmountValue = authorisedAmountValue; + isSetAuthorisedAmountValue = true; // mark as set } /** @@ -828,6 +1043,7 @@ public void setAuthorisedAmountValue(String authorisedAmountValue) { */ public ResponseAdditionalDataCommon avsResult(String avsResult) { this.avsResult = avsResult; + isSetAvsResult = true; // mark as set return this; } @@ -859,6 +1075,7 @@ public String getAvsResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAvsResult(String avsResult) { this.avsResult = avsResult; + isSetAvsResult = true; // mark as set } /** @@ -869,6 +1086,7 @@ public void setAvsResult(String avsResult) { */ public ResponseAdditionalDataCommon avsResultRaw(String avsResultRaw) { this.avsResultRaw = avsResultRaw; + isSetAvsResultRaw = true; // mark as set return this; } @@ -892,6 +1110,7 @@ public String getAvsResultRaw() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAvsResultRaw(String avsResultRaw) { this.avsResultRaw = avsResultRaw; + isSetAvsResultRaw = true; // mark as set } /** @@ -903,6 +1122,7 @@ public void setAvsResultRaw(String avsResultRaw) { */ public ResponseAdditionalDataCommon bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -928,6 +1148,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -938,6 +1159,7 @@ public void setBic(String bic) { */ public ResponseAdditionalDataCommon coBrandedWith(String coBrandedWith) { this.coBrandedWith = coBrandedWith; + isSetCoBrandedWith = true; // mark as set return this; } @@ -961,6 +1183,7 @@ public String getCoBrandedWith() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCoBrandedWith(String coBrandedWith) { this.coBrandedWith = coBrandedWith; + isSetCoBrandedWith = true; // mark as set } /** @@ -971,6 +1194,7 @@ public void setCoBrandedWith(String coBrandedWith) { */ public ResponseAdditionalDataCommon cvcResult(String cvcResult) { this.cvcResult = cvcResult; + isSetCvcResult = true; // mark as set return this; } @@ -994,6 +1218,7 @@ public String getCvcResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvcResult(String cvcResult) { this.cvcResult = cvcResult; + isSetCvcResult = true; // mark as set } /** @@ -1004,6 +1229,7 @@ public void setCvcResult(String cvcResult) { */ public ResponseAdditionalDataCommon cvcResultRaw(String cvcResultRaw) { this.cvcResultRaw = cvcResultRaw; + isSetCvcResultRaw = true; // mark as set return this; } @@ -1027,6 +1253,7 @@ public String getCvcResultRaw() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvcResultRaw(String cvcResultRaw) { this.cvcResultRaw = cvcResultRaw; + isSetCvcResultRaw = true; // mark as set } /** @@ -1039,6 +1266,7 @@ public void setCvcResultRaw(String cvcResultRaw) { */ public ResponseAdditionalDataCommon dsTransID(String dsTransID) { this.dsTransID = dsTransID; + isSetDsTransID = true; // mark as set return this; } @@ -1066,6 +1294,7 @@ public String getDsTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDsTransID(String dsTransID) { this.dsTransID = dsTransID; + isSetDsTransID = true; // mark as set } /** @@ -1078,6 +1307,7 @@ public void setDsTransID(String dsTransID) { */ public ResponseAdditionalDataCommon eci(String eci) { this.eci = eci; + isSetEci = true; // mark as set return this; } @@ -1105,6 +1335,7 @@ public String getEci() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEci(String eci) { this.eci = eci; + isSetEci = true; // mark as set } /** @@ -1116,6 +1347,7 @@ public void setEci(String eci) { */ public ResponseAdditionalDataCommon expiryDate(String expiryDate) { this.expiryDate = expiryDate; + isSetExpiryDate = true; // mark as set return this; } @@ -1141,6 +1373,7 @@ public String getExpiryDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryDate(String expiryDate) { this.expiryDate = expiryDate; + isSetExpiryDate = true; // mark as set } /** @@ -1153,6 +1386,7 @@ public void setExpiryDate(String expiryDate) { */ public ResponseAdditionalDataCommon extraCostsCurrency(String extraCostsCurrency) { this.extraCostsCurrency = extraCostsCurrency; + isSetExtraCostsCurrency = true; // mark as set return this; } @@ -1180,6 +1414,7 @@ public String getExtraCostsCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExtraCostsCurrency(String extraCostsCurrency) { this.extraCostsCurrency = extraCostsCurrency; + isSetExtraCostsCurrency = true; // mark as set } /** @@ -1192,6 +1427,7 @@ public void setExtraCostsCurrency(String extraCostsCurrency) { */ public ResponseAdditionalDataCommon extraCostsValue(String extraCostsValue) { this.extraCostsValue = extraCostsValue; + isSetExtraCostsValue = true; // mark as set return this; } @@ -1219,6 +1455,7 @@ public String getExtraCostsValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExtraCostsValue(String extraCostsValue) { this.extraCostsValue = extraCostsValue; + isSetExtraCostsValue = true; // mark as set } /** @@ -1232,6 +1469,7 @@ public void setExtraCostsValue(String extraCostsValue) { public ResponseAdditionalDataCommon fraudCheckItemNrFraudCheckname( String fraudCheckItemNrFraudCheckname) { this.fraudCheckItemNrFraudCheckname = fraudCheckItemNrFraudCheckname; + isSetFraudCheckItemNrFraudCheckname = true; // mark as set return this; } @@ -1259,6 +1497,7 @@ public String getFraudCheckItemNrFraudCheckname() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudCheckItemNrFraudCheckname(String fraudCheckItemNrFraudCheckname) { this.fraudCheckItemNrFraudCheckname = fraudCheckItemNrFraudCheckname; + isSetFraudCheckItemNrFraudCheckname = true; // mark as set } /** @@ -1269,6 +1508,7 @@ public void setFraudCheckItemNrFraudCheckname(String fraudCheckItemNrFraudCheckn */ public ResponseAdditionalDataCommon fraudManualReview(String fraudManualReview) { this.fraudManualReview = fraudManualReview; + isSetFraudManualReview = true; // mark as set return this; } @@ -1292,6 +1532,7 @@ public String getFraudManualReview() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudManualReview(String fraudManualReview) { this.fraudManualReview = fraudManualReview; + isSetFraudManualReview = true; // mark as set } /** @@ -1302,6 +1543,7 @@ public void setFraudManualReview(String fraudManualReview) { */ public ResponseAdditionalDataCommon fraudResultType(FraudResultTypeEnum fraudResultType) { this.fraudResultType = fraudResultType; + isSetFraudResultType = true; // mark as set return this; } @@ -1325,6 +1567,7 @@ public FraudResultTypeEnum getFraudResultType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudResultType(FraudResultTypeEnum fraudResultType) { this.fraudResultType = fraudResultType; + isSetFraudResultType = true; // mark as set } /** @@ -1342,6 +1585,7 @@ public void setFraudResultType(FraudResultTypeEnum fraudResultType) { */ public ResponseAdditionalDataCommon fraudRiskLevel(FraudRiskLevelEnum fraudRiskLevel) { this.fraudRiskLevel = fraudRiskLevel; + isSetFraudRiskLevel = true; // mark as set return this; } @@ -1379,6 +1623,7 @@ public FraudRiskLevelEnum getFraudRiskLevel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudRiskLevel(FraudRiskLevelEnum fraudRiskLevel) { this.fraudRiskLevel = fraudRiskLevel; + isSetFraudRiskLevel = true; // mark as set } /** @@ -1398,6 +1643,7 @@ public void setFraudRiskLevel(FraudRiskLevelEnum fraudRiskLevel) { */ public ResponseAdditionalDataCommon fundingSource(String fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -1439,6 +1685,7 @@ public String getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(String fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -1457,6 +1704,7 @@ public void setFundingSource(String fundingSource) { */ public ResponseAdditionalDataCommon fundsAvailability(String fundsAvailability) { this.fundsAvailability = fundsAvailability; + isSetFundsAvailability = true; // mark as set return this; } @@ -1496,6 +1744,7 @@ public String getFundsAvailability() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundsAvailability(String fundsAvailability) { this.fundsAvailability = fundsAvailability; + isSetFundsAvailability = true; // mark as set } /** @@ -1523,6 +1772,7 @@ public void setFundsAvailability(String fundsAvailability) { */ public ResponseAdditionalDataCommon inferredRefusalReason(String inferredRefusalReason) { this.inferredRefusalReason = inferredRefusalReason; + isSetInferredRefusalReason = true; // mark as set return this; } @@ -1580,6 +1830,7 @@ public String getInferredRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInferredRefusalReason(String inferredRefusalReason) { this.inferredRefusalReason = inferredRefusalReason; + isSetInferredRefusalReason = true; // mark as set } /** @@ -1590,6 +1841,7 @@ public void setInferredRefusalReason(String inferredRefusalReason) { */ public ResponseAdditionalDataCommon isCardCommercial(String isCardCommercial) { this.isCardCommercial = isCardCommercial; + isSetIsCardCommercial = true; // mark as set return this; } @@ -1613,6 +1865,7 @@ public String getIsCardCommercial() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIsCardCommercial(String isCardCommercial) { this.isCardCommercial = isCardCommercial; + isSetIsCardCommercial = true; // mark as set } /** @@ -1624,6 +1877,7 @@ public void setIsCardCommercial(String isCardCommercial) { */ public ResponseAdditionalDataCommon issuerCountry(String issuerCountry) { this.issuerCountry = issuerCountry; + isSetIssuerCountry = true; // mark as set return this; } @@ -1649,6 +1903,7 @@ public String getIssuerCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuerCountry(String issuerCountry) { this.issuerCountry = issuerCountry; + isSetIssuerCountry = true; // mark as set } /** @@ -1660,6 +1915,7 @@ public void setIssuerCountry(String issuerCountry) { */ public ResponseAdditionalDataCommon liabilityShift(String liabilityShift) { this.liabilityShift = liabilityShift; + isSetLiabilityShift = true; // mark as set return this; } @@ -1685,6 +1941,7 @@ public String getLiabilityShift() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLiabilityShift(String liabilityShift) { this.liabilityShift = liabilityShift; + isSetLiabilityShift = true; // mark as set } /** @@ -1698,6 +1955,7 @@ public void setLiabilityShift(String liabilityShift) { */ public ResponseAdditionalDataCommon mcBankNetReferenceNumber(String mcBankNetReferenceNumber) { this.mcBankNetReferenceNumber = mcBankNetReferenceNumber; + isSetMcBankNetReferenceNumber = true; // mark as set return this; } @@ -1727,6 +1985,7 @@ public String getMcBankNetReferenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcBankNetReferenceNumber(String mcBankNetReferenceNumber) { this.mcBankNetReferenceNumber = mcBankNetReferenceNumber; + isSetMcBankNetReferenceNumber = true; // mark as set } /** @@ -1743,6 +2002,7 @@ public void setMcBankNetReferenceNumber(String mcBankNetReferenceNumber) { */ public ResponseAdditionalDataCommon merchantAdviceCode(String merchantAdviceCode) { this.merchantAdviceCode = merchantAdviceCode; + isSetMerchantAdviceCode = true; // mark as set return this; } @@ -1778,6 +2038,7 @@ public String getMerchantAdviceCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAdviceCode(String merchantAdviceCode) { this.merchantAdviceCode = merchantAdviceCode; + isSetMerchantAdviceCode = true; // mark as set } /** @@ -1788,6 +2049,7 @@ public void setMerchantAdviceCode(String merchantAdviceCode) { */ public ResponseAdditionalDataCommon merchantReference(String merchantReference) { this.merchantReference = merchantReference; + isSetMerchantReference = true; // mark as set return this; } @@ -1811,6 +2073,7 @@ public String getMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantReference(String merchantReference) { this.merchantReference = merchantReference; + isSetMerchantReference = true; // mark as set } /** @@ -1825,6 +2088,7 @@ public void setMerchantReference(String merchantReference) { */ public ResponseAdditionalDataCommon networkTxReference(String networkTxReference) { this.networkTxReference = networkTxReference; + isSetNetworkTxReference = true; // mark as set return this; } @@ -1856,6 +2120,7 @@ public String getNetworkTxReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkTxReference(String networkTxReference) { this.networkTxReference = networkTxReference; + isSetNetworkTxReference = true; // mark as set } /** @@ -1867,6 +2132,7 @@ public void setNetworkTxReference(String networkTxReference) { */ public ResponseAdditionalDataCommon ownerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set return this; } @@ -1892,6 +2158,7 @@ public String getOwnerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwnerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set } /** @@ -1905,6 +2172,7 @@ public void setOwnerName(String ownerName) { */ public ResponseAdditionalDataCommon paymentAccountReference(String paymentAccountReference) { this.paymentAccountReference = paymentAccountReference; + isSetPaymentAccountReference = true; // mark as set return this; } @@ -1934,6 +2202,7 @@ public String getPaymentAccountReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentAccountReference(String paymentAccountReference) { this.paymentAccountReference = paymentAccountReference; + isSetPaymentAccountReference = true; // mark as set } /** @@ -1944,6 +2213,7 @@ public void setPaymentAccountReference(String paymentAccountReference) { */ public ResponseAdditionalDataCommon paymentMethod(String paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -1967,6 +2237,7 @@ public String getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(String paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -1983,6 +2254,7 @@ public void setPaymentMethod(String paymentMethod) { */ public ResponseAdditionalDataCommon paymentMethodVariant(String paymentMethodVariant) { this.paymentMethodVariant = paymentMethodVariant; + isSetPaymentMethodVariant = true; // mark as set return this; } @@ -2018,6 +2290,7 @@ public String getPaymentMethodVariant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodVariant(String paymentMethodVariant) { this.paymentMethodVariant = paymentMethodVariant; + isSetPaymentMethodVariant = true; // mark as set } /** @@ -2033,6 +2306,7 @@ public void setPaymentMethodVariant(String paymentMethodVariant) { */ public ResponseAdditionalDataCommon payoutEligible(String payoutEligible) { this.payoutEligible = payoutEligible; + isSetPayoutEligible = true; // mark as set return this; } @@ -2066,6 +2340,7 @@ public String getPayoutEligible() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayoutEligible(String payoutEligible) { this.payoutEligible = payoutEligible; + isSetPayoutEligible = true; // mark as set } /** @@ -2080,6 +2355,7 @@ public void setPayoutEligible(String payoutEligible) { public ResponseAdditionalDataCommon realtimeAccountUpdaterStatus( String realtimeAccountUpdaterStatus) { this.realtimeAccountUpdaterStatus = realtimeAccountUpdaterStatus; + isSetRealtimeAccountUpdaterStatus = true; // mark as set return this; } @@ -2109,6 +2385,7 @@ public String getRealtimeAccountUpdaterStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRealtimeAccountUpdaterStatus(String realtimeAccountUpdaterStatus) { this.realtimeAccountUpdaterStatus = realtimeAccountUpdaterStatus; + isSetRealtimeAccountUpdaterStatus = true; // mark as set } /** @@ -2119,6 +2396,7 @@ public void setRealtimeAccountUpdaterStatus(String realtimeAccountUpdaterStatus) */ public ResponseAdditionalDataCommon receiptFreeText(String receiptFreeText) { this.receiptFreeText = receiptFreeText; + isSetReceiptFreeText = true; // mark as set return this; } @@ -2142,6 +2420,7 @@ public String getReceiptFreeText() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReceiptFreeText(String receiptFreeText) { this.receiptFreeText = receiptFreeText; + isSetReceiptFreeText = true; // mark as set } /** @@ -2152,6 +2431,7 @@ public void setReceiptFreeText(String receiptFreeText) { */ public ResponseAdditionalDataCommon recurringContractTypes(String recurringContractTypes) { this.recurringContractTypes = recurringContractTypes; + isSetRecurringContractTypes = true; // mark as set return this; } @@ -2175,6 +2455,7 @@ public String getRecurringContractTypes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringContractTypes(String recurringContractTypes) { this.recurringContractTypes = recurringContractTypes; + isSetRecurringContractTypes = true; // mark as set } /** @@ -2190,6 +2471,7 @@ public void setRecurringContractTypes(String recurringContractTypes) { public ResponseAdditionalDataCommon recurringFirstPspReference( String recurringFirstPspReference) { this.recurringFirstPspReference = recurringFirstPspReference; + isSetRecurringFirstPspReference = true; // mark as set return this; } @@ -2221,6 +2503,7 @@ public String getRecurringFirstPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringFirstPspReference(String recurringFirstPspReference) { this.recurringFirstPspReference = recurringFirstPspReference; + isSetRecurringFirstPspReference = true; // mark as set } /** @@ -2236,6 +2519,7 @@ public void setRecurringFirstPspReference(String recurringFirstPspReference) { public ResponseAdditionalDataCommon recurringRecurringDetailReference( String recurringRecurringDetailReference) { this.recurringRecurringDetailReference = recurringRecurringDetailReference; + isSetRecurringRecurringDetailReference = true; // mark as set return this; } @@ -2268,6 +2552,7 @@ public String getRecurringRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringRecurringDetailReference(String recurringRecurringDetailReference) { this.recurringRecurringDetailReference = recurringRecurringDetailReference; + isSetRecurringRecurringDetailReference = true; // mark as set } /** @@ -2281,6 +2566,7 @@ public void setRecurringRecurringDetailReference(String recurringRecurringDetail @Deprecated // deprecated since Adyen Payment API v68: Use tokenization.shopperReference instead. public ResponseAdditionalDataCommon recurringShopperReference(String recurringShopperReference) { this.recurringShopperReference = recurringShopperReference; + isSetRecurringShopperReference = true; // mark as set return this; } @@ -2311,6 +2597,7 @@ public String getRecurringShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringShopperReference(String recurringShopperReference) { this.recurringShopperReference = recurringShopperReference; + isSetRecurringShopperReference = true; // mark as set } /** @@ -2322,6 +2609,7 @@ public void setRecurringShopperReference(String recurringShopperReference) { public ResponseAdditionalDataCommon recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -2345,6 +2633,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -2358,6 +2647,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public ResponseAdditionalDataCommon referred(String referred) { this.referred = referred; + isSetReferred = true; // mark as set return this; } @@ -2387,6 +2677,7 @@ public String getReferred() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferred(String referred) { this.referred = referred; + isSetReferred = true; // mark as set } /** @@ -2398,6 +2689,7 @@ public void setReferred(String referred) { */ public ResponseAdditionalDataCommon refusalReasonRaw(String refusalReasonRaw) { this.refusalReasonRaw = refusalReasonRaw; + isSetRefusalReasonRaw = true; // mark as set return this; } @@ -2423,6 +2715,7 @@ public String getRefusalReasonRaw() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReasonRaw(String refusalReasonRaw) { this.refusalReasonRaw = refusalReasonRaw; + isSetRefusalReasonRaw = true; // mark as set } /** @@ -2433,6 +2726,7 @@ public void setRefusalReasonRaw(String refusalReasonRaw) { */ public ResponseAdditionalDataCommon requestAmount(String requestAmount) { this.requestAmount = requestAmount; + isSetRequestAmount = true; // mark as set return this; } @@ -2456,6 +2750,7 @@ public String getRequestAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestAmount(String requestAmount) { this.requestAmount = requestAmount; + isSetRequestAmount = true; // mark as set } /** @@ -2466,6 +2761,7 @@ public void setRequestAmount(String requestAmount) { */ public ResponseAdditionalDataCommon requestCurrencyCode(String requestCurrencyCode) { this.requestCurrencyCode = requestCurrencyCode; + isSetRequestCurrencyCode = true; // mark as set return this; } @@ -2489,6 +2785,7 @@ public String getRequestCurrencyCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestCurrencyCode(String requestCurrencyCode) { this.requestCurrencyCode = requestCurrencyCode; + isSetRequestCurrencyCode = true; // mark as set } /** @@ -2500,6 +2797,7 @@ public void setRequestCurrencyCode(String requestCurrencyCode) { */ public ResponseAdditionalDataCommon shopperInteraction(String shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -2525,6 +2823,7 @@ public String getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(String shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -2536,6 +2835,7 @@ public void setShopperInteraction(String shopperInteraction) { */ public ResponseAdditionalDataCommon shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -2561,6 +2861,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -2571,6 +2872,7 @@ public void setShopperReference(String shopperReference) { */ public ResponseAdditionalDataCommon terminalId(String terminalId) { this.terminalId = terminalId; + isSetTerminalId = true; // mark as set return this; } @@ -2594,6 +2896,7 @@ public String getTerminalId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTerminalId(String terminalId) { this.terminalId = terminalId; + isSetTerminalId = true; // mark as set } /** @@ -2606,6 +2909,7 @@ public void setTerminalId(String terminalId) { */ public ResponseAdditionalDataCommon threeDAuthenticated(String threeDAuthenticated) { this.threeDAuthenticated = threeDAuthenticated; + isSetThreeDAuthenticated = true; // mark as set return this; } @@ -2633,6 +2937,7 @@ public String getThreeDAuthenticated() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDAuthenticated(String threeDAuthenticated) { this.threeDAuthenticated = threeDAuthenticated; + isSetThreeDAuthenticated = true; // mark as set } /** @@ -2645,6 +2950,7 @@ public void setThreeDAuthenticated(String threeDAuthenticated) { public ResponseAdditionalDataCommon threeDAuthenticatedResponse( String threeDAuthenticatedResponse) { this.threeDAuthenticatedResponse = threeDAuthenticatedResponse; + isSetThreeDAuthenticatedResponse = true; // mark as set return this; } @@ -2670,6 +2976,7 @@ public String getThreeDAuthenticatedResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDAuthenticatedResponse(String threeDAuthenticatedResponse) { this.threeDAuthenticatedResponse = threeDAuthenticatedResponse; + isSetThreeDAuthenticatedResponse = true; // mark as set } /** @@ -2681,6 +2988,7 @@ public void setThreeDAuthenticatedResponse(String threeDAuthenticatedResponse) { */ public ResponseAdditionalDataCommon threeDOffered(String threeDOffered) { this.threeDOffered = threeDOffered; + isSetThreeDOffered = true; // mark as set return this; } @@ -2706,6 +3014,7 @@ public String getThreeDOffered() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDOffered(String threeDOffered) { this.threeDOffered = threeDOffered; + isSetThreeDOffered = true; // mark as set } /** @@ -2717,6 +3026,7 @@ public void setThreeDOffered(String threeDOffered) { */ public ResponseAdditionalDataCommon threeDOfferedResponse(String threeDOfferedResponse) { this.threeDOfferedResponse = threeDOfferedResponse; + isSetThreeDOfferedResponse = true; // mark as set return this; } @@ -2742,6 +3052,7 @@ public String getThreeDOfferedResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDOfferedResponse(String threeDOfferedResponse) { this.threeDOfferedResponse = threeDOfferedResponse; + isSetThreeDOfferedResponse = true; // mark as set } /** @@ -2752,6 +3063,7 @@ public void setThreeDOfferedResponse(String threeDOfferedResponse) { */ public ResponseAdditionalDataCommon threeDSVersion(String threeDSVersion) { this.threeDSVersion = threeDSVersion; + isSetThreeDSVersion = true; // mark as set return this; } @@ -2775,6 +3087,7 @@ public String getThreeDSVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSVersion(String threeDSVersion) { this.threeDSVersion = threeDSVersion; + isSetThreeDSVersion = true; // mark as set } /** @@ -2787,6 +3100,7 @@ public void setThreeDSVersion(String threeDSVersion) { public ResponseAdditionalDataCommon tokenizationShopperReference( String tokenizationShopperReference) { this.tokenizationShopperReference = tokenizationShopperReference; + isSetTokenizationShopperReference = true; // mark as set return this; } @@ -2812,6 +3126,7 @@ public String getTokenizationShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenizationShopperReference(String tokenizationShopperReference) { this.tokenizationShopperReference = tokenizationShopperReference; + isSetTokenizationShopperReference = true; // mark as set } /** @@ -2827,6 +3142,7 @@ public void setTokenizationShopperReference(String tokenizationShopperReference) public ResponseAdditionalDataCommon tokenizationStoreOperationType( TokenizationStoreOperationTypeEnum tokenizationStoreOperationType) { this.tokenizationStoreOperationType = tokenizationStoreOperationType; + isSetTokenizationStoreOperationType = true; // mark as set return this; } @@ -2859,6 +3175,7 @@ public TokenizationStoreOperationTypeEnum getTokenizationStoreOperationType() { public void setTokenizationStoreOperationType( TokenizationStoreOperationTypeEnum tokenizationStoreOperationType) { this.tokenizationStoreOperationType = tokenizationStoreOperationType; + isSetTokenizationStoreOperationType = true; // mark as set } /** @@ -2871,6 +3188,7 @@ public void setTokenizationStoreOperationType( public ResponseAdditionalDataCommon tokenizationStoredPaymentMethodId( String tokenizationStoredPaymentMethodId) { this.tokenizationStoredPaymentMethodId = tokenizationStoredPaymentMethodId; + isSetTokenizationStoredPaymentMethodId = true; // mark as set return this; } @@ -2896,6 +3214,7 @@ public String getTokenizationStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenizationStoredPaymentMethodId(String tokenizationStoredPaymentMethodId) { this.tokenizationStoredPaymentMethodId = tokenizationStoredPaymentMethodId; + isSetTokenizationStoredPaymentMethodId = true; // mark as set } /** @@ -2908,6 +3227,7 @@ public void setTokenizationStoredPaymentMethodId(String tokenizationStoredPaymen */ public ResponseAdditionalDataCommon visaTransactionId(String visaTransactionId) { this.visaTransactionId = visaTransactionId; + isSetVisaTransactionId = true; // mark as set return this; } @@ -2935,6 +3255,7 @@ public String getVisaTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVisaTransactionId(String visaTransactionId) { this.visaTransactionId = visaTransactionId; + isSetVisaTransactionId = true; // mark as set } /** @@ -2949,6 +3270,7 @@ public void setVisaTransactionId(String visaTransactionId) { */ public ResponseAdditionalDataCommon xid(String xid) { this.xid = xid; + isSetXid = true; // mark as set return this; } @@ -2980,6 +3302,27 @@ public String getXid() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setXid(String xid) { this.xid = xid; + isSetXid = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalDataCommon 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 ResponseAdditionalDataCommon object is equal to o. */ @@ -2994,164 +3337,348 @@ public boolean equals(Object o) { ResponseAdditionalDataCommon responseAdditionalDataCommon = (ResponseAdditionalDataCommon) o; return Objects.equals( this.acquirerAccountCode, responseAdditionalDataCommon.acquirerAccountCode) + && Objects.equals( + this.isSetAcquirerAccountCode, responseAdditionalDataCommon.isSetAcquirerAccountCode) && Objects.equals(this.acquirerCode, responseAdditionalDataCommon.acquirerCode) + && Objects.equals(this.isSetAcquirerCode, responseAdditionalDataCommon.isSetAcquirerCode) && Objects.equals(this.acquirerReference, responseAdditionalDataCommon.acquirerReference) + && Objects.equals( + this.isSetAcquirerReference, responseAdditionalDataCommon.isSetAcquirerReference) && Objects.equals(this.alias, responseAdditionalDataCommon.alias) + && Objects.equals(this.isSetAlias, responseAdditionalDataCommon.isSetAlias) && Objects.equals(this.aliasType, responseAdditionalDataCommon.aliasType) + && Objects.equals(this.isSetAliasType, responseAdditionalDataCommon.isSetAliasType) && Objects.equals(this.authCode, responseAdditionalDataCommon.authCode) + && Objects.equals(this.isSetAuthCode, responseAdditionalDataCommon.isSetAuthCode) && Objects.equals(this.authorisationMid, responseAdditionalDataCommon.authorisationMid) + && Objects.equals( + this.isSetAuthorisationMid, responseAdditionalDataCommon.isSetAuthorisationMid) && Objects.equals( this.authorisedAmountCurrency, responseAdditionalDataCommon.authorisedAmountCurrency) + && Objects.equals( + this.isSetAuthorisedAmountCurrency, + responseAdditionalDataCommon.isSetAuthorisedAmountCurrency) && Objects.equals( this.authorisedAmountValue, responseAdditionalDataCommon.authorisedAmountValue) + && Objects.equals( + this.isSetAuthorisedAmountValue, + responseAdditionalDataCommon.isSetAuthorisedAmountValue) && Objects.equals(this.avsResult, responseAdditionalDataCommon.avsResult) + && Objects.equals(this.isSetAvsResult, responseAdditionalDataCommon.isSetAvsResult) && Objects.equals(this.avsResultRaw, responseAdditionalDataCommon.avsResultRaw) + && Objects.equals(this.isSetAvsResultRaw, responseAdditionalDataCommon.isSetAvsResultRaw) && Objects.equals(this.bic, responseAdditionalDataCommon.bic) + && Objects.equals(this.isSetBic, responseAdditionalDataCommon.isSetBic) && Objects.equals(this.coBrandedWith, responseAdditionalDataCommon.coBrandedWith) + && Objects.equals(this.isSetCoBrandedWith, responseAdditionalDataCommon.isSetCoBrandedWith) && Objects.equals(this.cvcResult, responseAdditionalDataCommon.cvcResult) + && Objects.equals(this.isSetCvcResult, responseAdditionalDataCommon.isSetCvcResult) && Objects.equals(this.cvcResultRaw, responseAdditionalDataCommon.cvcResultRaw) + && Objects.equals(this.isSetCvcResultRaw, responseAdditionalDataCommon.isSetCvcResultRaw) && Objects.equals(this.dsTransID, responseAdditionalDataCommon.dsTransID) + && Objects.equals(this.isSetDsTransID, responseAdditionalDataCommon.isSetDsTransID) && Objects.equals(this.eci, responseAdditionalDataCommon.eci) + && Objects.equals(this.isSetEci, responseAdditionalDataCommon.isSetEci) && Objects.equals(this.expiryDate, responseAdditionalDataCommon.expiryDate) + && Objects.equals(this.isSetExpiryDate, responseAdditionalDataCommon.isSetExpiryDate) && Objects.equals(this.extraCostsCurrency, responseAdditionalDataCommon.extraCostsCurrency) + && Objects.equals( + this.isSetExtraCostsCurrency, responseAdditionalDataCommon.isSetExtraCostsCurrency) && Objects.equals(this.extraCostsValue, responseAdditionalDataCommon.extraCostsValue) + && Objects.equals( + this.isSetExtraCostsValue, responseAdditionalDataCommon.isSetExtraCostsValue) && Objects.equals( this.fraudCheckItemNrFraudCheckname, responseAdditionalDataCommon.fraudCheckItemNrFraudCheckname) + && Objects.equals( + this.isSetFraudCheckItemNrFraudCheckname, + responseAdditionalDataCommon.isSetFraudCheckItemNrFraudCheckname) && Objects.equals(this.fraudManualReview, responseAdditionalDataCommon.fraudManualReview) + && Objects.equals( + this.isSetFraudManualReview, responseAdditionalDataCommon.isSetFraudManualReview) && Objects.equals(this.fraudResultType, responseAdditionalDataCommon.fraudResultType) + && Objects.equals( + this.isSetFraudResultType, responseAdditionalDataCommon.isSetFraudResultType) && Objects.equals(this.fraudRiskLevel, responseAdditionalDataCommon.fraudRiskLevel) + && Objects.equals( + this.isSetFraudRiskLevel, responseAdditionalDataCommon.isSetFraudRiskLevel) && Objects.equals(this.fundingSource, responseAdditionalDataCommon.fundingSource) + && Objects.equals(this.isSetFundingSource, responseAdditionalDataCommon.isSetFundingSource) && Objects.equals(this.fundsAvailability, responseAdditionalDataCommon.fundsAvailability) + && Objects.equals( + this.isSetFundsAvailability, responseAdditionalDataCommon.isSetFundsAvailability) && Objects.equals( this.inferredRefusalReason, responseAdditionalDataCommon.inferredRefusalReason) + && Objects.equals( + this.isSetInferredRefusalReason, + responseAdditionalDataCommon.isSetInferredRefusalReason) && Objects.equals(this.isCardCommercial, responseAdditionalDataCommon.isCardCommercial) + && Objects.equals( + this.isSetIsCardCommercial, responseAdditionalDataCommon.isSetIsCardCommercial) && Objects.equals(this.issuerCountry, responseAdditionalDataCommon.issuerCountry) + && Objects.equals(this.isSetIssuerCountry, responseAdditionalDataCommon.isSetIssuerCountry) && Objects.equals(this.liabilityShift, responseAdditionalDataCommon.liabilityShift) + && Objects.equals( + this.isSetLiabilityShift, responseAdditionalDataCommon.isSetLiabilityShift) && Objects.equals( this.mcBankNetReferenceNumber, responseAdditionalDataCommon.mcBankNetReferenceNumber) + && Objects.equals( + this.isSetMcBankNetReferenceNumber, + responseAdditionalDataCommon.isSetMcBankNetReferenceNumber) && Objects.equals(this.merchantAdviceCode, responseAdditionalDataCommon.merchantAdviceCode) + && Objects.equals( + this.isSetMerchantAdviceCode, responseAdditionalDataCommon.isSetMerchantAdviceCode) && Objects.equals(this.merchantReference, responseAdditionalDataCommon.merchantReference) + && Objects.equals( + this.isSetMerchantReference, responseAdditionalDataCommon.isSetMerchantReference) && Objects.equals(this.networkTxReference, responseAdditionalDataCommon.networkTxReference) + && Objects.equals( + this.isSetNetworkTxReference, responseAdditionalDataCommon.isSetNetworkTxReference) && Objects.equals(this.ownerName, responseAdditionalDataCommon.ownerName) + && Objects.equals(this.isSetOwnerName, responseAdditionalDataCommon.isSetOwnerName) && Objects.equals( this.paymentAccountReference, responseAdditionalDataCommon.paymentAccountReference) + && Objects.equals( + this.isSetPaymentAccountReference, + responseAdditionalDataCommon.isSetPaymentAccountReference) && Objects.equals(this.paymentMethod, responseAdditionalDataCommon.paymentMethod) + && Objects.equals(this.isSetPaymentMethod, responseAdditionalDataCommon.isSetPaymentMethod) && Objects.equals( this.paymentMethodVariant, responseAdditionalDataCommon.paymentMethodVariant) + && Objects.equals( + this.isSetPaymentMethodVariant, responseAdditionalDataCommon.isSetPaymentMethodVariant) && Objects.equals(this.payoutEligible, responseAdditionalDataCommon.payoutEligible) + && Objects.equals( + this.isSetPayoutEligible, responseAdditionalDataCommon.isSetPayoutEligible) && Objects.equals( this.realtimeAccountUpdaterStatus, responseAdditionalDataCommon.realtimeAccountUpdaterStatus) + && Objects.equals( + this.isSetRealtimeAccountUpdaterStatus, + responseAdditionalDataCommon.isSetRealtimeAccountUpdaterStatus) && Objects.equals(this.receiptFreeText, responseAdditionalDataCommon.receiptFreeText) + && Objects.equals( + this.isSetReceiptFreeText, responseAdditionalDataCommon.isSetReceiptFreeText) && Objects.equals( this.recurringContractTypes, responseAdditionalDataCommon.recurringContractTypes) + && Objects.equals( + this.isSetRecurringContractTypes, + responseAdditionalDataCommon.isSetRecurringContractTypes) && Objects.equals( this.recurringFirstPspReference, responseAdditionalDataCommon.recurringFirstPspReference) + && Objects.equals( + this.isSetRecurringFirstPspReference, + responseAdditionalDataCommon.isSetRecurringFirstPspReference) && Objects.equals( this.recurringRecurringDetailReference, responseAdditionalDataCommon.recurringRecurringDetailReference) + && Objects.equals( + this.isSetRecurringRecurringDetailReference, + responseAdditionalDataCommon.isSetRecurringRecurringDetailReference) && Objects.equals( this.recurringShopperReference, responseAdditionalDataCommon.recurringShopperReference) + && Objects.equals( + this.isSetRecurringShopperReference, + responseAdditionalDataCommon.isSetRecurringShopperReference) && Objects.equals( this.recurringProcessingModel, responseAdditionalDataCommon.recurringProcessingModel) + && Objects.equals( + this.isSetRecurringProcessingModel, + responseAdditionalDataCommon.isSetRecurringProcessingModel) && Objects.equals(this.referred, responseAdditionalDataCommon.referred) + && Objects.equals(this.isSetReferred, responseAdditionalDataCommon.isSetReferred) && Objects.equals(this.refusalReasonRaw, responseAdditionalDataCommon.refusalReasonRaw) + && Objects.equals( + this.isSetRefusalReasonRaw, responseAdditionalDataCommon.isSetRefusalReasonRaw) && Objects.equals(this.requestAmount, responseAdditionalDataCommon.requestAmount) + && Objects.equals(this.isSetRequestAmount, responseAdditionalDataCommon.isSetRequestAmount) && Objects.equals( this.requestCurrencyCode, responseAdditionalDataCommon.requestCurrencyCode) + && Objects.equals( + this.isSetRequestCurrencyCode, responseAdditionalDataCommon.isSetRequestCurrencyCode) && Objects.equals(this.shopperInteraction, responseAdditionalDataCommon.shopperInteraction) + && Objects.equals( + this.isSetShopperInteraction, responseAdditionalDataCommon.isSetShopperInteraction) && Objects.equals(this.shopperReference, responseAdditionalDataCommon.shopperReference) + && Objects.equals( + this.isSetShopperReference, responseAdditionalDataCommon.isSetShopperReference) && Objects.equals(this.terminalId, responseAdditionalDataCommon.terminalId) + && Objects.equals(this.isSetTerminalId, responseAdditionalDataCommon.isSetTerminalId) && Objects.equals( this.threeDAuthenticated, responseAdditionalDataCommon.threeDAuthenticated) + && Objects.equals( + this.isSetThreeDAuthenticated, responseAdditionalDataCommon.isSetThreeDAuthenticated) && Objects.equals( this.threeDAuthenticatedResponse, responseAdditionalDataCommon.threeDAuthenticatedResponse) + && Objects.equals( + this.isSetThreeDAuthenticatedResponse, + responseAdditionalDataCommon.isSetThreeDAuthenticatedResponse) && Objects.equals(this.threeDOffered, responseAdditionalDataCommon.threeDOffered) + && Objects.equals(this.isSetThreeDOffered, responseAdditionalDataCommon.isSetThreeDOffered) && Objects.equals( this.threeDOfferedResponse, responseAdditionalDataCommon.threeDOfferedResponse) + && Objects.equals( + this.isSetThreeDOfferedResponse, + responseAdditionalDataCommon.isSetThreeDOfferedResponse) && Objects.equals(this.threeDSVersion, responseAdditionalDataCommon.threeDSVersion) + && Objects.equals( + this.isSetThreeDSVersion, responseAdditionalDataCommon.isSetThreeDSVersion) && Objects.equals( this.tokenizationShopperReference, responseAdditionalDataCommon.tokenizationShopperReference) + && Objects.equals( + this.isSetTokenizationShopperReference, + responseAdditionalDataCommon.isSetTokenizationShopperReference) && Objects.equals( this.tokenizationStoreOperationType, responseAdditionalDataCommon.tokenizationStoreOperationType) + && Objects.equals( + this.isSetTokenizationStoreOperationType, + responseAdditionalDataCommon.isSetTokenizationStoreOperationType) && Objects.equals( this.tokenizationStoredPaymentMethodId, responseAdditionalDataCommon.tokenizationStoredPaymentMethodId) + && Objects.equals( + this.isSetTokenizationStoredPaymentMethodId, + responseAdditionalDataCommon.isSetTokenizationStoredPaymentMethodId) && Objects.equals(this.visaTransactionId, responseAdditionalDataCommon.visaTransactionId) - && Objects.equals(this.xid, responseAdditionalDataCommon.xid); + && Objects.equals( + this.isSetVisaTransactionId, responseAdditionalDataCommon.isSetVisaTransactionId) + && Objects.equals(this.xid, responseAdditionalDataCommon.xid) + && Objects.equals(this.isSetXid, responseAdditionalDataCommon.isSetXid); } @Override public int hashCode() { return Objects.hash( acquirerAccountCode, + isSetAcquirerAccountCode, acquirerCode, + isSetAcquirerCode, acquirerReference, + isSetAcquirerReference, alias, + isSetAlias, aliasType, + isSetAliasType, authCode, + isSetAuthCode, authorisationMid, + isSetAuthorisationMid, authorisedAmountCurrency, + isSetAuthorisedAmountCurrency, authorisedAmountValue, + isSetAuthorisedAmountValue, avsResult, + isSetAvsResult, avsResultRaw, + isSetAvsResultRaw, bic, + isSetBic, coBrandedWith, + isSetCoBrandedWith, cvcResult, + isSetCvcResult, cvcResultRaw, + isSetCvcResultRaw, dsTransID, + isSetDsTransID, eci, + isSetEci, expiryDate, + isSetExpiryDate, extraCostsCurrency, + isSetExtraCostsCurrency, extraCostsValue, + isSetExtraCostsValue, fraudCheckItemNrFraudCheckname, + isSetFraudCheckItemNrFraudCheckname, fraudManualReview, + isSetFraudManualReview, fraudResultType, + isSetFraudResultType, fraudRiskLevel, + isSetFraudRiskLevel, fundingSource, + isSetFundingSource, fundsAvailability, + isSetFundsAvailability, inferredRefusalReason, + isSetInferredRefusalReason, isCardCommercial, + isSetIsCardCommercial, issuerCountry, + isSetIssuerCountry, liabilityShift, + isSetLiabilityShift, mcBankNetReferenceNumber, + isSetMcBankNetReferenceNumber, merchantAdviceCode, + isSetMerchantAdviceCode, merchantReference, + isSetMerchantReference, networkTxReference, + isSetNetworkTxReference, ownerName, + isSetOwnerName, paymentAccountReference, + isSetPaymentAccountReference, paymentMethod, + isSetPaymentMethod, paymentMethodVariant, + isSetPaymentMethodVariant, payoutEligible, + isSetPayoutEligible, realtimeAccountUpdaterStatus, + isSetRealtimeAccountUpdaterStatus, receiptFreeText, + isSetReceiptFreeText, recurringContractTypes, + isSetRecurringContractTypes, recurringFirstPspReference, + isSetRecurringFirstPspReference, recurringRecurringDetailReference, + isSetRecurringRecurringDetailReference, recurringShopperReference, + isSetRecurringShopperReference, recurringProcessingModel, + isSetRecurringProcessingModel, referred, + isSetReferred, refusalReasonRaw, + isSetRefusalReasonRaw, requestAmount, + isSetRequestAmount, requestCurrencyCode, + isSetRequestCurrencyCode, shopperInteraction, + isSetShopperInteraction, shopperReference, + isSetShopperReference, terminalId, + isSetTerminalId, threeDAuthenticated, + isSetThreeDAuthenticated, threeDAuthenticatedResponse, + isSetThreeDAuthenticatedResponse, threeDOffered, + isSetThreeDOffered, threeDOfferedResponse, + isSetThreeDOfferedResponse, threeDSVersion, + isSetThreeDSVersion, tokenizationShopperReference, + isSetTokenizationShopperReference, tokenizationStoreOperationType, + isSetTokenizationStoreOperationType, tokenizationStoredPaymentMethodId, + isSetTokenizationStoredPaymentMethodId, visaTransactionId, - xid); + isSetVisaTransactionId, + xid, + isSetXid); } @Override @@ -3277,6 +3804,232 @@ 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 (isSetAcquirerAccountCode) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_ACCOUNT_CODE, this.acquirerAccountCode); + } + if (isSetAcquirerCode) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_CODE, this.acquirerCode); + } + if (isSetAcquirerReference) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_REFERENCE, this.acquirerReference); + } + if (isSetAlias) { + addIfNull(nulls, JSON_PROPERTY_ALIAS, this.alias); + } + if (isSetAliasType) { + addIfNull(nulls, JSON_PROPERTY_ALIAS_TYPE, this.aliasType); + } + if (isSetAuthCode) { + addIfNull(nulls, JSON_PROPERTY_AUTH_CODE, this.authCode); + } + if (isSetAuthorisationMid) { + addIfNull(nulls, JSON_PROPERTY_AUTHORISATION_MID, this.authorisationMid); + } + if (isSetAuthorisedAmountCurrency) { + addIfNull(nulls, JSON_PROPERTY_AUTHORISED_AMOUNT_CURRENCY, this.authorisedAmountCurrency); + } + if (isSetAuthorisedAmountValue) { + addIfNull(nulls, JSON_PROPERTY_AUTHORISED_AMOUNT_VALUE, this.authorisedAmountValue); + } + if (isSetAvsResult) { + addIfNull(nulls, JSON_PROPERTY_AVS_RESULT, this.avsResult); + } + if (isSetAvsResultRaw) { + addIfNull(nulls, JSON_PROPERTY_AVS_RESULT_RAW, this.avsResultRaw); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + if (isSetCoBrandedWith) { + addIfNull(nulls, JSON_PROPERTY_CO_BRANDED_WITH, this.coBrandedWith); + } + if (isSetCvcResult) { + addIfNull(nulls, JSON_PROPERTY_CVC_RESULT, this.cvcResult); + } + if (isSetCvcResultRaw) { + addIfNull(nulls, JSON_PROPERTY_CVC_RESULT_RAW, this.cvcResultRaw); + } + if (isSetDsTransID) { + addIfNull(nulls, JSON_PROPERTY_DS_TRANS_I_D, this.dsTransID); + } + if (isSetEci) { + addIfNull(nulls, JSON_PROPERTY_ECI, this.eci); + } + if (isSetExpiryDate) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_DATE, this.expiryDate); + } + if (isSetExtraCostsCurrency) { + addIfNull(nulls, JSON_PROPERTY_EXTRA_COSTS_CURRENCY, this.extraCostsCurrency); + } + if (isSetExtraCostsValue) { + addIfNull(nulls, JSON_PROPERTY_EXTRA_COSTS_VALUE, this.extraCostsValue); + } + if (isSetFraudCheckItemNrFraudCheckname) { + addIfNull( + nulls, + JSON_PROPERTY_FRAUD_CHECK_ITEM_NR_FRAUD_CHECKNAME, + this.fraudCheckItemNrFraudCheckname); + } + if (isSetFraudManualReview) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_MANUAL_REVIEW, this.fraudManualReview); + } + if (isSetFraudResultType) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_RESULT_TYPE, this.fraudResultType); + } + if (isSetFraudRiskLevel) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_RISK_LEVEL, this.fraudRiskLevel); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetFundsAvailability) { + addIfNull(nulls, JSON_PROPERTY_FUNDS_AVAILABILITY, this.fundsAvailability); + } + if (isSetInferredRefusalReason) { + addIfNull(nulls, JSON_PROPERTY_INFERRED_REFUSAL_REASON, this.inferredRefusalReason); + } + if (isSetIsCardCommercial) { + addIfNull(nulls, JSON_PROPERTY_IS_CARD_COMMERCIAL, this.isCardCommercial); + } + if (isSetIssuerCountry) { + addIfNull(nulls, JSON_PROPERTY_ISSUER_COUNTRY, this.issuerCountry); + } + if (isSetLiabilityShift) { + addIfNull(nulls, JSON_PROPERTY_LIABILITY_SHIFT, this.liabilityShift); + } + if (isSetMcBankNetReferenceNumber) { + addIfNull(nulls, JSON_PROPERTY_MC_BANK_NET_REFERENCE_NUMBER, this.mcBankNetReferenceNumber); + } + if (isSetMerchantAdviceCode) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ADVICE_CODE, this.merchantAdviceCode); + } + if (isSetMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_REFERENCE, this.merchantReference); + } + if (isSetNetworkTxReference) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TX_REFERENCE, this.networkTxReference); + } + if (isSetOwnerName) { + addIfNull(nulls, JSON_PROPERTY_OWNER_NAME, this.ownerName); + } + if (isSetPaymentAccountReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_ACCOUNT_REFERENCE, this.paymentAccountReference); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetPaymentMethodVariant) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_VARIANT, this.paymentMethodVariant); + } + if (isSetPayoutEligible) { + addIfNull(nulls, JSON_PROPERTY_PAYOUT_ELIGIBLE, this.payoutEligible); + } + if (isSetRealtimeAccountUpdaterStatus) { + addIfNull( + nulls, JSON_PROPERTY_REALTIME_ACCOUNT_UPDATER_STATUS, this.realtimeAccountUpdaterStatus); + } + if (isSetReceiptFreeText) { + addIfNull(nulls, JSON_PROPERTY_RECEIPT_FREE_TEXT, this.receiptFreeText); + } + if (isSetRecurringContractTypes) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_CONTRACT_TYPES, this.recurringContractTypes); + } + if (isSetRecurringFirstPspReference) { + addIfNull( + nulls, JSON_PROPERTY_RECURRING_FIRST_PSP_REFERENCE, this.recurringFirstPspReference); + } + if (isSetRecurringRecurringDetailReference) { + addIfNull( + nulls, + JSON_PROPERTY_RECURRING_RECURRING_DETAIL_REFERENCE, + this.recurringRecurringDetailReference); + } + if (isSetRecurringShopperReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_SHOPPER_REFERENCE, this.recurringShopperReference); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetReferred) { + addIfNull(nulls, JSON_PROPERTY_REFERRED, this.referred); + } + if (isSetRefusalReasonRaw) { + addIfNull(nulls, JSON_PROPERTY_REFUSAL_REASON_RAW, this.refusalReasonRaw); + } + if (isSetRequestAmount) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_AMOUNT, this.requestAmount); + } + if (isSetRequestCurrencyCode) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_CURRENCY_CODE, this.requestCurrencyCode); + } + if (isSetShopperInteraction) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION, this.shopperInteraction); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetTerminalId) { + addIfNull(nulls, JSON_PROPERTY_TERMINAL_ID, this.terminalId); + } + if (isSetThreeDAuthenticated) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_AUTHENTICATED, this.threeDAuthenticated); + } + if (isSetThreeDAuthenticatedResponse) { + addIfNull( + nulls, JSON_PROPERTY_THREE_D_AUTHENTICATED_RESPONSE, this.threeDAuthenticatedResponse); + } + if (isSetThreeDOffered) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_OFFERED, this.threeDOffered); + } + if (isSetThreeDOfferedResponse) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_OFFERED_RESPONSE, this.threeDOfferedResponse); + } + if (isSetThreeDSVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_VERSION, this.threeDSVersion); + } + if (isSetTokenizationShopperReference) { + addIfNull( + nulls, JSON_PROPERTY_TOKENIZATION_SHOPPER_REFERENCE, this.tokenizationShopperReference); + } + if (isSetTokenizationStoreOperationType) { + addIfNull( + nulls, + JSON_PROPERTY_TOKENIZATION_STORE_OPERATION_TYPE, + this.tokenizationStoreOperationType); + } + if (isSetTokenizationStoredPaymentMethodId) { + addIfNull( + nulls, + JSON_PROPERTY_TOKENIZATION_STORED_PAYMENT_METHOD_ID, + this.tokenizationStoredPaymentMethodId); + } + if (isSetVisaTransactionId) { + addIfNull(nulls, JSON_PROPERTY_VISA_TRANSACTION_ID, this.visaTransactionId); + } + if (isSetXid) { + addIfNull(nulls, JSON_PROPERTY_XID, this.xid); + } + + 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 ResponseAdditionalDataCommon given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataDomesticError.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataDomesticError.java index db3bb3c5e..95c874ba6 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataDomesticError.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataDomesticError.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -26,9 +28,21 @@ public class ResponseAdditionalDataDomesticError { public static final String JSON_PROPERTY_DOMESTIC_REFUSAL_REASON_RAW = "domesticRefusalReasonRaw"; private String domesticRefusalReasonRaw; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDomesticRefusalReasonRaw = false; + public static final String JSON_PROPERTY_DOMESTIC_SHOPPER_ADVICE = "domesticShopperAdvice"; private String domesticShopperAdvice; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDomesticShopperAdvice = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalDataDomesticError() {} /** @@ -43,6 +57,7 @@ public ResponseAdditionalDataDomesticError() {} public ResponseAdditionalDataDomesticError domesticRefusalReasonRaw( String domesticRefusalReasonRaw) { this.domesticRefusalReasonRaw = domesticRefusalReasonRaw; + isSetDomesticRefusalReasonRaw = true; // mark as set return this; } @@ -70,6 +85,7 @@ public String getDomesticRefusalReasonRaw() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDomesticRefusalReasonRaw(String domesticRefusalReasonRaw) { this.domesticRefusalReasonRaw = domesticRefusalReasonRaw; + isSetDomesticRefusalReasonRaw = true; // mark as set } /** @@ -83,6 +99,7 @@ public void setDomesticRefusalReasonRaw(String domesticRefusalReasonRaw) { */ public ResponseAdditionalDataDomesticError domesticShopperAdvice(String domesticShopperAdvice) { this.domesticShopperAdvice = domesticShopperAdvice; + isSetDomesticShopperAdvice = true; // mark as set return this; } @@ -110,6 +127,27 @@ public String getDomesticShopperAdvice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDomesticShopperAdvice(String domesticShopperAdvice) { this.domesticShopperAdvice = domesticShopperAdvice; + isSetDomesticShopperAdvice = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalDataDomesticError 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 ResponseAdditionalDataDomesticError object is equal to o. */ @@ -127,12 +165,22 @@ public boolean equals(Object o) { this.domesticRefusalReasonRaw, responseAdditionalDataDomesticError.domesticRefusalReasonRaw) && Objects.equals( - this.domesticShopperAdvice, responseAdditionalDataDomesticError.domesticShopperAdvice); + this.isSetDomesticRefusalReasonRaw, + responseAdditionalDataDomesticError.isSetDomesticRefusalReasonRaw) + && Objects.equals( + this.domesticShopperAdvice, responseAdditionalDataDomesticError.domesticShopperAdvice) + && Objects.equals( + this.isSetDomesticShopperAdvice, + responseAdditionalDataDomesticError.isSetDomesticShopperAdvice); } @Override public int hashCode() { - return Objects.hash(domesticRefusalReasonRaw, domesticShopperAdvice); + return Objects.hash( + domesticRefusalReasonRaw, + isSetDomesticRefusalReasonRaw, + domesticShopperAdvice, + isSetDomesticShopperAdvice); } @Override @@ -159,6 +207,33 @@ 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 (isSetDomesticRefusalReasonRaw) { + addIfNull(nulls, JSON_PROPERTY_DOMESTIC_REFUSAL_REASON_RAW, this.domesticRefusalReasonRaw); + } + if (isSetDomesticShopperAdvice) { + addIfNull(nulls, JSON_PROPERTY_DOMESTIC_SHOPPER_ADVICE, this.domesticShopperAdvice); + } + + 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 ResponseAdditionalDataDomesticError given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataInstallments.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataInstallments.java index abf80a4ff..2da4eb4ac 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataInstallments.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataInstallments.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -46,56 +48,98 @@ public class ResponseAdditionalDataInstallments { "installmentPaymentData.installmentType"; private String installmentPaymentDataInstallmentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataInstallmentType = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_ANNUAL_PERCENTAGE_RATE = "installmentPaymentData.option[itemNr].annualPercentageRate"; private String installmentPaymentDataOptionItemNrAnnualPercentageRate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataOptionItemNrAnnualPercentageRate = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_FIRST_INSTALLMENT_AMOUNT = "installmentPaymentData.option[itemNr].firstInstallmentAmount"; private String installmentPaymentDataOptionItemNrFirstInstallmentAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataOptionItemNrFirstInstallmentAmount = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_INSTALLMENT_FEE = "installmentPaymentData.option[itemNr].installmentFee"; private String installmentPaymentDataOptionItemNrInstallmentFee; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataOptionItemNrInstallmentFee = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_INTEREST_RATE = "installmentPaymentData.option[itemNr].interestRate"; private String installmentPaymentDataOptionItemNrInterestRate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataOptionItemNrInterestRate = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_MAXIMUM_NUMBER_OF_INSTALLMENTS = "installmentPaymentData.option[itemNr].maximumNumberOfInstallments"; private String installmentPaymentDataOptionItemNrMaximumNumberOfInstallments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_MINIMUM_NUMBER_OF_INSTALLMENTS = "installmentPaymentData.option[itemNr].minimumNumberOfInstallments"; private String installmentPaymentDataOptionItemNrMinimumNumberOfInstallments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_NUMBER_OF_INSTALLMENTS = "installmentPaymentData.option[itemNr].numberOfInstallments"; private String installmentPaymentDataOptionItemNrNumberOfInstallments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataOptionItemNrNumberOfInstallments = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_SUBSEQUENT_INSTALLMENT_AMOUNT = "installmentPaymentData.option[itemNr].subsequentInstallmentAmount"; private String installmentPaymentDataOptionItemNrSubsequentInstallmentAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_TOTAL_AMOUNT_DUE = "installmentPaymentData.option[itemNr].totalAmountDue"; private String installmentPaymentDataOptionItemNrTotalAmountDue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataOptionItemNrTotalAmountDue = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_PAYMENT_OPTIONS = "installmentPaymentData.paymentOptions"; private String installmentPaymentDataPaymentOptions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataPaymentOptions = false; + public static final String JSON_PROPERTY_INSTALLMENTS_VALUE = "installments.value"; private String installmentsValue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentsValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalDataInstallments() {} /** @@ -109,6 +153,7 @@ public ResponseAdditionalDataInstallments() {} public ResponseAdditionalDataInstallments installmentPaymentDataInstallmentType( String installmentPaymentDataInstallmentType) { this.installmentPaymentDataInstallmentType = installmentPaymentDataInstallmentType; + isSetInstallmentPaymentDataInstallmentType = true; // mark as set return this; } @@ -135,6 +180,7 @@ public String getInstallmentPaymentDataInstallmentType() { public void setInstallmentPaymentDataInstallmentType( String installmentPaymentDataInstallmentType) { this.installmentPaymentDataInstallmentType = installmentPaymentDataInstallmentType; + isSetInstallmentPaymentDataInstallmentType = true; // mark as set } /** @@ -148,6 +194,7 @@ public ResponseAdditionalDataInstallments installmentPaymentDataOptionItemNrAnnu String installmentPaymentDataOptionItemNrAnnualPercentageRate) { this.installmentPaymentDataOptionItemNrAnnualPercentageRate = installmentPaymentDataOptionItemNrAnnualPercentageRate; + isSetInstallmentPaymentDataOptionItemNrAnnualPercentageRate = true; // mark as set return this; } @@ -173,6 +220,7 @@ public void setInstallmentPaymentDataOptionItemNrAnnualPercentageRate( String installmentPaymentDataOptionItemNrAnnualPercentageRate) { this.installmentPaymentDataOptionItemNrAnnualPercentageRate = installmentPaymentDataOptionItemNrAnnualPercentageRate; + isSetInstallmentPaymentDataOptionItemNrAnnualPercentageRate = true; // mark as set } /** @@ -188,6 +236,7 @@ public void setInstallmentPaymentDataOptionItemNrAnnualPercentageRate( String installmentPaymentDataOptionItemNrFirstInstallmentAmount) { this.installmentPaymentDataOptionItemNrFirstInstallmentAmount = installmentPaymentDataOptionItemNrFirstInstallmentAmount; + isSetInstallmentPaymentDataOptionItemNrFirstInstallmentAmount = true; // mark as set return this; } @@ -215,6 +264,7 @@ public void setInstallmentPaymentDataOptionItemNrFirstInstallmentAmount( String installmentPaymentDataOptionItemNrFirstInstallmentAmount) { this.installmentPaymentDataOptionItemNrFirstInstallmentAmount = installmentPaymentDataOptionItemNrFirstInstallmentAmount; + isSetInstallmentPaymentDataOptionItemNrFirstInstallmentAmount = true; // mark as set } /** @@ -228,6 +278,7 @@ public ResponseAdditionalDataInstallments installmentPaymentDataOptionItemNrInst String installmentPaymentDataOptionItemNrInstallmentFee) { this.installmentPaymentDataOptionItemNrInstallmentFee = installmentPaymentDataOptionItemNrInstallmentFee; + isSetInstallmentPaymentDataOptionItemNrInstallmentFee = true; // mark as set return this; } @@ -253,6 +304,7 @@ public void setInstallmentPaymentDataOptionItemNrInstallmentFee( String installmentPaymentDataOptionItemNrInstallmentFee) { this.installmentPaymentDataOptionItemNrInstallmentFee = installmentPaymentDataOptionItemNrInstallmentFee; + isSetInstallmentPaymentDataOptionItemNrInstallmentFee = true; // mark as set } /** @@ -266,6 +318,7 @@ public ResponseAdditionalDataInstallments installmentPaymentDataOptionItemNrInte String installmentPaymentDataOptionItemNrInterestRate) { this.installmentPaymentDataOptionItemNrInterestRate = installmentPaymentDataOptionItemNrInterestRate; + isSetInstallmentPaymentDataOptionItemNrInterestRate = true; // mark as set return this; } @@ -292,6 +345,7 @@ public void setInstallmentPaymentDataOptionItemNrInterestRate( String installmentPaymentDataOptionItemNrInterestRate) { this.installmentPaymentDataOptionItemNrInterestRate = installmentPaymentDataOptionItemNrInterestRate; + isSetInstallmentPaymentDataOptionItemNrInterestRate = true; // mark as set } /** @@ -307,6 +361,7 @@ public void setInstallmentPaymentDataOptionItemNrInterestRate( String installmentPaymentDataOptionItemNrMaximumNumberOfInstallments) { this.installmentPaymentDataOptionItemNrMaximumNumberOfInstallments = installmentPaymentDataOptionItemNrMaximumNumberOfInstallments; + isSetInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments = true; // mark as set return this; } @@ -336,6 +391,7 @@ public void setInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments( String installmentPaymentDataOptionItemNrMaximumNumberOfInstallments) { this.installmentPaymentDataOptionItemNrMaximumNumberOfInstallments = installmentPaymentDataOptionItemNrMaximumNumberOfInstallments; + isSetInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments = true; // mark as set } /** @@ -351,6 +407,7 @@ public void setInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments( String installmentPaymentDataOptionItemNrMinimumNumberOfInstallments) { this.installmentPaymentDataOptionItemNrMinimumNumberOfInstallments = installmentPaymentDataOptionItemNrMinimumNumberOfInstallments; + isSetInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments = true; // mark as set return this; } @@ -380,6 +437,7 @@ public void setInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments( String installmentPaymentDataOptionItemNrMinimumNumberOfInstallments) { this.installmentPaymentDataOptionItemNrMinimumNumberOfInstallments = installmentPaymentDataOptionItemNrMinimumNumberOfInstallments; + isSetInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments = true; // mark as set } /** @@ -394,6 +452,7 @@ public ResponseAdditionalDataInstallments installmentPaymentDataOptionItemNrNumb String installmentPaymentDataOptionItemNrNumberOfInstallments) { this.installmentPaymentDataOptionItemNrNumberOfInstallments = installmentPaymentDataOptionItemNrNumberOfInstallments; + isSetInstallmentPaymentDataOptionItemNrNumberOfInstallments = true; // mark as set return this; } @@ -421,6 +480,7 @@ public void setInstallmentPaymentDataOptionItemNrNumberOfInstallments( String installmentPaymentDataOptionItemNrNumberOfInstallments) { this.installmentPaymentDataOptionItemNrNumberOfInstallments = installmentPaymentDataOptionItemNrNumberOfInstallments; + isSetInstallmentPaymentDataOptionItemNrNumberOfInstallments = true; // mark as set } /** @@ -436,6 +496,7 @@ public void setInstallmentPaymentDataOptionItemNrNumberOfInstallments( String installmentPaymentDataOptionItemNrSubsequentInstallmentAmount) { this.installmentPaymentDataOptionItemNrSubsequentInstallmentAmount = installmentPaymentDataOptionItemNrSubsequentInstallmentAmount; + isSetInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount = true; // mark as set return this; } @@ -463,6 +524,7 @@ public void setInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount( String installmentPaymentDataOptionItemNrSubsequentInstallmentAmount) { this.installmentPaymentDataOptionItemNrSubsequentInstallmentAmount = installmentPaymentDataOptionItemNrSubsequentInstallmentAmount; + isSetInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount = true; // mark as set } /** @@ -476,6 +538,7 @@ public ResponseAdditionalDataInstallments installmentPaymentDataOptionItemNrTota String installmentPaymentDataOptionItemNrTotalAmountDue) { this.installmentPaymentDataOptionItemNrTotalAmountDue = installmentPaymentDataOptionItemNrTotalAmountDue; + isSetInstallmentPaymentDataOptionItemNrTotalAmountDue = true; // mark as set return this; } @@ -501,6 +564,7 @@ public void setInstallmentPaymentDataOptionItemNrTotalAmountDue( String installmentPaymentDataOptionItemNrTotalAmountDue) { this.installmentPaymentDataOptionItemNrTotalAmountDue = installmentPaymentDataOptionItemNrTotalAmountDue; + isSetInstallmentPaymentDataOptionItemNrTotalAmountDue = true; // mark as set } /** @@ -514,6 +578,7 @@ public void setInstallmentPaymentDataOptionItemNrTotalAmountDue( public ResponseAdditionalDataInstallments installmentPaymentDataPaymentOptions( String installmentPaymentDataPaymentOptions) { this.installmentPaymentDataPaymentOptions = installmentPaymentDataPaymentOptions; + isSetInstallmentPaymentDataPaymentOptions = true; // mark as set return this; } @@ -539,6 +604,7 @@ public String getInstallmentPaymentDataPaymentOptions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallmentPaymentDataPaymentOptions(String installmentPaymentDataPaymentOptions) { this.installmentPaymentDataPaymentOptions = installmentPaymentDataPaymentOptions; + isSetInstallmentPaymentDataPaymentOptions = true; // mark as set } /** @@ -553,6 +619,7 @@ public void setInstallmentPaymentDataPaymentOptions(String installmentPaymentDat */ public ResponseAdditionalDataInstallments installmentsValue(String installmentsValue) { this.installmentsValue = installmentsValue; + isSetInstallmentsValue = true; // mark as set return this; } @@ -582,6 +649,27 @@ public String getInstallmentsValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallmentsValue(String installmentsValue) { this.installmentsValue = installmentsValue; + isSetInstallmentsValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalDataInstallments 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 ResponseAdditionalDataInstallments object is equal to o. */ @@ -598,61 +686,116 @@ public boolean equals(Object o) { return Objects.equals( this.installmentPaymentDataInstallmentType, responseAdditionalDataInstallments.installmentPaymentDataInstallmentType) + && Objects.equals( + this.isSetInstallmentPaymentDataInstallmentType, + responseAdditionalDataInstallments.isSetInstallmentPaymentDataInstallmentType) && Objects.equals( this.installmentPaymentDataOptionItemNrAnnualPercentageRate, responseAdditionalDataInstallments .installmentPaymentDataOptionItemNrAnnualPercentageRate) + && Objects.equals( + this.isSetInstallmentPaymentDataOptionItemNrAnnualPercentageRate, + responseAdditionalDataInstallments + .isSetInstallmentPaymentDataOptionItemNrAnnualPercentageRate) && Objects.equals( this.installmentPaymentDataOptionItemNrFirstInstallmentAmount, responseAdditionalDataInstallments .installmentPaymentDataOptionItemNrFirstInstallmentAmount) + && Objects.equals( + this.isSetInstallmentPaymentDataOptionItemNrFirstInstallmentAmount, + responseAdditionalDataInstallments + .isSetInstallmentPaymentDataOptionItemNrFirstInstallmentAmount) && Objects.equals( this.installmentPaymentDataOptionItemNrInstallmentFee, responseAdditionalDataInstallments.installmentPaymentDataOptionItemNrInstallmentFee) + && Objects.equals( + this.isSetInstallmentPaymentDataOptionItemNrInstallmentFee, + responseAdditionalDataInstallments + .isSetInstallmentPaymentDataOptionItemNrInstallmentFee) && Objects.equals( this.installmentPaymentDataOptionItemNrInterestRate, responseAdditionalDataInstallments.installmentPaymentDataOptionItemNrInterestRate) + && Objects.equals( + this.isSetInstallmentPaymentDataOptionItemNrInterestRate, + responseAdditionalDataInstallments.isSetInstallmentPaymentDataOptionItemNrInterestRate) && Objects.equals( this.installmentPaymentDataOptionItemNrMaximumNumberOfInstallments, responseAdditionalDataInstallments .installmentPaymentDataOptionItemNrMaximumNumberOfInstallments) + && Objects.equals( + this.isSetInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments, + responseAdditionalDataInstallments + .isSetInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments) && Objects.equals( this.installmentPaymentDataOptionItemNrMinimumNumberOfInstallments, responseAdditionalDataInstallments .installmentPaymentDataOptionItemNrMinimumNumberOfInstallments) + && Objects.equals( + this.isSetInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments, + responseAdditionalDataInstallments + .isSetInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments) && Objects.equals( this.installmentPaymentDataOptionItemNrNumberOfInstallments, responseAdditionalDataInstallments .installmentPaymentDataOptionItemNrNumberOfInstallments) + && Objects.equals( + this.isSetInstallmentPaymentDataOptionItemNrNumberOfInstallments, + responseAdditionalDataInstallments + .isSetInstallmentPaymentDataOptionItemNrNumberOfInstallments) && Objects.equals( this.installmentPaymentDataOptionItemNrSubsequentInstallmentAmount, responseAdditionalDataInstallments .installmentPaymentDataOptionItemNrSubsequentInstallmentAmount) + && Objects.equals( + this.isSetInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount, + responseAdditionalDataInstallments + .isSetInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount) && Objects.equals( this.installmentPaymentDataOptionItemNrTotalAmountDue, responseAdditionalDataInstallments.installmentPaymentDataOptionItemNrTotalAmountDue) + && Objects.equals( + this.isSetInstallmentPaymentDataOptionItemNrTotalAmountDue, + responseAdditionalDataInstallments + .isSetInstallmentPaymentDataOptionItemNrTotalAmountDue) && Objects.equals( this.installmentPaymentDataPaymentOptions, responseAdditionalDataInstallments.installmentPaymentDataPaymentOptions) && Objects.equals( - this.installmentsValue, responseAdditionalDataInstallments.installmentsValue); + this.isSetInstallmentPaymentDataPaymentOptions, + responseAdditionalDataInstallments.isSetInstallmentPaymentDataPaymentOptions) + && Objects.equals( + this.installmentsValue, responseAdditionalDataInstallments.installmentsValue) + && Objects.equals( + this.isSetInstallmentsValue, responseAdditionalDataInstallments.isSetInstallmentsValue); } @Override public int hashCode() { return Objects.hash( installmentPaymentDataInstallmentType, + isSetInstallmentPaymentDataInstallmentType, installmentPaymentDataOptionItemNrAnnualPercentageRate, + isSetInstallmentPaymentDataOptionItemNrAnnualPercentageRate, installmentPaymentDataOptionItemNrFirstInstallmentAmount, + isSetInstallmentPaymentDataOptionItemNrFirstInstallmentAmount, installmentPaymentDataOptionItemNrInstallmentFee, + isSetInstallmentPaymentDataOptionItemNrInstallmentFee, installmentPaymentDataOptionItemNrInterestRate, + isSetInstallmentPaymentDataOptionItemNrInterestRate, installmentPaymentDataOptionItemNrMaximumNumberOfInstallments, + isSetInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments, installmentPaymentDataOptionItemNrMinimumNumberOfInstallments, + isSetInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments, installmentPaymentDataOptionItemNrNumberOfInstallments, + isSetInstallmentPaymentDataOptionItemNrNumberOfInstallments, installmentPaymentDataOptionItemNrSubsequentInstallmentAmount, + isSetInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount, installmentPaymentDataOptionItemNrTotalAmountDue, + isSetInstallmentPaymentDataOptionItemNrTotalAmountDue, installmentPaymentDataPaymentOptions, - installmentsValue); + isSetInstallmentPaymentDataPaymentOptions, + installmentsValue, + isSetInstallmentsValue); } @Override @@ -707,6 +850,96 @@ 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 (isSetInstallmentPaymentDataInstallmentType) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_INSTALLMENT_TYPE, + this.installmentPaymentDataInstallmentType); + } + if (isSetInstallmentPaymentDataOptionItemNrAnnualPercentageRate) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_ANNUAL_PERCENTAGE_RATE, + this.installmentPaymentDataOptionItemNrAnnualPercentageRate); + } + if (isSetInstallmentPaymentDataOptionItemNrFirstInstallmentAmount) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_FIRST_INSTALLMENT_AMOUNT, + this.installmentPaymentDataOptionItemNrFirstInstallmentAmount); + } + if (isSetInstallmentPaymentDataOptionItemNrInstallmentFee) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_INSTALLMENT_FEE, + this.installmentPaymentDataOptionItemNrInstallmentFee); + } + if (isSetInstallmentPaymentDataOptionItemNrInterestRate) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_INTEREST_RATE, + this.installmentPaymentDataOptionItemNrInterestRate); + } + if (isSetInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_MAXIMUM_NUMBER_OF_INSTALLMENTS, + this.installmentPaymentDataOptionItemNrMaximumNumberOfInstallments); + } + if (isSetInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_MINIMUM_NUMBER_OF_INSTALLMENTS, + this.installmentPaymentDataOptionItemNrMinimumNumberOfInstallments); + } + if (isSetInstallmentPaymentDataOptionItemNrNumberOfInstallments) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_NUMBER_OF_INSTALLMENTS, + this.installmentPaymentDataOptionItemNrNumberOfInstallments); + } + if (isSetInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_SUBSEQUENT_INSTALLMENT_AMOUNT, + this.installmentPaymentDataOptionItemNrSubsequentInstallmentAmount); + } + if (isSetInstallmentPaymentDataOptionItemNrTotalAmountDue) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_TOTAL_AMOUNT_DUE, + this.installmentPaymentDataOptionItemNrTotalAmountDue); + } + if (isSetInstallmentPaymentDataPaymentOptions) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_PAYMENT_OPTIONS, + this.installmentPaymentDataPaymentOptions); + } + if (isSetInstallmentsValue) { + addIfNull(nulls, JSON_PROPERTY_INSTALLMENTS_VALUE, this.installmentsValue); + } + + 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 ResponseAdditionalDataInstallments given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataNetworkTokens.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataNetworkTokens.java index ac6761f95..e0f25ba7c 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataNetworkTokens.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataNetworkTokens.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -27,13 +29,28 @@ public class ResponseAdditionalDataNetworkTokens { public static final String JSON_PROPERTY_NETWORK_TOKEN_AVAILABLE = "networkToken.available"; private String networkTokenAvailable; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkTokenAvailable = false; + public static final String JSON_PROPERTY_NETWORK_TOKEN_BIN = "networkToken.bin"; private String networkTokenBin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkTokenBin = false; + public static final String JSON_PROPERTY_NETWORK_TOKEN_TOKEN_SUMMARY = "networkToken.tokenSummary"; private String networkTokenTokenSummary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkTokenTokenSummary = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalDataNetworkTokens() {} /** @@ -46,6 +63,7 @@ public ResponseAdditionalDataNetworkTokens() {} */ public ResponseAdditionalDataNetworkTokens networkTokenAvailable(String networkTokenAvailable) { this.networkTokenAvailable = networkTokenAvailable; + isSetNetworkTokenAvailable = true; // mark as set return this; } @@ -71,6 +89,7 @@ public String getNetworkTokenAvailable() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkTokenAvailable(String networkTokenAvailable) { this.networkTokenAvailable = networkTokenAvailable; + isSetNetworkTokenAvailable = true; // mark as set } /** @@ -84,6 +103,7 @@ public void setNetworkTokenAvailable(String networkTokenAvailable) { */ public ResponseAdditionalDataNetworkTokens networkTokenBin(String networkTokenBin) { this.networkTokenBin = networkTokenBin; + isSetNetworkTokenBin = true; // mark as set return this; } @@ -111,6 +131,7 @@ public String getNetworkTokenBin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkTokenBin(String networkTokenBin) { this.networkTokenBin = networkTokenBin; + isSetNetworkTokenBin = true; // mark as set } /** @@ -123,6 +144,7 @@ public void setNetworkTokenBin(String networkTokenBin) { public ResponseAdditionalDataNetworkTokens networkTokenTokenSummary( String networkTokenTokenSummary) { this.networkTokenTokenSummary = networkTokenTokenSummary; + isSetNetworkTokenTokenSummary = true; // mark as set return this; } @@ -146,6 +168,27 @@ public String getNetworkTokenTokenSummary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkTokenTokenSummary(String networkTokenTokenSummary) { this.networkTokenTokenSummary = networkTokenTokenSummary; + isSetNetworkTokenTokenSummary = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalDataNetworkTokens 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 ResponseAdditionalDataNetworkTokens object is equal to o. */ @@ -161,15 +204,29 @@ public boolean equals(Object o) { (ResponseAdditionalDataNetworkTokens) o; return Objects.equals( this.networkTokenAvailable, responseAdditionalDataNetworkTokens.networkTokenAvailable) + && Objects.equals( + this.isSetNetworkTokenAvailable, + responseAdditionalDataNetworkTokens.isSetNetworkTokenAvailable) && Objects.equals(this.networkTokenBin, responseAdditionalDataNetworkTokens.networkTokenBin) + && Objects.equals( + this.isSetNetworkTokenBin, responseAdditionalDataNetworkTokens.isSetNetworkTokenBin) && Objects.equals( this.networkTokenTokenSummary, - responseAdditionalDataNetworkTokens.networkTokenTokenSummary); + responseAdditionalDataNetworkTokens.networkTokenTokenSummary) + && Objects.equals( + this.isSetNetworkTokenTokenSummary, + responseAdditionalDataNetworkTokens.isSetNetworkTokenTokenSummary); } @Override public int hashCode() { - return Objects.hash(networkTokenAvailable, networkTokenBin, networkTokenTokenSummary); + return Objects.hash( + networkTokenAvailable, + isSetNetworkTokenAvailable, + networkTokenBin, + isSetNetworkTokenBin, + networkTokenTokenSummary, + isSetNetworkTokenTokenSummary); } @Override @@ -197,6 +254,36 @@ 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 (isSetNetworkTokenAvailable) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TOKEN_AVAILABLE, this.networkTokenAvailable); + } + if (isSetNetworkTokenBin) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TOKEN_BIN, this.networkTokenBin); + } + if (isSetNetworkTokenTokenSummary) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TOKEN_TOKEN_SUMMARY, this.networkTokenTokenSummary); + } + + 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 ResponseAdditionalDataNetworkTokens given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataOpi.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataOpi.java index 4cd26799b..e06d0bfb6 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataOpi.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataOpi.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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 ResponseAdditionalDataOpi { public static final String JSON_PROPERTY_OPI_TRANS_TOKEN = "opi.transToken"; private String opiTransToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpiTransToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalDataOpi() {} /** @@ -41,6 +52,7 @@ public ResponseAdditionalDataOpi() {} */ public ResponseAdditionalDataOpi opiTransToken(String opiTransToken) { this.opiTransToken = opiTransToken; + isSetOpiTransToken = true; // mark as set return this; } @@ -80,6 +92,27 @@ public String getOpiTransToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpiTransToken(String opiTransToken) { this.opiTransToken = opiTransToken; + isSetOpiTransToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalDataOpi 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 ResponseAdditionalDataOpi object is equal to o. */ @@ -92,12 +125,13 @@ public boolean equals(Object o) { return false; } ResponseAdditionalDataOpi responseAdditionalDataOpi = (ResponseAdditionalDataOpi) o; - return Objects.equals(this.opiTransToken, responseAdditionalDataOpi.opiTransToken); + return Objects.equals(this.opiTransToken, responseAdditionalDataOpi.opiTransToken) + && Objects.equals(this.isSetOpiTransToken, responseAdditionalDataOpi.isSetOpiTransToken); } @Override public int hashCode() { - return Objects.hash(opiTransToken); + return Objects.hash(opiTransToken, isSetOpiTransToken); } @Override @@ -119,6 +153,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 (isSetOpiTransToken) { + addIfNull(nulls, JSON_PROPERTY_OPI_TRANS_TOKEN, this.opiTransToken); + } + + 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 ResponseAdditionalDataOpi given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataSepa.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataSepa.java index 2fcd19cd9..6841c87ea 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataSepa.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataSepa.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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,17 +31,35 @@ public class ResponseAdditionalDataSepa { "sepadirectdebit.dateOfSignature"; private String sepadirectdebitDateOfSignature; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSepadirectdebitDateOfSignature = false; + public static final String JSON_PROPERTY_SEPADIRECTDEBIT_MANDATE_ID = "sepadirectdebit.mandateId"; private String sepadirectdebitMandateId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSepadirectdebitMandateId = false; + public static final String JSON_PROPERTY_SEPADIRECTDEBIT_SEPADIRECTDEBIT_DUE_DATE = "sepadirectdebit.sepadirectdebit.dueDate"; private String sepadirectdebitSepadirectdebitDueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSepadirectdebitSepadirectdebitDueDate = false; + public static final String JSON_PROPERTY_SEPADIRECTDEBIT_SEQUENCE_TYPE = "sepadirectdebit.sequenceType"; private String sepadirectdebitSequenceType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSepadirectdebitSequenceType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalDataSepa() {} /** @@ -51,6 +71,7 @@ public ResponseAdditionalDataSepa() {} public ResponseAdditionalDataSepa sepadirectdebitDateOfSignature( String sepadirectdebitDateOfSignature) { this.sepadirectdebitDateOfSignature = sepadirectdebitDateOfSignature; + isSetSepadirectdebitDateOfSignature = true; // mark as set return this; } @@ -74,6 +95,7 @@ public String getSepadirectdebitDateOfSignature() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSepadirectdebitDateOfSignature(String sepadirectdebitDateOfSignature) { this.sepadirectdebitDateOfSignature = sepadirectdebitDateOfSignature; + isSetSepadirectdebitDateOfSignature = true; // mark as set } /** @@ -85,6 +107,7 @@ public void setSepadirectdebitDateOfSignature(String sepadirectdebitDateOfSignat */ public ResponseAdditionalDataSepa sepadirectdebitMandateId(String sepadirectdebitMandateId) { this.sepadirectdebitMandateId = sepadirectdebitMandateId; + isSetSepadirectdebitMandateId = true; // mark as set return this; } @@ -110,6 +133,7 @@ public String getSepadirectdebitMandateId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSepadirectdebitMandateId(String sepadirectdebitMandateId) { this.sepadirectdebitMandateId = sepadirectdebitMandateId; + isSetSepadirectdebitMandateId = true; // mark as set } /** @@ -122,6 +146,7 @@ public void setSepadirectdebitMandateId(String sepadirectdebitMandateId) { public ResponseAdditionalDataSepa sepadirectdebitSepadirectdebitDueDate( String sepadirectdebitSepadirectdebitDueDate) { this.sepadirectdebitSepadirectdebitDueDate = sepadirectdebitSepadirectdebitDueDate; + isSetSepadirectdebitSepadirectdebitDueDate = true; // mark as set return this; } @@ -148,6 +173,7 @@ public String getSepadirectdebitSepadirectdebitDueDate() { public void setSepadirectdebitSepadirectdebitDueDate( String sepadirectdebitSepadirectdebitDueDate) { this.sepadirectdebitSepadirectdebitDueDate = sepadirectdebitSepadirectdebitDueDate; + isSetSepadirectdebitSepadirectdebitDueDate = true; // mark as set } /** @@ -168,6 +194,7 @@ public void setSepadirectdebitSepadirectdebitDueDate( public ResponseAdditionalDataSepa sepadirectdebitSequenceType( String sepadirectdebitSequenceType) { this.sepadirectdebitSequenceType = sepadirectdebitSequenceType; + isSetSepadirectdebitSequenceType = true; // mark as set return this; } @@ -209,6 +236,27 @@ public String getSepadirectdebitSequenceType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSepadirectdebitSequenceType(String sepadirectdebitSequenceType) { this.sepadirectdebitSequenceType = sepadirectdebitSequenceType; + isSetSepadirectdebitSequenceType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalDataSepa 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 ResponseAdditionalDataSepa object is equal to o. */ @@ -224,23 +272,39 @@ public boolean equals(Object o) { return Objects.equals( this.sepadirectdebitDateOfSignature, responseAdditionalDataSepa.sepadirectdebitDateOfSignature) + && Objects.equals( + this.isSetSepadirectdebitDateOfSignature, + responseAdditionalDataSepa.isSetSepadirectdebitDateOfSignature) && Objects.equals( this.sepadirectdebitMandateId, responseAdditionalDataSepa.sepadirectdebitMandateId) + && Objects.equals( + this.isSetSepadirectdebitMandateId, + responseAdditionalDataSepa.isSetSepadirectdebitMandateId) && Objects.equals( this.sepadirectdebitSepadirectdebitDueDate, responseAdditionalDataSepa.sepadirectdebitSepadirectdebitDueDate) + && Objects.equals( + this.isSetSepadirectdebitSepadirectdebitDueDate, + responseAdditionalDataSepa.isSetSepadirectdebitSepadirectdebitDueDate) && Objects.equals( this.sepadirectdebitSequenceType, - responseAdditionalDataSepa.sepadirectdebitSequenceType); + responseAdditionalDataSepa.sepadirectdebitSequenceType) + && Objects.equals( + this.isSetSepadirectdebitSequenceType, + responseAdditionalDataSepa.isSetSepadirectdebitSequenceType); } @Override public int hashCode() { return Objects.hash( sepadirectdebitDateOfSignature, + isSetSepadirectdebitDateOfSignature, sepadirectdebitMandateId, + isSetSepadirectdebitMandateId, sepadirectdebitSepadirectdebitDueDate, - sepadirectdebitSequenceType); + isSetSepadirectdebitSepadirectdebitDueDate, + sepadirectdebitSequenceType, + isSetSepadirectdebitSequenceType); } @Override @@ -273,6 +337,46 @@ 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 (isSetSepadirectdebitDateOfSignature) { + addIfNull( + nulls, + JSON_PROPERTY_SEPADIRECTDEBIT_DATE_OF_SIGNATURE, + this.sepadirectdebitDateOfSignature); + } + if (isSetSepadirectdebitMandateId) { + addIfNull(nulls, JSON_PROPERTY_SEPADIRECTDEBIT_MANDATE_ID, this.sepadirectdebitMandateId); + } + if (isSetSepadirectdebitSepadirectdebitDueDate) { + addIfNull( + nulls, + JSON_PROPERTY_SEPADIRECTDEBIT_SEPADIRECTDEBIT_DUE_DATE, + this.sepadirectdebitSepadirectdebitDueDate); + } + if (isSetSepadirectdebitSequenceType) { + addIfNull( + nulls, JSON_PROPERTY_SEPADIRECTDEBIT_SEQUENCE_TYPE, this.sepadirectdebitSequenceType); + } + + 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 ResponseAdditionalDataSepa given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataSwish.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataSwish.java index d7ef9eb2c..7bdb264bb 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataSwish.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataSwish.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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 ResponseAdditionalDataSwish { public static final String JSON_PROPERTY_SWISH_PAYER_ALIAS = "swish.payerAlias"; private String swishPayerAlias; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSwishPayerAlias = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalDataSwish() {} /** @@ -33,6 +44,7 @@ public ResponseAdditionalDataSwish() {} */ public ResponseAdditionalDataSwish swishPayerAlias(String swishPayerAlias) { this.swishPayerAlias = swishPayerAlias; + isSetSwishPayerAlias = true; // mark as set return this; } @@ -56,6 +68,27 @@ public String getSwishPayerAlias() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSwishPayerAlias(String swishPayerAlias) { this.swishPayerAlias = swishPayerAlias; + isSetSwishPayerAlias = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalDataSwish 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 ResponseAdditionalDataSwish object is equal to o. */ @@ -68,12 +101,14 @@ public boolean equals(Object o) { return false; } ResponseAdditionalDataSwish responseAdditionalDataSwish = (ResponseAdditionalDataSwish) o; - return Objects.equals(this.swishPayerAlias, responseAdditionalDataSwish.swishPayerAlias); + return Objects.equals(this.swishPayerAlias, responseAdditionalDataSwish.swishPayerAlias) + && Objects.equals( + this.isSetSwishPayerAlias, responseAdditionalDataSwish.isSetSwishPayerAlias); } @Override public int hashCode() { - return Objects.hash(swishPayerAlias); + return Objects.hash(swishPayerAlias, isSetSwishPayerAlias); } @Override @@ -95,6 +130,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 (isSetSwishPayerAlias) { + addIfNull(nulls, JSON_PROPERTY_SWISH_PAYER_ALIAS, this.swishPayerAlias); + } + + 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 ResponseAdditionalDataSwish given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/SDKEphemPubKey.java b/src/main/java/com/adyen/model/payment/SDKEphemPubKey.java index 68475fcfb..770975a4d 100644 --- a/src/main/java/com/adyen/model/payment/SDKEphemPubKey.java +++ b/src/main/java/com/adyen/model/payment/SDKEphemPubKey.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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 SDKEphemPubKey { public static final String JSON_PROPERTY_CRV = "crv"; private String crv; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCrv = false; + public static final String JSON_PROPERTY_KTY = "kty"; private String kty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetKty = false; + public static final String JSON_PROPERTY_X = "x"; private String x; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetX = false; + public static final String JSON_PROPERTY_Y = "y"; private String y; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetY = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SDKEphemPubKey() {} /** @@ -47,6 +67,7 @@ public SDKEphemPubKey() {} */ public SDKEphemPubKey crv(String crv) { this.crv = crv; + isSetCrv = true; // mark as set return this; } @@ -70,6 +91,7 @@ public String getCrv() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCrv(String crv) { this.crv = crv; + isSetCrv = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setCrv(String crv) { */ public SDKEphemPubKey kty(String kty) { this.kty = kty; + isSetKty = true; // mark as set return this; } @@ -103,6 +126,7 @@ public String getKty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setKty(String kty) { this.kty = kty; + isSetKty = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setKty(String kty) { */ public SDKEphemPubKey x(String x) { this.x = x; + isSetX = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getX() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setX(String x) { this.x = x; + isSetX = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setX(String x) { */ public SDKEphemPubKey y(String y) { this.y = y; + isSetY = true; // mark as set return this; } @@ -169,6 +196,27 @@ public String getY() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setY(String y) { this.y = y; + isSetY = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SDKEphemPubKey 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 SDKEphemPubKey object is equal to o. */ @@ -182,14 +230,18 @@ public boolean equals(Object o) { } SDKEphemPubKey sdKEphemPubKey = (SDKEphemPubKey) o; return Objects.equals(this.crv, sdKEphemPubKey.crv) + && Objects.equals(this.isSetCrv, sdKEphemPubKey.isSetCrv) && Objects.equals(this.kty, sdKEphemPubKey.kty) + && Objects.equals(this.isSetKty, sdKEphemPubKey.isSetKty) && Objects.equals(this.x, sdKEphemPubKey.x) - && Objects.equals(this.y, sdKEphemPubKey.y); + && Objects.equals(this.isSetX, sdKEphemPubKey.isSetX) + && Objects.equals(this.y, sdKEphemPubKey.y) + && Objects.equals(this.isSetY, sdKEphemPubKey.isSetY); } @Override public int hashCode() { - return Objects.hash(crv, kty, x, y); + return Objects.hash(crv, isSetCrv, kty, isSetKty, x, isSetX, y, isSetY); } @Override @@ -214,6 +266,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 (isSetCrv) { + addIfNull(nulls, JSON_PROPERTY_CRV, this.crv); + } + if (isSetKty) { + addIfNull(nulls, JSON_PROPERTY_KTY, this.kty); + } + if (isSetX) { + addIfNull(nulls, JSON_PROPERTY_X, this.x); + } + if (isSetY) { + addIfNull(nulls, JSON_PROPERTY_Y, this.y); + } + + 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 SDKEphemPubKey given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/SecureRemoteCommerceCheckoutData.java b/src/main/java/com/adyen/model/payment/SecureRemoteCommerceCheckoutData.java index 172514a5d..c383e8fff 100644 --- a/src/main/java/com/adyen/model/payment/SecureRemoteCommerceCheckoutData.java +++ b/src/main/java/com/adyen/model/payment/SecureRemoteCommerceCheckoutData.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -34,15 +36,27 @@ public class SecureRemoteCommerceCheckoutData { public static final String JSON_PROPERTY_CHECKOUT_PAYLOAD = "checkoutPayload"; private String checkoutPayload; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutPayload = false; + public static final String JSON_PROPERTY_CORRELATION_ID = "correlationId"; private String correlationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCorrelationId = false; + public static final String JSON_PROPERTY_CVC = "cvc"; private String cvc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCvc = false; + public static final String JSON_PROPERTY_DIGITAL_CARD_ID = "digitalCardId"; private String digitalCardId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDigitalCardId = false; + /** The Secure Remote Commerce scheme. */ public enum SchemeEnum { MC(String.valueOf("mc")), @@ -87,9 +101,21 @@ public static SchemeEnum fromValue(String value) { public static final String JSON_PROPERTY_SCHEME = "scheme"; private SchemeEnum scheme; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScheme = false; + public static final String JSON_PROPERTY_TOKEN_REFERENCE = "tokenReference"; private String tokenReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SecureRemoteCommerceCheckoutData() {} /** @@ -101,6 +127,7 @@ public SecureRemoteCommerceCheckoutData() {} */ public SecureRemoteCommerceCheckoutData checkoutPayload(String checkoutPayload) { this.checkoutPayload = checkoutPayload; + isSetCheckoutPayload = true; // mark as set return this; } @@ -125,6 +152,7 @@ public String getCheckoutPayload() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutPayload(String checkoutPayload) { this.checkoutPayload = checkoutPayload; + isSetCheckoutPayload = true; // mark as set } /** @@ -140,6 +168,7 @@ public void setCheckoutPayload(String checkoutPayload) { */ public SecureRemoteCommerceCheckoutData correlationId(String correlationId) { this.correlationId = correlationId; + isSetCorrelationId = true; // mark as set return this; } @@ -171,6 +200,7 @@ public String getCorrelationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCorrelationId(String correlationId) { this.correlationId = correlationId; + isSetCorrelationId = true; // mark as set } /** @@ -184,6 +214,7 @@ public void setCorrelationId(String correlationId) { */ public SecureRemoteCommerceCheckoutData cvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set return this; } @@ -211,6 +242,7 @@ public String getCvc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set } /** @@ -224,6 +256,7 @@ public void setCvc(String cvc) { */ public SecureRemoteCommerceCheckoutData digitalCardId(String digitalCardId) { this.digitalCardId = digitalCardId; + isSetDigitalCardId = true; // mark as set return this; } @@ -251,6 +284,7 @@ public String getDigitalCardId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDigitalCardId(String digitalCardId) { this.digitalCardId = digitalCardId; + isSetDigitalCardId = true; // mark as set } /** @@ -262,6 +296,7 @@ public void setDigitalCardId(String digitalCardId) { */ public SecureRemoteCommerceCheckoutData scheme(SchemeEnum scheme) { this.scheme = scheme; + isSetScheme = true; // mark as set return this; } @@ -285,6 +320,7 @@ public SchemeEnum getScheme() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScheme(SchemeEnum scheme) { this.scheme = scheme; + isSetScheme = true; // mark as set } /** @@ -298,6 +334,7 @@ public void setScheme(SchemeEnum scheme) { */ public SecureRemoteCommerceCheckoutData tokenReference(String tokenReference) { this.tokenReference = tokenReference; + isSetTokenReference = true; // mark as set return this; } @@ -325,6 +362,27 @@ public String getTokenReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenReference(String tokenReference) { this.tokenReference = tokenReference; + isSetTokenReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SecureRemoteCommerceCheckoutData 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 SecureRemoteCommerceCheckoutData object is equal to o. */ @@ -339,16 +397,38 @@ public boolean equals(Object o) { SecureRemoteCommerceCheckoutData secureRemoteCommerceCheckoutData = (SecureRemoteCommerceCheckoutData) o; return Objects.equals(this.checkoutPayload, secureRemoteCommerceCheckoutData.checkoutPayload) + && Objects.equals( + this.isSetCheckoutPayload, secureRemoteCommerceCheckoutData.isSetCheckoutPayload) && Objects.equals(this.correlationId, secureRemoteCommerceCheckoutData.correlationId) + && Objects.equals( + this.isSetCorrelationId, secureRemoteCommerceCheckoutData.isSetCorrelationId) && Objects.equals(this.cvc, secureRemoteCommerceCheckoutData.cvc) + && Objects.equals(this.isSetCvc, secureRemoteCommerceCheckoutData.isSetCvc) && Objects.equals(this.digitalCardId, secureRemoteCommerceCheckoutData.digitalCardId) + && Objects.equals( + this.isSetDigitalCardId, secureRemoteCommerceCheckoutData.isSetDigitalCardId) && Objects.equals(this.scheme, secureRemoteCommerceCheckoutData.scheme) - && Objects.equals(this.tokenReference, secureRemoteCommerceCheckoutData.tokenReference); + && Objects.equals(this.isSetScheme, secureRemoteCommerceCheckoutData.isSetScheme) + && Objects.equals(this.tokenReference, secureRemoteCommerceCheckoutData.tokenReference) + && Objects.equals( + this.isSetTokenReference, secureRemoteCommerceCheckoutData.isSetTokenReference); } @Override public int hashCode() { - return Objects.hash(checkoutPayload, correlationId, cvc, digitalCardId, scheme, tokenReference); + return Objects.hash( + checkoutPayload, + isSetCheckoutPayload, + correlationId, + isSetCorrelationId, + cvc, + isSetCvc, + digitalCardId, + isSetDigitalCardId, + scheme, + isSetScheme, + tokenReference, + isSetTokenReference); } @Override @@ -375,6 +455,45 @@ 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 (isSetCheckoutPayload) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_PAYLOAD, this.checkoutPayload); + } + if (isSetCorrelationId) { + addIfNull(nulls, JSON_PROPERTY_CORRELATION_ID, this.correlationId); + } + if (isSetCvc) { + addIfNull(nulls, JSON_PROPERTY_CVC, this.cvc); + } + if (isSetDigitalCardId) { + addIfNull(nulls, JSON_PROPERTY_DIGITAL_CARD_ID, this.digitalCardId); + } + if (isSetScheme) { + addIfNull(nulls, JSON_PROPERTY_SCHEME, this.scheme); + } + if (isSetTokenReference) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_REFERENCE, this.tokenReference); + } + + 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 SecureRemoteCommerceCheckoutData given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ServiceError.java b/src/main/java/com/adyen/model/payment/ServiceError.java index 30720ebd8..189d1277f 100644 --- a/src/main/java/com/adyen/model/payment/ServiceError.java +++ b/src/main/java/com/adyen/model/payment/ServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -32,21 +34,45 @@ public class ServiceError { public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_ERROR_CODE = "errorCode"; private String errorCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorCode = false; + public static final String JSON_PROPERTY_ERROR_TYPE = "errorType"; private String errorType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorType = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + public static final String JSON_PROPERTY_STATUS = "status"; private Integer status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ServiceError() {} /** @@ -60,6 +86,7 @@ public ServiceError() {} */ public ServiceError additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -97,6 +124,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -107,6 +135,7 @@ public void setAdditionalData(Map additionalData) { */ public ServiceError errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -130,6 +159,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -140,6 +170,7 @@ public void setErrorCode(String errorCode) { */ public ServiceError errorType(String errorType) { this.errorType = errorType; + isSetErrorType = true; // mark as set return this; } @@ -163,6 +194,7 @@ public String getErrorType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorType(String errorType) { this.errorType = errorType; + isSetErrorType = true; // mark as set } /** @@ -173,6 +205,7 @@ public void setErrorType(String errorType) { */ public ServiceError message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -196,6 +229,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -206,6 +240,7 @@ public void setMessage(String message) { */ public ServiceError pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -229,6 +264,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -239,6 +275,7 @@ public void setPspReference(String pspReference) { */ public ServiceError status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -262,6 +299,27 @@ public Integer getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(Integer status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ServiceError 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 ServiceError object is equal to o. */ @@ -275,16 +333,34 @@ public boolean equals(Object o) { } ServiceError serviceError = (ServiceError) o; return Objects.equals(this.additionalData, serviceError.additionalData) + && Objects.equals(this.isSetAdditionalData, serviceError.isSetAdditionalData) && Objects.equals(this.errorCode, serviceError.errorCode) + && Objects.equals(this.isSetErrorCode, serviceError.isSetErrorCode) && Objects.equals(this.errorType, serviceError.errorType) + && Objects.equals(this.isSetErrorType, serviceError.isSetErrorType) && Objects.equals(this.message, serviceError.message) + && Objects.equals(this.isSetMessage, serviceError.isSetMessage) && Objects.equals(this.pspReference, serviceError.pspReference) - && Objects.equals(this.status, serviceError.status); + && Objects.equals(this.isSetPspReference, serviceError.isSetPspReference) + && Objects.equals(this.status, serviceError.status) + && Objects.equals(this.isSetStatus, serviceError.isSetStatus); } @Override public int hashCode() { - return Objects.hash(additionalData, errorCode, errorType, message, pspReference, status); + return Objects.hash( + additionalData, + isSetAdditionalData, + errorCode, + isSetErrorCode, + errorType, + isSetErrorType, + message, + isSetMessage, + pspReference, + isSetPspReference, + status, + isSetStatus); } @Override @@ -311,6 +387,45 @@ 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 (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetErrorType) { + addIfNull(nulls, JSON_PROPERTY_ERROR_TYPE, this.errorType); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + 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 ServiceError given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ShopperInteractionDevice.java b/src/main/java/com/adyen/model/payment/ShopperInteractionDevice.java index 8b08225d5..6abafb6e4 100644 --- a/src/main/java/com/adyen/model/payment/ShopperInteractionDevice.java +++ b/src/main/java/com/adyen/model/payment/ShopperInteractionDevice.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -27,12 +29,27 @@ public class ShopperInteractionDevice { public static final String JSON_PROPERTY_LOCALE = "locale"; private String locale; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLocale = false; + public static final String JSON_PROPERTY_OS = "os"; private String os; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOs = false; + public static final String JSON_PROPERTY_OS_VERSION = "osVersion"; private String osVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOsVersion = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ShopperInteractionDevice() {} /** @@ -43,6 +60,7 @@ public ShopperInteractionDevice() {} */ public ShopperInteractionDevice locale(String locale) { this.locale = locale; + isSetLocale = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLocale(String locale) { this.locale = locale; + isSetLocale = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setLocale(String locale) { */ public ShopperInteractionDevice os(String os) { this.os = os; + isSetOs = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getOs() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOs(String os) { this.os = os; + isSetOs = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setOs(String os) { */ public ShopperInteractionDevice osVersion(String osVersion) { this.osVersion = osVersion; + isSetOsVersion = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getOsVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOsVersion(String osVersion) { this.osVersion = osVersion; + isSetOsVersion = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ShopperInteractionDevice 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 ShopperInteractionDevice object is equal to o. */ @@ -145,13 +188,16 @@ public boolean equals(Object o) { } ShopperInteractionDevice shopperInteractionDevice = (ShopperInteractionDevice) o; return Objects.equals(this.locale, shopperInteractionDevice.locale) + && Objects.equals(this.isSetLocale, shopperInteractionDevice.isSetLocale) && Objects.equals(this.os, shopperInteractionDevice.os) - && Objects.equals(this.osVersion, shopperInteractionDevice.osVersion); + && Objects.equals(this.isSetOs, shopperInteractionDevice.isSetOs) + && Objects.equals(this.osVersion, shopperInteractionDevice.osVersion) + && Objects.equals(this.isSetOsVersion, shopperInteractionDevice.isSetOsVersion); } @Override public int hashCode() { - return Objects.hash(locale, os, osVersion); + return Objects.hash(locale, isSetLocale, os, isSetOs, osVersion, isSetOsVersion); } @Override @@ -175,6 +221,36 @@ 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 (isSetLocale) { + addIfNull(nulls, JSON_PROPERTY_LOCALE, this.locale); + } + if (isSetOs) { + addIfNull(nulls, JSON_PROPERTY_OS, this.os); + } + if (isSetOsVersion) { + addIfNull(nulls, JSON_PROPERTY_OS_VERSION, this.osVersion); + } + + 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 ShopperInteractionDevice given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/Split.java b/src/main/java/com/adyen/model/payment/Split.java index af5bc6949..c901ad7e8 100644 --- a/src/main/java/com/adyen/model/payment/Split.java +++ b/src/main/java/com/adyen/model/payment/Split.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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,15 +35,27 @@ public class Split { public static final String JSON_PROPERTY_ACCOUNT = "account"; private String account; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccount = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private SplitAmount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + 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_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * The part of the payment you want to book to the specified `account`. Possible values * for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * @@ -139,6 +153,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 Split() {} /** @@ -163,6 +186,7 @@ public Split() {} */ public Split account(String account) { this.account = account; + isSetAccount = true; // mark as set return this; } @@ -214,6 +238,7 @@ public String getAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccount(String account) { this.account = account; + isSetAccount = true; // mark as set } /** @@ -224,6 +249,7 @@ public void setAccount(String account) { */ public Split amount(SplitAmount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -247,6 +273,7 @@ public SplitAmount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(SplitAmount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -257,6 +284,7 @@ public void setAmount(SplitAmount amount) { */ public Split description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -280,6 +308,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -300,6 +329,7 @@ public void setDescription(String description) { */ public Split reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -343,6 +373,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -400,6 +431,7 @@ public void setReference(String reference) { */ public Split type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -517,6 +549,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 Split 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 Split object is equal to o. */ @@ -530,15 +583,30 @@ public boolean equals(Object o) { } Split split = (Split) o; return Objects.equals(this.account, split.account) + && Objects.equals(this.isSetAccount, split.isSetAccount) && Objects.equals(this.amount, split.amount) + && Objects.equals(this.isSetAmount, split.isSetAmount) && Objects.equals(this.description, split.description) + && Objects.equals(this.isSetDescription, split.isSetDescription) && Objects.equals(this.reference, split.reference) - && Objects.equals(this.type, split.type); + && Objects.equals(this.isSetReference, split.isSetReference) + && Objects.equals(this.type, split.type) + && Objects.equals(this.isSetType, split.isSetType); } @Override public int hashCode() { - return Objects.hash(account, amount, description, reference, type); + return Objects.hash( + account, + isSetAccount, + amount, + isSetAmount, + description, + isSetDescription, + reference, + isSetReference, + type, + isSetType); } @Override @@ -564,6 +632,42 @@ 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 (isSetAccount) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT, this.account); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + 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 Split given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/SplitAmount.java b/src/main/java/com/adyen/model/payment/SplitAmount.java index dbbd345eb..b0a7c30d4 100644 --- a/src/main/java/com/adyen/model/payment/SplitAmount.java +++ b/src/main/java/com/adyen/model/payment/SplitAmount.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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,9 +25,21 @@ public class SplitAmount { 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 SplitAmount() {} /** @@ -40,6 +54,7 @@ public SplitAmount() {} */ public SplitAmount currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -71,6 +86,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -83,6 +99,7 @@ public void setCurrency(String currency) { */ public SplitAmount value(Long value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -110,6 +127,27 @@ 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 SplitAmount 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 SplitAmount object is equal to o. */ @@ -123,12 +161,14 @@ public boolean equals(Object o) { } SplitAmount splitAmount = (SplitAmount) o; return Objects.equals(this.currency, splitAmount.currency) - && Objects.equals(this.value, splitAmount.value); + && Objects.equals(this.isSetCurrency, splitAmount.isSetCurrency) + && Objects.equals(this.value, splitAmount.value) + && Objects.equals(this.isSetValue, splitAmount.isSetValue); } @Override public int hashCode() { - return Objects.hash(currency, value); + return Objects.hash(currency, isSetCurrency, value, isSetValue); } @Override @@ -151,6 +191,33 @@ 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 SplitAmount given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/SubMerchant.java b/src/main/java/com/adyen/model/payment/SubMerchant.java index 8d7a8f070..5039d7a67 100644 --- a/src/main/java/com/adyen/model/payment/SubMerchant.java +++ b/src/main/java/com/adyen/model/payment/SubMerchant.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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,18 +31,39 @@ public class SubMerchant { public static final String JSON_PROPERTY_CITY = "city"; private String city; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_TAX_ID = "taxId"; private String taxId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SubMerchant() {} /** @@ -53,6 +76,7 @@ public SubMerchant() {} */ public SubMerchant city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -80,6 +104,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -94,6 +119,7 @@ public void setCity(String city) { */ public SubMerchant country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -125,6 +151,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -137,6 +164,7 @@ public void setCountry(String country) { */ public SubMerchant mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -164,6 +192,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -178,6 +207,7 @@ public void setMcc(String mcc) { */ public SubMerchant name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -209,6 +239,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -221,6 +252,7 @@ public void setName(String name) { */ public SubMerchant taxId(String taxId) { this.taxId = taxId; + isSetTaxId = true; // mark as set return this; } @@ -248,6 +280,27 @@ public String getTaxId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxId(String taxId) { this.taxId = taxId; + isSetTaxId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SubMerchant 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 SubMerchant object is equal to o. */ @@ -261,15 +314,21 @@ public boolean equals(Object o) { } SubMerchant subMerchant = (SubMerchant) o; return Objects.equals(this.city, subMerchant.city) + && Objects.equals(this.isSetCity, subMerchant.isSetCity) && Objects.equals(this.country, subMerchant.country) + && Objects.equals(this.isSetCountry, subMerchant.isSetCountry) && Objects.equals(this.mcc, subMerchant.mcc) + && Objects.equals(this.isSetMcc, subMerchant.isSetMcc) && Objects.equals(this.name, subMerchant.name) - && Objects.equals(this.taxId, subMerchant.taxId); + && Objects.equals(this.isSetName, subMerchant.isSetName) + && Objects.equals(this.taxId, subMerchant.taxId) + && Objects.equals(this.isSetTaxId, subMerchant.isSetTaxId); } @Override public int hashCode() { - return Objects.hash(city, country, mcc, name, taxId); + return Objects.hash( + city, isSetCity, country, isSetCountry, mcc, isSetMcc, name, isSetName, taxId, isSetTaxId); } @Override @@ -295,6 +354,42 @@ 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 (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetTaxId) { + addIfNull(nulls, JSON_PROPERTY_TAX_ID, this.taxId); + } + + 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 SubMerchant given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/TechnicalCancelRequest.java b/src/main/java/com/adyen/model/payment/TechnicalCancelRequest.java index 60e6e4f53..229a89398 100644 --- a/src/main/java/com/adyen/model/payment/TechnicalCancelRequest.java +++ b/src/main/java/com/adyen/model/payment/TechnicalCancelRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -38,34 +40,70 @@ public class TechnicalCancelRequest { public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_MODIFICATION_AMOUNT = "modificationAmount"; private Amount modificationAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationAmount = false; + public static final String JSON_PROPERTY_MPI_DATA = "mpiData"; private ThreeDSecureData mpiData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMpiData = false; + public static final String JSON_PROPERTY_ORIGINAL_MERCHANT_REFERENCE = "originalMerchantReference"; private String originalMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalMerchantReference = false; + public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; private PlatformChargebackLogic platformChargebackLogic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformChargebackLogic = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + public static final String JSON_PROPERTY_TENDER_REFERENCE = "tenderReference"; private String tenderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTenderReference = false; + public static final String JSON_PROPERTY_UNIQUE_TERMINAL_ID = "uniqueTerminalId"; private String uniqueTerminalId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUniqueTerminalId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TechnicalCancelRequest() {} /** @@ -80,6 +118,7 @@ public TechnicalCancelRequest() {} */ public TechnicalCancelRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -119,6 +158,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -129,6 +169,7 @@ public void setAdditionalData(Map additionalData) { */ public TechnicalCancelRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -152,6 +193,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -162,6 +204,7 @@ public void setMerchantAccount(String merchantAccount) { */ public TechnicalCancelRequest modificationAmount(Amount modificationAmount) { this.modificationAmount = modificationAmount; + isSetModificationAmount = true; // mark as set return this; } @@ -185,6 +228,7 @@ public Amount getModificationAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationAmount(Amount modificationAmount) { this.modificationAmount = modificationAmount; + isSetModificationAmount = true; // mark as set } /** @@ -195,6 +239,7 @@ public void setModificationAmount(Amount modificationAmount) { */ public TechnicalCancelRequest mpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set return this; } @@ -218,6 +263,7 @@ public ThreeDSecureData getMpiData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set } /** @@ -228,6 +274,7 @@ public void setMpiData(ThreeDSecureData mpiData) { */ public TechnicalCancelRequest originalMerchantReference(String originalMerchantReference) { this.originalMerchantReference = originalMerchantReference; + isSetOriginalMerchantReference = true; // mark as set return this; } @@ -251,6 +298,7 @@ public String getOriginalMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalMerchantReference(String originalMerchantReference) { this.originalMerchantReference = originalMerchantReference; + isSetOriginalMerchantReference = true; // mark as set } /** @@ -262,6 +310,7 @@ public void setOriginalMerchantReference(String originalMerchantReference) { public TechnicalCancelRequest platformChargebackLogic( PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -285,6 +334,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -297,6 +347,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public TechnicalCancelRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -324,6 +375,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -338,6 +390,7 @@ public void setReference(String reference) { */ public TechnicalCancelRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -377,6 +430,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -388,6 +442,7 @@ public void setSplits(List splits) { */ public TechnicalCancelRequest tenderReference(String tenderReference) { this.tenderReference = tenderReference; + isSetTenderReference = true; // mark as set return this; } @@ -413,6 +468,7 @@ public String getTenderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTenderReference(String tenderReference) { this.tenderReference = tenderReference; + isSetTenderReference = true; // mark as set } /** @@ -425,6 +481,7 @@ public void setTenderReference(String tenderReference) { */ public TechnicalCancelRequest uniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set return this; } @@ -452,6 +509,27 @@ public String getUniqueTerminalId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TechnicalCancelRequest 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 TechnicalCancelRequest object is equal to o. */ @@ -465,32 +543,56 @@ public boolean equals(Object o) { } TechnicalCancelRequest technicalCancelRequest = (TechnicalCancelRequest) o; return Objects.equals(this.additionalData, technicalCancelRequest.additionalData) + && Objects.equals(this.isSetAdditionalData, technicalCancelRequest.isSetAdditionalData) && Objects.equals(this.merchantAccount, technicalCancelRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, technicalCancelRequest.isSetMerchantAccount) && Objects.equals(this.modificationAmount, technicalCancelRequest.modificationAmount) + && Objects.equals( + this.isSetModificationAmount, technicalCancelRequest.isSetModificationAmount) && Objects.equals(this.mpiData, technicalCancelRequest.mpiData) + && Objects.equals(this.isSetMpiData, technicalCancelRequest.isSetMpiData) && Objects.equals( this.originalMerchantReference, technicalCancelRequest.originalMerchantReference) + && Objects.equals( + this.isSetOriginalMerchantReference, + technicalCancelRequest.isSetOriginalMerchantReference) && Objects.equals( this.platformChargebackLogic, technicalCancelRequest.platformChargebackLogic) + && Objects.equals( + this.isSetPlatformChargebackLogic, technicalCancelRequest.isSetPlatformChargebackLogic) && Objects.equals(this.reference, technicalCancelRequest.reference) + && Objects.equals(this.isSetReference, technicalCancelRequest.isSetReference) && Objects.equals(this.splits, technicalCancelRequest.splits) + && Objects.equals(this.isSetSplits, technicalCancelRequest.isSetSplits) && Objects.equals(this.tenderReference, technicalCancelRequest.tenderReference) - && Objects.equals(this.uniqueTerminalId, technicalCancelRequest.uniqueTerminalId); + && Objects.equals(this.isSetTenderReference, technicalCancelRequest.isSetTenderReference) + && Objects.equals(this.uniqueTerminalId, technicalCancelRequest.uniqueTerminalId) + && Objects.equals(this.isSetUniqueTerminalId, technicalCancelRequest.isSetUniqueTerminalId); } @Override public int hashCode() { return Objects.hash( additionalData, + isSetAdditionalData, merchantAccount, + isSetMerchantAccount, modificationAmount, + isSetModificationAmount, mpiData, + isSetMpiData, originalMerchantReference, + isSetOriginalMerchantReference, platformChargebackLogic, + isSetPlatformChargebackLogic, reference, + isSetReference, splits, + isSetSplits, tenderReference, - uniqueTerminalId); + isSetTenderReference, + uniqueTerminalId, + isSetUniqueTerminalId); } @Override @@ -525,6 +627,57 @@ 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 (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetModificationAmount) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_AMOUNT, this.modificationAmount); + } + if (isSetMpiData) { + addIfNull(nulls, JSON_PROPERTY_MPI_DATA, this.mpiData); + } + if (isSetOriginalMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_MERCHANT_REFERENCE, this.originalMerchantReference); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetTenderReference) { + addIfNull(nulls, JSON_PROPERTY_TENDER_REFERENCE, this.tenderReference); + } + if (isSetUniqueTerminalId) { + addIfNull(nulls, JSON_PROPERTY_UNIQUE_TERMINAL_ID, this.uniqueTerminalId); + } + + 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 TechnicalCancelRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ThreeDS1Result.java b/src/main/java/com/adyen/model/payment/ThreeDS1Result.java index 2953881bf..14540df00 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDS1Result.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS1Result.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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,22 +32,46 @@ public class ThreeDS1Result { public static final String JSON_PROPERTY_CAVV = "cavv"; private String cavv; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCavv = false; + public static final String JSON_PROPERTY_CAVV_ALGORITHM = "cavvAlgorithm"; private String cavvAlgorithm; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCavvAlgorithm = false; + public static final String JSON_PROPERTY_ECI = "eci"; private String eci; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEci = false; + public static final String JSON_PROPERTY_THREE_D_AUTHENTICATED_RESPONSE = "threeDAuthenticatedResponse"; private String threeDAuthenticatedResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDAuthenticatedResponse = false; + public static final String JSON_PROPERTY_THREE_D_OFFERED_RESPONSE = "threeDOfferedResponse"; private String threeDOfferedResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDOfferedResponse = false; + public static final String JSON_PROPERTY_XID = "xid"; private String xid; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetXid = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDS1Result() {} /** @@ -56,6 +82,7 @@ public ThreeDS1Result() {} */ public ThreeDS1Result cavv(String cavv) { this.cavv = cavv; + isSetCavv = true; // mark as set return this; } @@ -79,6 +106,7 @@ public String getCavv() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCavv(String cavv) { this.cavv = cavv; + isSetCavv = true; // mark as set } /** @@ -89,6 +117,7 @@ public void setCavv(String cavv) { */ public ThreeDS1Result cavvAlgorithm(String cavvAlgorithm) { this.cavvAlgorithm = cavvAlgorithm; + isSetCavvAlgorithm = true; // mark as set return this; } @@ -112,6 +141,7 @@ public String getCavvAlgorithm() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCavvAlgorithm(String cavvAlgorithm) { this.cavvAlgorithm = cavvAlgorithm; + isSetCavvAlgorithm = true; // mark as set } /** @@ -122,6 +152,7 @@ public void setCavvAlgorithm(String cavvAlgorithm) { */ public ThreeDS1Result eci(String eci) { this.eci = eci; + isSetEci = true; // mark as set return this; } @@ -145,6 +176,7 @@ public String getEci() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEci(String eci) { this.eci = eci; + isSetEci = true; // mark as set } /** @@ -155,6 +187,7 @@ public void setEci(String eci) { */ public ThreeDS1Result threeDAuthenticatedResponse(String threeDAuthenticatedResponse) { this.threeDAuthenticatedResponse = threeDAuthenticatedResponse; + isSetThreeDAuthenticatedResponse = true; // mark as set return this; } @@ -178,6 +211,7 @@ public String getThreeDAuthenticatedResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDAuthenticatedResponse(String threeDAuthenticatedResponse) { this.threeDAuthenticatedResponse = threeDAuthenticatedResponse; + isSetThreeDAuthenticatedResponse = true; // mark as set } /** @@ -188,6 +222,7 @@ public void setThreeDAuthenticatedResponse(String threeDAuthenticatedResponse) { */ public ThreeDS1Result threeDOfferedResponse(String threeDOfferedResponse) { this.threeDOfferedResponse = threeDOfferedResponse; + isSetThreeDOfferedResponse = true; // mark as set return this; } @@ -211,6 +246,7 @@ public String getThreeDOfferedResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDOfferedResponse(String threeDOfferedResponse) { this.threeDOfferedResponse = threeDOfferedResponse; + isSetThreeDOfferedResponse = true; // mark as set } /** @@ -223,6 +259,7 @@ public void setThreeDOfferedResponse(String threeDOfferedResponse) { */ public ThreeDS1Result xid(String xid) { this.xid = xid; + isSetXid = true; // mark as set return this; } @@ -250,6 +287,27 @@ public String getXid() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setXid(String xid) { this.xid = xid; + isSetXid = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDS1Result 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 ThreeDS1Result object is equal to o. */ @@ -263,18 +321,37 @@ public boolean equals(Object o) { } ThreeDS1Result threeDS1Result = (ThreeDS1Result) o; return Objects.equals(this.cavv, threeDS1Result.cavv) + && Objects.equals(this.isSetCavv, threeDS1Result.isSetCavv) && Objects.equals(this.cavvAlgorithm, threeDS1Result.cavvAlgorithm) + && Objects.equals(this.isSetCavvAlgorithm, threeDS1Result.isSetCavvAlgorithm) && Objects.equals(this.eci, threeDS1Result.eci) + && Objects.equals(this.isSetEci, threeDS1Result.isSetEci) && Objects.equals( this.threeDAuthenticatedResponse, threeDS1Result.threeDAuthenticatedResponse) + && Objects.equals( + this.isSetThreeDAuthenticatedResponse, threeDS1Result.isSetThreeDAuthenticatedResponse) && Objects.equals(this.threeDOfferedResponse, threeDS1Result.threeDOfferedResponse) - && Objects.equals(this.xid, threeDS1Result.xid); + && Objects.equals( + this.isSetThreeDOfferedResponse, threeDS1Result.isSetThreeDOfferedResponse) + && Objects.equals(this.xid, threeDS1Result.xid) + && Objects.equals(this.isSetXid, threeDS1Result.isSetXid); } @Override public int hashCode() { return Objects.hash( - cavv, cavvAlgorithm, eci, threeDAuthenticatedResponse, threeDOfferedResponse, xid); + cavv, + isSetCavv, + cavvAlgorithm, + isSetCavvAlgorithm, + eci, + isSetEci, + threeDAuthenticatedResponse, + isSetThreeDAuthenticatedResponse, + threeDOfferedResponse, + isSetThreeDOfferedResponse, + xid, + isSetXid); } @Override @@ -305,6 +382,46 @@ 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 (isSetCavv) { + addIfNull(nulls, JSON_PROPERTY_CAVV, this.cavv); + } + if (isSetCavvAlgorithm) { + addIfNull(nulls, JSON_PROPERTY_CAVV_ALGORITHM, this.cavvAlgorithm); + } + if (isSetEci) { + addIfNull(nulls, JSON_PROPERTY_ECI, this.eci); + } + if (isSetThreeDAuthenticatedResponse) { + addIfNull( + nulls, JSON_PROPERTY_THREE_D_AUTHENTICATED_RESPONSE, this.threeDAuthenticatedResponse); + } + if (isSetThreeDOfferedResponse) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_OFFERED_RESPONSE, this.threeDOfferedResponse); + } + if (isSetXid) { + addIfNull(nulls, JSON_PROPERTY_XID, this.xid); + } + + 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 ThreeDS1Result given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java b/src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java index 45a8754a1..fd2b31fae 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -67,6 +69,9 @@ public class ThreeDS2RequestData { public static final String JSON_PROPERTY_ACCT_INFO = "acctInfo"; private AcctInfo acctInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcctInfo = false; + /** * Indicates the type of account. For example, for a multi-account card product. Length: 2 * characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit @@ -116,12 +121,21 @@ public static AcctTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCT_TYPE = "acctType"; private AcctTypeEnum acctType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcctType = false; + public static final String JSON_PROPERTY_ACQUIRER_B_I_N = "acquirerBIN"; private String acquirerBIN; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerBIN = false; + public static final String JSON_PROPERTY_ACQUIRER_MERCHANT_I_D = "acquirerMerchantID"; private String acquirerMerchantID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerMerchantID = false; + /** * Indicates whether the cardholder shipping address and cardholder billing address are the same. * Allowed values: * **Y** — Shipping address matches billing address. * **N** — Shipping address @@ -170,10 +184,16 @@ public static AddrMatchEnum fromValue(String value) { public static final String JSON_PROPERTY_ADDR_MATCH = "addrMatch"; private AddrMatchEnum addrMatch; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddrMatch = false; + public static final String JSON_PROPERTY_AUTHENTICATION_ONLY = "authenticationOnly"; @Deprecated // deprecated since Adyen Payment API v50: Use `threeDSAuthenticationOnly` instead. private Boolean authenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationOnly = false; + /** * Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * * `noPreference` * `requestNoChallenge` * `requestChallenge` * @@ -227,78 +247,150 @@ public static ChallengeIndicatorEnum fromValue(String value) { @Deprecated // deprecated since Adyen Payment API v68: Use `threeDSRequestorChallengeInd` instead. private ChallengeIndicatorEnum challengeIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChallengeIndicator = false; + public static final String JSON_PROPERTY_DEVICE_CHANNEL = "deviceChannel"; private String deviceChannel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceChannel = false; + public static final String JSON_PROPERTY_DEVICE_RENDER_OPTIONS = "deviceRenderOptions"; private DeviceRenderOptions deviceRenderOptions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceRenderOptions = false; + public static final String JSON_PROPERTY_HOME_PHONE = "homePhone"; private Phone homePhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHomePhone = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_MERCHANT_NAME = "merchantName"; private String merchantName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantName = false; + public static final String JSON_PROPERTY_MESSAGE_VERSION = "messageVersion"; private String messageVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessageVersion = false; + public static final String JSON_PROPERTY_MOBILE_PHONE = "mobilePhone"; private Phone mobilePhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMobilePhone = false; + public static final String JSON_PROPERTY_NOTIFICATION_U_R_L = "notificationURL"; private String notificationURL; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationURL = false; + public static final String JSON_PROPERTY_PAY_TOKEN_IND = "payTokenInd"; private Boolean payTokenInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayTokenInd = false; + public static final String JSON_PROPERTY_PAYMENT_AUTHENTICATION_USE_CASE = "paymentAuthenticationUseCase"; private String paymentAuthenticationUseCase; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentAuthenticationUseCase = false; + public static final String JSON_PROPERTY_PURCHASE_INSTAL_DATA = "purchaseInstalData"; private String purchaseInstalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPurchaseInstalData = false; + public static final String JSON_PROPERTY_RECURRING_EXPIRY = "recurringExpiry"; private String recurringExpiry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringExpiry = false; + public static final String JSON_PROPERTY_RECURRING_FREQUENCY = "recurringFrequency"; private String recurringFrequency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringFrequency = false; + public static final String JSON_PROPERTY_SDK_APP_I_D = "sdkAppID"; private String sdkAppID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkAppID = false; + public static final String JSON_PROPERTY_SDK_ENC_DATA = "sdkEncData"; private String sdkEncData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkEncData = false; + public static final String JSON_PROPERTY_SDK_EPHEM_PUB_KEY = "sdkEphemPubKey"; private SDKEphemPubKey sdkEphemPubKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkEphemPubKey = false; + public static final String JSON_PROPERTY_SDK_MAX_TIMEOUT = "sdkMaxTimeout"; private Integer sdkMaxTimeout; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkMaxTimeout = false; + public static final String JSON_PROPERTY_SDK_REFERENCE_NUMBER = "sdkReferenceNumber"; private String sdkReferenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkReferenceNumber = false; + public static final String JSON_PROPERTY_SDK_TRANS_I_D = "sdkTransID"; private String sdkTransID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkTransID = false; + public static final String JSON_PROPERTY_SDK_VERSION = "sdkVersion"; private String sdkVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkVersion = false; + public static final String JSON_PROPERTY_THREE_D_S_COMP_IND = "threeDSCompInd"; private String threeDSCompInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSCompInd = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_AUTHENTICATION_IND = "threeDSRequestorAuthenticationInd"; private String threeDSRequestorAuthenticationInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorAuthenticationInd = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_AUTHENTICATION_INFO = "threeDSRequestorAuthenticationInfo"; private ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorAuthenticationInfo = false; + /** * Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No * preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor @@ -358,19 +450,34 @@ public static ThreeDSRequestorChallengeIndEnum fromValue(String value) { "threeDSRequestorChallengeInd"; private ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorChallengeInd = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_I_D = "threeDSRequestorID"; private String threeDSRequestorID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorID = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_NAME = "threeDSRequestorName"; private String threeDSRequestorName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorName = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_PRIOR_AUTHENTICATION_INFO = "threeDSRequestorPriorAuthenticationInfo"; private ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorPriorAuthenticationInfo = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_U_R_L = "threeDSRequestorURL"; private String threeDSRequestorURL; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorURL = false; + /** * Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** @@ -425,6 +532,9 @@ public static TransTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TRANS_TYPE = "transType"; private TransTypeEnum transType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransType = false; + /** Identify the type of the transaction being authenticated. */ public enum TransactionTypeEnum { GOODSORSERVICEPURCHASE(String.valueOf("goodsOrServicePurchase")), @@ -475,12 +585,27 @@ public static TransactionTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TRANSACTION_TYPE = "transactionType"; private TransactionTypeEnum transactionType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionType = false; + public static final String JSON_PROPERTY_WHITE_LIST_STATUS = "whiteListStatus"; private String whiteListStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWhiteListStatus = false; + public static final String JSON_PROPERTY_WORK_PHONE = "workPhone"; private Phone workPhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWorkPhone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDS2RequestData() {} /** @@ -491,6 +616,7 @@ public ThreeDS2RequestData() {} */ public ThreeDS2RequestData acctInfo(AcctInfo acctInfo) { this.acctInfo = acctInfo; + isSetAcctInfo = true; // mark as set return this; } @@ -514,6 +640,7 @@ public AcctInfo getAcctInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcctInfo(AcctInfo acctInfo) { this.acctInfo = acctInfo; + isSetAcctInfo = true; // mark as set } /** @@ -527,6 +654,7 @@ public void setAcctInfo(AcctInfo acctInfo) { */ public ThreeDS2RequestData acctType(AcctTypeEnum acctType) { this.acctType = acctType; + isSetAcctType = true; // mark as set return this; } @@ -556,6 +684,7 @@ public AcctTypeEnum getAcctType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcctType(AcctTypeEnum acctType) { this.acctType = acctType; + isSetAcctType = true; // mark as set } /** @@ -572,6 +701,7 @@ public void setAcctType(AcctTypeEnum acctType) { */ public ThreeDS2RequestData acquirerBIN(String acquirerBIN) { this.acquirerBIN = acquirerBIN; + isSetAcquirerBIN = true; // mark as set return this; } @@ -607,6 +737,7 @@ public String getAcquirerBIN() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerBIN(String acquirerBIN) { this.acquirerBIN = acquirerBIN; + isSetAcquirerBIN = true; // mark as set } /** @@ -624,6 +755,7 @@ public void setAcquirerBIN(String acquirerBIN) { */ public ThreeDS2RequestData acquirerMerchantID(String acquirerMerchantID) { this.acquirerMerchantID = acquirerMerchantID; + isSetAcquirerMerchantID = true; // mark as set return this; } @@ -661,6 +793,7 @@ public String getAcquirerMerchantID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerMerchantID(String acquirerMerchantID) { this.acquirerMerchantID = acquirerMerchantID; + isSetAcquirerMerchantID = true; // mark as set } /** @@ -675,6 +808,7 @@ public void setAcquirerMerchantID(String acquirerMerchantID) { */ public ThreeDS2RequestData addrMatch(AddrMatchEnum addrMatch) { this.addrMatch = addrMatch; + isSetAddrMatch = true; // mark as set return this; } @@ -706,6 +840,7 @@ public AddrMatchEnum getAddrMatch() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddrMatch(AddrMatchEnum addrMatch) { this.addrMatch = addrMatch; + isSetAddrMatch = true; // mark as set } /** @@ -722,6 +857,7 @@ public void setAddrMatch(AddrMatchEnum addrMatch) { @Deprecated // deprecated since Adyen Payment API v50: Use `threeDSAuthenticationOnly` instead. public ThreeDS2RequestData authenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; + isSetAuthenticationOnly = true; // mark as set return this; } @@ -757,6 +893,7 @@ public Boolean getAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; + isSetAuthenticationOnly = true; // mark as set } /** @@ -773,6 +910,7 @@ public void setAuthenticationOnly(Boolean authenticationOnly) { @Deprecated // deprecated since Adyen Payment API v68: Use `threeDSRequestorChallengeInd` instead. public ThreeDS2RequestData challengeIndicator(ChallengeIndicatorEnum challengeIndicator) { this.challengeIndicator = challengeIndicator; + isSetChallengeIndicator = true; // mark as set return this; } @@ -809,6 +947,7 @@ public ChallengeIndicatorEnum getChallengeIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallengeIndicator(ChallengeIndicatorEnum challengeIndicator) { this.challengeIndicator = challengeIndicator; + isSetChallengeIndicator = true; // mark as set } /** @@ -820,6 +959,7 @@ public void setChallengeIndicator(ChallengeIndicatorEnum challengeIndicator) { */ public ThreeDS2RequestData deviceChannel(String deviceChannel) { this.deviceChannel = deviceChannel; + isSetDeviceChannel = true; // mark as set return this; } @@ -845,6 +985,7 @@ public String getDeviceChannel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceChannel(String deviceChannel) { this.deviceChannel = deviceChannel; + isSetDeviceChannel = true; // mark as set } /** @@ -855,6 +996,7 @@ public void setDeviceChannel(String deviceChannel) { */ public ThreeDS2RequestData deviceRenderOptions(DeviceRenderOptions deviceRenderOptions) { this.deviceRenderOptions = deviceRenderOptions; + isSetDeviceRenderOptions = true; // mark as set return this; } @@ -878,6 +1020,7 @@ public DeviceRenderOptions getDeviceRenderOptions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceRenderOptions(DeviceRenderOptions deviceRenderOptions) { this.deviceRenderOptions = deviceRenderOptions; + isSetDeviceRenderOptions = true; // mark as set } /** @@ -888,6 +1031,7 @@ public void setDeviceRenderOptions(DeviceRenderOptions deviceRenderOptions) { */ public ThreeDS2RequestData homePhone(Phone homePhone) { this.homePhone = homePhone; + isSetHomePhone = true; // mark as set return this; } @@ -911,6 +1055,7 @@ public Phone getHomePhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHomePhone(Phone homePhone) { this.homePhone = homePhone; + isSetHomePhone = true; // mark as set } /** @@ -929,6 +1074,7 @@ public void setHomePhone(Phone homePhone) { */ public ThreeDS2RequestData mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -968,6 +1114,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -992,6 +1139,7 @@ public void setMcc(String mcc) { */ public ThreeDS2RequestData merchantName(String merchantName) { this.merchantName = merchantName; + isSetMerchantName = true; // mark as set return this; } @@ -1043,6 +1191,7 @@ public String getMerchantName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantName(String merchantName) { this.merchantName = merchantName; + isSetMerchantName = true; // mark as set } /** @@ -1054,6 +1203,7 @@ public void setMerchantName(String merchantName) { */ public ThreeDS2RequestData messageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set return this; } @@ -1079,6 +1229,7 @@ public String getMessageVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set } /** @@ -1089,6 +1240,7 @@ public void setMessageVersion(String messageVersion) { */ public ThreeDS2RequestData mobilePhone(Phone mobilePhone) { this.mobilePhone = mobilePhone; + isSetMobilePhone = true; // mark as set return this; } @@ -1112,6 +1264,7 @@ public Phone getMobilePhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMobilePhone(Phone mobilePhone) { this.mobilePhone = mobilePhone; + isSetMobilePhone = true; // mark as set } /** @@ -1126,6 +1279,7 @@ public void setMobilePhone(Phone mobilePhone) { */ public ThreeDS2RequestData notificationURL(String notificationURL) { this.notificationURL = notificationURL; + isSetNotificationURL = true; // mark as set return this; } @@ -1157,6 +1311,7 @@ public String getNotificationURL() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationURL(String notificationURL) { this.notificationURL = notificationURL; + isSetNotificationURL = true; // mark as set } /** @@ -1169,6 +1324,7 @@ public void setNotificationURL(String notificationURL) { */ public ThreeDS2RequestData payTokenInd(Boolean payTokenInd) { this.payTokenInd = payTokenInd; + isSetPayTokenInd = true; // mark as set return this; } @@ -1196,6 +1352,7 @@ public Boolean getPayTokenInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayTokenInd(Boolean payTokenInd) { this.payTokenInd = payTokenInd; + isSetPayTokenInd = true; // mark as set } /** @@ -1207,6 +1364,7 @@ public void setPayTokenInd(Boolean payTokenInd) { */ public ThreeDS2RequestData paymentAuthenticationUseCase(String paymentAuthenticationUseCase) { this.paymentAuthenticationUseCase = paymentAuthenticationUseCase; + isSetPaymentAuthenticationUseCase = true; // mark as set return this; } @@ -1232,6 +1390,7 @@ public String getPaymentAuthenticationUseCase() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentAuthenticationUseCase(String paymentAuthenticationUseCase) { this.paymentAuthenticationUseCase = paymentAuthenticationUseCase; + isSetPaymentAuthenticationUseCase = true; // mark as set } /** @@ -1244,6 +1403,7 @@ public void setPaymentAuthenticationUseCase(String paymentAuthenticationUseCase) */ public ThreeDS2RequestData purchaseInstalData(String purchaseInstalData) { this.purchaseInstalData = purchaseInstalData; + isSetPurchaseInstalData = true; // mark as set return this; } @@ -1271,6 +1431,7 @@ public String getPurchaseInstalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPurchaseInstalData(String purchaseInstalData) { this.purchaseInstalData = purchaseInstalData; + isSetPurchaseInstalData = true; // mark as set } /** @@ -1282,6 +1443,7 @@ public void setPurchaseInstalData(String purchaseInstalData) { */ public ThreeDS2RequestData recurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set return this; } @@ -1307,6 +1469,7 @@ public String getRecurringExpiry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set } /** @@ -1318,6 +1481,7 @@ public void setRecurringExpiry(String recurringExpiry) { */ public ThreeDS2RequestData recurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set return this; } @@ -1343,6 +1507,7 @@ public String getRecurringFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set } /** @@ -1355,6 +1520,7 @@ public void setRecurringFrequency(String recurringFrequency) { */ public ThreeDS2RequestData sdkAppID(String sdkAppID) { this.sdkAppID = sdkAppID; + isSetSdkAppID = true; // mark as set return this; } @@ -1382,6 +1548,7 @@ public String getSdkAppID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkAppID(String sdkAppID) { this.sdkAppID = sdkAppID; + isSetSdkAppID = true; // mark as set } /** @@ -1394,6 +1561,7 @@ public void setSdkAppID(String sdkAppID) { */ public ThreeDS2RequestData sdkEncData(String sdkEncData) { this.sdkEncData = sdkEncData; + isSetSdkEncData = true; // mark as set return this; } @@ -1421,6 +1589,7 @@ public String getSdkEncData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkEncData(String sdkEncData) { this.sdkEncData = sdkEncData; + isSetSdkEncData = true; // mark as set } /** @@ -1431,6 +1600,7 @@ public void setSdkEncData(String sdkEncData) { */ public ThreeDS2RequestData sdkEphemPubKey(SDKEphemPubKey sdkEphemPubKey) { this.sdkEphemPubKey = sdkEphemPubKey; + isSetSdkEphemPubKey = true; // mark as set return this; } @@ -1454,6 +1624,7 @@ public SDKEphemPubKey getSdkEphemPubKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkEphemPubKey(SDKEphemPubKey sdkEphemPubKey) { this.sdkEphemPubKey = sdkEphemPubKey; + isSetSdkEphemPubKey = true; // mark as set } /** @@ -1467,6 +1638,7 @@ public void setSdkEphemPubKey(SDKEphemPubKey sdkEphemPubKey) { */ public ThreeDS2RequestData sdkMaxTimeout(Integer sdkMaxTimeout) { this.sdkMaxTimeout = sdkMaxTimeout; + isSetSdkMaxTimeout = true; // mark as set return this; } @@ -1496,6 +1668,7 @@ public Integer getSdkMaxTimeout() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkMaxTimeout(Integer sdkMaxTimeout) { this.sdkMaxTimeout = sdkMaxTimeout; + isSetSdkMaxTimeout = true; // mark as set } /** @@ -1508,6 +1681,7 @@ public void setSdkMaxTimeout(Integer sdkMaxTimeout) { */ public ThreeDS2RequestData sdkReferenceNumber(String sdkReferenceNumber) { this.sdkReferenceNumber = sdkReferenceNumber; + isSetSdkReferenceNumber = true; // mark as set return this; } @@ -1535,6 +1709,7 @@ public String getSdkReferenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkReferenceNumber(String sdkReferenceNumber) { this.sdkReferenceNumber = sdkReferenceNumber; + isSetSdkReferenceNumber = true; // mark as set } /** @@ -1547,6 +1722,7 @@ public void setSdkReferenceNumber(String sdkReferenceNumber) { */ public ThreeDS2RequestData sdkTransID(String sdkTransID) { this.sdkTransID = sdkTransID; + isSetSdkTransID = true; // mark as set return this; } @@ -1574,6 +1750,7 @@ public String getSdkTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkTransID(String sdkTransID) { this.sdkTransID = sdkTransID; + isSetSdkTransID = true; // mark as set } /** @@ -1585,6 +1762,7 @@ public void setSdkTransID(String sdkTransID) { */ public ThreeDS2RequestData sdkVersion(String sdkVersion) { this.sdkVersion = sdkVersion; + isSetSdkVersion = true; // mark as set return this; } @@ -1610,6 +1788,7 @@ public String getSdkVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkVersion(String sdkVersion) { this.sdkVersion = sdkVersion; + isSetSdkVersion = true; // mark as set } /** @@ -1620,6 +1799,7 @@ public void setSdkVersion(String sdkVersion) { */ public ThreeDS2RequestData threeDSCompInd(String threeDSCompInd) { this.threeDSCompInd = threeDSCompInd; + isSetThreeDSCompInd = true; // mark as set return this; } @@ -1643,6 +1823,7 @@ public String getThreeDSCompInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSCompInd(String threeDSCompInd) { this.threeDSCompInd = threeDSCompInd; + isSetThreeDSCompInd = true; // mark as set } /** @@ -1654,6 +1835,7 @@ public void setThreeDSCompInd(String threeDSCompInd) { public ThreeDS2RequestData threeDSRequestorAuthenticationInd( String threeDSRequestorAuthenticationInd) { this.threeDSRequestorAuthenticationInd = threeDSRequestorAuthenticationInd; + isSetThreeDSRequestorAuthenticationInd = true; // mark as set return this; } @@ -1677,6 +1859,7 @@ public String getThreeDSRequestorAuthenticationInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorAuthenticationInd(String threeDSRequestorAuthenticationInd) { this.threeDSRequestorAuthenticationInd = threeDSRequestorAuthenticationInd; + isSetThreeDSRequestorAuthenticationInd = true; // mark as set } /** @@ -1688,6 +1871,7 @@ public void setThreeDSRequestorAuthenticationInd(String threeDSRequestorAuthenti public ThreeDS2RequestData threeDSRequestorAuthenticationInfo( ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo) { this.threeDSRequestorAuthenticationInfo = threeDSRequestorAuthenticationInfo; + isSetThreeDSRequestorAuthenticationInfo = true; // mark as set return this; } @@ -1712,6 +1896,7 @@ public ThreeDSRequestorAuthenticationInfo getThreeDSRequestorAuthenticationInfo( public void setThreeDSRequestorAuthenticationInfo( ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo) { this.threeDSRequestorAuthenticationInfo = threeDSRequestorAuthenticationInfo; + isSetThreeDSRequestorAuthenticationInfo = true; // mark as set } /** @@ -1730,6 +1915,7 @@ public void setThreeDSRequestorAuthenticationInfo( public ThreeDS2RequestData threeDSRequestorChallengeInd( ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd) { this.threeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + isSetThreeDSRequestorChallengeInd = true; // mark as set return this; } @@ -1768,6 +1954,7 @@ public ThreeDSRequestorChallengeIndEnum getThreeDSRequestorChallengeInd() { public void setThreeDSRequestorChallengeInd( ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd) { this.threeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + isSetThreeDSRequestorChallengeInd = true; // mark as set } /** @@ -1784,6 +1971,7 @@ public void setThreeDSRequestorChallengeInd( */ public ThreeDS2RequestData threeDSRequestorID(String threeDSRequestorID) { this.threeDSRequestorID = threeDSRequestorID; + isSetThreeDSRequestorID = true; // mark as set return this; } @@ -1819,6 +2007,7 @@ public String getThreeDSRequestorID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorID(String threeDSRequestorID) { this.threeDSRequestorID = threeDSRequestorID; + isSetThreeDSRequestorID = true; // mark as set } /** @@ -1835,6 +2024,7 @@ public void setThreeDSRequestorID(String threeDSRequestorID) { */ public ThreeDS2RequestData threeDSRequestorName(String threeDSRequestorName) { this.threeDSRequestorName = threeDSRequestorName; + isSetThreeDSRequestorName = true; // mark as set return this; } @@ -1870,6 +2060,7 @@ public String getThreeDSRequestorName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorName(String threeDSRequestorName) { this.threeDSRequestorName = threeDSRequestorName; + isSetThreeDSRequestorName = true; // mark as set } /** @@ -1881,6 +2072,7 @@ public void setThreeDSRequestorName(String threeDSRequestorName) { public ThreeDS2RequestData threeDSRequestorPriorAuthenticationInfo( ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo) { this.threeDSRequestorPriorAuthenticationInfo = threeDSRequestorPriorAuthenticationInfo; + isSetThreeDSRequestorPriorAuthenticationInfo = true; // mark as set return this; } @@ -1905,6 +2097,7 @@ public ThreeDSRequestorPriorAuthenticationInfo getThreeDSRequestorPriorAuthentic public void setThreeDSRequestorPriorAuthenticationInfo( ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo) { this.threeDSRequestorPriorAuthenticationInfo = threeDSRequestorPriorAuthenticationInfo; + isSetThreeDSRequestorPriorAuthenticationInfo = true; // mark as set } /** @@ -1917,6 +2110,7 @@ public void setThreeDSRequestorPriorAuthenticationInfo( */ public ThreeDS2RequestData threeDSRequestorURL(String threeDSRequestorURL) { this.threeDSRequestorURL = threeDSRequestorURL; + isSetThreeDSRequestorURL = true; // mark as set return this; } @@ -1944,6 +2138,7 @@ public String getThreeDSRequestorURL() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorURL(String threeDSRequestorURL) { this.threeDSRequestorURL = threeDSRequestorURL; + isSetThreeDSRequestorURL = true; // mark as set } /** @@ -1958,6 +2153,7 @@ public void setThreeDSRequestorURL(String threeDSRequestorURL) { */ public ThreeDS2RequestData transType(TransTypeEnum transType) { this.transType = transType; + isSetTransType = true; // mark as set return this; } @@ -1989,6 +2185,7 @@ public TransTypeEnum getTransType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransType(TransTypeEnum transType) { this.transType = transType; + isSetTransType = true; // mark as set } /** @@ -1999,6 +2196,7 @@ public void setTransType(TransTypeEnum transType) { */ public ThreeDS2RequestData transactionType(TransactionTypeEnum transactionType) { this.transactionType = transactionType; + isSetTransactionType = true; // mark as set return this; } @@ -2022,6 +2220,7 @@ public TransactionTypeEnum getTransactionType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionType(TransactionTypeEnum transactionType) { this.transactionType = transactionType; + isSetTransactionType = true; // mark as set } /** @@ -2034,6 +2233,7 @@ public void setTransactionType(TransactionTypeEnum transactionType) { */ public ThreeDS2RequestData whiteListStatus(String whiteListStatus) { this.whiteListStatus = whiteListStatus; + isSetWhiteListStatus = true; // mark as set return this; } @@ -2061,6 +2261,7 @@ public String getWhiteListStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWhiteListStatus(String whiteListStatus) { this.whiteListStatus = whiteListStatus; + isSetWhiteListStatus = true; // mark as set } /** @@ -2071,6 +2272,7 @@ public void setWhiteListStatus(String whiteListStatus) { */ public ThreeDS2RequestData workPhone(Phone workPhone) { this.workPhone = workPhone; + isSetWorkPhone = true; // mark as set return this; } @@ -2094,6 +2296,27 @@ public Phone getWorkPhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWorkPhone(Phone workPhone) { this.workPhone = workPhone; + isSetWorkPhone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDS2RequestData 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 ThreeDS2RequestData object is equal to o. */ @@ -2107,96 +2330,187 @@ public boolean equals(Object o) { } ThreeDS2RequestData threeDS2RequestData = (ThreeDS2RequestData) o; return Objects.equals(this.acctInfo, threeDS2RequestData.acctInfo) + && Objects.equals(this.isSetAcctInfo, threeDS2RequestData.isSetAcctInfo) && Objects.equals(this.acctType, threeDS2RequestData.acctType) + && Objects.equals(this.isSetAcctType, threeDS2RequestData.isSetAcctType) && Objects.equals(this.acquirerBIN, threeDS2RequestData.acquirerBIN) + && Objects.equals(this.isSetAcquirerBIN, threeDS2RequestData.isSetAcquirerBIN) && Objects.equals(this.acquirerMerchantID, threeDS2RequestData.acquirerMerchantID) + && Objects.equals(this.isSetAcquirerMerchantID, threeDS2RequestData.isSetAcquirerMerchantID) && Objects.equals(this.addrMatch, threeDS2RequestData.addrMatch) + && Objects.equals(this.isSetAddrMatch, threeDS2RequestData.isSetAddrMatch) && Objects.equals(this.authenticationOnly, threeDS2RequestData.authenticationOnly) + && Objects.equals(this.isSetAuthenticationOnly, threeDS2RequestData.isSetAuthenticationOnly) && Objects.equals(this.challengeIndicator, threeDS2RequestData.challengeIndicator) + && Objects.equals(this.isSetChallengeIndicator, threeDS2RequestData.isSetChallengeIndicator) && Objects.equals(this.deviceChannel, threeDS2RequestData.deviceChannel) + && Objects.equals(this.isSetDeviceChannel, threeDS2RequestData.isSetDeviceChannel) && Objects.equals(this.deviceRenderOptions, threeDS2RequestData.deviceRenderOptions) + && Objects.equals( + this.isSetDeviceRenderOptions, threeDS2RequestData.isSetDeviceRenderOptions) && Objects.equals(this.homePhone, threeDS2RequestData.homePhone) + && Objects.equals(this.isSetHomePhone, threeDS2RequestData.isSetHomePhone) && Objects.equals(this.mcc, threeDS2RequestData.mcc) + && Objects.equals(this.isSetMcc, threeDS2RequestData.isSetMcc) && Objects.equals(this.merchantName, threeDS2RequestData.merchantName) + && Objects.equals(this.isSetMerchantName, threeDS2RequestData.isSetMerchantName) && Objects.equals(this.messageVersion, threeDS2RequestData.messageVersion) + && Objects.equals(this.isSetMessageVersion, threeDS2RequestData.isSetMessageVersion) && Objects.equals(this.mobilePhone, threeDS2RequestData.mobilePhone) + && Objects.equals(this.isSetMobilePhone, threeDS2RequestData.isSetMobilePhone) && Objects.equals(this.notificationURL, threeDS2RequestData.notificationURL) + && Objects.equals(this.isSetNotificationURL, threeDS2RequestData.isSetNotificationURL) && Objects.equals(this.payTokenInd, threeDS2RequestData.payTokenInd) + && Objects.equals(this.isSetPayTokenInd, threeDS2RequestData.isSetPayTokenInd) && Objects.equals( this.paymentAuthenticationUseCase, threeDS2RequestData.paymentAuthenticationUseCase) + && Objects.equals( + this.isSetPaymentAuthenticationUseCase, + threeDS2RequestData.isSetPaymentAuthenticationUseCase) && Objects.equals(this.purchaseInstalData, threeDS2RequestData.purchaseInstalData) + && Objects.equals(this.isSetPurchaseInstalData, threeDS2RequestData.isSetPurchaseInstalData) && Objects.equals(this.recurringExpiry, threeDS2RequestData.recurringExpiry) + && Objects.equals(this.isSetRecurringExpiry, threeDS2RequestData.isSetRecurringExpiry) && Objects.equals(this.recurringFrequency, threeDS2RequestData.recurringFrequency) + && Objects.equals(this.isSetRecurringFrequency, threeDS2RequestData.isSetRecurringFrequency) && Objects.equals(this.sdkAppID, threeDS2RequestData.sdkAppID) + && Objects.equals(this.isSetSdkAppID, threeDS2RequestData.isSetSdkAppID) && Objects.equals(this.sdkEncData, threeDS2RequestData.sdkEncData) + && Objects.equals(this.isSetSdkEncData, threeDS2RequestData.isSetSdkEncData) && Objects.equals(this.sdkEphemPubKey, threeDS2RequestData.sdkEphemPubKey) + && Objects.equals(this.isSetSdkEphemPubKey, threeDS2RequestData.isSetSdkEphemPubKey) && Objects.equals(this.sdkMaxTimeout, threeDS2RequestData.sdkMaxTimeout) + && Objects.equals(this.isSetSdkMaxTimeout, threeDS2RequestData.isSetSdkMaxTimeout) && Objects.equals(this.sdkReferenceNumber, threeDS2RequestData.sdkReferenceNumber) + && Objects.equals(this.isSetSdkReferenceNumber, threeDS2RequestData.isSetSdkReferenceNumber) && Objects.equals(this.sdkTransID, threeDS2RequestData.sdkTransID) + && Objects.equals(this.isSetSdkTransID, threeDS2RequestData.isSetSdkTransID) && Objects.equals(this.sdkVersion, threeDS2RequestData.sdkVersion) + && Objects.equals(this.isSetSdkVersion, threeDS2RequestData.isSetSdkVersion) && Objects.equals(this.threeDSCompInd, threeDS2RequestData.threeDSCompInd) + && Objects.equals(this.isSetThreeDSCompInd, threeDS2RequestData.isSetThreeDSCompInd) && Objects.equals( this.threeDSRequestorAuthenticationInd, threeDS2RequestData.threeDSRequestorAuthenticationInd) + && Objects.equals( + this.isSetThreeDSRequestorAuthenticationInd, + threeDS2RequestData.isSetThreeDSRequestorAuthenticationInd) && Objects.equals( this.threeDSRequestorAuthenticationInfo, threeDS2RequestData.threeDSRequestorAuthenticationInfo) + && Objects.equals( + this.isSetThreeDSRequestorAuthenticationInfo, + threeDS2RequestData.isSetThreeDSRequestorAuthenticationInfo) && Objects.equals( this.threeDSRequestorChallengeInd, threeDS2RequestData.threeDSRequestorChallengeInd) + && Objects.equals( + this.isSetThreeDSRequestorChallengeInd, + threeDS2RequestData.isSetThreeDSRequestorChallengeInd) && Objects.equals(this.threeDSRequestorID, threeDS2RequestData.threeDSRequestorID) + && Objects.equals(this.isSetThreeDSRequestorID, threeDS2RequestData.isSetThreeDSRequestorID) && Objects.equals(this.threeDSRequestorName, threeDS2RequestData.threeDSRequestorName) + && Objects.equals( + this.isSetThreeDSRequestorName, threeDS2RequestData.isSetThreeDSRequestorName) && Objects.equals( this.threeDSRequestorPriorAuthenticationInfo, threeDS2RequestData.threeDSRequestorPriorAuthenticationInfo) + && Objects.equals( + this.isSetThreeDSRequestorPriorAuthenticationInfo, + threeDS2RequestData.isSetThreeDSRequestorPriorAuthenticationInfo) && Objects.equals(this.threeDSRequestorURL, threeDS2RequestData.threeDSRequestorURL) + && Objects.equals( + this.isSetThreeDSRequestorURL, threeDS2RequestData.isSetThreeDSRequestorURL) && Objects.equals(this.transType, threeDS2RequestData.transType) + && Objects.equals(this.isSetTransType, threeDS2RequestData.isSetTransType) && Objects.equals(this.transactionType, threeDS2RequestData.transactionType) + && Objects.equals(this.isSetTransactionType, threeDS2RequestData.isSetTransactionType) && Objects.equals(this.whiteListStatus, threeDS2RequestData.whiteListStatus) - && Objects.equals(this.workPhone, threeDS2RequestData.workPhone); + && Objects.equals(this.isSetWhiteListStatus, threeDS2RequestData.isSetWhiteListStatus) + && Objects.equals(this.workPhone, threeDS2RequestData.workPhone) + && Objects.equals(this.isSetWorkPhone, threeDS2RequestData.isSetWorkPhone); } @Override public int hashCode() { return Objects.hash( acctInfo, + isSetAcctInfo, acctType, + isSetAcctType, acquirerBIN, + isSetAcquirerBIN, acquirerMerchantID, + isSetAcquirerMerchantID, addrMatch, + isSetAddrMatch, authenticationOnly, + isSetAuthenticationOnly, challengeIndicator, + isSetChallengeIndicator, deviceChannel, + isSetDeviceChannel, deviceRenderOptions, + isSetDeviceRenderOptions, homePhone, + isSetHomePhone, mcc, + isSetMcc, merchantName, + isSetMerchantName, messageVersion, + isSetMessageVersion, mobilePhone, + isSetMobilePhone, notificationURL, + isSetNotificationURL, payTokenInd, + isSetPayTokenInd, paymentAuthenticationUseCase, + isSetPaymentAuthenticationUseCase, purchaseInstalData, + isSetPurchaseInstalData, recurringExpiry, + isSetRecurringExpiry, recurringFrequency, + isSetRecurringFrequency, sdkAppID, + isSetSdkAppID, sdkEncData, + isSetSdkEncData, sdkEphemPubKey, + isSetSdkEphemPubKey, sdkMaxTimeout, + isSetSdkMaxTimeout, sdkReferenceNumber, + isSetSdkReferenceNumber, sdkTransID, + isSetSdkTransID, sdkVersion, + isSetSdkVersion, threeDSCompInd, + isSetThreeDSCompInd, threeDSRequestorAuthenticationInd, + isSetThreeDSRequestorAuthenticationInd, threeDSRequestorAuthenticationInfo, + isSetThreeDSRequestorAuthenticationInfo, threeDSRequestorChallengeInd, + isSetThreeDSRequestorChallengeInd, threeDSRequestorID, + isSetThreeDSRequestorID, threeDSRequestorName, + isSetThreeDSRequestorName, threeDSRequestorPriorAuthenticationInfo, + isSetThreeDSRequestorPriorAuthenticationInfo, threeDSRequestorURL, + isSetThreeDSRequestorURL, transType, + isSetTransType, transactionType, + isSetTransactionType, whiteListStatus, - workPhone); + isSetWhiteListStatus, + workPhone, + isSetWorkPhone); } @Override @@ -2272,6 +2586,157 @@ 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 (isSetAcctInfo) { + addIfNull(nulls, JSON_PROPERTY_ACCT_INFO, this.acctInfo); + } + if (isSetAcctType) { + addIfNull(nulls, JSON_PROPERTY_ACCT_TYPE, this.acctType); + } + if (isSetAcquirerBIN) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_B_I_N, this.acquirerBIN); + } + if (isSetAcquirerMerchantID) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_MERCHANT_I_D, this.acquirerMerchantID); + } + if (isSetAddrMatch) { + addIfNull(nulls, JSON_PROPERTY_ADDR_MATCH, this.addrMatch); + } + if (isSetAuthenticationOnly) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_ONLY, this.authenticationOnly); + } + if (isSetChallengeIndicator) { + addIfNull(nulls, JSON_PROPERTY_CHALLENGE_INDICATOR, this.challengeIndicator); + } + if (isSetDeviceChannel) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_CHANNEL, this.deviceChannel); + } + if (isSetDeviceRenderOptions) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_RENDER_OPTIONS, this.deviceRenderOptions); + } + if (isSetHomePhone) { + addIfNull(nulls, JSON_PROPERTY_HOME_PHONE, this.homePhone); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantName) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_NAME, this.merchantName); + } + if (isSetMessageVersion) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_VERSION, this.messageVersion); + } + if (isSetMobilePhone) { + addIfNull(nulls, JSON_PROPERTY_MOBILE_PHONE, this.mobilePhone); + } + if (isSetNotificationURL) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_U_R_L, this.notificationURL); + } + if (isSetPayTokenInd) { + addIfNull(nulls, JSON_PROPERTY_PAY_TOKEN_IND, this.payTokenInd); + } + if (isSetPaymentAuthenticationUseCase) { + addIfNull( + nulls, JSON_PROPERTY_PAYMENT_AUTHENTICATION_USE_CASE, this.paymentAuthenticationUseCase); + } + if (isSetPurchaseInstalData) { + addIfNull(nulls, JSON_PROPERTY_PURCHASE_INSTAL_DATA, this.purchaseInstalData); + } + if (isSetRecurringExpiry) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_EXPIRY, this.recurringExpiry); + } + if (isSetRecurringFrequency) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_FREQUENCY, this.recurringFrequency); + } + if (isSetSdkAppID) { + addIfNull(nulls, JSON_PROPERTY_SDK_APP_I_D, this.sdkAppID); + } + if (isSetSdkEncData) { + addIfNull(nulls, JSON_PROPERTY_SDK_ENC_DATA, this.sdkEncData); + } + if (isSetSdkEphemPubKey) { + addIfNull(nulls, JSON_PROPERTY_SDK_EPHEM_PUB_KEY, this.sdkEphemPubKey); + } + if (isSetSdkMaxTimeout) { + addIfNull(nulls, JSON_PROPERTY_SDK_MAX_TIMEOUT, this.sdkMaxTimeout); + } + if (isSetSdkReferenceNumber) { + addIfNull(nulls, JSON_PROPERTY_SDK_REFERENCE_NUMBER, this.sdkReferenceNumber); + } + if (isSetSdkTransID) { + addIfNull(nulls, JSON_PROPERTY_SDK_TRANS_I_D, this.sdkTransID); + } + if (isSetSdkVersion) { + addIfNull(nulls, JSON_PROPERTY_SDK_VERSION, this.sdkVersion); + } + if (isSetThreeDSCompInd) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_COMP_IND, this.threeDSCompInd); + } + if (isSetThreeDSRequestorAuthenticationInd) { + addIfNull( + nulls, + JSON_PROPERTY_THREE_D_S_REQUESTOR_AUTHENTICATION_IND, + this.threeDSRequestorAuthenticationInd); + } + if (isSetThreeDSRequestorAuthenticationInfo) { + addIfNull( + nulls, + JSON_PROPERTY_THREE_D_S_REQUESTOR_AUTHENTICATION_INFO, + this.threeDSRequestorAuthenticationInfo); + } + if (isSetThreeDSRequestorChallengeInd) { + addIfNull( + nulls, + JSON_PROPERTY_THREE_D_S_REQUESTOR_CHALLENGE_IND, + this.threeDSRequestorChallengeInd); + } + if (isSetThreeDSRequestorID) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQUESTOR_I_D, this.threeDSRequestorID); + } + if (isSetThreeDSRequestorName) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQUESTOR_NAME, this.threeDSRequestorName); + } + if (isSetThreeDSRequestorPriorAuthenticationInfo) { + addIfNull( + nulls, + JSON_PROPERTY_THREE_D_S_REQUESTOR_PRIOR_AUTHENTICATION_INFO, + this.threeDSRequestorPriorAuthenticationInfo); + } + if (isSetThreeDSRequestorURL) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQUESTOR_U_R_L, this.threeDSRequestorURL); + } + if (isSetTransType) { + addIfNull(nulls, JSON_PROPERTY_TRANS_TYPE, this.transType); + } + if (isSetTransactionType) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_TYPE, this.transactionType); + } + if (isSetWhiteListStatus) { + addIfNull(nulls, JSON_PROPERTY_WHITE_LIST_STATUS, this.whiteListStatus); + } + if (isSetWorkPhone) { + addIfNull(nulls, JSON_PROPERTY_WORK_PHONE, this.workPhone); + } + + 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 ThreeDS2RequestData given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ThreeDS2Result.java b/src/main/java/com/adyen/model/payment/ThreeDS2Result.java index 9b2655d61..6fd19cc68 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDS2Result.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS2Result.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -42,9 +44,15 @@ public class ThreeDS2Result { public static final String JSON_PROPERTY_AUTHENTICATION_VALUE = "authenticationValue"; private String authenticationValue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationValue = false; + public static final String JSON_PROPERTY_CAVV_ALGORITHM = "cavvAlgorithm"; private String cavvAlgorithm; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCavvAlgorithm = false; + /** * Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the * authentication has been cancelled. For possible values, refer to [3D Secure API @@ -103,12 +111,21 @@ public static ChallengeCancelEnum fromValue(String value) { public static final String JSON_PROPERTY_CHALLENGE_CANCEL = "challengeCancel"; private ChallengeCancelEnum challengeCancel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChallengeCancel = false; + public static final String JSON_PROPERTY_DS_TRANS_I_D = "dsTransID"; private String dsTransID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDsTransID = false; + public static final String JSON_PROPERTY_ECI = "eci"; private String eci; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEci = false; + /** * Indicates the exemption type that was applied by the issuer to the authentication, if exemption * applied. Allowed values: * `lowValue` * `secureCorporate` * @@ -161,12 +178,21 @@ public static ExemptionIndicatorEnum fromValue(String value) { public static final String JSON_PROPERTY_EXEMPTION_INDICATOR = "exemptionIndicator"; private ExemptionIndicatorEnum exemptionIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExemptionIndicator = false; + public static final String JSON_PROPERTY_MESSAGE_VERSION = "messageVersion"; private String messageVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessageVersion = false; + public static final String JSON_PROPERTY_RISK_SCORE = "riskScore"; private String riskScore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskScore = false; + /** * Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No * preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor @@ -226,21 +252,45 @@ public static ThreeDSRequestorChallengeIndEnum fromValue(String value) { "threeDSRequestorChallengeInd"; private ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorChallengeInd = false; + public static final String JSON_PROPERTY_THREE_D_S_SERVER_TRANS_I_D = "threeDSServerTransID"; private String threeDSServerTransID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSServerTransID = false; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private String timestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + public static final String JSON_PROPERTY_TRANS_STATUS = "transStatus"; private String transStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransStatus = false; + public static final String JSON_PROPERTY_TRANS_STATUS_REASON = "transStatusReason"; private String transStatusReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransStatusReason = false; + public static final String JSON_PROPERTY_WHITE_LIST_STATUS = "whiteListStatus"; private String whiteListStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWhiteListStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDS2Result() {} /** @@ -252,6 +302,7 @@ public ThreeDS2Result() {} */ public ThreeDS2Result authenticationValue(String authenticationValue) { this.authenticationValue = authenticationValue; + isSetAuthenticationValue = true; // mark as set return this; } @@ -277,6 +328,7 @@ public String getAuthenticationValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationValue(String authenticationValue) { this.authenticationValue = authenticationValue; + isSetAuthenticationValue = true; // mark as set } /** @@ -289,6 +341,7 @@ public void setAuthenticationValue(String authenticationValue) { */ public ThreeDS2Result cavvAlgorithm(String cavvAlgorithm) { this.cavvAlgorithm = cavvAlgorithm; + isSetCavvAlgorithm = true; // mark as set return this; } @@ -316,6 +369,7 @@ public String getCavvAlgorithm() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCavvAlgorithm(String cavvAlgorithm) { this.cavvAlgorithm = cavvAlgorithm; + isSetCavvAlgorithm = true; // mark as set } /** @@ -331,6 +385,7 @@ public void setCavvAlgorithm(String cavvAlgorithm) { */ public ThreeDS2Result challengeCancel(ChallengeCancelEnum challengeCancel) { this.challengeCancel = challengeCancel; + isSetChallengeCancel = true; // mark as set return this; } @@ -364,6 +419,7 @@ public ChallengeCancelEnum getChallengeCancel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallengeCancel(ChallengeCancelEnum challengeCancel) { this.challengeCancel = challengeCancel; + isSetChallengeCancel = true; // mark as set } /** @@ -374,6 +430,7 @@ public void setChallengeCancel(ChallengeCancelEnum challengeCancel) { */ public ThreeDS2Result dsTransID(String dsTransID) { this.dsTransID = dsTransID; + isSetDsTransID = true; // mark as set return this; } @@ -397,6 +454,7 @@ public String getDsTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDsTransID(String dsTransID) { this.dsTransID = dsTransID; + isSetDsTransID = true; // mark as set } /** @@ -407,6 +465,7 @@ public void setDsTransID(String dsTransID) { */ public ThreeDS2Result eci(String eci) { this.eci = eci; + isSetEci = true; // mark as set return this; } @@ -430,6 +489,7 @@ public String getEci() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEci(String eci) { this.eci = eci; + isSetEci = true; // mark as set } /** @@ -445,6 +505,7 @@ public void setEci(String eci) { */ public ThreeDS2Result exemptionIndicator(ExemptionIndicatorEnum exemptionIndicator) { this.exemptionIndicator = exemptionIndicator; + isSetExemptionIndicator = true; // mark as set return this; } @@ -478,6 +539,7 @@ public ExemptionIndicatorEnum getExemptionIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExemptionIndicator(ExemptionIndicatorEnum exemptionIndicator) { this.exemptionIndicator = exemptionIndicator; + isSetExemptionIndicator = true; // mark as set } /** @@ -489,6 +551,7 @@ public void setExemptionIndicator(ExemptionIndicatorEnum exemptionIndicator) { */ public ThreeDS2Result messageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set return this; } @@ -514,6 +577,7 @@ public String getMessageVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set } /** @@ -524,6 +588,7 @@ public void setMessageVersion(String messageVersion) { */ public ThreeDS2Result riskScore(String riskScore) { this.riskScore = riskScore; + isSetRiskScore = true; // mark as set return this; } @@ -547,6 +612,7 @@ public String getRiskScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskScore(String riskScore) { this.riskScore = riskScore; + isSetRiskScore = true; // mark as set } /** @@ -565,6 +631,7 @@ public void setRiskScore(String riskScore) { public ThreeDS2Result threeDSRequestorChallengeInd( ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd) { this.threeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + isSetThreeDSRequestorChallengeInd = true; // mark as set return this; } @@ -603,6 +670,7 @@ public ThreeDSRequestorChallengeIndEnum getThreeDSRequestorChallengeInd() { public void setThreeDSRequestorChallengeInd( ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd) { this.threeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + isSetThreeDSRequestorChallengeInd = true; // mark as set } /** @@ -614,6 +682,7 @@ public void setThreeDSRequestorChallengeInd( */ public ThreeDS2Result threeDSServerTransID(String threeDSServerTransID) { this.threeDSServerTransID = threeDSServerTransID; + isSetThreeDSServerTransID = true; // mark as set return this; } @@ -639,6 +708,7 @@ public String getThreeDSServerTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSServerTransID(String threeDSServerTransID) { this.threeDSServerTransID = threeDSServerTransID; + isSetThreeDSServerTransID = true; // mark as set } /** @@ -649,6 +719,7 @@ public void setThreeDSServerTransID(String threeDSServerTransID) { */ public ThreeDS2Result timestamp(String timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set return this; } @@ -672,6 +743,7 @@ public String getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(String timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set } /** @@ -683,6 +755,7 @@ public void setTimestamp(String timestamp) { */ public ThreeDS2Result transStatus(String transStatus) { this.transStatus = transStatus; + isSetTransStatus = true; // mark as set return this; } @@ -708,6 +781,7 @@ public String getTransStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransStatus(String transStatus) { this.transStatus = transStatus; + isSetTransStatus = true; // mark as set } /** @@ -722,6 +796,7 @@ public void setTransStatus(String transStatus) { */ public ThreeDS2Result transStatusReason(String transStatusReason) { this.transStatusReason = transStatusReason; + isSetTransStatusReason = true; // mark as set return this; } @@ -753,6 +828,7 @@ public String getTransStatusReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransStatusReason(String transStatusReason) { this.transStatusReason = transStatusReason; + isSetTransStatusReason = true; // mark as set } /** @@ -764,6 +840,7 @@ public void setTransStatusReason(String transStatusReason) { */ public ThreeDS2Result whiteListStatus(String whiteListStatus) { this.whiteListStatus = whiteListStatus; + isSetWhiteListStatus = true; // mark as set return this; } @@ -789,6 +866,27 @@ public String getWhiteListStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWhiteListStatus(String whiteListStatus) { this.whiteListStatus = whiteListStatus; + isSetWhiteListStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDS2Result 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 ThreeDS2Result object is equal to o. */ @@ -802,39 +900,69 @@ public boolean equals(Object o) { } ThreeDS2Result threeDS2Result = (ThreeDS2Result) o; return Objects.equals(this.authenticationValue, threeDS2Result.authenticationValue) + && Objects.equals(this.isSetAuthenticationValue, threeDS2Result.isSetAuthenticationValue) && Objects.equals(this.cavvAlgorithm, threeDS2Result.cavvAlgorithm) + && Objects.equals(this.isSetCavvAlgorithm, threeDS2Result.isSetCavvAlgorithm) && Objects.equals(this.challengeCancel, threeDS2Result.challengeCancel) + && Objects.equals(this.isSetChallengeCancel, threeDS2Result.isSetChallengeCancel) && Objects.equals(this.dsTransID, threeDS2Result.dsTransID) + && Objects.equals(this.isSetDsTransID, threeDS2Result.isSetDsTransID) && Objects.equals(this.eci, threeDS2Result.eci) + && Objects.equals(this.isSetEci, threeDS2Result.isSetEci) && Objects.equals(this.exemptionIndicator, threeDS2Result.exemptionIndicator) + && Objects.equals(this.isSetExemptionIndicator, threeDS2Result.isSetExemptionIndicator) && Objects.equals(this.messageVersion, threeDS2Result.messageVersion) + && Objects.equals(this.isSetMessageVersion, threeDS2Result.isSetMessageVersion) && Objects.equals(this.riskScore, threeDS2Result.riskScore) + && Objects.equals(this.isSetRiskScore, threeDS2Result.isSetRiskScore) && Objects.equals( this.threeDSRequestorChallengeInd, threeDS2Result.threeDSRequestorChallengeInd) + && Objects.equals( + this.isSetThreeDSRequestorChallengeInd, + threeDS2Result.isSetThreeDSRequestorChallengeInd) && Objects.equals(this.threeDSServerTransID, threeDS2Result.threeDSServerTransID) + && Objects.equals(this.isSetThreeDSServerTransID, threeDS2Result.isSetThreeDSServerTransID) && Objects.equals(this.timestamp, threeDS2Result.timestamp) + && Objects.equals(this.isSetTimestamp, threeDS2Result.isSetTimestamp) && Objects.equals(this.transStatus, threeDS2Result.transStatus) + && Objects.equals(this.isSetTransStatus, threeDS2Result.isSetTransStatus) && Objects.equals(this.transStatusReason, threeDS2Result.transStatusReason) - && Objects.equals(this.whiteListStatus, threeDS2Result.whiteListStatus); + && Objects.equals(this.isSetTransStatusReason, threeDS2Result.isSetTransStatusReason) + && Objects.equals(this.whiteListStatus, threeDS2Result.whiteListStatus) + && Objects.equals(this.isSetWhiteListStatus, threeDS2Result.isSetWhiteListStatus); } @Override public int hashCode() { return Objects.hash( authenticationValue, + isSetAuthenticationValue, cavvAlgorithm, + isSetCavvAlgorithm, challengeCancel, + isSetChallengeCancel, dsTransID, + isSetDsTransID, eci, + isSetEci, exemptionIndicator, + isSetExemptionIndicator, messageVersion, + isSetMessageVersion, riskScore, + isSetRiskScore, threeDSRequestorChallengeInd, + isSetThreeDSRequestorChallengeInd, threeDSServerTransID, + isSetThreeDSServerTransID, timestamp, + isSetTimestamp, transStatus, + isSetTransStatus, transStatusReason, - whiteListStatus); + isSetTransStatusReason, + whiteListStatus, + isSetWhiteListStatus); } @Override @@ -875,6 +1003,72 @@ 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 (isSetAuthenticationValue) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_VALUE, this.authenticationValue); + } + if (isSetCavvAlgorithm) { + addIfNull(nulls, JSON_PROPERTY_CAVV_ALGORITHM, this.cavvAlgorithm); + } + if (isSetChallengeCancel) { + addIfNull(nulls, JSON_PROPERTY_CHALLENGE_CANCEL, this.challengeCancel); + } + if (isSetDsTransID) { + addIfNull(nulls, JSON_PROPERTY_DS_TRANS_I_D, this.dsTransID); + } + if (isSetEci) { + addIfNull(nulls, JSON_PROPERTY_ECI, this.eci); + } + if (isSetExemptionIndicator) { + addIfNull(nulls, JSON_PROPERTY_EXEMPTION_INDICATOR, this.exemptionIndicator); + } + if (isSetMessageVersion) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_VERSION, this.messageVersion); + } + if (isSetRiskScore) { + addIfNull(nulls, JSON_PROPERTY_RISK_SCORE, this.riskScore); + } + if (isSetThreeDSRequestorChallengeInd) { + addIfNull( + nulls, + JSON_PROPERTY_THREE_D_S_REQUESTOR_CHALLENGE_IND, + this.threeDSRequestorChallengeInd); + } + if (isSetThreeDSServerTransID) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_SERVER_TRANS_I_D, this.threeDSServerTransID); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetTransStatus) { + addIfNull(nulls, JSON_PROPERTY_TRANS_STATUS, this.transStatus); + } + if (isSetTransStatusReason) { + addIfNull(nulls, JSON_PROPERTY_TRANS_STATUS_REASON, this.transStatusReason); + } + if (isSetWhiteListStatus) { + addIfNull(nulls, JSON_PROPERTY_WHITE_LIST_STATUS, this.whiteListStatus); + } + + 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 ThreeDS2Result given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ThreeDS2ResultRequest.java b/src/main/java/com/adyen/model/payment/ThreeDS2ResultRequest.java index 053b395e0..1dde560de 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDS2ResultRequest.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS2ResultRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -26,9 +28,21 @@ public class ThreeDS2ResultRequest { public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDS2ResultRequest() {} /** @@ -40,6 +54,7 @@ public ThreeDS2ResultRequest() {} */ public ThreeDS2ResultRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -65,6 +80,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -75,6 +91,7 @@ public void setMerchantAccount(String merchantAccount) { */ public ThreeDS2ResultRequest pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -98,6 +115,27 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDS2ResultRequest 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 ThreeDS2ResultRequest object is equal to o. */ @@ -111,12 +149,14 @@ public boolean equals(Object o) { } ThreeDS2ResultRequest threeDS2ResultRequest = (ThreeDS2ResultRequest) o; return Objects.equals(this.merchantAccount, threeDS2ResultRequest.merchantAccount) - && Objects.equals(this.pspReference, threeDS2ResultRequest.pspReference); + && Objects.equals(this.isSetMerchantAccount, threeDS2ResultRequest.isSetMerchantAccount) + && Objects.equals(this.pspReference, threeDS2ResultRequest.pspReference) + && Objects.equals(this.isSetPspReference, threeDS2ResultRequest.isSetPspReference); } @Override public int hashCode() { - return Objects.hash(merchantAccount, pspReference); + return Objects.hash(merchantAccount, isSetMerchantAccount, pspReference, isSetPspReference); } @Override @@ -139,6 +179,33 @@ 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 (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + + 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 ThreeDS2ResultRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ThreeDS2ResultResponse.java b/src/main/java/com/adyen/model/payment/ThreeDS2ResultResponse.java index f454feb6b..ac96758f1 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDS2ResultResponse.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS2ResultResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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 ThreeDS2ResultResponse { public static final String JSON_PROPERTY_THREE_D_S2_RESULT = "threeDS2Result"; private ThreeDS2Result threeDS2Result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2Result = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDS2ResultResponse() {} /** @@ -33,6 +44,7 @@ public ThreeDS2ResultResponse() {} */ public ThreeDS2ResultResponse threeDS2Result(ThreeDS2Result threeDS2Result) { this.threeDS2Result = threeDS2Result; + isSetThreeDS2Result = true; // mark as set return this; } @@ -56,6 +68,27 @@ public ThreeDS2Result getThreeDS2Result() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2Result(ThreeDS2Result threeDS2Result) { this.threeDS2Result = threeDS2Result; + isSetThreeDS2Result = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDS2ResultResponse 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 ThreeDS2ResultResponse object is equal to o. */ @@ -68,12 +101,13 @@ public boolean equals(Object o) { return false; } ThreeDS2ResultResponse threeDS2ResultResponse = (ThreeDS2ResultResponse) o; - return Objects.equals(this.threeDS2Result, threeDS2ResultResponse.threeDS2Result); + return Objects.equals(this.threeDS2Result, threeDS2ResultResponse.threeDS2Result) + && Objects.equals(this.isSetThreeDS2Result, threeDS2ResultResponse.isSetThreeDS2Result); } @Override public int hashCode() { - return Objects.hash(threeDS2Result); + return Objects.hash(threeDS2Result, isSetThreeDS2Result); } @Override @@ -95,6 +129,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 (isSetThreeDS2Result) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_RESULT, this.threeDS2Result); + } + + 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 ThreeDS2ResultResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ThreeDSRequestorAuthenticationInfo.java b/src/main/java/com/adyen/model/payment/ThreeDSRequestorAuthenticationInfo.java index 615d00037..2136d1921 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDSRequestorAuthenticationInfo.java +++ b/src/main/java/com/adyen/model/payment/ThreeDSRequestorAuthenticationInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -31,6 +33,9 @@ public class ThreeDSRequestorAuthenticationInfo { public static final String JSON_PROPERTY_THREE_D_S_REQ_AUTH_DATA = "threeDSReqAuthData"; private String threeDSReqAuthData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSReqAuthData = false; + /** * Mechanism used by the Cardholder to authenticate to the 3DS Requestor. Allowed values: * **01** * — No 3DS Requestor authentication occurred (for example, cardholder “logged in” as guest). * @@ -92,9 +97,21 @@ public static ThreeDSReqAuthMethodEnum fromValue(String value) { public static final String JSON_PROPERTY_THREE_D_S_REQ_AUTH_METHOD = "threeDSReqAuthMethod"; private ThreeDSReqAuthMethodEnum threeDSReqAuthMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSReqAuthMethod = false; + public static final String JSON_PROPERTY_THREE_D_S_REQ_AUTH_TIMESTAMP = "threeDSReqAuthTimestamp"; private String threeDSReqAuthTimestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSReqAuthTimestamp = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDSRequestorAuthenticationInfo() {} /** @@ -107,6 +124,7 @@ public ThreeDSRequestorAuthenticationInfo() {} */ public ThreeDSRequestorAuthenticationInfo threeDSReqAuthData(String threeDSReqAuthData) { this.threeDSReqAuthData = threeDSReqAuthData; + isSetThreeDSReqAuthData = true; // mark as set return this; } @@ -132,6 +150,7 @@ public String getThreeDSReqAuthData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSReqAuthData(String threeDSReqAuthData) { this.threeDSReqAuthData = threeDSReqAuthData; + isSetThreeDSReqAuthData = true; // mark as set } /** @@ -159,6 +178,7 @@ public void setThreeDSReqAuthData(String threeDSReqAuthData) { public ThreeDSRequestorAuthenticationInfo threeDSReqAuthMethod( ThreeDSReqAuthMethodEnum threeDSReqAuthMethod) { this.threeDSReqAuthMethod = threeDSReqAuthMethod; + isSetThreeDSReqAuthMethod = true; // mark as set return this; } @@ -212,6 +232,7 @@ public ThreeDSReqAuthMethodEnum getThreeDSReqAuthMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSReqAuthMethod(ThreeDSReqAuthMethodEnum threeDSReqAuthMethod) { this.threeDSReqAuthMethod = threeDSReqAuthMethod; + isSetThreeDSReqAuthMethod = true; // mark as set } /** @@ -225,6 +246,7 @@ public void setThreeDSReqAuthMethod(ThreeDSReqAuthMethodEnum threeDSReqAuthMetho public ThreeDSRequestorAuthenticationInfo threeDSReqAuthTimestamp( String threeDSReqAuthTimestamp) { this.threeDSReqAuthTimestamp = threeDSReqAuthTimestamp; + isSetThreeDSReqAuthTimestamp = true; // mark as set return this; } @@ -250,6 +272,27 @@ public String getThreeDSReqAuthTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSReqAuthTimestamp(String threeDSReqAuthTimestamp) { this.threeDSReqAuthTimestamp = threeDSReqAuthTimestamp; + isSetThreeDSReqAuthTimestamp = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDSRequestorAuthenticationInfo 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 ThreeDSRequestorAuthenticationInfo object is equal to o. */ @@ -265,16 +308,31 @@ public boolean equals(Object o) { (ThreeDSRequestorAuthenticationInfo) o; return Objects.equals( this.threeDSReqAuthData, threeDSRequestorAuthenticationInfo.threeDSReqAuthData) + && Objects.equals( + this.isSetThreeDSReqAuthData, + threeDSRequestorAuthenticationInfo.isSetThreeDSReqAuthData) && Objects.equals( this.threeDSReqAuthMethod, threeDSRequestorAuthenticationInfo.threeDSReqAuthMethod) + && Objects.equals( + this.isSetThreeDSReqAuthMethod, + threeDSRequestorAuthenticationInfo.isSetThreeDSReqAuthMethod) && Objects.equals( this.threeDSReqAuthTimestamp, - threeDSRequestorAuthenticationInfo.threeDSReqAuthTimestamp); + threeDSRequestorAuthenticationInfo.threeDSReqAuthTimestamp) + && Objects.equals( + this.isSetThreeDSReqAuthTimestamp, + threeDSRequestorAuthenticationInfo.isSetThreeDSReqAuthTimestamp); } @Override public int hashCode() { - return Objects.hash(threeDSReqAuthData, threeDSReqAuthMethod, threeDSReqAuthTimestamp); + return Objects.hash( + threeDSReqAuthData, + isSetThreeDSReqAuthData, + threeDSReqAuthMethod, + isSetThreeDSReqAuthMethod, + threeDSReqAuthTimestamp, + isSetThreeDSReqAuthTimestamp); } @Override @@ -302,6 +360,36 @@ 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 (isSetThreeDSReqAuthData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQ_AUTH_DATA, this.threeDSReqAuthData); + } + if (isSetThreeDSReqAuthMethod) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQ_AUTH_METHOD, this.threeDSReqAuthMethod); + } + if (isSetThreeDSReqAuthTimestamp) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQ_AUTH_TIMESTAMP, this.threeDSReqAuthTimestamp); + } + + 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 ThreeDSRequestorAuthenticationInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ThreeDSRequestorPriorAuthenticationInfo.java b/src/main/java/com/adyen/model/payment/ThreeDSRequestorPriorAuthenticationInfo.java index 33fea8601..d7a3176b4 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDSRequestorPriorAuthenticationInfo.java +++ b/src/main/java/com/adyen/model/payment/ThreeDSRequestorPriorAuthenticationInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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,6 +35,9 @@ public class ThreeDSRequestorPriorAuthenticationInfo { "threeDSReqPriorAuthData"; private String threeDSReqPriorAuthData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSReqPriorAuthData = false; + /** * Mechanism used by the Cardholder to previously authenticate to the 3DS Requestor. Allowed * values: * **01** — Frictionless authentication occurred by ACS. * **02** — Cardholder challenge @@ -87,13 +92,28 @@ public static ThreeDSReqPriorAuthMethodEnum fromValue(String value) { "threeDSReqPriorAuthMethod"; private ThreeDSReqPriorAuthMethodEnum threeDSReqPriorAuthMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSReqPriorAuthMethod = false; + public static final String JSON_PROPERTY_THREE_D_S_REQ_PRIOR_AUTH_TIMESTAMP = "threeDSReqPriorAuthTimestamp"; private String threeDSReqPriorAuthTimestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSReqPriorAuthTimestamp = false; + public static final String JSON_PROPERTY_THREE_D_S_REQ_PRIOR_REF = "threeDSReqPriorRef"; private String threeDSReqPriorRef; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSReqPriorRef = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDSRequestorPriorAuthenticationInfo() {} /** @@ -107,6 +127,7 @@ public ThreeDSRequestorPriorAuthenticationInfo() {} public ThreeDSRequestorPriorAuthenticationInfo threeDSReqPriorAuthData( String threeDSReqPriorAuthData) { this.threeDSReqPriorAuthData = threeDSReqPriorAuthData; + isSetThreeDSReqPriorAuthData = true; // mark as set return this; } @@ -132,6 +153,7 @@ public String getThreeDSReqPriorAuthData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSReqPriorAuthData(String threeDSReqPriorAuthData) { this.threeDSReqPriorAuthData = threeDSReqPriorAuthData; + isSetThreeDSReqPriorAuthData = true; // mark as set } /** @@ -149,6 +171,7 @@ public void setThreeDSReqPriorAuthData(String threeDSReqPriorAuthData) { public ThreeDSRequestorPriorAuthenticationInfo threeDSReqPriorAuthMethod( ThreeDSReqPriorAuthMethodEnum threeDSReqPriorAuthMethod) { this.threeDSReqPriorAuthMethod = threeDSReqPriorAuthMethod; + isSetThreeDSReqPriorAuthMethod = true; // mark as set return this; } @@ -183,6 +206,7 @@ public ThreeDSReqPriorAuthMethodEnum getThreeDSReqPriorAuthMethod() { public void setThreeDSReqPriorAuthMethod( ThreeDSReqPriorAuthMethodEnum threeDSReqPriorAuthMethod) { this.threeDSReqPriorAuthMethod = threeDSReqPriorAuthMethod; + isSetThreeDSReqPriorAuthMethod = true; // mark as set } /** @@ -196,6 +220,7 @@ public void setThreeDSReqPriorAuthMethod( public ThreeDSRequestorPriorAuthenticationInfo threeDSReqPriorAuthTimestamp( String threeDSReqPriorAuthTimestamp) { this.threeDSReqPriorAuthTimestamp = threeDSReqPriorAuthTimestamp; + isSetThreeDSReqPriorAuthTimestamp = true; // mark as set return this; } @@ -221,6 +246,7 @@ public String getThreeDSReqPriorAuthTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSReqPriorAuthTimestamp(String threeDSReqPriorAuthTimestamp) { this.threeDSReqPriorAuthTimestamp = threeDSReqPriorAuthTimestamp; + isSetThreeDSReqPriorAuthTimestamp = true; // mark as set } /** @@ -238,6 +264,7 @@ public void setThreeDSReqPriorAuthTimestamp(String threeDSReqPriorAuthTimestamp) */ public ThreeDSRequestorPriorAuthenticationInfo threeDSReqPriorRef(String threeDSReqPriorRef) { this.threeDSReqPriorRef = threeDSReqPriorRef; + isSetThreeDSReqPriorRef = true; // mark as set return this; } @@ -273,6 +300,27 @@ public String getThreeDSReqPriorRef() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSReqPriorRef(String threeDSReqPriorRef) { this.threeDSReqPriorRef = threeDSReqPriorRef; + isSetThreeDSReqPriorRef = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDSRequestorPriorAuthenticationInfo 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 ThreeDSRequestorPriorAuthenticationInfo object is equal to o. */ @@ -289,23 +337,39 @@ public boolean equals(Object o) { return Objects.equals( this.threeDSReqPriorAuthData, threeDSRequestorPriorAuthenticationInfo.threeDSReqPriorAuthData) + && Objects.equals( + this.isSetThreeDSReqPriorAuthData, + threeDSRequestorPriorAuthenticationInfo.isSetThreeDSReqPriorAuthData) && Objects.equals( this.threeDSReqPriorAuthMethod, threeDSRequestorPriorAuthenticationInfo.threeDSReqPriorAuthMethod) + && Objects.equals( + this.isSetThreeDSReqPriorAuthMethod, + threeDSRequestorPriorAuthenticationInfo.isSetThreeDSReqPriorAuthMethod) && Objects.equals( this.threeDSReqPriorAuthTimestamp, threeDSRequestorPriorAuthenticationInfo.threeDSReqPriorAuthTimestamp) && Objects.equals( - this.threeDSReqPriorRef, threeDSRequestorPriorAuthenticationInfo.threeDSReqPriorRef); + this.isSetThreeDSReqPriorAuthTimestamp, + threeDSRequestorPriorAuthenticationInfo.isSetThreeDSReqPriorAuthTimestamp) + && Objects.equals( + this.threeDSReqPriorRef, threeDSRequestorPriorAuthenticationInfo.threeDSReqPriorRef) + && Objects.equals( + this.isSetThreeDSReqPriorRef, + threeDSRequestorPriorAuthenticationInfo.isSetThreeDSReqPriorRef); } @Override public int hashCode() { return Objects.hash( threeDSReqPriorAuthData, + isSetThreeDSReqPriorAuthData, threeDSReqPriorAuthMethod, + isSetThreeDSReqPriorAuthMethod, threeDSReqPriorAuthTimestamp, - threeDSReqPriorRef); + isSetThreeDSReqPriorAuthTimestamp, + threeDSReqPriorRef, + isSetThreeDSReqPriorRef); } @Override @@ -336,6 +400,43 @@ 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 (isSetThreeDSReqPriorAuthData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQ_PRIOR_AUTH_DATA, this.threeDSReqPriorAuthData); + } + if (isSetThreeDSReqPriorAuthMethod) { + addIfNull( + nulls, JSON_PROPERTY_THREE_D_S_REQ_PRIOR_AUTH_METHOD, this.threeDSReqPriorAuthMethod); + } + if (isSetThreeDSReqPriorAuthTimestamp) { + addIfNull( + nulls, + JSON_PROPERTY_THREE_D_S_REQ_PRIOR_AUTH_TIMESTAMP, + this.threeDSReqPriorAuthTimestamp); + } + if (isSetThreeDSReqPriorRef) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQ_PRIOR_REF, this.threeDSReqPriorRef); + } + + 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 ThreeDSRequestorPriorAuthenticationInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/ThreeDSecureData.java b/src/main/java/com/adyen/model/payment/ThreeDSecureData.java index 62e4c1070..8b06fee16 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDSecureData.java +++ b/src/main/java/com/adyen/model/payment/ThreeDSecureData.java @@ -11,7 +11,9 @@ package com.adyen.model.payment; +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; @@ -88,12 +90,21 @@ public static AuthenticationResponseEnum fromValue(String value) { public static final String JSON_PROPERTY_AUTHENTICATION_RESPONSE = "authenticationResponse"; private AuthenticationResponseEnum authenticationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationResponse = false; + public static final String JSON_PROPERTY_CAVV = "cavv"; private byte[] cavv; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCavv = false; + public static final String JSON_PROPERTY_CAVV_ALGORITHM = "cavvAlgorithm"; private String cavvAlgorithm; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCavvAlgorithm = false; + /** * Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the * authentication has been cancelled. For possible values, refer to [3D Secure API @@ -152,6 +163,9 @@ public static ChallengeCancelEnum fromValue(String value) { public static final String JSON_PROPERTY_CHALLENGE_CANCEL = "challengeCancel"; private ChallengeCancelEnum challengeCancel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChallengeCancel = false; + /** In 3D Secure 2, this is the `transStatus` from the `ARes`. */ public enum DirectoryResponseEnum { A(String.valueOf("A")), @@ -208,28 +222,58 @@ public static DirectoryResponseEnum fromValue(String value) { public static final String JSON_PROPERTY_DIRECTORY_RESPONSE = "directoryResponse"; private DirectoryResponseEnum directoryResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirectoryResponse = false; + public static final String JSON_PROPERTY_DS_TRANS_I_D = "dsTransID"; private String dsTransID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDsTransID = false; + public static final String JSON_PROPERTY_ECI = "eci"; private String eci; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEci = false; + public static final String JSON_PROPERTY_RISK_SCORE = "riskScore"; private String riskScore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskScore = false; + public static final String JSON_PROPERTY_THREE_D_S_VERSION = "threeDSVersion"; private String threeDSVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSVersion = false; + public static final String JSON_PROPERTY_TOKEN_AUTHENTICATION_VERIFICATION_VALUE = "tokenAuthenticationVerificationValue"; private byte[] tokenAuthenticationVerificationValue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenAuthenticationVerificationValue = false; + public static final String JSON_PROPERTY_TRANS_STATUS_REASON = "transStatusReason"; private String transStatusReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransStatusReason = false; + public static final String JSON_PROPERTY_XID = "xid"; private byte[] xid; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetXid = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDSecureData() {} /** @@ -243,6 +287,7 @@ public ThreeDSecureData() {} public ThreeDSecureData authenticationResponse( AuthenticationResponseEnum authenticationResponse) { this.authenticationResponse = authenticationResponse; + isSetAuthenticationResponse = true; // mark as set return this; } @@ -270,6 +315,7 @@ public AuthenticationResponseEnum getAuthenticationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationResponse(AuthenticationResponseEnum authenticationResponse) { this.authenticationResponse = authenticationResponse; + isSetAuthenticationResponse = true; // mark as set } /** @@ -280,6 +326,7 @@ public void setAuthenticationResponse(AuthenticationResponseEnum authenticationR */ public ThreeDSecureData cavv(byte[] cavv) { this.cavv = cavv; + isSetCavv = true; // mark as set return this; } @@ -303,6 +350,7 @@ public byte[] getCavv() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCavv(byte[] cavv) { this.cavv = cavv; + isSetCavv = true; // mark as set } /** @@ -313,6 +361,7 @@ public void setCavv(byte[] cavv) { */ public ThreeDSecureData cavvAlgorithm(String cavvAlgorithm) { this.cavvAlgorithm = cavvAlgorithm; + isSetCavvAlgorithm = true; // mark as set return this; } @@ -336,6 +385,7 @@ public String getCavvAlgorithm() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCavvAlgorithm(String cavvAlgorithm) { this.cavvAlgorithm = cavvAlgorithm; + isSetCavvAlgorithm = true; // mark as set } /** @@ -351,6 +401,7 @@ public void setCavvAlgorithm(String cavvAlgorithm) { */ public ThreeDSecureData challengeCancel(ChallengeCancelEnum challengeCancel) { this.challengeCancel = challengeCancel; + isSetChallengeCancel = true; // mark as set return this; } @@ -384,6 +435,7 @@ public ChallengeCancelEnum getChallengeCancel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallengeCancel(ChallengeCancelEnum challengeCancel) { this.challengeCancel = challengeCancel; + isSetChallengeCancel = true; // mark as set } /** @@ -395,6 +447,7 @@ public void setChallengeCancel(ChallengeCancelEnum challengeCancel) { */ public ThreeDSecureData directoryResponse(DirectoryResponseEnum directoryResponse) { this.directoryResponse = directoryResponse; + isSetDirectoryResponse = true; // mark as set return this; } @@ -420,6 +473,7 @@ public DirectoryResponseEnum getDirectoryResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirectoryResponse(DirectoryResponseEnum directoryResponse) { this.directoryResponse = directoryResponse; + isSetDirectoryResponse = true; // mark as set } /** @@ -432,6 +486,7 @@ public void setDirectoryResponse(DirectoryResponseEnum directoryResponse) { */ public ThreeDSecureData dsTransID(String dsTransID) { this.dsTransID = dsTransID; + isSetDsTransID = true; // mark as set return this; } @@ -459,6 +514,7 @@ public String getDsTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDsTransID(String dsTransID) { this.dsTransID = dsTransID; + isSetDsTransID = true; // mark as set } /** @@ -469,6 +525,7 @@ public void setDsTransID(String dsTransID) { */ public ThreeDSecureData eci(String eci) { this.eci = eci; + isSetEci = true; // mark as set return this; } @@ -492,6 +549,7 @@ public String getEci() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEci(String eci) { this.eci = eci; + isSetEci = true; // mark as set } /** @@ -503,6 +561,7 @@ public void setEci(String eci) { */ public ThreeDSecureData riskScore(String riskScore) { this.riskScore = riskScore; + isSetRiskScore = true; // mark as set return this; } @@ -528,6 +587,7 @@ public String getRiskScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskScore(String riskScore) { this.riskScore = riskScore; + isSetRiskScore = true; // mark as set } /** @@ -538,6 +598,7 @@ public void setRiskScore(String riskScore) { */ public ThreeDSecureData threeDSVersion(String threeDSVersion) { this.threeDSVersion = threeDSVersion; + isSetThreeDSVersion = true; // mark as set return this; } @@ -561,6 +622,7 @@ public String getThreeDSVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSVersion(String threeDSVersion) { this.threeDSVersion = threeDSVersion; + isSetThreeDSVersion = true; // mark as set } /** @@ -573,6 +635,7 @@ public void setThreeDSVersion(String threeDSVersion) { public ThreeDSecureData tokenAuthenticationVerificationValue( byte[] tokenAuthenticationVerificationValue) { this.tokenAuthenticationVerificationValue = tokenAuthenticationVerificationValue; + isSetTokenAuthenticationVerificationValue = true; // mark as set return this; } @@ -598,6 +661,7 @@ public byte[] getTokenAuthenticationVerificationValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenAuthenticationVerificationValue(byte[] tokenAuthenticationVerificationValue) { this.tokenAuthenticationVerificationValue = tokenAuthenticationVerificationValue; + isSetTokenAuthenticationVerificationValue = true; // mark as set } /** @@ -612,6 +676,7 @@ public void setTokenAuthenticationVerificationValue(byte[] tokenAuthenticationVe */ public ThreeDSecureData transStatusReason(String transStatusReason) { this.transStatusReason = transStatusReason; + isSetTransStatusReason = true; // mark as set return this; } @@ -643,6 +708,7 @@ public String getTransStatusReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransStatusReason(String transStatusReason) { this.transStatusReason = transStatusReason; + isSetTransStatusReason = true; // mark as set } /** @@ -655,6 +721,7 @@ public void setTransStatusReason(String transStatusReason) { */ public ThreeDSecureData xid(byte[] xid) { this.xid = xid; + isSetXid = true; // mark as set return this; } @@ -682,6 +749,27 @@ public byte[] getXid() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setXid(byte[] xid) { this.xid = xid; + isSetXid = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDSecureData 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 ThreeDSecureData object is equal to o. */ @@ -695,36 +783,63 @@ public boolean equals(Object o) { } ThreeDSecureData threeDSecureData = (ThreeDSecureData) o; return Objects.equals(this.authenticationResponse, threeDSecureData.authenticationResponse) + && Objects.equals( + this.isSetAuthenticationResponse, threeDSecureData.isSetAuthenticationResponse) && Arrays.equals(this.cavv, threeDSecureData.cavv) + && Objects.equals(this.isSetCavv, threeDSecureData.isSetCavv) && Objects.equals(this.cavvAlgorithm, threeDSecureData.cavvAlgorithm) + && Objects.equals(this.isSetCavvAlgorithm, threeDSecureData.isSetCavvAlgorithm) && Objects.equals(this.challengeCancel, threeDSecureData.challengeCancel) + && Objects.equals(this.isSetChallengeCancel, threeDSecureData.isSetChallengeCancel) && Objects.equals(this.directoryResponse, threeDSecureData.directoryResponse) + && Objects.equals(this.isSetDirectoryResponse, threeDSecureData.isSetDirectoryResponse) && Objects.equals(this.dsTransID, threeDSecureData.dsTransID) + && Objects.equals(this.isSetDsTransID, threeDSecureData.isSetDsTransID) && Objects.equals(this.eci, threeDSecureData.eci) + && Objects.equals(this.isSetEci, threeDSecureData.isSetEci) && Objects.equals(this.riskScore, threeDSecureData.riskScore) + && Objects.equals(this.isSetRiskScore, threeDSecureData.isSetRiskScore) && Objects.equals(this.threeDSVersion, threeDSecureData.threeDSVersion) + && Objects.equals(this.isSetThreeDSVersion, threeDSecureData.isSetThreeDSVersion) && Arrays.equals( this.tokenAuthenticationVerificationValue, threeDSecureData.tokenAuthenticationVerificationValue) + && Objects.equals( + this.isSetTokenAuthenticationVerificationValue, + threeDSecureData.isSetTokenAuthenticationVerificationValue) && Objects.equals(this.transStatusReason, threeDSecureData.transStatusReason) - && Arrays.equals(this.xid, threeDSecureData.xid); + && Objects.equals(this.isSetTransStatusReason, threeDSecureData.isSetTransStatusReason) + && Arrays.equals(this.xid, threeDSecureData.xid) + && Objects.equals(this.isSetXid, threeDSecureData.isSetXid); } @Override public int hashCode() { return Objects.hash( authenticationResponse, + isSetAuthenticationResponse, Arrays.hashCode(cavv), + isSetCavv, cavvAlgorithm, + isSetCavvAlgorithm, challengeCancel, + isSetChallengeCancel, directoryResponse, + isSetDirectoryResponse, dsTransID, + isSetDsTransID, eci, + isSetEci, riskScore, + isSetRiskScore, threeDSVersion, + isSetThreeDSVersion, Arrays.hashCode(tokenAuthenticationVerificationValue), + isSetTokenAuthenticationVerificationValue, transStatusReason, - Arrays.hashCode(xid)); + isSetTransStatusReason, + Arrays.hashCode(xid), + isSetXid); } @Override @@ -761,6 +876,66 @@ 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 (isSetAuthenticationResponse) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_RESPONSE, this.authenticationResponse); + } + if (isSetCavv) { + addIfNull(nulls, JSON_PROPERTY_CAVV, this.cavv); + } + if (isSetCavvAlgorithm) { + addIfNull(nulls, JSON_PROPERTY_CAVV_ALGORITHM, this.cavvAlgorithm); + } + if (isSetChallengeCancel) { + addIfNull(nulls, JSON_PROPERTY_CHALLENGE_CANCEL, this.challengeCancel); + } + if (isSetDirectoryResponse) { + addIfNull(nulls, JSON_PROPERTY_DIRECTORY_RESPONSE, this.directoryResponse); + } + if (isSetDsTransID) { + addIfNull(nulls, JSON_PROPERTY_DS_TRANS_I_D, this.dsTransID); + } + if (isSetEci) { + addIfNull(nulls, JSON_PROPERTY_ECI, this.eci); + } + if (isSetRiskScore) { + addIfNull(nulls, JSON_PROPERTY_RISK_SCORE, this.riskScore); + } + if (isSetThreeDSVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_VERSION, this.threeDSVersion); + } + if (isSetTokenAuthenticationVerificationValue) { + addIfNull( + nulls, + JSON_PROPERTY_TOKEN_AUTHENTICATION_VERIFICATION_VALUE, + this.tokenAuthenticationVerificationValue); + } + if (isSetTransStatusReason) { + addIfNull(nulls, JSON_PROPERTY_TRANS_STATUS_REASON, this.transStatusReason); + } + if (isSetXid) { + addIfNull(nulls, JSON_PROPERTY_XID, this.xid); + } + + 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 ThreeDSecureData given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/VoidPendingRefundRequest.java b/src/main/java/com/adyen/model/payment/VoidPendingRefundRequest.java index d1a4950fe..84776945e 100644 --- a/src/main/java/com/adyen/model/payment/VoidPendingRefundRequest.java +++ b/src/main/java/com/adyen/model/payment/VoidPendingRefundRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.payment; +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; @@ -39,37 +41,76 @@ public class VoidPendingRefundRequest { public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_MODIFICATION_AMOUNT = "modificationAmount"; private Amount modificationAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationAmount = false; + public static final String JSON_PROPERTY_MPI_DATA = "mpiData"; private ThreeDSecureData mpiData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMpiData = false; + public static final String JSON_PROPERTY_ORIGINAL_MERCHANT_REFERENCE = "originalMerchantReference"; private String originalMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalMerchantReference = false; + public static final String JSON_PROPERTY_ORIGINAL_REFERENCE = "originalReference"; private String originalReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalReference = false; + public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; private PlatformChargebackLogic platformChargebackLogic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformChargebackLogic = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + public static final String JSON_PROPERTY_TENDER_REFERENCE = "tenderReference"; private String tenderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTenderReference = false; + public static final String JSON_PROPERTY_UNIQUE_TERMINAL_ID = "uniqueTerminalId"; private String uniqueTerminalId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUniqueTerminalId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public VoidPendingRefundRequest() {} /** @@ -84,6 +125,7 @@ public VoidPendingRefundRequest() {} */ public VoidPendingRefundRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -123,6 +165,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -133,6 +176,7 @@ public void setAdditionalData(Map additionalData) { */ public VoidPendingRefundRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -156,6 +200,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -166,6 +211,7 @@ public void setMerchantAccount(String merchantAccount) { */ public VoidPendingRefundRequest modificationAmount(Amount modificationAmount) { this.modificationAmount = modificationAmount; + isSetModificationAmount = true; // mark as set return this; } @@ -189,6 +235,7 @@ public Amount getModificationAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationAmount(Amount modificationAmount) { this.modificationAmount = modificationAmount; + isSetModificationAmount = true; // mark as set } /** @@ -199,6 +246,7 @@ public void setModificationAmount(Amount modificationAmount) { */ public VoidPendingRefundRequest mpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set return this; } @@ -222,6 +270,7 @@ public ThreeDSecureData getMpiData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set } /** @@ -232,6 +281,7 @@ public void setMpiData(ThreeDSecureData mpiData) { */ public VoidPendingRefundRequest originalMerchantReference(String originalMerchantReference) { this.originalMerchantReference = originalMerchantReference; + isSetOriginalMerchantReference = true; // mark as set return this; } @@ -255,6 +305,7 @@ public String getOriginalMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalMerchantReference(String originalMerchantReference) { this.originalMerchantReference = originalMerchantReference; + isSetOriginalMerchantReference = true; // mark as set } /** @@ -267,6 +318,7 @@ public void setOriginalMerchantReference(String originalMerchantReference) { */ public VoidPendingRefundRequest originalReference(String originalReference) { this.originalReference = originalReference; + isSetOriginalReference = true; // mark as set return this; } @@ -294,6 +346,7 @@ public String getOriginalReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalReference(String originalReference) { this.originalReference = originalReference; + isSetOriginalReference = true; // mark as set } /** @@ -305,6 +358,7 @@ public void setOriginalReference(String originalReference) { public VoidPendingRefundRequest platformChargebackLogic( PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -328,6 +382,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -340,6 +395,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public VoidPendingRefundRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -367,6 +423,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -381,6 +438,7 @@ public void setReference(String reference) { */ public VoidPendingRefundRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -420,6 +478,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -431,6 +490,7 @@ public void setSplits(List splits) { */ public VoidPendingRefundRequest tenderReference(String tenderReference) { this.tenderReference = tenderReference; + isSetTenderReference = true; // mark as set return this; } @@ -456,6 +516,7 @@ public String getTenderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTenderReference(String tenderReference) { this.tenderReference = tenderReference; + isSetTenderReference = true; // mark as set } /** @@ -468,6 +529,7 @@ public void setTenderReference(String tenderReference) { */ public VoidPendingRefundRequest uniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set return this; } @@ -495,6 +557,27 @@ public String getUniqueTerminalId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public VoidPendingRefundRequest 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 VoidPendingRefundRequest object is equal to o. */ @@ -508,34 +591,63 @@ public boolean equals(Object o) { } VoidPendingRefundRequest voidPendingRefundRequest = (VoidPendingRefundRequest) o; return Objects.equals(this.additionalData, voidPendingRefundRequest.additionalData) + && Objects.equals(this.isSetAdditionalData, voidPendingRefundRequest.isSetAdditionalData) && Objects.equals(this.merchantAccount, voidPendingRefundRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, voidPendingRefundRequest.isSetMerchantAccount) && Objects.equals(this.modificationAmount, voidPendingRefundRequest.modificationAmount) + && Objects.equals( + this.isSetModificationAmount, voidPendingRefundRequest.isSetModificationAmount) && Objects.equals(this.mpiData, voidPendingRefundRequest.mpiData) + && Objects.equals(this.isSetMpiData, voidPendingRefundRequest.isSetMpiData) && Objects.equals( this.originalMerchantReference, voidPendingRefundRequest.originalMerchantReference) + && Objects.equals( + this.isSetOriginalMerchantReference, + voidPendingRefundRequest.isSetOriginalMerchantReference) && Objects.equals(this.originalReference, voidPendingRefundRequest.originalReference) + && Objects.equals( + this.isSetOriginalReference, voidPendingRefundRequest.isSetOriginalReference) && Objects.equals( this.platformChargebackLogic, voidPendingRefundRequest.platformChargebackLogic) + && Objects.equals( + this.isSetPlatformChargebackLogic, + voidPendingRefundRequest.isSetPlatformChargebackLogic) && Objects.equals(this.reference, voidPendingRefundRequest.reference) + && Objects.equals(this.isSetReference, voidPendingRefundRequest.isSetReference) && Objects.equals(this.splits, voidPendingRefundRequest.splits) + && Objects.equals(this.isSetSplits, voidPendingRefundRequest.isSetSplits) && Objects.equals(this.tenderReference, voidPendingRefundRequest.tenderReference) - && Objects.equals(this.uniqueTerminalId, voidPendingRefundRequest.uniqueTerminalId); + && Objects.equals(this.isSetTenderReference, voidPendingRefundRequest.isSetTenderReference) + && Objects.equals(this.uniqueTerminalId, voidPendingRefundRequest.uniqueTerminalId) + && Objects.equals( + this.isSetUniqueTerminalId, voidPendingRefundRequest.isSetUniqueTerminalId); } @Override public int hashCode() { return Objects.hash( additionalData, + isSetAdditionalData, merchantAccount, + isSetMerchantAccount, modificationAmount, + isSetModificationAmount, mpiData, + isSetMpiData, originalMerchantReference, + isSetOriginalMerchantReference, originalReference, + isSetOriginalReference, platformChargebackLogic, + isSetPlatformChargebackLogic, reference, + isSetReference, splits, + isSetSplits, tenderReference, - uniqueTerminalId); + isSetTenderReference, + uniqueTerminalId, + isSetUniqueTerminalId); } @Override @@ -571,6 +683,60 @@ 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 (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetModificationAmount) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_AMOUNT, this.modificationAmount); + } + if (isSetMpiData) { + addIfNull(nulls, JSON_PROPERTY_MPI_DATA, this.mpiData); + } + if (isSetOriginalMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_MERCHANT_REFERENCE, this.originalMerchantReference); + } + if (isSetOriginalReference) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_REFERENCE, this.originalReference); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetTenderReference) { + addIfNull(nulls, JSON_PROPERTY_TENDER_REFERENCE, this.tenderReference); + } + if (isSetUniqueTerminalId) { + addIfNull(nulls, JSON_PROPERTY_UNIQUE_TERMINAL_ID, this.uniqueTerminalId); + } + + 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 VoidPendingRefundRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/transactionwebhooks/Amount.java b/src/main/java/com/adyen/model/transactionwebhooks/Amount.java index 5081ada76..cde08ff1b 100644 --- a/src/main/java/com/adyen/model/transactionwebhooks/Amount.java +++ b/src/main/java/com/adyen/model/transactionwebhooks/Amount.java @@ -30,10 +30,12 @@ public Amount() {} /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * 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). + * 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) { @@ -43,10 +45,12 @@ public Amount currency(String currency) { /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * 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). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -56,10 +60,12 @@ public String getCurrency() { /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * 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). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -68,10 +74,10 @@ public void setCurrency(String currency) { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @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 */ @@ -81,10 +87,10 @@ public Amount value(Long value) { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @return value The amount of the transaction, in [minor + * @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) @@ -94,10 +100,10 @@ public Long getValue() { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @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) diff --git a/src/main/java/com/adyen/model/transactionwebhooks/BankCategoryData.java b/src/main/java/com/adyen/model/transactionwebhooks/BankCategoryData.java index ca0ad9e60..3e5ae9030 100644 --- a/src/main/java/com/adyen/model/transactionwebhooks/BankCategoryData.java +++ b/src/main/java/com/adyen/model/transactionwebhooks/BankCategoryData.java @@ -27,14 +27,14 @@ public class BankCategoryData { /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ public enum PriorityEnum { @@ -135,26 +135,26 @@ public BankCategoryData() {} /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @param priority The priority for the bank transfer. This sets the speed at which the transfer * is sent and the fees that you have to pay. Required for transfers with `category` - * **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * @return the current {@code BankCategoryData} instance, allowing for method chaining */ @@ -166,26 +166,26 @@ public BankCategoryData priority(PriorityEnum priority) { /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @return priority The priority for the bank transfer. This sets the speed at which the transfer * is sent and the fees that you have to pay. Required for transfers with `category` - * **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ @JsonProperty(JSON_PROPERTY_PRIORITY) @@ -197,26 +197,26 @@ public PriorityEnum getPriority() { /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @param priority The priority for the bank transfer. This sets the speed at which the transfer * is sent and the fees that you have to pay. Required for transfers with `category` - * **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ @JsonProperty(JSON_PROPERTY_PRIORITY) diff --git a/src/main/java/com/adyen/model/transactionwebhooks/PlatformPayment.java b/src/main/java/com/adyen/model/transactionwebhooks/PlatformPayment.java index 44d895627..4c4b7f596 100644 --- a/src/main/java/com/adyen/model/transactionwebhooks/PlatformPayment.java +++ b/src/main/java/com/adyen/model/transactionwebhooks/PlatformPayment.java @@ -47,21 +47,21 @@ public class PlatformPayment { * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of interchange - * and scheme fee) incurred on a transaction. * **AdyenCommission**: the transaction fee due to + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of interchange + * and scheme fee) incurred on a transaction. * **AdyenCommission**: The transaction fee due to * Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen under - * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the amount booked - * to your user after the deduction of the relevant fees. * **Commission**: your platform's or - * marketplace's commission on a transaction. * **DCCPlatformCommission**: the Dynamic - * Currency Conversion (DCC) fee on a transaction. * **Interchange**: the interchange fee (fee - * paid to the issuer) incurred on a transaction. * **PaymentFee**: the aggregated amount of all - * transaction fees. * **Remainder**: the leftover amount after currency conversion. * - * **SchemeFee**: the scheme fee incurred on a transaction. * **Surcharge**: the surcharge paid by - * the customer on a transaction. * **Tip**: the tip paid by the customer. * **TopUp**: an - * incoming transfer to top up your user's balance account. * **VAT**: the value-added tax + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen under + * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The amount booked + * to your user after the deduction of the relevant fees. * **Commission**: Your platform's or + * marketplace's commission on a transaction. * **DCCPlatformCommission**: The Dynamic + * Currency Conversion (DCC) fee on a transaction. * **Interchange**: The interchange fee (fee + * paid to the issuer) incurred on a transaction. * **PaymentFee**: The aggregated amount of all + * transaction fees. * **Remainder**: The leftover amount after currency conversion. * + * **SchemeFee**: The scheme fee incurred on a transaction. * **Surcharge**: The surcharge paid by + * the customer on a transaction. * **Tip**: The tip paid by the customer. * **TopUp**: An + * incoming transfer to top up your user's balance account. * **VAT**: The value-added tax * charged on the payment. */ public enum PlatformPaymentTypeEnum { @@ -292,21 +292,21 @@ public void setPaymentMerchantReference(String paymentMerchantReference) { * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of interchange - * and scheme fee) incurred on a transaction. * **AdyenCommission**: the transaction fee due to + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of interchange + * and scheme fee) incurred on a transaction. * **AdyenCommission**: The transaction fee due to * Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen under - * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the amount booked - * to your user after the deduction of the relevant fees. * **Commission**: your platform's or - * marketplace's commission on a transaction. * **DCCPlatformCommission**: the Dynamic - * Currency Conversion (DCC) fee on a transaction. * **Interchange**: the interchange fee (fee - * paid to the issuer) incurred on a transaction. * **PaymentFee**: the aggregated amount of all - * transaction fees. * **Remainder**: the leftover amount after currency conversion. * - * **SchemeFee**: the scheme fee incurred on a transaction. * **Surcharge**: the surcharge paid by - * the customer on a transaction. * **Tip**: the tip paid by the customer. * **TopUp**: an - * incoming transfer to top up your user's balance account. * **VAT**: the value-added tax + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen under + * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The amount booked + * to your user after the deduction of the relevant fees. * **Commission**: Your platform's or + * marketplace's commission on a transaction. * **DCCPlatformCommission**: The Dynamic + * Currency Conversion (DCC) fee on a transaction. * **Interchange**: The interchange fee (fee + * paid to the issuer) incurred on a transaction. * **PaymentFee**: The aggregated amount of all + * transaction fees. * **Remainder**: The leftover amount after currency conversion. * + * **SchemeFee**: The scheme fee incurred on a transaction. * **Surcharge**: The surcharge paid by + * the customer on a transaction. * **Tip**: The tip paid by the customer. * **TopUp**: An + * incoming transfer to top up your user's balance account. * **VAT**: The value-added tax * charged on the payment. * * @param platformPaymentType Specifies the nature of the transfer. This parameter helps @@ -315,22 +315,22 @@ public void setPaymentMerchantReference(String paymentMerchantReference) { * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of - * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: the + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of + * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: The * transaction fee due to Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen - * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the - * amount booked to your user after the deduction of the relevant fees. * **Commission**: your + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen + * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The + * amount booked to your user after the deduction of the relevant fees. * **Commission**: Your * platform's or marketplace's commission on a transaction. * - * **DCCPlatformCommission**: the Dynamic Currency Conversion (DCC) fee on a transaction. * - * **Interchange**: the interchange fee (fee paid to the issuer) incurred on a transaction. * - * **PaymentFee**: the aggregated amount of all transaction fees. * **Remainder**: the - * leftover amount after currency conversion. * **SchemeFee**: the scheme fee incurred on a - * transaction. * **Surcharge**: the surcharge paid by the customer on a transaction. * - * **Tip**: the tip paid by the customer. * **TopUp**: an incoming transfer to top up your - * user's balance account. * **VAT**: the value-added tax charged on the payment. + * **DCCPlatformCommission**: The Dynamic Currency Conversion (DCC) fee on a transaction. * + * **Interchange**: The interchange fee (fee paid to the issuer) incurred on a transaction. * + * **PaymentFee**: The aggregated amount of all transaction fees. * **Remainder**: The + * leftover amount after currency conversion. * **SchemeFee**: The scheme fee incurred on a + * transaction. * **Surcharge**: The surcharge paid by the customer on a transaction. * + * **Tip**: The tip paid by the customer. * **TopUp**: An incoming transfer to top up your + * user's balance account. * **VAT**: The value-added tax charged on the payment. * @return the current {@code PlatformPayment} instance, allowing for method chaining */ public PlatformPayment platformPaymentType(PlatformPaymentTypeEnum platformPaymentType) { @@ -344,21 +344,21 @@ public PlatformPayment platformPaymentType(PlatformPaymentTypeEnum platformPayme * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of interchange - * and scheme fee) incurred on a transaction. * **AdyenCommission**: the transaction fee due to + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of interchange + * and scheme fee) incurred on a transaction. * **AdyenCommission**: The transaction fee due to * Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen under - * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the amount booked - * to your user after the deduction of the relevant fees. * **Commission**: your platform's or - * marketplace's commission on a transaction. * **DCCPlatformCommission**: the Dynamic - * Currency Conversion (DCC) fee on a transaction. * **Interchange**: the interchange fee (fee - * paid to the issuer) incurred on a transaction. * **PaymentFee**: the aggregated amount of all - * transaction fees. * **Remainder**: the leftover amount after currency conversion. * - * **SchemeFee**: the scheme fee incurred on a transaction. * **Surcharge**: the surcharge paid by - * the customer on a transaction. * **Tip**: the tip paid by the customer. * **TopUp**: an - * incoming transfer to top up your user's balance account. * **VAT**: the value-added tax + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen under + * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The amount booked + * to your user after the deduction of the relevant fees. * **Commission**: Your platform's or + * marketplace's commission on a transaction. * **DCCPlatformCommission**: The Dynamic + * Currency Conversion (DCC) fee on a transaction. * **Interchange**: The interchange fee (fee + * paid to the issuer) incurred on a transaction. * **PaymentFee**: The aggregated amount of all + * transaction fees. * **Remainder**: The leftover amount after currency conversion. * + * **SchemeFee**: The scheme fee incurred on a transaction. * **Surcharge**: The surcharge paid by + * the customer on a transaction. * **Tip**: The tip paid by the customer. * **TopUp**: An + * incoming transfer to top up your user's balance account. * **VAT**: The value-added tax * charged on the payment. * * @return platformPaymentType Specifies the nature of the transfer. This parameter helps @@ -367,22 +367,22 @@ public PlatformPayment platformPaymentType(PlatformPaymentTypeEnum platformPayme * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of - * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: the + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of + * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: The * transaction fee due to Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen - * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the - * amount booked to your user after the deduction of the relevant fees. * **Commission**: your + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen + * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The + * amount booked to your user after the deduction of the relevant fees. * **Commission**: Your * platform's or marketplace's commission on a transaction. * - * **DCCPlatformCommission**: the Dynamic Currency Conversion (DCC) fee on a transaction. * - * **Interchange**: the interchange fee (fee paid to the issuer) incurred on a transaction. * - * **PaymentFee**: the aggregated amount of all transaction fees. * **Remainder**: the - * leftover amount after currency conversion. * **SchemeFee**: the scheme fee incurred on a - * transaction. * **Surcharge**: the surcharge paid by the customer on a transaction. * - * **Tip**: the tip paid by the customer. * **TopUp**: an incoming transfer to top up your - * user's balance account. * **VAT**: the value-added tax charged on the payment. + * **DCCPlatformCommission**: The Dynamic Currency Conversion (DCC) fee on a transaction. * + * **Interchange**: The interchange fee (fee paid to the issuer) incurred on a transaction. * + * **PaymentFee**: The aggregated amount of all transaction fees. * **Remainder**: The + * leftover amount after currency conversion. * **SchemeFee**: The scheme fee incurred on a + * transaction. * **Surcharge**: The surcharge paid by the customer on a transaction. * + * **Tip**: The tip paid by the customer. * **TopUp**: An incoming transfer to top up your + * user's balance account. * **VAT**: The value-added tax charged on the payment. */ @JsonProperty(JSON_PROPERTY_PLATFORM_PAYMENT_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -396,21 +396,21 @@ public PlatformPaymentTypeEnum getPlatformPaymentType() { * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of interchange - * and scheme fee) incurred on a transaction. * **AdyenCommission**: the transaction fee due to + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of interchange + * and scheme fee) incurred on a transaction. * **AdyenCommission**: The transaction fee due to * Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen under - * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the amount booked - * to your user after the deduction of the relevant fees. * **Commission**: your platform's or - * marketplace's commission on a transaction. * **DCCPlatformCommission**: the Dynamic - * Currency Conversion (DCC) fee on a transaction. * **Interchange**: the interchange fee (fee - * paid to the issuer) incurred on a transaction. * **PaymentFee**: the aggregated amount of all - * transaction fees. * **Remainder**: the leftover amount after currency conversion. * - * **SchemeFee**: the scheme fee incurred on a transaction. * **Surcharge**: the surcharge paid by - * the customer on a transaction. * **Tip**: the tip paid by the customer. * **TopUp**: an - * incoming transfer to top up your user's balance account. * **VAT**: the value-added tax + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen under + * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The amount booked + * to your user after the deduction of the relevant fees. * **Commission**: Your platform's or + * marketplace's commission on a transaction. * **DCCPlatformCommission**: The Dynamic + * Currency Conversion (DCC) fee on a transaction. * **Interchange**: The interchange fee (fee + * paid to the issuer) incurred on a transaction. * **PaymentFee**: The aggregated amount of all + * transaction fees. * **Remainder**: The leftover amount after currency conversion. * + * **SchemeFee**: The scheme fee incurred on a transaction. * **Surcharge**: The surcharge paid by + * the customer on a transaction. * **Tip**: The tip paid by the customer. * **TopUp**: An + * incoming transfer to top up your user's balance account. * **VAT**: The value-added tax * charged on the payment. * * @param platformPaymentType Specifies the nature of the transfer. This parameter helps @@ -419,22 +419,22 @@ public PlatformPaymentTypeEnum getPlatformPaymentType() { * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of - * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: the + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of + * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: The * transaction fee due to Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen - * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the - * amount booked to your user after the deduction of the relevant fees. * **Commission**: your + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen + * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The + * amount booked to your user after the deduction of the relevant fees. * **Commission**: Your * platform's or marketplace's commission on a transaction. * - * **DCCPlatformCommission**: the Dynamic Currency Conversion (DCC) fee on a transaction. * - * **Interchange**: the interchange fee (fee paid to the issuer) incurred on a transaction. * - * **PaymentFee**: the aggregated amount of all transaction fees. * **Remainder**: the - * leftover amount after currency conversion. * **SchemeFee**: the scheme fee incurred on a - * transaction. * **Surcharge**: the surcharge paid by the customer on a transaction. * - * **Tip**: the tip paid by the customer. * **TopUp**: an incoming transfer to top up your - * user's balance account. * **VAT**: the value-added tax charged on the payment. + * **DCCPlatformCommission**: The Dynamic Currency Conversion (DCC) fee on a transaction. * + * **Interchange**: The interchange fee (fee paid to the issuer) incurred on a transaction. * + * **PaymentFee**: The aggregated amount of all transaction fees. * **Remainder**: The + * leftover amount after currency conversion. * **SchemeFee**: The scheme fee incurred on a + * transaction. * **Surcharge**: The surcharge paid by the customer on a transaction. * + * **Tip**: The tip paid by the customer. * **TopUp**: An incoming transfer to top up your + * user's balance account. * **VAT**: The value-added tax charged on the payment. */ @JsonProperty(JSON_PROPERTY_PLATFORM_PAYMENT_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/test/java/com/adyen/CheckoutTest.java b/src/test/java/com/adyen/CheckoutTest.java index b81e95531..396880cdc 100644 --- a/src/test/java/com/adyen/CheckoutTest.java +++ b/src/test/java/com/adyen/CheckoutTest.java @@ -889,7 +889,7 @@ public void testForwardCardDetails() throws Exception { CheckoutForwardResponse response = recurringApi.forward(checkoutForwardRequest); - assertNull(response.getStoredPaymentMethodId()); // card is not tokenized + assertNull(response.getStoredPaymentMethodId()); // card is not tokenized assertNotNull(response.getResponse()); assertEquals(200, (int) response.getResponse().getStatus()); assertTrue(response.getResponse().getBody().contains("PAYMENT_METHOD_ID"));