diff --git a/src/main/java/com/adyen/model/acswebhooks/Amount.java b/src/main/java/com/adyen/model/acswebhooks/Amount.java index 1266aa4d6..c645735c8 100644 --- a/src/main/java/com/adyen/model/acswebhooks/Amount.java +++ b/src/main/java/com/adyen/model/acswebhooks/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.acswebhooks; +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. */ @@ -145,6 +189,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/acswebhooks/AuthenticationDecision.java b/src/main/java/com/adyen/model/acswebhooks/AuthenticationDecision.java index 78d30b6d5..bf48c7d10 100644 --- a/src/main/java/com/adyen/model/acswebhooks/AuthenticationDecision.java +++ b/src/main/java/com/adyen/model/acswebhooks/AuthenticationDecision.java @@ -11,7 +11,9 @@ package com.adyen.model.acswebhooks; +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; @@ -72,6 +74,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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AuthenticationDecision() {} /** @@ -86,6 +97,7 @@ public AuthenticationDecision() {} */ public AuthenticationDecision status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -117,6 +129,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AuthenticationDecision 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 AuthenticationDecision object is equal to o. */ @@ -156,6 +189,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 (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 AuthenticationDecision given an JSON string * diff --git a/src/main/java/com/adyen/model/acswebhooks/AuthenticationInfo.java b/src/main/java/com/adyen/model/acswebhooks/AuthenticationInfo.java index 612f7db9c..87cbad0e1 100644 --- a/src/main/java/com/adyen/model/acswebhooks/AuthenticationInfo.java +++ b/src/main/java/com/adyen/model/acswebhooks/AuthenticationInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.acswebhooks; +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; @@ -44,9 +46,15 @@ public class AuthenticationInfo { public static final String JSON_PROPERTY_ACS_TRANS_ID = "acsTransId"; private String acsTransId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsTransId = false; + public static final String JSON_PROPERTY_CHALLENGE = "challenge"; private ChallengeInfo challenge; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChallenge = false; + /** * Specifies a preference for receiving a challenge. Possible values: * **01**: No preference * * **02**: No challenge requested * **03**: Challenge requested (preference) * **04**: Challenge @@ -116,9 +124,15 @@ public static ChallengeIndicatorEnum fromValue(String value) { public static final String JSON_PROPERTY_CHALLENGE_INDICATOR = "challengeIndicator"; private ChallengeIndicatorEnum challengeIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChallengeIndicator = 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; + /** * Indicates the type of channel interface being used to initiate the transaction. Possible * values: * **app** * **browser** * **3DSRequestorInitiated** (initiated by a merchant when the @@ -169,9 +183,15 @@ public static DeviceChannelEnum fromValue(String value) { public static final String JSON_PROPERTY_DEVICE_CHANNEL = "deviceChannel"; private DeviceChannelEnum deviceChannel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceChannel = 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; + /** * Indicates the exemption type that was applied to the authentication by the issuer, if exemption * applied. Possible values: * **lowValue** * **secureCorporate** * **trustedBeneficiary** * @@ -231,9 +251,15 @@ 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_IN_P_S_D2_SCOPE = "inPSD2Scope"; private Boolean inPSD2Scope; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInPSD2Scope = false; + /** * Identifies the category of the message for a specific use case. Possible values: * **payment** * * **nonPayment** @@ -281,15 +307,27 @@ public static MessageCategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_MESSAGE_CATEGORY = "messageCategory"; private MessageCategoryEnum messageCategory; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessageCategory = 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 Integer riskScore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskScore = 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; + /** * The `transStatus` value as defined in the 3D Secure 2 specification. Possible values: * * **Y**: Authentication / Account verification successful. * **N**: Not Authenticated / Account @@ -346,6 +384,9 @@ public static TransStatusEnum fromValue(String value) { public static final String JSON_PROPERTY_TRANS_STATUS = "transStatus"; private TransStatusEnum transStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransStatus = false; + /** * Provides information on why the `transStatus` field has the specified value. For * possible values, refer to [our @@ -460,6 +501,9 @@ public static TransStatusReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_TRANS_STATUS_REASON = "transStatusReason"; private TransStatusReasonEnum transStatusReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransStatusReason = false; + /** The type of authentication performed. Possible values: * **frictionless** * **challenge** */ public enum TypeEnum { FRICTIONLESS(String.valueOf("frictionless")), @@ -504,6 +548,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 AuthenticationInfo() {} /** @@ -516,6 +569,7 @@ public AuthenticationInfo() {} */ public AuthenticationInfo acsTransId(String acsTransId) { this.acsTransId = acsTransId; + isSetAcsTransId = true; // mark as set return this; } @@ -543,6 +597,7 @@ public String getAcsTransId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsTransId(String acsTransId) { this.acsTransId = acsTransId; + isSetAcsTransId = true; // mark as set } /** @@ -553,6 +608,7 @@ public void setAcsTransId(String acsTransId) { */ public AuthenticationInfo challenge(ChallengeInfo challenge) { this.challenge = challenge; + isSetChallenge = true; // mark as set return this; } @@ -576,6 +632,7 @@ public ChallengeInfo getChallenge() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallenge(ChallengeInfo challenge) { this.challenge = challenge; + isSetChallenge = true; // mark as set } /** @@ -600,6 +657,7 @@ public void setChallenge(ChallengeInfo challenge) { */ public AuthenticationInfo challengeIndicator(ChallengeIndicatorEnum challengeIndicator) { this.challengeIndicator = challengeIndicator; + isSetChallengeIndicator = true; // mark as set return this; } @@ -651,6 +709,7 @@ public ChallengeIndicatorEnum getChallengeIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallengeIndicator(ChallengeIndicatorEnum challengeIndicator) { this.challengeIndicator = challengeIndicator; + isSetChallengeIndicator = true; // mark as set } /** @@ -665,6 +724,7 @@ public void setChallengeIndicator(ChallengeIndicatorEnum challengeIndicator) { */ public AuthenticationInfo createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -696,6 +756,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -710,6 +771,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public AuthenticationInfo deviceChannel(DeviceChannelEnum deviceChannel) { this.deviceChannel = deviceChannel; + isSetDeviceChannel = true; // mark as set return this; } @@ -741,6 +803,7 @@ public DeviceChannelEnum getDeviceChannel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceChannel(DeviceChannelEnum deviceChannel) { this.deviceChannel = deviceChannel; + isSetDeviceChannel = true; // mark as set } /** @@ -753,6 +816,7 @@ public void setDeviceChannel(DeviceChannelEnum deviceChannel) { */ public AuthenticationInfo dsTransID(String dsTransID) { this.dsTransID = dsTransID; + isSetDsTransID = true; // mark as set return this; } @@ -780,6 +844,7 @@ public String getDsTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDsTransID(String dsTransID) { this.dsTransID = dsTransID; + isSetDsTransID = true; // mark as set } /** @@ -796,6 +861,7 @@ public void setDsTransID(String dsTransID) { */ public AuthenticationInfo exemptionIndicator(ExemptionIndicatorEnum exemptionIndicator) { this.exemptionIndicator = exemptionIndicator; + isSetExemptionIndicator = true; // mark as set return this; } @@ -831,6 +897,7 @@ public ExemptionIndicatorEnum getExemptionIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExemptionIndicator(ExemptionIndicatorEnum exemptionIndicator) { this.exemptionIndicator = exemptionIndicator; + isSetExemptionIndicator = true; // mark as set } /** @@ -841,6 +908,7 @@ public void setExemptionIndicator(ExemptionIndicatorEnum exemptionIndicator) { */ public AuthenticationInfo inPSD2Scope(Boolean inPSD2Scope) { this.inPSD2Scope = inPSD2Scope; + isSetInPSD2Scope = true; // mark as set return this; } @@ -864,6 +932,7 @@ public Boolean getInPSD2Scope() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInPSD2Scope(Boolean inPSD2Scope) { this.inPSD2Scope = inPSD2Scope; + isSetInPSD2Scope = true; // mark as set } /** @@ -876,6 +945,7 @@ public void setInPSD2Scope(Boolean inPSD2Scope) { */ public AuthenticationInfo messageCategory(MessageCategoryEnum messageCategory) { this.messageCategory = messageCategory; + isSetMessageCategory = true; // mark as set return this; } @@ -903,6 +973,7 @@ public MessageCategoryEnum getMessageCategory() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessageCategory(MessageCategoryEnum messageCategory) { this.messageCategory = messageCategory; + isSetMessageCategory = true; // mark as set } /** @@ -914,6 +985,7 @@ public void setMessageCategory(MessageCategoryEnum messageCategory) { */ public AuthenticationInfo messageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set return this; } @@ -939,6 +1011,7 @@ public String getMessageVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set } /** @@ -949,6 +1022,7 @@ public void setMessageVersion(String messageVersion) { */ public AuthenticationInfo riskScore(Integer riskScore) { this.riskScore = riskScore; + isSetRiskScore = true; // mark as set return this; } @@ -972,6 +1046,7 @@ public Integer getRiskScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskScore(Integer riskScore) { this.riskScore = riskScore; + isSetRiskScore = true; // mark as set } /** @@ -983,6 +1058,7 @@ public void setRiskScore(Integer riskScore) { */ public AuthenticationInfo threeDSServerTransID(String threeDSServerTransID) { this.threeDSServerTransID = threeDSServerTransID; + isSetThreeDSServerTransID = true; // mark as set return this; } @@ -1008,6 +1084,7 @@ public String getThreeDSServerTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSServerTransID(String threeDSServerTransID) { this.threeDSServerTransID = threeDSServerTransID; + isSetThreeDSServerTransID = true; // mark as set } /** @@ -1027,6 +1104,7 @@ public void setThreeDSServerTransID(String threeDSServerTransID) { */ public AuthenticationInfo transStatus(TransStatusEnum transStatus) { this.transStatus = transStatus; + isSetTransStatus = true; // mark as set return this; } @@ -1068,6 +1146,7 @@ public TransStatusEnum getTransStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransStatus(TransStatusEnum transStatus) { this.transStatus = transStatus; + isSetTransStatus = true; // mark as set } /** @@ -1082,6 +1161,7 @@ public void setTransStatus(TransStatusEnum transStatus) { */ public AuthenticationInfo transStatusReason(TransStatusReasonEnum transStatusReason) { this.transStatusReason = transStatusReason; + isSetTransStatusReason = true; // mark as set return this; } @@ -1113,6 +1193,7 @@ public TransStatusReasonEnum getTransStatusReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransStatusReason(TransStatusReasonEnum transStatusReason) { this.transStatusReason = transStatusReason; + isSetTransStatusReason = true; // mark as set } /** @@ -1124,6 +1205,7 @@ public void setTransStatusReason(TransStatusReasonEnum transStatusReason) { */ public AuthenticationInfo type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1149,6 +1231,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 AuthenticationInfo 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 AuthenticationInfo object is equal to o. */ @@ -1233,6 +1336,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 (isSetAcsTransId) { + addIfNull(nulls, JSON_PROPERTY_ACS_TRANS_ID, this.acsTransId); + } + if (isSetChallenge) { + addIfNull(nulls, JSON_PROPERTY_CHALLENGE, this.challenge); + } + if (isSetChallengeIndicator) { + addIfNull(nulls, JSON_PROPERTY_CHALLENGE_INDICATOR, this.challengeIndicator); + } + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetDeviceChannel) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_CHANNEL, this.deviceChannel); + } + if (isSetDsTransID) { + addIfNull(nulls, JSON_PROPERTY_DS_TRANS_I_D, this.dsTransID); + } + if (isSetExemptionIndicator) { + addIfNull(nulls, JSON_PROPERTY_EXEMPTION_INDICATOR, this.exemptionIndicator); + } + if (isSetInPSD2Scope) { + addIfNull(nulls, JSON_PROPERTY_IN_P_S_D2_SCOPE, this.inPSD2Scope); + } + if (isSetMessageCategory) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_CATEGORY, this.messageCategory); + } + if (isSetMessageVersion) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_VERSION, this.messageVersion); + } + if (isSetRiskScore) { + addIfNull(nulls, JSON_PROPERTY_RISK_SCORE, this.riskScore); + } + if (isSetThreeDSServerTransID) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_SERVER_TRANS_I_D, this.threeDSServerTransID); + } + if (isSetTransStatus) { + addIfNull(nulls, JSON_PROPERTY_TRANS_STATUS, this.transStatus); + } + if (isSetTransStatusReason) { + addIfNull(nulls, JSON_PROPERTY_TRANS_STATUS_REASON, this.transStatusReason); + } + 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 AuthenticationInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/acswebhooks/AuthenticationNotificationData.java b/src/main/java/com/adyen/model/acswebhooks/AuthenticationNotificationData.java index d7acf3076..e19dfa9cd 100644 --- a/src/main/java/com/adyen/model/acswebhooks/AuthenticationNotificationData.java +++ b/src/main/java/com/adyen/model/acswebhooks/AuthenticationNotificationData.java @@ -11,7 +11,9 @@ package com.adyen.model.acswebhooks; +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 AuthenticationNotificationData { public static final String JSON_PROPERTY_AUTHENTICATION = "authentication"; private AuthenticationInfo authentication; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthentication = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + public static final String JSON_PROPERTY_PURCHASE = "purchase"; private PurchaseInfo purchase; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPurchase = false; + /** Outcome of the authentication. Allowed values: * authenticated * rejected * error */ public enum StatusEnum { AUTHENTICATED(String.valueOf("authenticated")), @@ -92,6 +109,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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AuthenticationNotificationData() {} /** @@ -103,6 +129,7 @@ public AuthenticationNotificationData() {} */ public AuthenticationNotificationData authentication(AuthenticationInfo authentication) { this.authentication = authentication; + isSetAuthentication = true; // mark as set return this; } @@ -126,6 +153,7 @@ public AuthenticationInfo getAuthentication() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthentication(AuthenticationInfo authentication) { this.authentication = authentication; + isSetAuthentication = true; // mark as set } /** @@ -137,6 +165,7 @@ public void setAuthentication(AuthenticationInfo authentication) { */ public AuthenticationNotificationData balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -160,6 +189,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -171,6 +201,7 @@ public void setBalancePlatform(String balancePlatform) { */ public AuthenticationNotificationData id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -194,6 +225,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -206,6 +238,7 @@ public void setId(String id) { */ public AuthenticationNotificationData paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -231,6 +264,7 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set } /** @@ -242,6 +276,7 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { */ public AuthenticationNotificationData purchase(PurchaseInfo purchase) { this.purchase = purchase; + isSetPurchase = true; // mark as set return this; } @@ -265,6 +300,7 @@ public PurchaseInfo getPurchase() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPurchase(PurchaseInfo purchase) { this.purchase = purchase; + isSetPurchase = true; // mark as set } /** @@ -276,6 +312,7 @@ public void setPurchase(PurchaseInfo purchase) { */ public AuthenticationNotificationData status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -300,6 +337,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AuthenticationNotificationData 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 AuthenticationNotificationData object is equal to o. */ @@ -353,6 +411,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 (isSetAuthentication) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION, this.authentication); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + if (isSetPurchase) { + addIfNull(nulls, JSON_PROPERTY_PURCHASE, this.purchase); + } + 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 AuthenticationNotificationData given an JSON string * diff --git a/src/main/java/com/adyen/model/acswebhooks/AuthenticationNotificationRequest.java b/src/main/java/com/adyen/model/acswebhooks/AuthenticationNotificationRequest.java index 076294fdf..56dd63ee3 100644 --- a/src/main/java/com/adyen/model/acswebhooks/AuthenticationNotificationRequest.java +++ b/src/main/java/com/adyen/model/acswebhooks/AuthenticationNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.acswebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class AuthenticationNotificationRequest { public static final String JSON_PROPERTY_DATA = "data"; private AuthenticationNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + /** Type of notification. */ public enum TypeEnum { BALANCEPLATFORM_AUTHENTICATION_CREATED( @@ -82,6 +93,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AuthenticationNotificationRequest() {} /** @@ -93,6 +113,7 @@ public AuthenticationNotificationRequest() {} */ public AuthenticationNotificationRequest data(AuthenticationNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -116,6 +137,7 @@ public AuthenticationNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(AuthenticationNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -128,6 +150,7 @@ public void setData(AuthenticationNotificationData data) { */ public AuthenticationNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -153,6 +176,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -164,6 +188,7 @@ public void setEnvironment(String environment) { */ public AuthenticationNotificationRequest timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set return this; } @@ -187,6 +212,7 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set } /** @@ -198,6 +224,7 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public AuthenticationNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -221,6 +248,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AuthenticationNotificationRequest 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 AuthenticationNotificationRequest object is equal to o. */ @@ -267,6 +315,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AuthenticationNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/acswebhooks/BalancePlatformNotificationResponse.java b/src/main/java/com/adyen/model/acswebhooks/BalancePlatformNotificationResponse.java index 88b15bd90..28f5cd141 100644 --- a/src/main/java/com/adyen/model/acswebhooks/BalancePlatformNotificationResponse.java +++ b/src/main/java/com/adyen/model/acswebhooks/BalancePlatformNotificationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.acswebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class BalancePlatformNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalancePlatformNotificationResponse() {} /** @@ -36,6 +47,7 @@ public BalancePlatformNotificationResponse() {} */ public BalancePlatformNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalancePlatformNotificationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalancePlatformNotificationResponse object is equal to o. */ @@ -106,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalancePlatformNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/acswebhooks/ChallengeInfo.java b/src/main/java/com/adyen/model/acswebhooks/ChallengeInfo.java index 65f350b04..06a5f4d28 100644 --- a/src/main/java/com/adyen/model/acswebhooks/ChallengeInfo.java +++ b/src/main/java/com/adyen/model/acswebhooks/ChallengeInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.acswebhooks; +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; @@ -98,6 +100,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; + /** * The flow used in the challenge. Possible values: * **PWD_OTP_PHONE_FL**: one-time password * (OTP) flow via SMS * **PWD_OTP_EMAIL_FL**: one-time password (OTP) flow via email * @@ -148,18 +153,39 @@ public static FlowEnum fromValue(String value) { public static final String JSON_PROPERTY_FLOW = "flow"; private FlowEnum flow; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFlow = false; + public static final String JSON_PROPERTY_LAST_INTERACTION = "lastInteraction"; private OffsetDateTime lastInteraction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastInteraction = false; + public static final String JSON_PROPERTY_PHONE_NUMBER = "phoneNumber"; private String phoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneNumber = false; + public static final String JSON_PROPERTY_RESENDS = "resends"; private Integer resends; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResends = false; + public static final String JSON_PROPERTY_RETRIES = "retries"; private Integer retries; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRetries = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ChallengeInfo() {} /** @@ -182,6 +208,7 @@ public ChallengeInfo() {} */ public ChallengeInfo challengeCancel(ChallengeCancelEnum challengeCancel) { this.challengeCancel = challengeCancel; + isSetChallengeCancel = true; // mark as set return this; } @@ -229,6 +256,7 @@ public ChallengeCancelEnum getChallengeCancel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallengeCancel(ChallengeCancelEnum challengeCancel) { this.challengeCancel = challengeCancel; + isSetChallengeCancel = true; // mark as set } /** @@ -243,6 +271,7 @@ public void setChallengeCancel(ChallengeCancelEnum challengeCancel) { */ public ChallengeInfo flow(FlowEnum flow) { this.flow = flow; + isSetFlow = true; // mark as set return this; } @@ -274,6 +303,7 @@ public FlowEnum getFlow() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFlow(FlowEnum flow) { this.flow = flow; + isSetFlow = true; // mark as set } /** @@ -284,6 +314,7 @@ public void setFlow(FlowEnum flow) { */ public ChallengeInfo lastInteraction(OffsetDateTime lastInteraction) { this.lastInteraction = lastInteraction; + isSetLastInteraction = true; // mark as set return this; } @@ -307,6 +338,7 @@ public OffsetDateTime getLastInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastInteraction(OffsetDateTime lastInteraction) { this.lastInteraction = lastInteraction; + isSetLastInteraction = true; // mark as set } /** @@ -317,6 +349,7 @@ public void setLastInteraction(OffsetDateTime lastInteraction) { */ public ChallengeInfo phoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set return this; } @@ -340,6 +373,7 @@ public String getPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set } /** @@ -350,6 +384,7 @@ public void setPhoneNumber(String phoneNumber) { */ public ChallengeInfo resends(Integer resends) { this.resends = resends; + isSetResends = true; // mark as set return this; } @@ -374,6 +409,7 @@ public Integer getResends() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResends(Integer resends) { this.resends = resends; + isSetResends = true; // mark as set } /** @@ -384,6 +420,7 @@ public void setResends(Integer resends) { */ public ChallengeInfo retries(Integer retries) { this.retries = retries; + isSetRetries = true; // mark as set return this; } @@ -407,6 +444,27 @@ public Integer getRetries() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRetries(Integer retries) { this.retries = retries; + isSetRetries = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ChallengeInfo 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 ChallengeInfo object is equal to o. */ @@ -456,6 +514,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 (isSetChallengeCancel) { + addIfNull(nulls, JSON_PROPERTY_CHALLENGE_CANCEL, this.challengeCancel); + } + if (isSetFlow) { + addIfNull(nulls, JSON_PROPERTY_FLOW, this.flow); + } + if (isSetLastInteraction) { + addIfNull(nulls, JSON_PROPERTY_LAST_INTERACTION, this.lastInteraction); + } + if (isSetPhoneNumber) { + addIfNull(nulls, JSON_PROPERTY_PHONE_NUMBER, this.phoneNumber); + } + if (isSetResends) { + addIfNull(nulls, JSON_PROPERTY_RESENDS, this.resends); + } + if (isSetRetries) { + addIfNull(nulls, JSON_PROPERTY_RETRIES, this.retries); + } + + 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 ChallengeInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/acswebhooks/Purchase.java b/src/main/java/com/adyen/model/acswebhooks/Purchase.java index f3d4e8ca9..dcbf6e923 100644 --- a/src/main/java/com/adyen/model/acswebhooks/Purchase.java +++ b/src/main/java/com/adyen/model/acswebhooks/Purchase.java @@ -11,6 +11,8 @@ package com.adyen.model.acswebhooks; +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,12 +30,27 @@ public class Purchase { public static final String JSON_PROPERTY_DATE = "date"; private OffsetDateTime date; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDate = 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_ORIGINAL_AMOUNT = "originalAmount"; private Amount originalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Purchase() {} /** @@ -44,6 +61,7 @@ public Purchase() {} */ public Purchase date(OffsetDateTime date) { this.date = date; + isSetDate = true; // mark as set return this; } @@ -67,6 +85,7 @@ public OffsetDateTime getDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDate(OffsetDateTime date) { this.date = date; + isSetDate = true; // mark as set } /** @@ -77,6 +96,7 @@ public void setDate(OffsetDateTime date) { */ public Purchase merchantName(String merchantName) { this.merchantName = merchantName; + isSetMerchantName = true; // mark as set return this; } @@ -100,6 +120,7 @@ public String getMerchantName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantName(String merchantName) { this.merchantName = merchantName; + isSetMerchantName = true; // mark as set } /** @@ -110,6 +131,7 @@ public void setMerchantName(String merchantName) { */ public Purchase originalAmount(Amount originalAmount) { this.originalAmount = originalAmount; + isSetOriginalAmount = true; // mark as set return this; } @@ -133,6 +155,27 @@ public Amount getOriginalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalAmount(Amount originalAmount) { this.originalAmount = originalAmount; + isSetOriginalAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Purchase 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 Purchase object is equal to o. */ @@ -176,6 +219,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 (isSetDate) { + addIfNull(nulls, JSON_PROPERTY_DATE, this.date); + } + if (isSetMerchantName) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_NAME, this.merchantName); + } + if (isSetOriginalAmount) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_AMOUNT, this.originalAmount); + } + + 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 Purchase given an JSON string * diff --git a/src/main/java/com/adyen/model/acswebhooks/PurchaseInfo.java b/src/main/java/com/adyen/model/acswebhooks/PurchaseInfo.java index 640bb6338..91e844c77 100644 --- a/src/main/java/com/adyen/model/acswebhooks/PurchaseInfo.java +++ b/src/main/java/com/adyen/model/acswebhooks/PurchaseInfo.java @@ -11,6 +11,8 @@ package com.adyen.model.acswebhooks; +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 PurchaseInfo { public static final String JSON_PROPERTY_DATE = "date"; private String date; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDate = 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_ORIGINAL_AMOUNT = "originalAmount"; private Amount originalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PurchaseInfo() {} /** @@ -43,6 +60,7 @@ public PurchaseInfo() {} */ public PurchaseInfo date(String date) { this.date = date; + isSetDate = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDate(String date) { this.date = date; + isSetDate = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setDate(String date) { */ public PurchaseInfo merchantName(String merchantName) { this.merchantName = merchantName; + isSetMerchantName = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getMerchantName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantName(String merchantName) { this.merchantName = merchantName; + isSetMerchantName = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setMerchantName(String merchantName) { */ public PurchaseInfo originalAmount(Amount originalAmount) { this.originalAmount = originalAmount; + isSetOriginalAmount = true; // mark as set return this; } @@ -132,6 +154,27 @@ public Amount getOriginalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalAmount(Amount originalAmount) { this.originalAmount = originalAmount; + isSetOriginalAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PurchaseInfo 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 PurchaseInfo object is equal to o. */ @@ -175,6 +218,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 (isSetDate) { + addIfNull(nulls, JSON_PROPERTY_DATE, this.date); + } + if (isSetMerchantName) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_NAME, this.merchantName); + } + if (isSetOriginalAmount) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_AMOUNT, this.originalAmount); + } + + 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 PurchaseInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/acswebhooks/RelayedAuthenticationRequest.java b/src/main/java/com/adyen/model/acswebhooks/RelayedAuthenticationRequest.java index 87f6ce555..a40f2481d 100644 --- a/src/main/java/com/adyen/model/acswebhooks/RelayedAuthenticationRequest.java +++ b/src/main/java/com/adyen/model/acswebhooks/RelayedAuthenticationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.acswebhooks; +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; @@ -36,21 +38,39 @@ public class RelayedAuthenticationRequest { public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + public static final String JSON_PROPERTY_PURCHASE = "purchase"; private Purchase purchase; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPurchase = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_APP_U_R_L = "threeDSRequestorAppURL"; private String threeDSRequestorAppURL; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorAppURL = false; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + /** Type of notification. */ public enum TypeEnum { BALANCEPLATFORM_AUTHENTICATION_RELAYED( @@ -94,6 +114,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 RelayedAuthenticationRequest() {} /** @@ -105,6 +134,7 @@ public RelayedAuthenticationRequest() {} */ public RelayedAuthenticationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -130,6 +160,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -140,6 +171,7 @@ public void setEnvironment(String environment) { */ public RelayedAuthenticationRequest id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -163,6 +195,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -177,6 +210,7 @@ public void setId(String id) { */ public RelayedAuthenticationRequest paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -208,6 +242,7 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set } /** @@ -218,6 +253,7 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { */ public RelayedAuthenticationRequest purchase(Purchase purchase) { this.purchase = purchase; + isSetPurchase = true; // mark as set return this; } @@ -241,6 +277,7 @@ public Purchase getPurchase() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPurchase(Purchase purchase) { this.purchase = purchase; + isSetPurchase = true; // mark as set } /** @@ -253,6 +290,7 @@ public void setPurchase(Purchase purchase) { */ public RelayedAuthenticationRequest threeDSRequestorAppURL(String threeDSRequestorAppURL) { this.threeDSRequestorAppURL = threeDSRequestorAppURL; + isSetThreeDSRequestorAppURL = true; // mark as set return this; } @@ -280,6 +318,7 @@ public String getThreeDSRequestorAppURL() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorAppURL(String threeDSRequestorAppURL) { this.threeDSRequestorAppURL = threeDSRequestorAppURL; + isSetThreeDSRequestorAppURL = true; // mark as set } /** @@ -290,6 +329,7 @@ public void setThreeDSRequestorAppURL(String threeDSRequestorAppURL) { */ public RelayedAuthenticationRequest timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set return this; } @@ -313,6 +353,7 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set } /** @@ -323,6 +364,7 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public RelayedAuthenticationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -346,6 +388,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 RelayedAuthenticationRequest 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 RelayedAuthenticationRequest object is equal to o. */ @@ -404,6 +467,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + if (isSetPurchase) { + addIfNull(nulls, JSON_PROPERTY_PURCHASE, this.purchase); + } + if (isSetThreeDSRequestorAppURL) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQUESTOR_APP_U_R_L, this.threeDSRequestorAppURL); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RelayedAuthenticationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/acswebhooks/RelayedAuthenticationResponse.java b/src/main/java/com/adyen/model/acswebhooks/RelayedAuthenticationResponse.java index edb1533bf..4e4c36d02 100644 --- a/src/main/java/com/adyen/model/acswebhooks/RelayedAuthenticationResponse.java +++ b/src/main/java/com/adyen/model/acswebhooks/RelayedAuthenticationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.acswebhooks; +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 RelayedAuthenticationResponse { public static final String JSON_PROPERTY_AUTHENTICATION_DECISION = "authenticationDecision"; private AuthenticationDecision authenticationDecision; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationDecision = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RelayedAuthenticationResponse() {} /** @@ -35,6 +46,7 @@ public RelayedAuthenticationResponse() {} public RelayedAuthenticationResponse authenticationDecision( AuthenticationDecision authenticationDecision) { this.authenticationDecision = authenticationDecision; + isSetAuthenticationDecision = true; // mark as set return this; } @@ -58,6 +70,27 @@ public AuthenticationDecision getAuthenticationDecision() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationDecision(AuthenticationDecision authenticationDecision) { this.authenticationDecision = authenticationDecision; + isSetAuthenticationDecision = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RelayedAuthenticationResponse 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 RelayedAuthenticationResponse object is equal to o. */ @@ -100,6 +133,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 (isSetAuthenticationDecision) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_DECISION, this.authenticationDecision); + } + + 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 RelayedAuthenticationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/acswebhooks/Resource.java b/src/main/java/com/adyen/model/acswebhooks/Resource.java index 37bb6def5..511231cc0 100644 --- a/src/main/java/com/adyen/model/acswebhooks/Resource.java +++ b/src/main/java/com/adyen/model/acswebhooks/Resource.java @@ -11,6 +11,8 @@ package com.adyen.model.acswebhooks; +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,12 +30,27 @@ public class Resource { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Resource() {} /** @@ -44,6 +61,7 @@ public Resource() {} */ public Resource balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -67,6 +85,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -79,6 +98,7 @@ public void setBalancePlatform(String balancePlatform) { */ public Resource creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -106,6 +126,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -116,6 +137,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public Resource id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -139,6 +161,27 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Resource 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 Resource object is equal to o. */ @@ -182,6 +225,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 (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + + 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 Resource given an JSON string * diff --git a/src/main/java/com/adyen/model/acswebhooks/ServiceError.java b/src/main/java/com/adyen/model/acswebhooks/ServiceError.java index d70fd8386..49a4655ef 100644 --- a/src/main/java/com/adyen/model/acswebhooks/ServiceError.java +++ b/src/main/java/com/adyen/model/acswebhooks/ServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.acswebhooks; +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 ServiceError { 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() {} /** @@ -51,6 +74,7 @@ public ServiceError() {} */ public ServiceError errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -74,6 +98,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setErrorCode(String errorCode) { */ public ServiceError errorType(String errorType) { this.errorType = errorType; + isSetErrorType = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getErrorType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorType(String errorType) { this.errorType = errorType; + isSetErrorType = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setErrorType(String errorType) { */ public ServiceError message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -140,6 +168,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setMessage(String message) { */ public ServiceError pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -173,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 } /** @@ -183,6 +214,7 @@ public void setPspReference(String pspReference) { */ public ServiceError status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -206,6 +238,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. */ @@ -253,6 +306,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 (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/balancecontrol/Amount.java b/src/main/java/com/adyen/model/balancecontrol/Amount.java index 076c43f80..b4b24c7ab 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. */ @@ -145,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 (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..380b12cdd 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. */ @@ -375,6 +433,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..02d1785ed 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. */ @@ -559,6 +632,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/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java index fc9b5cafd..4d4bb84eb 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,9 +33,15 @@ public class AULocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BSB_CODE = "bsbCode"; private String bsbCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBsbCode = false; + /** **auLocal** */ public enum TypeEnum { AULOCAL(String.valueOf("auLocal")); @@ -76,6 +84,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 AULocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public AULocalAccountIdentification() {} */ public AULocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -121,6 +140,7 @@ public void setAccountNumber(String accountNumber) { */ public AULocalAccountIdentification bsbCode(String bsbCode) { this.bsbCode = bsbCode; + isSetBsbCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getBsbCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBsbCode(String bsbCode) { this.bsbCode = bsbCode; + isSetBsbCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setBsbCode(String bsbCode) { */ public AULocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,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 AULocalAccountIdentification 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 AULocalAccountIdentification object is equal to o. */ @@ -224,6 +267,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBsbCode) { + addIfNull(nulls, JSON_PROPERTY_BSB_CODE, this.bsbCode); + } + 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 AULocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java index 7051c52ce..e8cc6e79f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -44,35 +46,65 @@ public class AccountHolder { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private Map capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_CONTACT_DETAILS = "contactDetails"; @Deprecated // deprecated private ContactDetails contactDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContactDetails = 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_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_LEGAL_ENTITY_ID = "legalEntityId"; private String legalEntityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalEntityId = 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_MIGRATED_ACCOUNT_HOLDER_CODE = "migratedAccountHolderCode"; private String migratedAccountHolderCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMigratedAccountHolderCode = false; + public static final String JSON_PROPERTY_PRIMARY_BALANCE_ACCOUNT = "primaryBalanceAccount"; private String primaryBalanceAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrimaryBalanceAccount = 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 account holder. Possible values: * **active**: The account holder is active * and allowed to use its capabilities. This is the initial status for account holders and balance @@ -126,12 +158,27 @@ 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_TIME_ZONE = "timeZone"; private String timeZone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZone = false; + public static final String JSON_PROPERTY_VERIFICATION_DEADLINES = "verificationDeadlines"; private List verificationDeadlines; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationDeadlines = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountHolder() {} @JsonCreator @@ -160,6 +207,7 @@ public AccountHolder( */ public AccountHolder balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -195,6 +243,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -210,6 +259,7 @@ public void setBalancePlatform(String balancePlatform) { */ public AccountHolder capabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -251,6 +301,7 @@ public Map getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -263,6 +314,7 @@ public void setCapabilities(Map capabilities) { @Deprecated // deprecated public AccountHolder contactDetails(ContactDetails contactDetails) { this.contactDetails = contactDetails; + isSetContactDetails = true; // mark as set return this; } @@ -290,6 +342,7 @@ public ContactDetails getContactDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContactDetails(ContactDetails contactDetails) { this.contactDetails = contactDetails; + isSetContactDetails = true; // mark as set } /** @@ -300,6 +353,7 @@ public void setContactDetails(ContactDetails contactDetails) { */ public AccountHolder description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -323,6 +377,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -350,6 +405,7 @@ public String getId() { */ public AccountHolder legalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set return this; } @@ -385,6 +441,7 @@ public String getLegalEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set } /** @@ -400,6 +457,7 @@ public void setLegalEntityId(String legalEntityId) { */ public AccountHolder metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -441,6 +499,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -467,6 +526,7 @@ public String getMigratedAccountHolderCode() { */ public AccountHolder primaryBalanceAccount(String primaryBalanceAccount) { this.primaryBalanceAccount = primaryBalanceAccount; + isSetPrimaryBalanceAccount = true; // mark as set return this; } @@ -498,6 +558,7 @@ public String getPrimaryBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrimaryBalanceAccount(String primaryBalanceAccount) { this.primaryBalanceAccount = primaryBalanceAccount; + isSetPrimaryBalanceAccount = true; // mark as set } /** @@ -508,6 +569,7 @@ public void setPrimaryBalanceAccount(String primaryBalanceAccount) { */ public AccountHolder reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -531,6 +593,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -552,6 +615,7 @@ public void setReference(String reference) { */ public AccountHolder status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -597,6 +661,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -612,6 +677,7 @@ public void setStatus(StatusEnum status) { */ public AccountHolder timeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set return this; } @@ -645,6 +711,7 @@ public String getTimeZone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set } /** @@ -660,6 +727,26 @@ public List getVerificationDeadlines() { return verificationDeadlines; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountHolder 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 AccountHolder object is equal to o. */ @Override public boolean equals(Object o) { @@ -740,6 +827,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 (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetContactDetails) { + addIfNull(nulls, JSON_PROPERTY_CONTACT_DETAILS, this.contactDetails); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLegalEntityId) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_ENTITY_ID, this.legalEntityId); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMigratedAccountHolderCode) { + addIfNull(nulls, JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE, this.migratedAccountHolderCode); + } + if (isSetPrimaryBalanceAccount) { + addIfNull(nulls, JSON_PROPERTY_PRIMARY_BALANCE_ACCOUNT, this.primaryBalanceAccount); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTimeZone) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE, this.timeZone); + } + if (isSetVerificationDeadlines) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_DEADLINES, this.verificationDeadlines); + } + + 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 AccountHolder given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java index 4185adeb4..3806e06bf 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -39,6 +41,9 @@ public class AccountHolderCapability { public static final String JSON_PROPERTY_ALLOWED = "allowed"; private Boolean allowed; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowed = false; + /** * The capability level that is allowed for the account holder. Possible values: * **notApplicable**, **low**, **medium**, **high**. @@ -90,18 +95,33 @@ public static AllowedLevelEnum fromValue(String value) { public static final String JSON_PROPERTY_ALLOWED_LEVEL = "allowedLevel"; private AllowedLevelEnum allowedLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedLevel = false; + public static final String JSON_PROPERTY_ALLOWED_SETTINGS = "allowedSettings"; private CapabilitySettings allowedSettings; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedSettings = false; + public static final String JSON_PROPERTY_ENABLED = "enabled"; private Boolean enabled; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnabled = false; + public static final String JSON_PROPERTY_PROBLEMS = "problems"; private List problems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProblems = false; + public static final String JSON_PROPERTY_REQUESTED = "requested"; private Boolean requested; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequested = false; + /** * The requested level of the capability. Some capabilities, such as those used in [card * issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different @@ -155,12 +175,21 @@ public static RequestedLevelEnum fromValue(String value) { public static final String JSON_PROPERTY_REQUESTED_LEVEL = "requestedLevel"; private RequestedLevelEnum requestedLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedLevel = false; + public static final String JSON_PROPERTY_REQUESTED_SETTINGS = "requestedSettings"; private CapabilitySettings requestedSettings; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedSettings = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENTS = "transferInstruments"; private List transferInstruments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstruments = false; + /** * The status of the verification checks for the capability. Possible values: * **pending**: Adyen * is running the verification. * **invalid**: The verification failed. Check if the @@ -215,6 +244,15 @@ public static VerificationStatusEnum fromValue(String value) { public static final String JSON_PROPERTY_VERIFICATION_STATUS = "verificationStatus"; private VerificationStatusEnum verificationStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountHolderCapability() {} @JsonCreator @@ -267,6 +305,7 @@ public AllowedLevelEnum getAllowedLevel() { */ public AccountHolderCapability allowedSettings(CapabilitySettings allowedSettings) { this.allowedSettings = allowedSettings; + isSetAllowedSettings = true; // mark as set return this; } @@ -290,6 +329,7 @@ public CapabilitySettings getAllowedSettings() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowedSettings(CapabilitySettings allowedSettings) { this.allowedSettings = allowedSettings; + isSetAllowedSettings = true; // mark as set } /** @@ -302,6 +342,7 @@ public void setAllowedSettings(CapabilitySettings allowedSettings) { */ public AccountHolderCapability enabled(Boolean enabled) { this.enabled = enabled; + isSetEnabled = true; // mark as set return this; } @@ -329,6 +370,7 @@ public Boolean getEnabled() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnabled(Boolean enabled) { this.enabled = enabled; + isSetEnabled = true; // mark as set } /** @@ -353,6 +395,7 @@ public List getProblems() { */ public AccountHolderCapability requested(Boolean requested) { this.requested = requested; + isSetRequested = true; // mark as set return this; } @@ -380,6 +423,7 @@ public Boolean getRequested() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequested(Boolean requested) { this.requested = requested; + isSetRequested = true; // mark as set } /** @@ -397,6 +441,7 @@ public void setRequested(Boolean requested) { */ public AccountHolderCapability requestedLevel(RequestedLevelEnum requestedLevel) { this.requestedLevel = requestedLevel; + isSetRequestedLevel = true; // mark as set return this; } @@ -434,6 +479,7 @@ public RequestedLevelEnum getRequestedLevel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestedLevel(RequestedLevelEnum requestedLevel) { this.requestedLevel = requestedLevel; + isSetRequestedLevel = true; // mark as set } /** @@ -444,6 +490,7 @@ public void setRequestedLevel(RequestedLevelEnum requestedLevel) { */ public AccountHolderCapability requestedSettings(CapabilitySettings requestedSettings) { this.requestedSettings = requestedSettings; + isSetRequestedSettings = true; // mark as set return this; } @@ -467,6 +514,7 @@ public CapabilitySettings getRequestedSettings() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestedSettings(CapabilitySettings requestedSettings) { this.requestedSettings = requestedSettings; + isSetRequestedSettings = true; // mark as set } /** @@ -500,6 +548,26 @@ public VerificationStatusEnum getVerificationStatus() { return verificationStatus; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountHolderCapability 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 AccountHolderCapability object is equal to o. */ @Override public boolean equals(Object o) { @@ -567,6 +635,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 (isSetAllowed) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED, this.allowed); + } + if (isSetAllowedLevel) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_LEVEL, this.allowedLevel); + } + if (isSetAllowedSettings) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_SETTINGS, this.allowedSettings); + } + if (isSetEnabled) { + addIfNull(nulls, JSON_PROPERTY_ENABLED, this.enabled); + } + if (isSetProblems) { + addIfNull(nulls, JSON_PROPERTY_PROBLEMS, this.problems); + } + if (isSetRequested) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED, this.requested); + } + if (isSetRequestedLevel) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED_LEVEL, this.requestedLevel); + } + if (isSetRequestedSettings) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED_SETTINGS, this.requestedSettings); + } + if (isSetTransferInstruments) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENTS, this.transferInstruments); + } + if (isSetVerificationStatus) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_STATUS, this.verificationStatus); + } + + 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 AccountHolderCapability given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java index 873291221..cccb6cb55 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -36,32 +38,65 @@ public class AccountHolderInfo { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private Map capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_CONTACT_DETAILS = "contactDetails"; @Deprecated // deprecated private ContactDetails contactDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContactDetails = 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_LEGAL_ENTITY_ID = "legalEntityId"; private String legalEntityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalEntityId = 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_MIGRATED_ACCOUNT_HOLDER_CODE = "migratedAccountHolderCode"; private String migratedAccountHolderCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMigratedAccountHolderCode = 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_TIME_ZONE = "timeZone"; private String timeZone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountHolderInfo() {} @JsonCreator @@ -85,6 +120,7 @@ public AccountHolderInfo( */ public AccountHolderInfo balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -120,6 +156,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -135,6 +172,7 @@ public void setBalancePlatform(String balancePlatform) { */ public AccountHolderInfo capabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -177,6 +215,7 @@ public Map getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -189,6 +228,7 @@ public void setCapabilities(Map capabilities) { @Deprecated // deprecated public AccountHolderInfo contactDetails(ContactDetails contactDetails) { this.contactDetails = contactDetails; + isSetContactDetails = true; // mark as set return this; } @@ -216,6 +256,7 @@ public ContactDetails getContactDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContactDetails(ContactDetails contactDetails) { this.contactDetails = contactDetails; + isSetContactDetails = true; // mark as set } /** @@ -226,6 +267,7 @@ public void setContactDetails(ContactDetails contactDetails) { */ public AccountHolderInfo description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -249,6 +291,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -265,6 +308,7 @@ public void setDescription(String description) { */ public AccountHolderInfo legalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set return this; } @@ -300,6 +344,7 @@ public String getLegalEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set } /** @@ -315,6 +360,7 @@ public void setLegalEntityId(String legalEntityId) { */ public AccountHolderInfo metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -356,6 +402,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -378,6 +425,7 @@ public String getMigratedAccountHolderCode() { */ public AccountHolderInfo reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -401,6 +449,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -416,6 +465,7 @@ public void setReference(String reference) { */ public AccountHolderInfo timeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set return this; } @@ -449,6 +499,27 @@ public String getTimeZone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountHolderInfo 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 AccountHolderInfo object is equal to o. */ @@ -516,6 +587,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 (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetContactDetails) { + addIfNull(nulls, JSON_PROPERTY_CONTACT_DETAILS, this.contactDetails); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetLegalEntityId) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_ENTITY_ID, this.legalEntityId); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMigratedAccountHolderCode) { + addIfNull(nulls, JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE, this.migratedAccountHolderCode); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetTimeZone) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE, this.timeZone); + } + + 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 AccountHolderInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolderUpdateRequest.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolderUpdateRequest.java index 48260784d..297da345b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolderUpdateRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolderUpdateRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,29 +44,53 @@ public class AccountHolderUpdateRequest { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private Map capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_CONTACT_DETAILS = "contactDetails"; @Deprecated // deprecated private ContactDetails contactDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContactDetails = 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_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE = "migratedAccountHolderCode"; private String migratedAccountHolderCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMigratedAccountHolderCode = false; + public static final String JSON_PROPERTY_PRIMARY_BALANCE_ACCOUNT = "primaryBalanceAccount"; private String primaryBalanceAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrimaryBalanceAccount = 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 account holder. Possible values: * **active**: The account holder is active * and allowed to use its capabilities. This is the initial status for account holders and balance @@ -118,12 +144,27 @@ 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_TIME_ZONE = "timeZone"; private String timeZone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZone = false; + public static final String JSON_PROPERTY_VERIFICATION_DEADLINES = "verificationDeadlines"; private List verificationDeadlines; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationDeadlines = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountHolderUpdateRequest() {} @JsonCreator @@ -150,6 +191,7 @@ public AccountHolderUpdateRequest( */ public AccountHolderUpdateRequest balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -185,6 +227,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -201,6 +244,7 @@ public void setBalancePlatform(String balancePlatform) { public AccountHolderUpdateRequest capabilities( Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -243,6 +287,7 @@ public Map getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -255,6 +300,7 @@ public void setCapabilities(Map capabilities) { @Deprecated // deprecated public AccountHolderUpdateRequest contactDetails(ContactDetails contactDetails) { this.contactDetails = contactDetails; + isSetContactDetails = true; // mark as set return this; } @@ -282,6 +328,7 @@ public ContactDetails getContactDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContactDetails(ContactDetails contactDetails) { this.contactDetails = contactDetails; + isSetContactDetails = true; // mark as set } /** @@ -292,6 +339,7 @@ public void setContactDetails(ContactDetails contactDetails) { */ public AccountHolderUpdateRequest description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -315,6 +363,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -330,6 +379,7 @@ public void setDescription(String description) { */ public AccountHolderUpdateRequest metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -371,6 +421,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -397,6 +448,7 @@ public String getMigratedAccountHolderCode() { */ public AccountHolderUpdateRequest primaryBalanceAccount(String primaryBalanceAccount) { this.primaryBalanceAccount = primaryBalanceAccount; + isSetPrimaryBalanceAccount = true; // mark as set return this; } @@ -428,6 +480,7 @@ public String getPrimaryBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrimaryBalanceAccount(String primaryBalanceAccount) { this.primaryBalanceAccount = primaryBalanceAccount; + isSetPrimaryBalanceAccount = true; // mark as set } /** @@ -438,6 +491,7 @@ public void setPrimaryBalanceAccount(String primaryBalanceAccount) { */ public AccountHolderUpdateRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -461,6 +515,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -482,6 +537,7 @@ public void setReference(String reference) { */ public AccountHolderUpdateRequest status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -527,6 +583,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -542,6 +599,7 @@ public void setStatus(StatusEnum status) { */ public AccountHolderUpdateRequest timeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set return this; } @@ -575,6 +633,7 @@ public String getTimeZone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set } /** @@ -590,6 +649,26 @@ public List getVerificationDeadlines() { return verificationDeadlines; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountHolderUpdateRequest 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 AccountHolderUpdateRequest object is equal to o. */ @Override public boolean equals(Object o) { @@ -667,6 +746,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 (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetContactDetails) { + addIfNull(nulls, JSON_PROPERTY_CONTACT_DETAILS, this.contactDetails); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMigratedAccountHolderCode) { + addIfNull(nulls, JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE, this.migratedAccountHolderCode); + } + if (isSetPrimaryBalanceAccount) { + addIfNull(nulls, JSON_PROPERTY_PRIMARY_BALANCE_ACCOUNT, this.primaryBalanceAccount); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTimeZone) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE, this.timeZone); + } + if (isSetVerificationDeadlines) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_DEADLINES, this.verificationDeadlines); + } + + 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 AccountHolderUpdateRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java b/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java index 9344d2af8..755e314d1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,6 +37,9 @@ public class AccountSupportingEntityCapability { public static final String JSON_PROPERTY_ALLOWED = "allowed"; private Boolean allowed; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowed = false; + /** * The capability level that is allowed for the account holder. Possible values: * **notApplicable**, **low**, **medium**, **high**. @@ -86,15 +91,27 @@ public static AllowedLevelEnum fromValue(String value) { public static final String JSON_PROPERTY_ALLOWED_LEVEL = "allowedLevel"; private AllowedLevelEnum allowedLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedLevel = false; + public static final String JSON_PROPERTY_ENABLED = "enabled"; private Boolean enabled; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnabled = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REQUESTED = "requested"; private Boolean requested; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequested = false; + /** * The requested level of the capability. Some capabilities, such as those used in [card * issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different @@ -148,6 +165,9 @@ public static RequestedLevelEnum fromValue(String value) { public static final String JSON_PROPERTY_REQUESTED_LEVEL = "requestedLevel"; private RequestedLevelEnum requestedLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedLevel = false; + /** * The status of the verification checks for the supporting entity capability. Possible values: * * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check @@ -202,6 +222,15 @@ public static VerificationStatusEnum fromValue(String value) { public static final String JSON_PROPERTY_VERIFICATION_STATUS = "verificationStatus"; private VerificationStatusEnum verificationStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountSupportingEntityCapability() {} @JsonCreator @@ -255,6 +284,7 @@ public AllowedLevelEnum getAllowedLevel() { */ public AccountSupportingEntityCapability enabled(Boolean enabled) { this.enabled = enabled; + isSetEnabled = true; // mark as set return this; } @@ -282,6 +312,7 @@ public Boolean getEnabled() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnabled(Boolean enabled) { this.enabled = enabled; + isSetEnabled = true; // mark as set } /** @@ -306,6 +337,7 @@ public String getId() { */ public AccountSupportingEntityCapability requested(Boolean requested) { this.requested = requested; + isSetRequested = true; // mark as set return this; } @@ -333,6 +365,7 @@ public Boolean getRequested() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequested(Boolean requested) { this.requested = requested; + isSetRequested = true; // mark as set } /** @@ -351,6 +384,7 @@ public void setRequested(Boolean requested) { */ public AccountSupportingEntityCapability requestedLevel(RequestedLevelEnum requestedLevel) { this.requestedLevel = requestedLevel; + isSetRequestedLevel = true; // mark as set return this; } @@ -388,6 +422,7 @@ public RequestedLevelEnum getRequestedLevel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestedLevel(RequestedLevelEnum requestedLevel) { this.requestedLevel = requestedLevel; + isSetRequestedLevel = true; // mark as set } /** @@ -409,6 +444,26 @@ public VerificationStatusEnum getVerificationStatus() { return verificationStatus; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountSupportingEntityCapability 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 AccountSupportingEntityCapability object is equal to o. */ @Override public boolean equals(Object o) { @@ -461,6 +516,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAllowed) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED, this.allowed); + } + if (isSetAllowedLevel) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_LEVEL, this.allowedLevel); + } + if (isSetEnabled) { + addIfNull(nulls, JSON_PROPERTY_ENABLED, this.enabled); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetRequested) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED, this.requested); + } + if (isSetRequestedLevel) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED_LEVEL, this.requestedLevel); + } + if (isSetVerificationStatus) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_STATUS, this.verificationStatus); + } + + 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 AccountSupportingEntityCapability given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ActiveNetworkTokensRestriction.java b/src/main/java/com/adyen/model/balanceplatform/ActiveNetworkTokensRestriction.java index 6a4f3a8f1..bc500bcb6 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ActiveNetworkTokensRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/ActiveNetworkTokensRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 ActiveNetworkTokensRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = 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 ActiveNetworkTokensRestriction() {} /** @@ -40,6 +54,7 @@ public ActiveNetworkTokensRestriction() {} */ public ActiveNetworkTokensRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -63,6 +78,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setOperation(String operation) { */ public ActiveNetworkTokensRestriction value(Integer value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -97,6 +114,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 ActiveNetworkTokensRestriction 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 ActiveNetworkTokensRestriction object is equal to o. */ @@ -139,6 +177,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 ActiveNetworkTokensRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java b/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java index c28210f8c..8d0684174 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -30,6 +32,9 @@ public class AdditionalBankIdentification { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + /** * The type of additional bank identification, depending on the country. Possible values: * * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) @@ -89,6 +94,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 AdditionalBankIdentification() {} /** @@ -99,6 +113,7 @@ public AdditionalBankIdentification() {} */ public AdditionalBankIdentification code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -122,6 +137,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -150,6 +166,7 @@ public void setCode(String code) { */ public AdditionalBankIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -209,6 +226,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 AdditionalBankIdentification 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 AdditionalBankIdentification object is equal to o. */ @@ -250,6 +288,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 (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + 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 AdditionalBankIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentificationRequirement.java b/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentificationRequirement.java index 179aea932..08a91ccde 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentificationRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentificationRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -89,9 +91,15 @@ public static AdditionalBankIdentificationTypeEnum fromValue(String value) { "additionalBankIdentificationType"; private AdditionalBankIdentificationTypeEnum additionalBankIdentificationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalBankIdentificationType = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + /** **additionalBankIdentificationRequirement** */ public enum TypeEnum { ADDITIONALBANKIDENTIFICATIONREQUIREMENT( @@ -135,6 +143,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 AdditionalBankIdentificationRequirement() {} /** @@ -165,6 +182,7 @@ public AdditionalBankIdentificationRequirement() {} public AdditionalBankIdentificationRequirement additionalBankIdentificationType( AdditionalBankIdentificationTypeEnum additionalBankIdentificationType) { this.additionalBankIdentificationType = additionalBankIdentificationType; + isSetAdditionalBankIdentificationType = true; // mark as set return this; } @@ -225,6 +243,7 @@ public AdditionalBankIdentificationTypeEnum getAdditionalBankIdentificationType( public void setAdditionalBankIdentificationType( AdditionalBankIdentificationTypeEnum additionalBankIdentificationType) { this.additionalBankIdentificationType = additionalBankIdentificationType; + isSetAdditionalBankIdentificationType = true; // mark as set } /** @@ -236,6 +255,7 @@ public void setAdditionalBankIdentificationType( */ public AdditionalBankIdentificationRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -259,6 +279,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -270,6 +291,7 @@ public void setDescription(String description) { */ public AdditionalBankIdentificationRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -293,6 +315,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 AdditionalBankIdentificationRequirement 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 AdditionalBankIdentificationRequirement object is equal to o. */ @@ -341,6 +384,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 (isSetAdditionalBankIdentificationType) { + addIfNull( + nulls, + JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION_TYPE, + this.additionalBankIdentificationType); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + 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 AdditionalBankIdentificationRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Address.java b/src/main/java/com/adyen/model/balanceplatform/Address.java index 314642ec9..6142a5604 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Address.java +++ b/src/main/java/com/adyen/model/balanceplatform/Address.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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. */ @@ -325,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 (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/balanceplatform/AddressRequirement.java b/src/main/java/com/adyen/model/balanceplatform/AddressRequirement.java index e5f9be663..aa7609591 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AddressRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/AddressRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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 AddressRequirement { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + /** Gets or Sets requiredAddressFields */ public enum RequiredAddressFieldsEnum { CITY(String.valueOf("city")), @@ -83,6 +88,9 @@ public static RequiredAddressFieldsEnum fromValue(String value) { public static final String JSON_PROPERTY_REQUIRED_ADDRESS_FIELDS = "requiredAddressFields"; private List requiredAddressFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequiredAddressFields = false; + /** **addressRequirement** */ public enum TypeEnum { ADDRESSREQUIREMENT(String.valueOf("addressRequirement")); @@ -125,6 +133,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 AddressRequirement() {} /** @@ -135,6 +152,7 @@ public AddressRequirement() {} */ public AddressRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -158,6 +176,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -169,6 +188,7 @@ public void setDescription(String description) { public AddressRequirement requiredAddressFields( List requiredAddressFields) { this.requiredAddressFields = requiredAddressFields; + isSetRequiredAddressFields = true; // mark as set return this; } @@ -201,6 +221,7 @@ public List getRequiredAddressFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequiredAddressFields(List requiredAddressFields) { this.requiredAddressFields = requiredAddressFields; + isSetRequiredAddressFields = true; // mark as set } /** @@ -211,6 +232,7 @@ public void setRequiredAddressFields(List requiredAdd */ public AddressRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -234,6 +256,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 AddressRequirement 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 AddressRequirement object is equal to o. */ @@ -279,6 +322,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetRequiredAddressFields) { + addIfNull(nulls, JSON_PROPERTY_REQUIRED_ADDRESS_FIELDS, this.requiredAddressFields); + } + 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 AddressRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Amount.java b/src/main/java/com/adyen/model/balanceplatform/Amount.java index 4cad929f3..7162cab4b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Amount.java +++ b/src/main/java/com/adyen/model/balanceplatform/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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. */ @@ -145,6 +189,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/balanceplatform/AmountMinMaxRequirement.java b/src/main/java/com/adyen/model/balanceplatform/AmountMinMaxRequirement.java index d46f7786d..91550b3a1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AmountMinMaxRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/AmountMinMaxRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -32,12 +34,21 @@ public class AmountMinMaxRequirement { 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_MAX = "max"; private Long max; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMax = false; + public static final String JSON_PROPERTY_MIN = "min"; private Long min; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMin = false; + /** **amountMinMaxRequirement** */ public enum TypeEnum { AMOUNTMINMAXREQUIREMENT(String.valueOf("amountMinMaxRequirement")); @@ -80,6 +91,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 AmountMinMaxRequirement() {} /** @@ -90,6 +110,7 @@ public AmountMinMaxRequirement() {} */ public AmountMinMaxRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -113,6 +134,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -123,6 +145,7 @@ public void setDescription(String description) { */ public AmountMinMaxRequirement max(Long max) { this.max = max; + isSetMax = true; // mark as set return this; } @@ -146,6 +169,7 @@ public Long getMax() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMax(Long max) { this.max = max; + isSetMax = true; // mark as set } /** @@ -156,6 +180,7 @@ public void setMax(Long max) { */ public AmountMinMaxRequirement min(Long min) { this.min = min; + isSetMin = true; // mark as set return this; } @@ -179,6 +204,7 @@ public Long getMin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMin(Long min) { this.min = min; + isSetMin = true; // mark as set } /** @@ -189,6 +215,7 @@ public void setMin(Long min) { */ public AmountMinMaxRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -212,6 +239,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 AmountMinMaxRequirement 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 AmountMinMaxRequirement object is equal to o. */ @@ -257,6 +305,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetMax) { + addIfNull(nulls, JSON_PROPERTY_MAX, this.max); + } + if (isSetMin) { + addIfNull(nulls, JSON_PROPERTY_MIN, this.min); + } + 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 AmountMinMaxRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AmountNonZeroDecimalsRequirement.java b/src/main/java/com/adyen/model/balanceplatform/AmountNonZeroDecimalsRequirement.java index 935aad63b..ddae8dde4 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AmountNonZeroDecimalsRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/AmountNonZeroDecimalsRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -30,6 +32,9 @@ public class AmountNonZeroDecimalsRequirement { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + /** **amountNonZeroDecimalsRequirement** */ public enum TypeEnum { AMOUNTNONZERODECIMALSREQUIREMENT(String.valueOf("amountNonZeroDecimalsRequirement")); @@ -72,6 +77,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 AmountNonZeroDecimalsRequirement() {} /** @@ -86,6 +100,7 @@ public AmountNonZeroDecimalsRequirement() {} */ public AmountNonZeroDecimalsRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -115,6 +130,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -126,6 +142,7 @@ public void setDescription(String description) { */ public AmountNonZeroDecimalsRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -149,6 +166,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 AmountNonZeroDecimalsRequirement 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 AmountNonZeroDecimalsRequirement object is equal to o. */ @@ -191,6 +229,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + 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 AmountNonZeroDecimalsRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ApproveAssociationRequest.java b/src/main/java/com/adyen/model/balanceplatform/ApproveAssociationRequest.java index c1833fecc..b64dc1f8d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ApproveAssociationRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/ApproveAssociationRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,15 +32,33 @@ public class ApproveAssociationRequest { public static final String JSON_PROPERTY_ENTITY_ID = "entityId"; private String entityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityId = false; + public static final String JSON_PROPERTY_ENTITY_TYPE = "entityType"; private ScaEntityType entityType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityType = false; + public static final String JSON_PROPERTY_SCA_DEVICE_IDS = "scaDeviceIds"; private List scaDeviceIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaDeviceIds = false; + public static final String JSON_PROPERTY_STATUS = "status"; private AssociationStatus 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 ApproveAssociationRequest() {} /** @@ -49,6 +69,7 @@ public ApproveAssociationRequest() {} */ public ApproveAssociationRequest entityId(String entityId) { this.entityId = entityId; + isSetEntityId = true; // mark as set return this; } @@ -72,6 +93,7 @@ public String getEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityId(String entityId) { this.entityId = entityId; + isSetEntityId = true; // mark as set } /** @@ -82,6 +104,7 @@ public void setEntityId(String entityId) { */ public ApproveAssociationRequest entityType(ScaEntityType entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set return this; } @@ -105,6 +128,7 @@ public ScaEntityType getEntityType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityType(ScaEntityType entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set } /** @@ -115,6 +139,7 @@ public void setEntityType(ScaEntityType entityType) { */ public ApproveAssociationRequest scaDeviceIds(List scaDeviceIds) { this.scaDeviceIds = scaDeviceIds; + isSetScaDeviceIds = true; // mark as set return this; } @@ -146,6 +171,7 @@ public List getScaDeviceIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaDeviceIds(List scaDeviceIds) { this.scaDeviceIds = scaDeviceIds; + isSetScaDeviceIds = true; // mark as set } /** @@ -156,6 +182,7 @@ public void setScaDeviceIds(List scaDeviceIds) { */ public ApproveAssociationRequest status(AssociationStatus status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -179,6 +206,27 @@ public AssociationStatus getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(AssociationStatus status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ApproveAssociationRequest 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 ApproveAssociationRequest object is equal to o. */ @@ -224,6 +272,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 (isSetEntityId) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_ID, this.entityId); + } + if (isSetEntityType) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_TYPE, this.entityType); + } + if (isSetScaDeviceIds) { + addIfNull(nulls, JSON_PROPERTY_SCA_DEVICE_IDS, this.scaDeviceIds); + } + 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 ApproveAssociationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ApproveAssociationResponse.java b/src/main/java/com/adyen/model/balanceplatform/ApproveAssociationResponse.java index b4b635d03..ca7a32124 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ApproveAssociationResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/ApproveAssociationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,6 +27,15 @@ public class ApproveAssociationResponse { public static final String JSON_PROPERTY_SCA_ASSOCIATIONS = "scaAssociations"; private List scaAssociations; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaAssociations = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ApproveAssociationResponse() {} /** @@ -35,6 +46,7 @@ public ApproveAssociationResponse() {} */ public ApproveAssociationResponse scaAssociations(List scaAssociations) { this.scaAssociations = scaAssociations; + isSetScaAssociations = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getScaAssociations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaAssociations(List scaAssociations) { this.scaAssociations = scaAssociations; + isSetScaAssociations = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ApproveAssociationResponse 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 ApproveAssociationResponse object is equal to o. */ @@ -105,6 +138,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 (isSetScaAssociations) { + addIfNull(nulls, JSON_PROPERTY_SCA_ASSOCIATIONS, this.scaAssociations); + } + + 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 ApproveAssociationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ApproveTransferLimitRequest.java b/src/main/java/com/adyen/model/balanceplatform/ApproveTransferLimitRequest.java index 929efbb85..d52c737dc 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ApproveTransferLimitRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/ApproveTransferLimitRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,6 +27,15 @@ public class ApproveTransferLimitRequest { public static final String JSON_PROPERTY_TRANSFER_LIMIT_IDS = "transferLimitIds"; private List transferLimitIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferLimitIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ApproveTransferLimitRequest() {} /** @@ -37,6 +48,7 @@ public ApproveTransferLimitRequest() {} */ public ApproveTransferLimitRequest transferLimitIds(List transferLimitIds) { this.transferLimitIds = transferLimitIds; + isSetTransferLimitIds = true; // mark as set return this; } @@ -72,6 +84,27 @@ public List getTransferLimitIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferLimitIds(List transferLimitIds) { this.transferLimitIds = transferLimitIds; + isSetTransferLimitIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ApproveTransferLimitRequest 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 ApproveTransferLimitRequest object is equal to o. */ @@ -111,6 +144,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 (isSetTransferLimitIds) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_LIMIT_IDS, this.transferLimitIds); + } + + 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 ApproveTransferLimitRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Association.java b/src/main/java/com/adyen/model/balanceplatform/Association.java index 8790afdde..b3f8ce1e4 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Association.java +++ b/src/main/java/com/adyen/model/balanceplatform/Association.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 Association { public static final String JSON_PROPERTY_ENTITY_ID = "entityId"; private String entityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityId = false; + public static final String JSON_PROPERTY_ENTITY_TYPE = "entityType"; private ScaEntityType entityType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityType = false; + public static final String JSON_PROPERTY_SCA_DEVICE_ID = "scaDeviceId"; private String scaDeviceId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaDeviceId = false; + public static final String JSON_PROPERTY_STATUS = "status"; private AssociationStatus 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 Association() {} /** @@ -47,6 +67,7 @@ public Association() {} */ public Association entityId(String entityId) { this.entityId = entityId; + isSetEntityId = true; // mark as set return this; } @@ -70,6 +91,7 @@ public String getEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityId(String entityId) { this.entityId = entityId; + isSetEntityId = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setEntityId(String entityId) { */ public Association entityType(ScaEntityType entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set return this; } @@ -103,6 +126,7 @@ public ScaEntityType getEntityType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityType(ScaEntityType entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setEntityType(ScaEntityType entityType) { */ public Association scaDeviceId(String scaDeviceId) { this.scaDeviceId = scaDeviceId; + isSetScaDeviceId = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getScaDeviceId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaDeviceId(String scaDeviceId) { this.scaDeviceId = scaDeviceId; + isSetScaDeviceId = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setScaDeviceId(String scaDeviceId) { */ public Association status(AssociationStatus status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -169,6 +196,27 @@ public AssociationStatus getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(AssociationStatus status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Association 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 Association object is equal to o. */ @@ -214,6 +262,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEntityId) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_ID, this.entityId); + } + if (isSetEntityType) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_TYPE, this.entityType); + } + if (isSetScaDeviceId) { + addIfNull(nulls, JSON_PROPERTY_SCA_DEVICE_ID, this.scaDeviceId); + } + 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 Association given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AssociationDelegatedAuthenticationData.java b/src/main/java/com/adyen/model/balanceplatform/AssociationDelegatedAuthenticationData.java index 9110d316e..cf88382f4 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AssociationDelegatedAuthenticationData.java +++ b/src/main/java/com/adyen/model/balanceplatform/AssociationDelegatedAuthenticationData.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 AssociationDelegatedAuthenticationData { public static final String JSON_PROPERTY_SDK_OUTPUT = "sdkOutput"; private String sdkOutput; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkOutput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AssociationDelegatedAuthenticationData() {} /** @@ -36,6 +47,7 @@ public AssociationDelegatedAuthenticationData() {} */ public AssociationDelegatedAuthenticationData sdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getSdkOutput() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AssociationDelegatedAuthenticationData 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 AssociationDelegatedAuthenticationData object is equal to o. */ @@ -103,6 +136,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 (isSetSdkOutput) { + addIfNull(nulls, JSON_PROPERTY_SDK_OUTPUT, this.sdkOutput); + } + + 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 AssociationDelegatedAuthenticationData given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AssociationFinaliseRequest.java b/src/main/java/com/adyen/model/balanceplatform/AssociationFinaliseRequest.java index a12d143a7..ffb7cdf44 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AssociationFinaliseRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/AssociationFinaliseRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,10 +35,16 @@ public class AssociationFinaliseRequest { public static final String JSON_PROPERTY_IDS = "ids"; private List ids; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIds = false; + public static final String JSON_PROPERTY_STRONG_CUSTOMER_AUTHENTICATION = "strongCustomerAuthentication"; private AssociationDelegatedAuthenticationData strongCustomerAuthentication; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStrongCustomerAuthentication = false; + /** * The type of resource that you are associating with the SCA device. Possible value: * **PaymentInstrument** @@ -82,6 +90,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 AssociationFinaliseRequest() {} /** @@ -94,6 +111,7 @@ public AssociationFinaliseRequest() {} */ public AssociationFinaliseRequest ids(List ids) { this.ids = ids; + isSetIds = true; // mark as set return this; } @@ -129,6 +147,7 @@ public List getIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIds(List ids) { this.ids = ids; + isSetIds = true; // mark as set } /** @@ -140,6 +159,7 @@ public void setIds(List ids) { public AssociationFinaliseRequest strongCustomerAuthentication( AssociationDelegatedAuthenticationData strongCustomerAuthentication) { this.strongCustomerAuthentication = strongCustomerAuthentication; + isSetStrongCustomerAuthentication = true; // mark as set return this; } @@ -164,6 +184,7 @@ public AssociationDelegatedAuthenticationData getStrongCustomerAuthentication() public void setStrongCustomerAuthentication( AssociationDelegatedAuthenticationData strongCustomerAuthentication) { this.strongCustomerAuthentication = strongCustomerAuthentication; + isSetStrongCustomerAuthentication = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setStrongCustomerAuthentication( */ public AssociationFinaliseRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -203,6 +225,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 AssociationFinaliseRequest 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 AssociationFinaliseRequest object is equal to o. */ @@ -250,6 +293,37 @@ 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 (isSetIds) { + addIfNull(nulls, JSON_PROPERTY_IDS, this.ids); + } + if (isSetStrongCustomerAuthentication) { + addIfNull( + nulls, JSON_PROPERTY_STRONG_CUSTOMER_AUTHENTICATION, this.strongCustomerAuthentication); + } + 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 AssociationFinaliseRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AssociationFinaliseResponse.java b/src/main/java/com/adyen/model/balanceplatform/AssociationFinaliseResponse.java index 5f88ae408..bdc2e7e11 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AssociationFinaliseResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/AssociationFinaliseResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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 AssociationFinaliseResponse { public static final String JSON_PROPERTY_DEVICE_ID = "deviceId"; private String deviceId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceId = false; + public static final String JSON_PROPERTY_IDS = "ids"; private List ids; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIds = false; + /** The type of resource that you associated with the SCA device. */ public enum TypeEnum { PAYMENT_INSTRUMENT(String.valueOf("PAYMENT_INSTRUMENT")); @@ -78,6 +86,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 AssociationFinaliseResponse() {} /** @@ -88,6 +105,7 @@ public AssociationFinaliseResponse() {} */ public AssociationFinaliseResponse deviceId(String deviceId) { this.deviceId = deviceId; + isSetDeviceId = true; // mark as set return this; } @@ -111,6 +129,7 @@ public String getDeviceId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceId(String deviceId) { this.deviceId = deviceId; + isSetDeviceId = true; // mark as set } /** @@ -122,6 +141,7 @@ public void setDeviceId(String deviceId) { */ public AssociationFinaliseResponse ids(List ids) { this.ids = ids; + isSetIds = true; // mark as set return this; } @@ -155,6 +175,7 @@ public List getIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIds(List ids) { this.ids = ids; + isSetIds = true; // mark as set } /** @@ -165,6 +186,7 @@ public void setIds(List ids) { */ public AssociationFinaliseResponse type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -188,6 +210,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 AssociationFinaliseResponse 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 AssociationFinaliseResponse object is equal to o. */ @@ -231,6 +274,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 (isSetDeviceId) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_ID, this.deviceId); + } + if (isSetIds) { + addIfNull(nulls, JSON_PROPERTY_IDS, this.ids); + } + 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 AssociationFinaliseResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AssociationInitiateRequest.java b/src/main/java/com/adyen/model/balanceplatform/AssociationInitiateRequest.java index 848ef857b..3e515eb38 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AssociationInitiateRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/AssociationInitiateRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -32,6 +34,9 @@ public class AssociationInitiateRequest { public static final String JSON_PROPERTY_IDS = "ids"; private List ids; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIds = false; + /** * The type of resource that you are associating with the SCA device. Possible value: * **PaymentInstrument** @@ -77,6 +82,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 AssociationInitiateRequest() {} /** @@ -89,6 +103,7 @@ public AssociationInitiateRequest() {} */ public AssociationInitiateRequest ids(List ids) { this.ids = ids; + isSetIds = true; // mark as set return this; } @@ -124,6 +139,7 @@ public List getIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIds(List ids) { this.ids = ids; + isSetIds = true; // mark as set } /** @@ -136,6 +152,7 @@ public void setIds(List ids) { */ public AssociationInitiateRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -163,6 +180,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 AssociationInitiateRequest 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 AssociationInitiateRequest object is equal to o. */ @@ -204,6 +242,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 (isSetIds) { + addIfNull(nulls, JSON_PROPERTY_IDS, this.ids); + } + 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 AssociationInitiateRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AssociationInitiateResponse.java b/src/main/java/com/adyen/model/balanceplatform/AssociationInitiateResponse.java index ed4a2253c..3a93c2f15 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AssociationInitiateResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/AssociationInitiateResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 AssociationInitiateResponse { public static final String JSON_PROPERTY_SDK_INPUT = "sdkInput"; private String sdkInput; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkInput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AssociationInitiateResponse() {} /** @@ -34,6 +45,7 @@ public AssociationInitiateResponse() {} */ public AssociationInitiateResponse sdkInput(String sdkInput) { this.sdkInput = sdkInput; + isSetSdkInput = true; // mark as set return this; } @@ -59,6 +71,27 @@ public String getSdkInput() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkInput(String sdkInput) { this.sdkInput = sdkInput; + isSetSdkInput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AssociationInitiateResponse 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 AssociationInitiateResponse object is equal to o. */ @@ -98,6 +131,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 (isSetSdkInput) { + addIfNull(nulls, JSON_PROPERTY_SDK_INPUT, this.sdkInput); + } + + 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 AssociationInitiateResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AssociationListing.java b/src/main/java/com/adyen/model/balanceplatform/AssociationListing.java index d9607c7ec..9ca77e1e8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AssociationListing.java +++ b/src/main/java/com/adyen/model/balanceplatform/AssociationListing.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,24 +34,51 @@ public class AssociationListing { 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_ENTITY_ID = "entityId"; private String entityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityId = false; + public static final String JSON_PROPERTY_ENTITY_TYPE = "entityType"; private ScaEntityType entityType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityType = false; + public static final String JSON_PROPERTY_SCA_DEVICE_ID = "scaDeviceId"; private String scaDeviceId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaDeviceId = false; + public static final String JSON_PROPERTY_SCA_DEVICE_NAME = "scaDeviceName"; private String scaDeviceName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaDeviceName = false; + public static final String JSON_PROPERTY_SCA_DEVICE_TYPE = "scaDeviceType"; private ScaDeviceType scaDeviceType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaDeviceType = false; + public static final String JSON_PROPERTY_STATUS = "status"; private AssociationStatus 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 AssociationListing() {} /** @@ -60,6 +89,7 @@ public AssociationListing() {} */ public AssociationListing createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -83,6 +113,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -93,6 +124,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public AssociationListing entityId(String entityId) { this.entityId = entityId; + isSetEntityId = true; // mark as set return this; } @@ -116,6 +148,7 @@ public String getEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityId(String entityId) { this.entityId = entityId; + isSetEntityId = true; // mark as set } /** @@ -126,6 +159,7 @@ public void setEntityId(String entityId) { */ public AssociationListing entityType(ScaEntityType entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set return this; } @@ -149,6 +183,7 @@ public ScaEntityType getEntityType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityType(ScaEntityType entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set } /** @@ -159,6 +194,7 @@ public void setEntityType(ScaEntityType entityType) { */ public AssociationListing scaDeviceId(String scaDeviceId) { this.scaDeviceId = scaDeviceId; + isSetScaDeviceId = true; // mark as set return this; } @@ -182,6 +218,7 @@ public String getScaDeviceId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaDeviceId(String scaDeviceId) { this.scaDeviceId = scaDeviceId; + isSetScaDeviceId = true; // mark as set } /** @@ -192,6 +229,7 @@ public void setScaDeviceId(String scaDeviceId) { */ public AssociationListing scaDeviceName(String scaDeviceName) { this.scaDeviceName = scaDeviceName; + isSetScaDeviceName = true; // mark as set return this; } @@ -215,6 +253,7 @@ public String getScaDeviceName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaDeviceName(String scaDeviceName) { this.scaDeviceName = scaDeviceName; + isSetScaDeviceName = true; // mark as set } /** @@ -225,6 +264,7 @@ public void setScaDeviceName(String scaDeviceName) { */ public AssociationListing scaDeviceType(ScaDeviceType scaDeviceType) { this.scaDeviceType = scaDeviceType; + isSetScaDeviceType = true; // mark as set return this; } @@ -248,6 +288,7 @@ public ScaDeviceType getScaDeviceType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaDeviceType(ScaDeviceType scaDeviceType) { this.scaDeviceType = scaDeviceType; + isSetScaDeviceType = true; // mark as set } /** @@ -258,6 +299,7 @@ public void setScaDeviceType(ScaDeviceType scaDeviceType) { */ public AssociationListing status(AssociationStatus status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -281,6 +323,27 @@ public AssociationStatus getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(AssociationStatus status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AssociationListing 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 AssociationListing object is equal to o. */ @@ -333,6 +396,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetEntityId) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_ID, this.entityId); + } + if (isSetEntityType) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_TYPE, this.entityType); + } + if (isSetScaDeviceId) { + addIfNull(nulls, JSON_PROPERTY_SCA_DEVICE_ID, this.scaDeviceId); + } + if (isSetScaDeviceName) { + addIfNull(nulls, JSON_PROPERTY_SCA_DEVICE_NAME, this.scaDeviceName); + } + if (isSetScaDeviceType) { + addIfNull(nulls, JSON_PROPERTY_SCA_DEVICE_TYPE, this.scaDeviceType); + } + 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 AssociationListing given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Authentication.java b/src/main/java/com/adyen/model/balanceplatform/Authentication.java index b1ca55240..08bbea000 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Authentication.java +++ b/src/main/java/com/adyen/model/balanceplatform/Authentication.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 Authentication { public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_PASSWORD = "password"; private String password; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPassword = false; + public static final String JSON_PROPERTY_PHONE = "phone"; private Phone phone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Authentication() {} /** @@ -43,6 +60,7 @@ public Authentication() {} */ public Authentication email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -82,6 +101,7 @@ public void setEmail(String email) { */ public Authentication password(String password) { this.password = password; + isSetPassword = true; // mark as set return this; } @@ -117,6 +137,7 @@ public String getPassword() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPassword(String password) { this.password = password; + isSetPassword = true; // mark as set } /** @@ -127,6 +148,7 @@ public void setPassword(String password) { */ public Authentication phone(Phone phone) { this.phone = phone; + isSetPhone = true; // mark as set return this; } @@ -150,6 +172,27 @@ public Phone getPhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhone(Phone phone) { this.phone = phone; + isSetPhone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Authentication 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 Authentication object is equal to o. */ @@ -193,6 +236,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 (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetPassword) { + addIfNull(nulls, JSON_PROPERTY_PASSWORD, this.password); + } + if (isSetPhone) { + addIfNull(nulls, JSON_PROPERTY_PHONE, this.phone); + } + + 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 Authentication given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/AuthorisedCardUsers.java b/src/main/java/com/adyen/model/balanceplatform/AuthorisedCardUsers.java index fae830b57..49e4758c3 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AuthorisedCardUsers.java +++ b/src/main/java/com/adyen/model/balanceplatform/AuthorisedCardUsers.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,6 +27,15 @@ public class AuthorisedCardUsers { public static final String JSON_PROPERTY_LEGAL_ENTITY_IDS = "legalEntityIds"; private List legalEntityIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalEntityIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AuthorisedCardUsers() {} /** @@ -36,6 +47,7 @@ public AuthorisedCardUsers() {} */ public AuthorisedCardUsers legalEntityIds(List legalEntityIds) { this.legalEntityIds = legalEntityIds; + isSetLegalEntityIds = true; // mark as set return this; } @@ -69,6 +81,27 @@ public List getLegalEntityIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalEntityIds(List legalEntityIds) { this.legalEntityIds = legalEntityIds; + isSetLegalEntityIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AuthorisedCardUsers 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 AuthorisedCardUsers object is equal to o. */ @@ -108,6 +141,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 (isSetLegalEntityIds) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_ENTITY_IDS, this.legalEntityIds); + } + + 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 AuthorisedCardUsers given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BRLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/BRLocalAccountIdentification.java index 163d24a87..d925cba96 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BRLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/BRLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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 BRLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + public static final String JSON_PROPERTY_BRANCH_NUMBER = "branchNumber"; private String branchNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBranchNumber = false; + public static final String JSON_PROPERTY_ISPB = "ispb"; private String ispb; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIspb = false; + /** **brLocal** */ public enum TypeEnum { BRLOCAL(String.valueOf("brLocal")); @@ -84,6 +98,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 BRLocalAccountIdentification() {} /** @@ -94,6 +117,7 @@ public BRLocalAccountIdentification() {} */ public BRLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +141,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +152,7 @@ public void setAccountNumber(String accountNumber) { */ public BRLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -150,6 +176,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -160,6 +187,7 @@ public void setBankCode(String bankCode) { */ public BRLocalAccountIdentification branchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set return this; } @@ -183,6 +211,7 @@ public String getBranchNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBranchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set } /** @@ -193,6 +222,7 @@ public void setBranchNumber(String branchNumber) { */ public BRLocalAccountIdentification ispb(String ispb) { this.ispb = ispb; + isSetIspb = true; // mark as set return this; } @@ -216,6 +246,7 @@ public String getIspb() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIspb(String ispb) { this.ispb = ispb; + isSetIspb = true; // mark as set } /** @@ -226,6 +257,7 @@ public void setIspb(String ispb) { */ public BRLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -249,6 +281,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 BRLocalAccountIdentification 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 BRLocalAccountIdentification object is equal to o. */ @@ -296,6 +349,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetBranchNumber) { + addIfNull(nulls, JSON_PROPERTY_BRANCH_NUMBER, this.branchNumber); + } + if (isSetIspb) { + addIfNull(nulls, JSON_PROPERTY_ISPB, this.ispb); + } + 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 BRLocalAccountIdentification 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 8d4a8c88f..b7531d3c0 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Balance.java +++ b/src/main/java/com/adyen/model/balanceplatform/Balance.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,24 +25,52 @@ Balance.JSON_PROPERTY_BALANCE, Balance.JSON_PROPERTY_CURRENCY, Balance.JSON_PROPERTY_PENDING, + Balance.JSON_PROPERTY_PENDING_AVAILABLE, Balance.JSON_PROPERTY_RESERVED }) public class Balance { public static final String JSON_PROPERTY_AVAILABLE = "available"; private Long available; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAvailable = false; + public static final String JSON_PROPERTY_BALANCE = "balance"; private Long balance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalance = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_PENDING = "pending"; private Long pending; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPending = false; + + public static final String JSON_PROPERTY_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; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReserved = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Balance() {} /** @@ -51,6 +81,7 @@ public Balance() {} */ public Balance available(Long available) { this.available = available; + isSetAvailable = true; // mark as set return this; } @@ -74,6 +105,7 @@ public Long getAvailable() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAvailable(Long available) { this.available = available; + isSetAvailable = true; // mark as set } /** @@ -84,6 +116,7 @@ public void setAvailable(Long available) { */ public Balance balance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set return this; } @@ -107,6 +140,7 @@ public Long getBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set } /** @@ -119,6 +153,7 @@ public void setBalance(Long balance) { */ public Balance currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -146,6 +181,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -156,6 +192,7 @@ public void setCurrency(String currency) { */ public Balance pending(Long pending) { this.pending = pending; + isSetPending = true; // mark as set return this; } @@ -179,6 +216,36 @@ public Long getPending() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPending(Long pending) { this.pending = 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 } /** @@ -189,6 +256,7 @@ public void setPending(Long pending) { */ public Balance reserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set return this; } @@ -212,6 +280,27 @@ public Long getReserved() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Balance 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 Balance object is equal to o. */ @@ -228,12 +317,13 @@ public boolean equals(Object o) { && Objects.equals(this.balance, balance.balance) && Objects.equals(this.currency, balance.currency) && Objects.equals(this.pending, balance.pending) + && Objects.equals(this.pendingAvailable, balance.pendingAvailable) && Objects.equals(this.reserved, balance.reserved); } @Override public int hashCode() { - return Objects.hash(available, balance, currency, pending, reserved); + return Objects.hash(available, balance, currency, pending, pendingAvailable, reserved); } @Override @@ -244,6 +334,7 @@ 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(); @@ -259,6 +350,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 (isSetAvailable) { + addIfNull(nulls, JSON_PROPERTY_AVAILABLE, this.available); + } + if (isSetBalance) { + addIfNull(nulls, JSON_PROPERTY_BALANCE, this.balance); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + 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); + } + + 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 Balance given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java index 61c175894..c52fc165f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,31 +45,58 @@ public class BalanceAccount { public static final String JSON_PROPERTY_ACCOUNT_HOLDER_ID = "accountHolderId"; private String accountHolderId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderId = false; + public static final String JSON_PROPERTY_BALANCES = "balances"; private List balances; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalances = false; + public static final String JSON_PROPERTY_DEFAULT_CURRENCY_CODE = "defaultCurrencyCode"; private String defaultCurrencyCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefaultCurrencyCode = 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_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = 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_MIGRATED_ACCOUNT_CODE = "migratedAccountCode"; private String migratedAccountCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMigratedAccountCode = false; + public static final String JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION = "platformPaymentConfiguration"; private PlatformPaymentConfiguration platformPaymentConfiguration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformPaymentConfiguration = 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 account, set to **active** by default. */ public enum StatusEnum { ACTIVE(String.valueOf("active")), @@ -116,9 +145,21 @@ 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_TIME_ZONE = "timeZone"; private String timeZone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceAccount() {} @JsonCreator @@ -140,6 +181,7 @@ public BalanceAccount( */ public BalanceAccount accountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set return this; } @@ -171,6 +213,7 @@ public String getAccountHolderId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set } /** @@ -181,6 +224,7 @@ public void setAccountHolderId(String accountHolderId) { */ public BalanceAccount balances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set return this; } @@ -212,6 +256,7 @@ public List getBalances() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set } /** @@ -230,6 +275,7 @@ public void setBalances(List balances) { */ public BalanceAccount defaultCurrencyCode(String defaultCurrencyCode) { this.defaultCurrencyCode = defaultCurrencyCode; + isSetDefaultCurrencyCode = true; // mark as set return this; } @@ -269,6 +315,7 @@ public String getDefaultCurrencyCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDefaultCurrencyCode(String defaultCurrencyCode) { this.defaultCurrencyCode = defaultCurrencyCode; + isSetDefaultCurrencyCode = true; // mark as set } /** @@ -282,6 +329,7 @@ public void setDefaultCurrencyCode(String defaultCurrencyCode) { */ public BalanceAccount description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -311,6 +359,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -321,6 +370,7 @@ public void setDescription(String description) { */ public BalanceAccount id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -344,6 +394,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -359,6 +410,7 @@ public void setId(String id) { */ public BalanceAccount metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -400,6 +452,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -423,6 +476,7 @@ public String getMigratedAccountCode() { public BalanceAccount platformPaymentConfiguration( PlatformPaymentConfiguration platformPaymentConfiguration) { this.platformPaymentConfiguration = platformPaymentConfiguration; + isSetPlatformPaymentConfiguration = true; // mark as set return this; } @@ -447,6 +501,7 @@ public PlatformPaymentConfiguration getPlatformPaymentConfiguration() { public void setPlatformPaymentConfiguration( PlatformPaymentConfiguration platformPaymentConfiguration) { this.platformPaymentConfiguration = platformPaymentConfiguration; + isSetPlatformPaymentConfiguration = true; // mark as set } /** @@ -457,6 +512,7 @@ public void setPlatformPaymentConfiguration( */ public BalanceAccount reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -480,6 +536,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -490,6 +547,7 @@ public void setReference(String reference) { */ public BalanceAccount status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -513,6 +571,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -528,6 +587,7 @@ public void setStatus(StatusEnum status) { */ public BalanceAccount timeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set return this; } @@ -561,6 +621,27 @@ public String getTimeZone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceAccount 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 BalanceAccount object is equal to o. */ @@ -638,6 +719,61 @@ 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 (isSetAccountHolderId) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_ID, this.accountHolderId); + } + if (isSetBalances) { + addIfNull(nulls, JSON_PROPERTY_BALANCES, this.balances); + } + if (isSetDefaultCurrencyCode) { + addIfNull(nulls, JSON_PROPERTY_DEFAULT_CURRENCY_CODE, this.defaultCurrencyCode); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMigratedAccountCode) { + addIfNull(nulls, JSON_PROPERTY_MIGRATED_ACCOUNT_CODE, this.migratedAccountCode); + } + if (isSetPlatformPaymentConfiguration) { + addIfNull( + nulls, JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION, this.platformPaymentConfiguration); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTimeZone) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE, this.timeZone); + } + + 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 BalanceAccount given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java index 5ffc89b49..fc0a6635b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -40,28 +42,52 @@ public class BalanceAccountBase { public static final String JSON_PROPERTY_ACCOUNT_HOLDER_ID = "accountHolderId"; private String accountHolderId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderId = false; + public static final String JSON_PROPERTY_DEFAULT_CURRENCY_CODE = "defaultCurrencyCode"; private String defaultCurrencyCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefaultCurrencyCode = 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_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = 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_MIGRATED_ACCOUNT_CODE = "migratedAccountCode"; private String migratedAccountCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMigratedAccountCode = false; + public static final String JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION = "platformPaymentConfiguration"; private PlatformPaymentConfiguration platformPaymentConfiguration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformPaymentConfiguration = 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 account, set to **active** by default. */ public enum StatusEnum { ACTIVE(String.valueOf("active")), @@ -110,9 +136,21 @@ 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_TIME_ZONE = "timeZone"; private String timeZone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceAccountBase() {} @JsonCreator @@ -134,6 +172,7 @@ public BalanceAccountBase( */ public BalanceAccountBase accountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set return this; } @@ -165,6 +204,7 @@ public String getAccountHolderId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set } /** @@ -183,6 +223,7 @@ public void setAccountHolderId(String accountHolderId) { */ public BalanceAccountBase defaultCurrencyCode(String defaultCurrencyCode) { this.defaultCurrencyCode = defaultCurrencyCode; + isSetDefaultCurrencyCode = true; // mark as set return this; } @@ -222,6 +263,7 @@ public String getDefaultCurrencyCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDefaultCurrencyCode(String defaultCurrencyCode) { this.defaultCurrencyCode = defaultCurrencyCode; + isSetDefaultCurrencyCode = true; // mark as set } /** @@ -235,6 +277,7 @@ public void setDefaultCurrencyCode(String defaultCurrencyCode) { */ public BalanceAccountBase description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -264,6 +307,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -274,6 +318,7 @@ public void setDescription(String description) { */ public BalanceAccountBase id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -297,6 +342,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -312,6 +358,7 @@ public void setId(String id) { */ public BalanceAccountBase metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -353,6 +400,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -376,6 +424,7 @@ public String getMigratedAccountCode() { public BalanceAccountBase platformPaymentConfiguration( PlatformPaymentConfiguration platformPaymentConfiguration) { this.platformPaymentConfiguration = platformPaymentConfiguration; + isSetPlatformPaymentConfiguration = true; // mark as set return this; } @@ -400,6 +449,7 @@ public PlatformPaymentConfiguration getPlatformPaymentConfiguration() { public void setPlatformPaymentConfiguration( PlatformPaymentConfiguration platformPaymentConfiguration) { this.platformPaymentConfiguration = platformPaymentConfiguration; + isSetPlatformPaymentConfiguration = true; // mark as set } /** @@ -410,6 +460,7 @@ public void setPlatformPaymentConfiguration( */ public BalanceAccountBase reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -433,6 +484,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -443,6 +495,7 @@ public void setReference(String reference) { */ public BalanceAccountBase status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -466,6 +519,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -481,6 +535,7 @@ public void setStatus(StatusEnum status) { */ public BalanceAccountBase timeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set return this; } @@ -514,6 +569,27 @@ public String getTimeZone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceAccountBase 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 BalanceAccountBase object is equal to o. */ @@ -588,6 +664,58 @@ 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 (isSetAccountHolderId) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_ID, this.accountHolderId); + } + if (isSetDefaultCurrencyCode) { + addIfNull(nulls, JSON_PROPERTY_DEFAULT_CURRENCY_CODE, this.defaultCurrencyCode); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMigratedAccountCode) { + addIfNull(nulls, JSON_PROPERTY_MIGRATED_ACCOUNT_CODE, this.migratedAccountCode); + } + if (isSetPlatformPaymentConfiguration) { + addIfNull( + nulls, JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION, this.platformPaymentConfiguration); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTimeZone) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE, this.timeZone); + } + + 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 BalanceAccountBase given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java index f708e38b7..1a4757059 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,28 +37,58 @@ public class BalanceAccountInfo { public static final String JSON_PROPERTY_ACCOUNT_HOLDER_ID = "accountHolderId"; private String accountHolderId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderId = false; + public static final String JSON_PROPERTY_DEFAULT_CURRENCY_CODE = "defaultCurrencyCode"; private String defaultCurrencyCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefaultCurrencyCode = 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_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_MIGRATED_ACCOUNT_CODE = "migratedAccountCode"; private String migratedAccountCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMigratedAccountCode = false; + public static final String JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION = "platformPaymentConfiguration"; private PlatformPaymentConfiguration platformPaymentConfiguration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformPaymentConfiguration = 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_TIME_ZONE = "timeZone"; private String timeZone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceAccountInfo() {} @JsonCreator @@ -78,6 +110,7 @@ public BalanceAccountInfo( */ public BalanceAccountInfo accountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set return this; } @@ -109,6 +142,7 @@ public String getAccountHolderId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set } /** @@ -127,6 +161,7 @@ public void setAccountHolderId(String accountHolderId) { */ public BalanceAccountInfo defaultCurrencyCode(String defaultCurrencyCode) { this.defaultCurrencyCode = defaultCurrencyCode; + isSetDefaultCurrencyCode = true; // mark as set return this; } @@ -166,6 +201,7 @@ public String getDefaultCurrencyCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDefaultCurrencyCode(String defaultCurrencyCode) { this.defaultCurrencyCode = defaultCurrencyCode; + isSetDefaultCurrencyCode = true; // mark as set } /** @@ -179,6 +215,7 @@ public void setDefaultCurrencyCode(String defaultCurrencyCode) { */ public BalanceAccountInfo description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -208,6 +245,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -223,6 +261,7 @@ public void setDescription(String description) { */ public BalanceAccountInfo metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -264,6 +303,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -287,6 +327,7 @@ public String getMigratedAccountCode() { public BalanceAccountInfo platformPaymentConfiguration( PlatformPaymentConfiguration platformPaymentConfiguration) { this.platformPaymentConfiguration = platformPaymentConfiguration; + isSetPlatformPaymentConfiguration = true; // mark as set return this; } @@ -311,6 +352,7 @@ public PlatformPaymentConfiguration getPlatformPaymentConfiguration() { public void setPlatformPaymentConfiguration( PlatformPaymentConfiguration platformPaymentConfiguration) { this.platformPaymentConfiguration = platformPaymentConfiguration; + isSetPlatformPaymentConfiguration = true; // mark as set } /** @@ -321,6 +363,7 @@ public void setPlatformPaymentConfiguration( */ public BalanceAccountInfo reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -344,6 +387,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -359,6 +403,7 @@ public void setReference(String reference) { */ public BalanceAccountInfo timeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set return this; } @@ -392,6 +437,27 @@ public String getTimeZone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceAccountInfo 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 BalanceAccountInfo object is equal to o. */ @@ -460,6 +526,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 (isSetAccountHolderId) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_ID, this.accountHolderId); + } + if (isSetDefaultCurrencyCode) { + addIfNull(nulls, JSON_PROPERTY_DEFAULT_CURRENCY_CODE, this.defaultCurrencyCode); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMigratedAccountCode) { + addIfNull(nulls, JSON_PROPERTY_MIGRATED_ACCOUNT_CODE, this.migratedAccountCode); + } + if (isSetPlatformPaymentConfiguration) { + addIfNull( + nulls, JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION, this.platformPaymentConfiguration); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetTimeZone) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE, this.timeZone); + } + + 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 BalanceAccountInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java index 5cd3126b2..7ffd41bb5 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,19 +39,34 @@ public class BalanceAccountUpdateRequest { public static final String JSON_PROPERTY_ACCOUNT_HOLDER_ID = "accountHolderId"; private String accountHolderId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderId = 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_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION = "platformPaymentConfiguration"; private PlatformPaymentConfiguration platformPaymentConfiguration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformPaymentConfiguration = 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 account. Payment instruments linked to the balance account can only * be used if the balance account status is **active**. Possible values: **active**, **closed**, @@ -102,9 +119,21 @@ 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_TIME_ZONE = "timeZone"; private String timeZone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceAccountUpdateRequest() {} /** @@ -119,6 +148,7 @@ public BalanceAccountUpdateRequest() {} */ public BalanceAccountUpdateRequest accountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set return this; } @@ -150,6 +180,7 @@ public String getAccountHolderId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set } /** @@ -162,6 +193,7 @@ public void setAccountHolderId(String accountHolderId) { */ public BalanceAccountUpdateRequest description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -189,6 +221,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -204,6 +237,7 @@ public void setDescription(String description) { */ public BalanceAccountUpdateRequest metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -245,6 +279,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -256,6 +291,7 @@ public void setMetadata(Map metadata) { public BalanceAccountUpdateRequest platformPaymentConfiguration( PlatformPaymentConfiguration platformPaymentConfiguration) { this.platformPaymentConfiguration = platformPaymentConfiguration; + isSetPlatformPaymentConfiguration = true; // mark as set return this; } @@ -280,6 +316,7 @@ public PlatformPaymentConfiguration getPlatformPaymentConfiguration() { public void setPlatformPaymentConfiguration( PlatformPaymentConfiguration platformPaymentConfiguration) { this.platformPaymentConfiguration = platformPaymentConfiguration; + isSetPlatformPaymentConfiguration = true; // mark as set } /** @@ -290,6 +327,7 @@ public void setPlatformPaymentConfiguration( */ public BalanceAccountUpdateRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -313,6 +351,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -327,6 +366,7 @@ public void setReference(String reference) { */ public BalanceAccountUpdateRequest status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -358,6 +398,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -373,6 +414,7 @@ public void setStatus(StatusEnum status) { */ public BalanceAccountUpdateRequest timeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set return this; } @@ -406,6 +448,27 @@ public String getTimeZone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceAccountUpdateRequest 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 BalanceAccountUpdateRequest object is equal to o. */ @@ -468,6 +531,49 @@ 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 (isSetAccountHolderId) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_ID, this.accountHolderId); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetPlatformPaymentConfiguration) { + addIfNull( + nulls, JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION, this.platformPaymentConfiguration); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTimeZone) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE, this.timeZone); + } + + 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 BalanceAccountUpdateRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BalancePlatform.java b/src/main/java/com/adyen/model/balanceplatform/BalancePlatform.java index af312dddc..abc379ec9 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalancePlatform.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalancePlatform.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 BalancePlatform { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_STATUS = "status"; private String 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 BalancePlatform() {} /** @@ -43,6 +60,7 @@ public BalancePlatform() {} */ public BalancePlatform description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setDescription(String description) { */ public BalancePlatform id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -111,6 +132,7 @@ public void setId(String id) { */ public BalancePlatform status(String status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -138,6 +160,27 @@ public String getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(String status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalancePlatform 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 BalancePlatform object is equal to o. */ @@ -181,6 +224,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + 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 BalancePlatform given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java b/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java index 625bfc41b..4a87115ae 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,12 +31,27 @@ public class BalanceSweepConfigurationsResponse { public static final String JSON_PROPERTY_HAS_NEXT = "hasNext"; private Boolean hasNext; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasNext = false; + public static final String JSON_PROPERTY_HAS_PREVIOUS = "hasPrevious"; private Boolean hasPrevious; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasPrevious = false; + public static final String JSON_PROPERTY_SWEEPS = "sweeps"; private List sweeps; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSweeps = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceSweepConfigurationsResponse() {} /** @@ -46,6 +63,7 @@ public BalanceSweepConfigurationsResponse() {} */ public BalanceSweepConfigurationsResponse hasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set return this; } @@ -69,6 +87,7 @@ public Boolean getHasNext() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set } /** @@ -80,6 +99,7 @@ public void setHasNext(Boolean hasNext) { */ public BalanceSweepConfigurationsResponse hasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set return this; } @@ -103,6 +123,7 @@ public Boolean getHasPrevious() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set } /** @@ -114,6 +135,7 @@ public void setHasPrevious(Boolean hasPrevious) { */ public BalanceSweepConfigurationsResponse sweeps(List sweeps) { this.sweeps = sweeps; + isSetSweeps = true; // mark as set return this; } @@ -145,6 +167,27 @@ public List getSweeps() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSweeps(List sweeps) { this.sweeps = sweeps; + isSetSweeps = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceSweepConfigurationsResponse 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 BalanceSweepConfigurationsResponse object is equal to o. */ @@ -189,6 +232,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 (isSetHasNext) { + addIfNull(nulls, JSON_PROPERTY_HAS_NEXT, this.hasNext); + } + if (isSetHasPrevious) { + addIfNull(nulls, JSON_PROPERTY_HAS_PREVIOUS, this.hasPrevious); + } + if (isSetSweeps) { + addIfNull(nulls, JSON_PROPERTY_SWEEPS, this.sweeps); + } + + 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 BalanceSweepConfigurationsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSetting.java b/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSetting.java index b115c25ff..cc91a6b40 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSetting.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSetting.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -38,6 +40,15 @@ public class BalanceWebhookSetting extends WebhookSetting { public static final String JSON_PROPERTY_CONDITIONS = "conditions"; private List conditions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConditions = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceWebhookSetting() {} /** @@ -50,6 +61,7 @@ public BalanceWebhookSetting() {} */ public BalanceWebhookSetting conditions(List conditions) { this.conditions = conditions; + isSetConditions = true; // mark as set return this; } @@ -85,6 +97,27 @@ public List getConditions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConditions(List conditions) { this.conditions = conditions; + isSetConditions = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceWebhookSetting 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 BalanceWebhookSetting object is equal to o. */ @@ -132,6 +165,30 @@ private String toIndentedString(Object o) { JSON.registerDiscriminator(BalanceWebhookSetting.class, "type", mappings); } + /** 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 (isSetConditions) { + addIfNull(nulls, JSON_PROPERTY_CONDITIONS, this.conditions); + } + + 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 BalanceWebhookSetting given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSettingInfo.java b/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSettingInfo.java index 5f084f64c..ebb9cf22c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSettingInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSettingInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +37,15 @@ public class BalanceWebhookSettingInfo { public static final String JSON_PROPERTY_CONDITIONS = "conditions"; private List conditions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConditions = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + /** * The status of the webhook setting. Possible values: * **active**: You receive a balance webhook * if any of the conditions in this setting are met. * **inactive**: You do not receive a balance @@ -86,9 +94,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_TARGET = "target"; private Target target; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTarget = false; + /** The type of the webhook you are configuring. Set to **balance**. */ public enum TypeEnum { BALANCE(String.valueOf("balance")); @@ -131,6 +145,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 BalanceWebhookSettingInfo() {} /** @@ -142,6 +165,7 @@ public BalanceWebhookSettingInfo() {} */ public BalanceWebhookSettingInfo conditions(List conditions) { this.conditions = conditions; + isSetConditions = true; // mark as set return this; } @@ -175,6 +199,7 @@ public List getConditions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConditions(List conditions) { this.conditions = conditions; + isSetConditions = true; // mark as set } /** @@ -187,6 +212,7 @@ public void setConditions(List conditions) { */ public BalanceWebhookSettingInfo currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -214,6 +240,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -228,6 +255,7 @@ public void setCurrency(String currency) { */ public BalanceWebhookSettingInfo status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -259,6 +287,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -269,6 +298,7 @@ public void setStatus(StatusEnum status) { */ public BalanceWebhookSettingInfo target(Target target) { this.target = target; + isSetTarget = true; // mark as set return this; } @@ -292,6 +322,7 @@ public Target getTarget() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTarget(Target target) { this.target = target; + isSetTarget = true; // mark as set } /** @@ -302,6 +333,7 @@ public void setTarget(Target target) { */ public BalanceWebhookSettingInfo type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -325,6 +357,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 BalanceWebhookSettingInfo 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 BalanceWebhookSettingInfo object is equal to o. */ @@ -372,6 +425,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 (isSetConditions) { + addIfNull(nulls, JSON_PROPERTY_CONDITIONS, this.conditions); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTarget) { + addIfNull(nulls, JSON_PROPERTY_TARGET, this.target); + } + 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 BalanceWebhookSettingInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSettingInfoUpdate.java b/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSettingInfoUpdate.java index dd077c2f3..66cf74afa 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSettingInfoUpdate.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceWebhookSettingInfoUpdate.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +37,15 @@ public class BalanceWebhookSettingInfoUpdate { public static final String JSON_PROPERTY_CONDITIONS = "conditions"; private List conditions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConditions = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + /** * The status of the webhook setting. Possible values: * **active**: You receive a balance webhook * if any of the conditions in this setting are met. * **inactive**: You do not receive a balance @@ -86,9 +94,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_TARGET = "target"; private TargetUpdate target; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTarget = false; + /** The type of the webhook you are configuring. Set to **balance**. */ public enum TypeEnum { BALANCE(String.valueOf("balance")); @@ -131,6 +145,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 BalanceWebhookSettingInfoUpdate() {} /** @@ -143,6 +166,7 @@ public BalanceWebhookSettingInfoUpdate() {} */ public BalanceWebhookSettingInfoUpdate conditions(List conditions) { this.conditions = conditions; + isSetConditions = true; // mark as set return this; } @@ -176,6 +200,7 @@ public List getConditions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConditions(List conditions) { this.conditions = conditions; + isSetConditions = true; // mark as set } /** @@ -189,6 +214,7 @@ public void setConditions(List conditions) { */ public BalanceWebhookSettingInfoUpdate currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -216,6 +242,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -231,6 +258,7 @@ public void setCurrency(String currency) { */ public BalanceWebhookSettingInfoUpdate status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -262,6 +290,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -273,6 +302,7 @@ public void setStatus(StatusEnum status) { */ public BalanceWebhookSettingInfoUpdate target(TargetUpdate target) { this.target = target; + isSetTarget = true; // mark as set return this; } @@ -296,6 +326,7 @@ public TargetUpdate getTarget() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTarget(TargetUpdate target) { this.target = target; + isSetTarget = true; // mark as set } /** @@ -307,6 +338,7 @@ public void setTarget(TargetUpdate target) { */ public BalanceWebhookSettingInfoUpdate type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -330,6 +362,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 BalanceWebhookSettingInfoUpdate 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 BalanceWebhookSettingInfoUpdate object is equal to o. */ @@ -378,6 +431,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 (isSetConditions) { + addIfNull(nulls, JSON_PROPERTY_CONDITIONS, this.conditions); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTarget) { + addIfNull(nulls, JSON_PROPERTY_TARGET, this.target); + } + 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 BalanceWebhookSettingInfoUpdate given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccount.java b/src/main/java/com/adyen/model/balanceplatform/BankAccount.java index 0e9722170..9a98f6ed2 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankAccount.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccount.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 BankAccount { public static final String JSON_PROPERTY_ACCOUNT_IDENTIFICATION = "accountIdentification"; private BankAccountAccountIdentification accountIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountIdentification = 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() {} /** @@ -33,6 +44,7 @@ public BankAccount() {} */ public BankAccount accountIdentification(BankAccountAccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set return this; } @@ -56,6 +68,27 @@ public BankAccountAccountIdentification getAccountIdentification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountIdentification(BankAccountAccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = 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. */ @@ -97,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 (isSetAccountIdentification) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_IDENTIFICATION, this.accountIdentification); + } + + 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/balanceplatform/BankAccountDetails.java b/src/main/java/com/adyen/model/balanceplatform/BankAccountDetails.java index 1e2a8749b..cb389aa5b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankAccountDetails.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccountDetails.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 BankAccountDetails { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = 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_BRANCH_NUMBER = "branchNumber"; private String branchNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBranchNumber = false; + public static final String JSON_PROPERTY_FORM_FACTOR = "formFactor"; private String formFactor; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFormFactor = 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_ROUTING_NUMBER = "routingNumber"; private String routingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRoutingNumber = false; + public static final String JSON_PROPERTY_SORT_CODE = "sortCode"; private String sortCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSortCode = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 BankAccountDetails() {} /** @@ -63,6 +95,7 @@ public BankAccountDetails() {} */ public BankAccountDetails accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -86,6 +119,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -97,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public BankAccountDetails accountType(String accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -122,6 +157,7 @@ public String getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(String accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -132,6 +168,7 @@ public void setAccountType(String accountType) { */ public BankAccountDetails branchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set return this; } @@ -155,6 +192,7 @@ public String getBranchNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBranchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set } /** @@ -175,6 +213,7 @@ public void setBranchNumber(String branchNumber) { */ public BankAccountDetails formFactor(String formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set return this; } @@ -218,6 +257,7 @@ public String getFormFactor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFormFactor(String formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set } /** @@ -230,6 +270,7 @@ public void setFormFactor(String formFactor) { */ public BankAccountDetails iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -257,6 +298,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -270,6 +312,7 @@ public void setIban(String iban) { */ public BankAccountDetails routingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set return this; } @@ -299,6 +342,7 @@ public String getRoutingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRoutingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set } /** @@ -310,6 +354,7 @@ public void setRoutingNumber(String routingNumber) { */ public BankAccountDetails sortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set return this; } @@ -335,6 +380,7 @@ public String getSortCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set } /** @@ -345,6 +391,7 @@ public void setSortCode(String sortCode) { */ public BankAccountDetails type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -368,6 +415,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankAccountDetails 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 BankAccountDetails object is equal to o. */ @@ -422,6 +490,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetBranchNumber) { + addIfNull(nulls, JSON_PROPERTY_BRANCH_NUMBER, this.branchNumber); + } + if (isSetFormFactor) { + addIfNull(nulls, JSON_PROPERTY_FORM_FACTOR, this.formFactor); + } + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetRoutingNumber) { + addIfNull(nulls, JSON_PROPERTY_ROUTING_NUMBER, this.routingNumber); + } + if (isSetSortCode) { + addIfNull(nulls, JSON_PROPERTY_SORT_CODE, this.sortCode); + } + 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 BankAccountDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationTypeRequirement.java b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationTypeRequirement.java index 5e2c81059..e712a4bac 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationTypeRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationTypeRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -106,9 +108,15 @@ public static BankAccountIdentificationTypesEnum fromValue(String value) { "bankAccountIdentificationTypes"; private List bankAccountIdentificationTypes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccountIdentificationTypes = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + /** **bankAccountIdentificationTypeRequirement** */ public enum TypeEnum { BANKACCOUNTIDENTIFICATIONTYPEREQUIREMENT( @@ -152,6 +160,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 BankAccountIdentificationTypeRequirement() {} /** @@ -165,6 +182,7 @@ public BankAccountIdentificationTypeRequirement() {} public BankAccountIdentificationTypeRequirement bankAccountIdentificationTypes( List bankAccountIdentificationTypes) { this.bankAccountIdentificationTypes = bankAccountIdentificationTypes; + isSetBankAccountIdentificationTypes = true; // mark as set return this; } @@ -200,6 +218,7 @@ public List getBankAccountIdentificationType public void setBankAccountIdentificationTypes( List bankAccountIdentificationTypes) { this.bankAccountIdentificationTypes = bankAccountIdentificationTypes; + isSetBankAccountIdentificationTypes = true; // mark as set } /** @@ -214,6 +233,7 @@ public void setBankAccountIdentificationTypes( */ public BankAccountIdentificationTypeRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -243,6 +263,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -254,6 +275,7 @@ public void setDescription(String description) { */ public BankAccountIdentificationTypeRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -277,6 +299,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 BankAccountIdentificationTypeRequirement 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 BankAccountIdentificationTypeRequirement object is equal to o. */ @@ -325,6 +368,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 (isSetBankAccountIdentificationTypes) { + addIfNull( + nulls, + JSON_PROPERTY_BANK_ACCOUNT_IDENTIFICATION_TYPES, + this.bankAccountIdentificationTypes); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + 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 BankAccountIdentificationTypeRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java index fbe2d5565..cdb1c9311 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,6 +27,15 @@ public class BankAccountIdentificationValidationRequest { public static final String JSON_PROPERTY_ACCOUNT_IDENTIFICATION = "accountIdentification"; private BankAccountIdentificationValidationRequestAccountIdentification accountIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountIdentification = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BankAccountIdentificationValidationRequest() {} /** @@ -37,6 +48,7 @@ public BankAccountIdentificationValidationRequest() {} public BankAccountIdentificationValidationRequest accountIdentification( BankAccountIdentificationValidationRequestAccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set return this; } @@ -62,6 +74,27 @@ public BankAccountIdentificationValidationRequest accountIdentification( public void setAccountIdentification( BankAccountIdentificationValidationRequestAccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankAccountIdentificationValidationRequest 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 BankAccountIdentificationValidationRequest object is equal to o. */ @@ -106,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountIdentification) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_IDENTIFICATION, this.accountIdentification); + } + + 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 BankAccountIdentificationValidationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccountModel.java b/src/main/java/com/adyen/model/balanceplatform/BankAccountModel.java index 821cb6521..252744e02 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankAccountModel.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccountModel.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,6 +79,15 @@ public static FormFactorEnum fromValue(String value) { public static final String JSON_PROPERTY_FORM_FACTOR = "formFactor"; private FormFactorEnum formFactor; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFormFactor = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BankAccountModel() {} /** @@ -97,6 +108,7 @@ public BankAccountModel() {} */ public BankAccountModel formFactor(FormFactorEnum formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set return this; } @@ -140,6 +152,27 @@ public FormFactorEnum getFormFactor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFormFactor(FormFactorEnum formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankAccountModel 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 BankAccountModel object is equal to o. */ @@ -179,6 +212,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 (isSetFormFactor) { + addIfNull(nulls, JSON_PROPERTY_FORM_FACTOR, this.formFactor); + } + + 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 BankAccountModel given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BankIdentification.java b/src/main/java/com/adyen/model/balanceplatform/BankIdentification.java index 7c393dbe2..5a52b14b8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,9 +33,15 @@ public class BankIdentification { 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_IDENTIFICATION = "identification"; private String identification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIdentification = false; + /** * The type of the identification. Possible values: **iban**, **routingNumber**, **sortCode**, * **bic**. @@ -85,6 +93,15 @@ public static IdentificationTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_IDENTIFICATION_TYPE = "identificationType"; private IdentificationTypeEnum identificationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIdentificationType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BankIdentification() {} /** @@ -97,6 +114,7 @@ public BankIdentification() {} */ public BankIdentification country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -124,6 +142,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -134,6 +153,7 @@ public void setCountry(String country) { */ public BankIdentification identification(String identification) { this.identification = identification; + isSetIdentification = true; // mark as set return this; } @@ -157,6 +177,7 @@ public String getIdentification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIdentification(String identification) { this.identification = identification; + isSetIdentification = true; // mark as set } /** @@ -169,6 +190,7 @@ public void setIdentification(String identification) { */ public BankIdentification identificationType(IdentificationTypeEnum identificationType) { this.identificationType = identificationType; + isSetIdentificationType = true; // mark as set return this; } @@ -196,6 +218,27 @@ public IdentificationTypeEnum getIdentificationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIdentificationType(IdentificationTypeEnum identificationType) { this.identificationType = identificationType; + isSetIdentificationType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankIdentification 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 BankIdentification object is equal to o. */ @@ -239,6 +282,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 (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetIdentification) { + addIfNull(nulls, JSON_PROPERTY_IDENTIFICATION, this.identification); + } + if (isSetIdentificationType) { + addIfNull(nulls, JSON_PROPERTY_IDENTIFICATION_TYPE, this.identificationType); + } + + 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 BankIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BeginScaDeviceRegistrationRequest.java b/src/main/java/com/adyen/model/balanceplatform/BeginScaDeviceRegistrationRequest.java index cb12b21c4..424df2ae5 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BeginScaDeviceRegistrationRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/BeginScaDeviceRegistrationRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 BeginScaDeviceRegistrationRequest { 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_SDK_OUTPUT = "sdkOutput"; private String sdkOutput; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkOutput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BeginScaDeviceRegistrationRequest() {} /** @@ -42,6 +56,7 @@ public BeginScaDeviceRegistrationRequest() {} */ public BeginScaDeviceRegistrationRequest name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -69,6 +84,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -82,6 +98,7 @@ public void setName(String name) { */ public BeginScaDeviceRegistrationRequest sdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set return this; } @@ -109,6 +126,27 @@ public String getSdkOutput() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BeginScaDeviceRegistrationRequest 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 BeginScaDeviceRegistrationRequest object is equal to o. */ @@ -151,6 +189,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 (isSetSdkOutput) { + addIfNull(nulls, JSON_PROPERTY_SDK_OUTPUT, this.sdkOutput); + } + + 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 BeginScaDeviceRegistrationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BeginScaDeviceRegistrationResponse.java b/src/main/java/com/adyen/model/balanceplatform/BeginScaDeviceRegistrationResponse.java index 21eb14e82..6d1f061fd 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BeginScaDeviceRegistrationResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/BeginScaDeviceRegistrationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 BeginScaDeviceRegistrationResponse { public static final String JSON_PROPERTY_SCA_DEVICE = "scaDevice"; private ScaDevice scaDevice; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaDevice = false; + public static final String JSON_PROPERTY_SDK_INPUT = "sdkInput"; private String sdkInput; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkInput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BeginScaDeviceRegistrationResponse() {} /** @@ -40,6 +54,7 @@ public BeginScaDeviceRegistrationResponse() {} */ public BeginScaDeviceRegistrationResponse scaDevice(ScaDevice scaDevice) { this.scaDevice = scaDevice; + isSetScaDevice = true; // mark as set return this; } @@ -63,6 +78,7 @@ public ScaDevice getScaDevice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaDevice(ScaDevice scaDevice) { this.scaDevice = scaDevice; + isSetScaDevice = true; // mark as set } /** @@ -76,6 +92,7 @@ public void setScaDevice(ScaDevice scaDevice) { */ public BeginScaDeviceRegistrationResponse sdkInput(String sdkInput) { this.sdkInput = sdkInput; + isSetSdkInput = true; // mark as set return this; } @@ -103,6 +120,27 @@ public String getSdkInput() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkInput(String sdkInput) { this.sdkInput = sdkInput; + isSetSdkInput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BeginScaDeviceRegistrationResponse 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 BeginScaDeviceRegistrationResponse object is equal to o. */ @@ -145,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 (isSetScaDevice) { + addIfNull(nulls, JSON_PROPERTY_SCA_DEVICE, this.scaDevice); + } + if (isSetSdkInput) { + addIfNull(nulls, JSON_PROPERTY_SDK_INPUT, this.sdkInput); + } + + 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 BeginScaDeviceRegistrationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BrandVariantsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/BrandVariantsRestriction.java index fc760cce2..2d82f4639 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BrandVariantsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/BrandVariantsRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,9 +30,21 @@ public class BrandVariantsRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private List 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 BrandVariantsRestriction() {} /** @@ -41,6 +55,7 @@ public BrandVariantsRestriction() {} */ public BrandVariantsRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -64,6 +79,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -84,6 +100,7 @@ public void setOperation(String operation) { */ public BrandVariantsRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -135,6 +152,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BrandVariantsRestriction 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 BrandVariantsRestriction object is equal to o. */ @@ -176,6 +214,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 BrandVariantsRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/BulkAddress.java b/src/main/java/com/adyen/model/balanceplatform/BulkAddress.java index da8276fd7..0acbcca89 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BulkAddress.java +++ b/src/main/java/com/adyen/model/balanceplatform/BulkAddress.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,6 +30,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 @@ -36,39 +39,87 @@ public class BulkAddress { 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_COMPANY = "company"; private String company; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCompany = 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_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = 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_LINE1 = "line1"; private String line1; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine1 = false; + public static final String JSON_PROPERTY_LINE2 = "line2"; private String line2; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine2 = false; + public static final String JSON_PROPERTY_LINE3 = "line3"; private String line3; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine3 = false; + public static final String JSON_PROPERTY_MOBILE = "mobile"; private String mobile; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMobile = 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_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 BulkAddress() {} /** @@ -79,6 +130,7 @@ public BulkAddress() {} */ public BulkAddress city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -102,6 +154,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -112,6 +165,7 @@ public void setCity(String city) { */ public BulkAddress company(String company) { this.company = company; + isSetCompany = true; // mark as set return this; } @@ -135,6 +189,7 @@ public String getCompany() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCompany(String company) { this.company = company; + isSetCompany = true; // mark as set } /** @@ -145,6 +200,7 @@ public void setCompany(String company) { */ public BulkAddress country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -168,6 +224,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -178,6 +235,7 @@ public void setCountry(String country) { */ public BulkAddress email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -201,6 +259,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -211,6 +270,7 @@ public void setEmail(String email) { */ public BulkAddress houseNumberOrName(String houseNumberOrName) { this.houseNumberOrName = houseNumberOrName; + isSetHouseNumberOrName = true; // mark as set return this; } @@ -234,6 +294,7 @@ public String getHouseNumberOrName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHouseNumberOrName(String houseNumberOrName) { this.houseNumberOrName = houseNumberOrName; + isSetHouseNumberOrName = true; // mark as set } /** @@ -246,6 +307,7 @@ public void setHouseNumberOrName(String houseNumberOrName) { */ public BulkAddress line1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set return this; } @@ -273,6 +335,7 @@ public String getLine1() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set } /** @@ -284,6 +347,7 @@ public void setLine1(String line1) { */ public BulkAddress line2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set return this; } @@ -309,6 +373,7 @@ public String getLine2() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set } /** @@ -319,6 +384,7 @@ public void setLine2(String line2) { */ public BulkAddress line3(String line3) { this.line3 = line3; + isSetLine3 = true; // mark as set return this; } @@ -342,6 +408,7 @@ public String getLine3() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine3(String line3) { this.line3 = line3; + isSetLine3 = true; // mark as set } /** @@ -352,6 +419,7 @@ public void setLine3(String line3) { */ public BulkAddress mobile(String mobile) { this.mobile = mobile; + isSetMobile = true; // mark as set return this; } @@ -375,6 +443,42 @@ public String getMobile() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMobile(String mobile) { this.mobile = mobile; + isSetMobile = true; // mark as set + } + + /** + * 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; + isSetName = true; // mark as set + 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; + isSetName = true; // mark as set } /** @@ -387,6 +491,7 @@ public void setMobile(String mobile) { */ public BulkAddress postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -414,6 +519,7 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set } /** @@ -426,6 +532,7 @@ public void setPostalCode(String postalCode) { */ public BulkAddress stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set return this; } @@ -453,6 +560,7 @@ public String getStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set } /** @@ -463,6 +571,7 @@ public void setStateOrProvince(String stateOrProvince) { */ public BulkAddress street(String street) { this.street = street; + isSetStreet = true; // mark as set return this; } @@ -486,6 +595,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 BulkAddress 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 BulkAddress object is equal to o. */ @@ -507,6 +637,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 +655,7 @@ public int hashCode() { line2, line3, mobile, + name, postalCode, stateOrProvince, street); @@ -542,6 +674,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"); @@ -559,6 +692,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 (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCompany) { + addIfNull(nulls, JSON_PROPERTY_COMPANY, this.company); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetHouseNumberOrName) { + addIfNull(nulls, JSON_PROPERTY_HOUSE_NUMBER_OR_NAME, this.houseNumberOrName); + } + if (isSetLine1) { + addIfNull(nulls, JSON_PROPERTY_LINE1, this.line1); + } + if (isSetLine2) { + addIfNull(nulls, JSON_PROPERTY_LINE2, this.line2); + } + if (isSetLine3) { + addIfNull(nulls, JSON_PROPERTY_LINE3, this.line3); + } + if (isSetMobile) { + addIfNull(nulls, JSON_PROPERTY_MOBILE, this.mobile); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + 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 BulkAddress given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java index 9f3813481..cb87bd6ce 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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 CALocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. */ @@ -79,12 +84,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_INSTITUTION_NUMBER = "institutionNumber"; private String institutionNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstitutionNumber = false; + public static final String JSON_PROPERTY_TRANSIT_NUMBER = "transitNumber"; private String transitNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransitNumber = false; + /** **caLocal** */ public enum TypeEnum { CALOCAL(String.valueOf("caLocal")); @@ -127,6 +141,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 CALocalAccountIdentification() {} /** @@ -137,6 +160,7 @@ public CALocalAccountIdentification() {} */ public CALocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -160,6 +184,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -171,6 +196,7 @@ public void setAccountNumber(String accountNumber) { */ public CALocalAccountIdentification accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -196,6 +222,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -206,6 +233,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public CALocalAccountIdentification institutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; + isSetInstitutionNumber = true; // mark as set return this; } @@ -229,6 +257,7 @@ public String getInstitutionNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstitutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; + isSetInstitutionNumber = true; // mark as set } /** @@ -239,6 +268,7 @@ public void setInstitutionNumber(String institutionNumber) { */ public CALocalAccountIdentification transitNumber(String transitNumber) { this.transitNumber = transitNumber; + isSetTransitNumber = true; // mark as set return this; } @@ -262,6 +292,7 @@ public String getTransitNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransitNumber(String transitNumber) { this.transitNumber = transitNumber; + isSetTransitNumber = true; // mark as set } /** @@ -272,6 +303,7 @@ public void setTransitNumber(String transitNumber) { */ public CALocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -295,6 +327,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 CALocalAccountIdentification 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 CALocalAccountIdentification object is equal to o. */ @@ -342,6 +395,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetInstitutionNumber) { + addIfNull(nulls, JSON_PROPERTY_INSTITUTION_NUMBER, this.institutionNumber); + } + if (isSetTransitNumber) { + addIfNull(nulls, JSON_PROPERTY_TRANSIT_NUMBER, this.transitNumber); + } + 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 CALocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java index ede24669a..19128febd 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,9 +33,15 @@ public class CZLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + /** **czLocal** */ public enum TypeEnum { CZLOCAL(String.valueOf("czLocal")); @@ -76,6 +84,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 CZLocalAccountIdentification() {} /** @@ -94,6 +111,7 @@ public CZLocalAccountIdentification() {} */ public CZLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -133,6 +151,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -143,6 +162,7 @@ public void setAccountNumber(String accountNumber) { */ public CZLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setBankCode(String bankCode) { */ public CZLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -199,6 +221,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 CZLocalAccountIdentification 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 CZLocalAccountIdentification object is equal to o. */ @@ -242,6 +285,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + 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 CZLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CapabilityProblem.java b/src/main/java/com/adyen/model/balanceplatform/CapabilityProblem.java index e2ad5d9a4..53a2137d8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CapabilityProblem.java +++ b/src/main/java/com/adyen/model/balanceplatform/CapabilityProblem.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,9 +30,21 @@ public class CapabilityProblem { public static final String JSON_PROPERTY_ENTITY = "entity"; private CapabilityProblemEntity entity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntity = false; + public static final String JSON_PROPERTY_VERIFICATION_ERRORS = "verificationErrors"; private List verificationErrors; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationErrors = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapabilityProblem() {} /** @@ -41,6 +55,7 @@ public CapabilityProblem() {} */ public CapabilityProblem entity(CapabilityProblemEntity entity) { this.entity = entity; + isSetEntity = true; // mark as set return this; } @@ -64,6 +79,7 @@ public CapabilityProblemEntity getEntity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntity(CapabilityProblemEntity entity) { this.entity = entity; + isSetEntity = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setEntity(CapabilityProblemEntity entity) { */ public CapabilityProblem verificationErrors(List verificationErrors) { this.verificationErrors = verificationErrors; + isSetVerificationErrors = true; // mark as set return this; } @@ -105,6 +122,27 @@ public List getVerificationErrors() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVerificationErrors(List verificationErrors) { this.verificationErrors = verificationErrors; + isSetVerificationErrors = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapabilityProblem 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 CapabilityProblem object is equal to o. */ @@ -146,6 +184,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 (isSetEntity) { + addIfNull(nulls, JSON_PROPERTY_ENTITY, this.entity); + } + if (isSetVerificationErrors) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_ERRORS, this.verificationErrors); + } + + 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 CapabilityProblem given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CapabilityProblemEntity.java b/src/main/java/com/adyen/model/balanceplatform/CapabilityProblemEntity.java index d57710394..5ce6ea866 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CapabilityProblemEntity.java +++ b/src/main/java/com/adyen/model/balanceplatform/CapabilityProblemEntity.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,12 +36,21 @@ public class CapabilityProblemEntity { public static final String JSON_PROPERTY_DOCUMENTS = "documents"; private List documents; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocuments = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_OWNER = "owner"; private CapabilityProblemEntityRecursive owner; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOwner = false; + /** Type of entity. Possible values: **LegalEntity**, **BankAccount**, **Document**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("BankAccount")), @@ -86,6 +97,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 CapabilityProblemEntity() {} /** @@ -98,6 +118,7 @@ public CapabilityProblemEntity() {} */ public CapabilityProblemEntity documents(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set return this; } @@ -133,6 +154,7 @@ public List getDocuments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocuments(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set } /** @@ -143,6 +165,7 @@ public void setDocuments(List documents) { */ public CapabilityProblemEntity id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -166,6 +189,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -176,6 +200,7 @@ public void setId(String id) { */ public CapabilityProblemEntity owner(CapabilityProblemEntityRecursive owner) { this.owner = owner; + isSetOwner = true; // mark as set return this; } @@ -199,6 +224,7 @@ public CapabilityProblemEntityRecursive getOwner() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwner(CapabilityProblemEntityRecursive owner) { this.owner = owner; + isSetOwner = true; // mark as set } /** @@ -209,6 +235,7 @@ public void setOwner(CapabilityProblemEntityRecursive owner) { */ public CapabilityProblemEntity type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -232,6 +259,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 CapabilityProblemEntity 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 CapabilityProblemEntity object is equal to o. */ @@ -277,6 +325,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 (isSetDocuments) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENTS, this.documents); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetOwner) { + addIfNull(nulls, JSON_PROPERTY_OWNER, this.owner); + } + 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 CapabilityProblemEntity given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CapabilityProblemEntityRecursive.java b/src/main/java/com/adyen/model/balanceplatform/CapabilityProblemEntityRecursive.java index d7acf7623..57ea60729 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CapabilityProblemEntityRecursive.java +++ b/src/main/java/com/adyen/model/balanceplatform/CapabilityProblemEntityRecursive.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +37,15 @@ public class CapabilityProblemEntityRecursive { public static final String JSON_PROPERTY_DOCUMENTS = "documents"; private List documents; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocuments = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + /** Type of entity. Possible values: **LegalEntity**, **BankAccount**, **Document**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("BankAccount")), @@ -84,6 +92,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 CapabilityProblemEntityRecursive() {} /** @@ -97,6 +114,7 @@ public CapabilityProblemEntityRecursive() {} */ public CapabilityProblemEntityRecursive documents(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set return this; } @@ -132,6 +150,7 @@ public List getDocuments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocuments(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set } /** @@ -143,6 +162,7 @@ public void setDocuments(List documents) { */ public CapabilityProblemEntityRecursive id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -177,6 +198,7 @@ public void setId(String id) { */ public CapabilityProblemEntityRecursive type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -200,6 +222,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 CapabilityProblemEntityRecursive 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 CapabilityProblemEntity-recursive object is equal to o. */ @@ -244,6 +287,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 (isSetDocuments) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENTS, this.documents); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + 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 CapabilityProblemEntityRecursive given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CapabilitySettings.java b/src/main/java/com/adyen/model/balanceplatform/CapabilitySettings.java index 7d5db1da1..ad0b960f8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CapabilitySettings.java +++ b/src/main/java/com/adyen/model/balanceplatform/CapabilitySettings.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,9 +39,15 @@ public class CapabilitySettings { public static final String JSON_PROPERTY_AMOUNT_PER_INDUSTRY = "amountPerIndustry"; private Map amountPerIndustry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountPerIndustry = false; + public static final String JSON_PROPERTY_AUTHORIZED_CARD_USERS = "authorizedCardUsers"; private Boolean authorizedCardUsers; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorizedCardUsers = false; + /** Gets or Sets fundingSource */ public enum FundingSourceEnum { CREDIT(String.valueOf("credit")), @@ -86,6 +94,9 @@ public static FundingSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private List fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + /** */ public enum IntervalEnum { DAILY(String.valueOf("daily")), @@ -132,9 +143,21 @@ public static IntervalEnum fromValue(String value) { public static final String JSON_PROPERTY_INTERVAL = "interval"; private IntervalEnum interval; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInterval = false; + public static final String JSON_PROPERTY_MAX_AMOUNT = "maxAmount"; private Amount maxAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaxAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapabilitySettings() {} /** @@ -143,6 +166,7 @@ public CapabilitySettings() {} */ public CapabilitySettings amountPerIndustry(Map amountPerIndustry) { this.amountPerIndustry = amountPerIndustry; + isSetAmountPerIndustry = true; // mark as set return this; } @@ -170,6 +194,7 @@ public Map getAmountPerIndustry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountPerIndustry(Map amountPerIndustry) { this.amountPerIndustry = amountPerIndustry; + isSetAmountPerIndustry = true; // mark as set } /** @@ -178,6 +203,7 @@ public void setAmountPerIndustry(Map amountPerIndustry) { */ public CapabilitySettings authorizedCardUsers(Boolean authorizedCardUsers) { this.authorizedCardUsers = authorizedCardUsers; + isSetAuthorizedCardUsers = true; // mark as set return this; } @@ -197,6 +223,7 @@ public Boolean getAuthorizedCardUsers() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorizedCardUsers(Boolean authorizedCardUsers) { this.authorizedCardUsers = authorizedCardUsers; + isSetAuthorizedCardUsers = true; // mark as set } /** @@ -205,6 +232,7 @@ public void setAuthorizedCardUsers(Boolean authorizedCardUsers) { */ public CapabilitySettings fundingSource(List fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -232,6 +260,7 @@ public List getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(List fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -240,6 +269,7 @@ public void setFundingSource(List fundingSource) { */ public CapabilitySettings interval(IntervalEnum interval) { this.interval = interval; + isSetInterval = true; // mark as set return this; } @@ -259,6 +289,7 @@ public IntervalEnum getInterval() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInterval(IntervalEnum interval) { this.interval = interval; + isSetInterval = true; // mark as set } /** @@ -269,6 +300,7 @@ public void setInterval(IntervalEnum interval) { */ public CapabilitySettings maxAmount(Amount maxAmount) { this.maxAmount = maxAmount; + isSetMaxAmount = true; // mark as set return this; } @@ -292,6 +324,27 @@ public Amount getMaxAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaxAmount(Amount maxAmount) { this.maxAmount = maxAmount; + isSetMaxAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapabilitySettings 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 CapabilitySettings object is equal to o. */ @@ -341,6 +394,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 (isSetAmountPerIndustry) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_PER_INDUSTRY, this.amountPerIndustry); + } + if (isSetAuthorizedCardUsers) { + addIfNull(nulls, JSON_PROPERTY_AUTHORIZED_CARD_USERS, this.authorizedCardUsers); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetInterval) { + addIfNull(nulls, JSON_PROPERTY_INTERVAL, this.interval); + } + if (isSetMaxAmount) { + addIfNull(nulls, JSON_PROPERTY_MAX_AMOUNT, this.maxAmount); + } + + 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 CapabilitySettings given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java b/src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java index a506efb74..b903464f9 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java +++ b/src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 CapitalBalance { 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_FEE = "fee"; private Long fee; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFee = false; + public static final String JSON_PROPERTY_PRINCIPAL = "principal"; private Long principal; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrincipal = false; + public static final String JSON_PROPERTY_TOTAL = "total"; private Long total; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotal = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapitalBalance() {} /** @@ -49,6 +69,7 @@ public CapitalBalance() {} */ public CapitalBalance currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -76,6 +97,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -86,6 +108,7 @@ public void setCurrency(String currency) { */ public CapitalBalance fee(Long fee) { this.fee = fee; + isSetFee = true; // mark as set return this; } @@ -109,6 +132,7 @@ public Long getFee() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFee(Long fee) { this.fee = fee; + isSetFee = true; // mark as set } /** @@ -119,6 +143,7 @@ public void setFee(Long fee) { */ public CapitalBalance principal(Long principal) { this.principal = principal; + isSetPrincipal = true; // mark as set return this; } @@ -142,6 +167,7 @@ public Long getPrincipal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrincipal(Long principal) { this.principal = principal; + isSetPrincipal = true; // mark as set } /** @@ -152,6 +178,7 @@ public void setPrincipal(Long principal) { */ public CapitalBalance total(Long total) { this.total = total; + isSetTotal = true; // mark as set return this; } @@ -175,6 +202,27 @@ public Long getTotal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTotal(Long total) { this.total = total; + isSetTotal = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapitalBalance 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 CapitalBalance object is equal to o. */ @@ -220,6 +268,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 (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetFee) { + addIfNull(nulls, JSON_PROPERTY_FEE, this.fee); + } + if (isSetPrincipal) { + addIfNull(nulls, JSON_PROPERTY_PRINCIPAL, this.principal); + } + if (isSetTotal) { + addIfNull(nulls, JSON_PROPERTY_TOTAL, this.total); + } + + 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 CapitalBalance given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java b/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java index 53c3fcdce..bceb98060 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java +++ b/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,15 +32,33 @@ public class CapitalGrantAccount { public static final String JSON_PROPERTY_BALANCES = "balances"; private List balances; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalances = false; + public static final String JSON_PROPERTY_FUNDING_BALANCE_ACCOUNT_ID = "fundingBalanceAccountId"; private String fundingBalanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingBalanceAccountId = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_LIMITS = "limits"; private List limits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLimits = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapitalGrantAccount() {} /** @@ -49,6 +69,7 @@ public CapitalGrantAccount() {} */ public CapitalGrantAccount balances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set return this; } @@ -80,6 +101,7 @@ public List getBalances() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set } /** @@ -91,6 +113,7 @@ public void setBalances(List balances) { */ public CapitalGrantAccount fundingBalanceAccountId(String fundingBalanceAccountId) { this.fundingBalanceAccountId = fundingBalanceAccountId; + isSetFundingBalanceAccountId = true; // mark as set return this; } @@ -116,6 +139,7 @@ public String getFundingBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingBalanceAccountId(String fundingBalanceAccountId) { this.fundingBalanceAccountId = fundingBalanceAccountId; + isSetFundingBalanceAccountId = true; // mark as set } /** @@ -126,6 +150,7 @@ public void setFundingBalanceAccountId(String fundingBalanceAccountId) { */ public CapitalGrantAccount id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -149,6 +174,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -159,6 +185,7 @@ public void setId(String id) { */ public CapitalGrantAccount limits(List limits) { this.limits = limits; + isSetLimits = true; // mark as set return this; } @@ -190,6 +217,27 @@ public List getLimits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLimits(List limits) { this.limits = limits; + isSetLimits = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapitalGrantAccount 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 CapitalGrantAccount object is equal to o. */ @@ -237,6 +285,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 (isSetBalances) { + addIfNull(nulls, JSON_PROPERTY_BALANCES, this.balances); + } + if (isSetFundingBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_BALANCE_ACCOUNT_ID, this.fundingBalanceAccountId); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLimits) { + addIfNull(nulls, JSON_PROPERTY_LIMITS, this.limits); + } + + 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 CapitalGrantAccount given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Card.java b/src/main/java/com/adyen/model/balanceplatform/Card.java index c80794462..4bd1d9c5f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Card.java +++ b/src/main/java/com/adyen/model/balanceplatform/Card.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,30 +44,57 @@ public class Card { public static final String JSON_PROPERTY_AUTHENTICATION = "authentication"; private Authentication authentication; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthentication = 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_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_BRAND_VARIANT = "brandVariant"; private String brandVariant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrandVariant = false; + public static final String JSON_PROPERTY_CARDHOLDER_NAME = "cardholderName"; private String cardholderName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardholderName = false; + public static final String JSON_PROPERTY_CONFIGURATION = "configuration"; private CardConfiguration configuration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConfiguration = 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_DELIVERY_CONTACT = "deliveryContact"; private DeliveryContact deliveryContact; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryContact = false; + public static final String JSON_PROPERTY_EXPIRATION = "expiration"; private Expiry expiration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiration = false; + /** The form factor of the card. Possible values: **virtual**, **physical**. */ public enum FormFactorEnum { PHYSICAL(String.valueOf("physical")), @@ -112,18 +141,39 @@ public static FormFactorEnum fromValue(String value) { public static final String JSON_PROPERTY_FORM_FACTOR = "formFactor"; private FormFactorEnum formFactor; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFormFactor = false; + public static final String JSON_PROPERTY_LAST_FOUR = "lastFour"; private String lastFour; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastFour = 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_THREE_D_SECURE = "threeDSecure"; private String threeDSecure; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSecure = false; + public static final String JSON_PROPERTY_USAGE = "usage"; private String usage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUsage = 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() {} @JsonCreator @@ -140,6 +190,7 @@ public Card(@JsonProperty(JSON_PROPERTY_NUMBER) String number) { */ public Card authentication(Authentication authentication) { this.authentication = authentication; + isSetAuthentication = true; // mark as set return this; } @@ -163,6 +214,7 @@ public Authentication getAuthentication() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthentication(Authentication authentication) { this.authentication = authentication; + isSetAuthentication = true; // mark as set } /** @@ -173,6 +225,7 @@ public void setAuthentication(Authentication authentication) { */ public Card bin(String bin) { this.bin = bin; + isSetBin = true; // mark as set return this; } @@ -196,6 +249,7 @@ public String getBin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBin(String bin) { this.bin = bin; + isSetBin = true; // mark as set } /** @@ -206,6 +260,7 @@ public void setBin(String bin) { */ public Card brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -229,6 +284,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -243,6 +299,7 @@ public void setBrand(String brand) { */ public Card brandVariant(String brandVariant) { this.brandVariant = brandVariant; + isSetBrandVariant = true; // mark as set return this; } @@ -274,6 +331,7 @@ public String getBrandVariant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrandVariant(String brandVariant) { this.brandVariant = brandVariant; + isSetBrandVariant = true; // mark as set } /** @@ -284,6 +342,7 @@ public void setBrandVariant(String brandVariant) { */ public Card cardholderName(String cardholderName) { this.cardholderName = cardholderName; + isSetCardholderName = true; // mark as set return this; } @@ -307,6 +366,7 @@ public String getCardholderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardholderName(String cardholderName) { this.cardholderName = cardholderName; + isSetCardholderName = true; // mark as set } /** @@ -317,6 +377,7 @@ public void setCardholderName(String cardholderName) { */ public Card configuration(CardConfiguration configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set return this; } @@ -340,6 +401,7 @@ public CardConfiguration getConfiguration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConfiguration(CardConfiguration configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set } /** @@ -352,6 +414,7 @@ public void setConfiguration(CardConfiguration configuration) { */ public Card cvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set return this; } @@ -379,6 +442,7 @@ public String getCvc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set } /** @@ -389,6 +453,7 @@ public void setCvc(String cvc) { */ public Card deliveryContact(DeliveryContact deliveryContact) { this.deliveryContact = deliveryContact; + isSetDeliveryContact = true; // mark as set return this; } @@ -412,6 +477,7 @@ public DeliveryContact getDeliveryContact() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryContact(DeliveryContact deliveryContact) { this.deliveryContact = deliveryContact; + isSetDeliveryContact = true; // mark as set } /** @@ -422,6 +488,7 @@ public void setDeliveryContact(DeliveryContact deliveryContact) { */ public Card expiration(Expiry expiration) { this.expiration = expiration; + isSetExpiration = true; // mark as set return this; } @@ -445,6 +512,7 @@ public Expiry getExpiration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiration(Expiry expiration) { this.expiration = expiration; + isSetExpiration = true; // mark as set } /** @@ -455,6 +523,7 @@ public void setExpiration(Expiry expiration) { */ public Card formFactor(FormFactorEnum formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set return this; } @@ -478,6 +547,7 @@ public FormFactorEnum getFormFactor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFormFactor(FormFactorEnum formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set } /** @@ -488,6 +558,7 @@ public void setFormFactor(FormFactorEnum formFactor) { */ public Card lastFour(String lastFour) { this.lastFour = lastFour; + isSetLastFour = true; // mark as set return this; } @@ -511,6 +582,7 @@ public String getLastFour() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastFour(String lastFour) { this.lastFour = lastFour; + isSetLastFour = true; // mark as set } /** @@ -538,6 +610,7 @@ public String getNumber() { */ public Card threeDSecure(String threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set return this; } @@ -569,6 +642,7 @@ public String getThreeDSecure() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSecure(String threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set } /** @@ -582,6 +656,7 @@ public void setThreeDSecure(String threeDSecure) { */ public Card usage(String usage) { this.usage = usage; + isSetUsage = true; // mark as set return this; } @@ -611,6 +686,27 @@ public String getUsage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUsage(String usage) { this.usage = usage; + isSetUsage = 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. */ @@ -690,6 +786,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 (isSetAuthentication) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION, this.authentication); + } + if (isSetBin) { + addIfNull(nulls, JSON_PROPERTY_BIN, this.bin); + } + if (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetBrandVariant) { + addIfNull(nulls, JSON_PROPERTY_BRAND_VARIANT, this.brandVariant); + } + if (isSetCardholderName) { + addIfNull(nulls, JSON_PROPERTY_CARDHOLDER_NAME, this.cardholderName); + } + if (isSetConfiguration) { + addIfNull(nulls, JSON_PROPERTY_CONFIGURATION, this.configuration); + } + if (isSetCvc) { + addIfNull(nulls, JSON_PROPERTY_CVC, this.cvc); + } + if (isSetDeliveryContact) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_CONTACT, this.deliveryContact); + } + if (isSetExpiration) { + addIfNull(nulls, JSON_PROPERTY_EXPIRATION, this.expiration); + } + if (isSetFormFactor) { + addIfNull(nulls, JSON_PROPERTY_FORM_FACTOR, this.formFactor); + } + if (isSetLastFour) { + addIfNull(nulls, JSON_PROPERTY_LAST_FOUR, this.lastFour); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + if (isSetThreeDSecure) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_SECURE, this.threeDSecure); + } + if (isSetUsage) { + addIfNull(nulls, JSON_PROPERTY_USAGE, this.usage); + } + + 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/balanceplatform/CardConfiguration.java b/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java index d448ec323..5b8b14e10 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java +++ b/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,68 +40,117 @@ public class CardConfiguration { public static final String JSON_PROPERTY_ACTIVATION = "activation"; private String activation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetActivation = false; + public static final String JSON_PROPERTY_ACTIVATION_URL = "activationUrl"; private String activationUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetActivationUrl = false; + public static final String JSON_PROPERTY_BULK_ADDRESS = "bulkAddress"; private BulkAddress bulkAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBulkAddress = false; + public static final String JSON_PROPERTY_CARD_IMAGE_ID = "cardImageId"; private String cardImageId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardImageId = false; + public static final String JSON_PROPERTY_CARRIER = "carrier"; private String carrier; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarrier = false; + public static final String JSON_PROPERTY_CARRIER_IMAGE_ID = "carrierImageId"; private String carrierImageId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarrierImageId = false; + public static final String JSON_PROPERTY_CONFIGURATION_PROFILE_ID = "configurationProfileId"; private String configurationProfileId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConfigurationProfileId = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_ENVELOPE = "envelope"; private String envelope; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvelope = false; + public static final String JSON_PROPERTY_INSERT = "insert"; private String insert; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInsert = 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_LOGO_IMAGE_ID = "logoImageId"; private String logoImageId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLogoImageId = false; + public static final String JSON_PROPERTY_PIN_MAILER = "pinMailer"; private String pinMailer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPinMailer = false; + public static final String JSON_PROPERTY_SHIPMENT_METHOD = "shipmentMethod"; private String shipmentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShipmentMethod = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + 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) { this.activation = activation; + isSetActivation = true; // mark as set return this; } /** - * 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,17 +159,18 @@ 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) public void setActivation(String activation) { this.activation = activation; + isSetActivation = true; // mark as set } /** @@ -135,6 +187,7 @@ public void setActivation(String activation) { */ public CardConfiguration activationUrl(String activationUrl) { this.activationUrl = activationUrl; + isSetActivationUrl = true; // mark as set return this; } @@ -170,6 +223,7 @@ public String getActivationUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setActivationUrl(String activationUrl) { this.activationUrl = activationUrl; + isSetActivationUrl = true; // mark as set } /** @@ -180,6 +234,7 @@ public void setActivationUrl(String activationUrl) { */ public CardConfiguration bulkAddress(BulkAddress bulkAddress) { this.bulkAddress = bulkAddress; + isSetBulkAddress = true; // mark as set return this; } @@ -203,25 +258,27 @@ public BulkAddress getBulkAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBulkAddress(BulkAddress bulkAddress) { this.bulkAddress = bulkAddress; + isSetBulkAddress = true; // mark as set } /** - * 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 */ public CardConfiguration cardImageId(String cardImageId) { this.cardImageId = cardImageId; + isSetCardImageId = true; // mark as set return this; } /** - * 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,38 +287,38 @@ 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) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardImageId(String cardImageId) { this.cardImageId = cardImageId; + isSetCardImageId = true; // mark as set } /** - * 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) { this.carrier = carrier; + isSetCarrier = true; // mark as set return this; } /** - * 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,37 +327,38 @@ 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) public void setCarrier(String carrier) { this.carrier = carrier; + isSetCarrier = true; // mark as set } /** - * 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 */ public CardConfiguration carrierImageId(String carrierImageId) { this.carrierImageId = carrierImageId; + isSetCarrierImageId = true; // mark as set return this; } /** - * 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,51 +368,55 @@ 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) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarrierImageId(String carrierImageId) { this.carrierImageId = carrierImageId; + isSetCarrierImageId = true; // mark as set } /** - * 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) { this.configurationProfileId = configurationProfileId; + isSetConfigurationProfileId = true; // mark as set return this; } /** - * 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,44 +425,51 @@ 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) public void setConfigurationProfileId(String configurationProfileId) { this.configurationProfileId = configurationProfileId; + isSetConfigurationProfileId = true; // mark as set } /** * 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) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } /** * 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,34 +479,36 @@ 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) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** - * 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) { this.envelope = envelope; + isSetEnvelope = true; // mark as set return this; } /** - * 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,38 +517,39 @@ 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) public void setEnvelope(String envelope) { this.envelope = envelope; + isSetEnvelope = true; // mark as set } /** - * 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) { this.insert = insert; + isSetInsert = true; // mark as set return this; } /** - * 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,17 +558,18 @@ 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) public void setInsert(String insert) { this.insert = insert; + isSetInsert = true; // mark as set } /** @@ -510,6 +583,7 @@ public void setInsert(String insert) { */ public CardConfiguration language(String language) { this.language = language; + isSetLanguage = true; // mark as set return this; } @@ -539,27 +613,29 @@ public String getLanguage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLanguage(String language) { this.language = language; + isSetLanguage = true; // mark as set } /** - * 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) { this.logoImageId = logoImageId; + isSetLogoImageId = true; // mark as set return this; } /** - * 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,39 +644,39 @@ 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) public void setLogoImageId(String logoImageId) { this.logoImageId = logoImageId; + isSetLogoImageId = true; // mark as set } /** - * 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) { this.pinMailer = pinMailer; + isSetPinMailer = true; // mark as set return this; } /** - * 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,36 +685,39 @@ 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) public void setPinMailer(String pinMailer) { this.pinMailer = pinMailer; + isSetPinMailer = true; // mark as set } /** - * 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) { this.shipmentMethod = shipmentMethod; + isSetShipmentMethod = true; // mark as set return this; } /** - * 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,15 +726,37 @@ 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) public void setShipmentMethod(String shipmentMethod) { this.shipmentMethod = shipmentMethod; + isSetShipmentMethod = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardConfiguration 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 CardConfiguration object is equal to o. */ @@ -737,6 +838,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 (isSetActivation) { + addIfNull(nulls, JSON_PROPERTY_ACTIVATION, this.activation); + } + if (isSetActivationUrl) { + addIfNull(nulls, JSON_PROPERTY_ACTIVATION_URL, this.activationUrl); + } + if (isSetBulkAddress) { + addIfNull(nulls, JSON_PROPERTY_BULK_ADDRESS, this.bulkAddress); + } + if (isSetCardImageId) { + addIfNull(nulls, JSON_PROPERTY_CARD_IMAGE_ID, this.cardImageId); + } + if (isSetCarrier) { + addIfNull(nulls, JSON_PROPERTY_CARRIER, this.carrier); + } + if (isSetCarrierImageId) { + addIfNull(nulls, JSON_PROPERTY_CARRIER_IMAGE_ID, this.carrierImageId); + } + if (isSetConfigurationProfileId) { + addIfNull(nulls, JSON_PROPERTY_CONFIGURATION_PROFILE_ID, this.configurationProfileId); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetEnvelope) { + addIfNull(nulls, JSON_PROPERTY_ENVELOPE, this.envelope); + } + if (isSetInsert) { + addIfNull(nulls, JSON_PROPERTY_INSERT, this.insert); + } + if (isSetLanguage) { + addIfNull(nulls, JSON_PROPERTY_LANGUAGE, this.language); + } + if (isSetLogoImageId) { + addIfNull(nulls, JSON_PROPERTY_LOGO_IMAGE_ID, this.logoImageId); + } + if (isSetPinMailer) { + addIfNull(nulls, JSON_PROPERTY_PIN_MAILER, this.pinMailer); + } + if (isSetShipmentMethod) { + addIfNull(nulls, JSON_PROPERTY_SHIPMENT_METHOD, this.shipmentMethod); + } + + 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 CardConfiguration given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CardInfo.java b/src/main/java/com/adyen/model/balanceplatform/CardInfo.java index 672469bfb..1ac922acf 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CardInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/CardInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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 CardInfo { public static final String JSON_PROPERTY_AUTHENTICATION = "authentication"; private Authentication authentication; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthentication = false; + public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_BRAND_VARIANT = "brandVariant"; private String brandVariant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrandVariant = false; + public static final String JSON_PROPERTY_CARDHOLDER_NAME = "cardholderName"; private String cardholderName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardholderName = false; + public static final String JSON_PROPERTY_CONFIGURATION = "configuration"; private CardConfiguration configuration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConfiguration = false; + public static final String JSON_PROPERTY_DELIVERY_CONTACT = "deliveryContact"; private DeliveryContact deliveryContact; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryContact = false; + /** The form factor of the card. Possible values: **virtual**, **physical**. */ public enum FormFactorEnum { PHYSICAL(String.valueOf("physical")), @@ -98,12 +118,27 @@ public static FormFactorEnum fromValue(String value) { public static final String JSON_PROPERTY_FORM_FACTOR = "formFactor"; private FormFactorEnum formFactor; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFormFactor = false; + public static final String JSON_PROPERTY_THREE_D_SECURE = "threeDSecure"; private String threeDSecure; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSecure = false; + public static final String JSON_PROPERTY_USAGE = "usage"; private String usage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUsage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardInfo() {} /** @@ -114,6 +149,7 @@ public CardInfo() {} */ public CardInfo authentication(Authentication authentication) { this.authentication = authentication; + isSetAuthentication = true; // mark as set return this; } @@ -137,6 +173,7 @@ public Authentication getAuthentication() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthentication(Authentication authentication) { this.authentication = authentication; + isSetAuthentication = true; // mark as set } /** @@ -147,6 +184,7 @@ public void setAuthentication(Authentication authentication) { */ public CardInfo brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -170,6 +208,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -184,6 +223,7 @@ public void setBrand(String brand) { */ public CardInfo brandVariant(String brandVariant) { this.brandVariant = brandVariant; + isSetBrandVariant = true; // mark as set return this; } @@ -215,6 +255,7 @@ public String getBrandVariant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrandVariant(String brandVariant) { this.brandVariant = brandVariant; + isSetBrandVariant = true; // mark as set } /** @@ -225,6 +266,7 @@ public void setBrandVariant(String brandVariant) { */ public CardInfo cardholderName(String cardholderName) { this.cardholderName = cardholderName; + isSetCardholderName = true; // mark as set return this; } @@ -248,6 +290,7 @@ public String getCardholderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardholderName(String cardholderName) { this.cardholderName = cardholderName; + isSetCardholderName = true; // mark as set } /** @@ -258,6 +301,7 @@ public void setCardholderName(String cardholderName) { */ public CardInfo configuration(CardConfiguration configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set return this; } @@ -281,6 +325,7 @@ public CardConfiguration getConfiguration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConfiguration(CardConfiguration configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set } /** @@ -291,6 +336,7 @@ public void setConfiguration(CardConfiguration configuration) { */ public CardInfo deliveryContact(DeliveryContact deliveryContact) { this.deliveryContact = deliveryContact; + isSetDeliveryContact = true; // mark as set return this; } @@ -314,6 +360,7 @@ public DeliveryContact getDeliveryContact() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryContact(DeliveryContact deliveryContact) { this.deliveryContact = deliveryContact; + isSetDeliveryContact = true; // mark as set } /** @@ -324,6 +371,7 @@ public void setDeliveryContact(DeliveryContact deliveryContact) { */ public CardInfo formFactor(FormFactorEnum formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set return this; } @@ -347,6 +395,7 @@ public FormFactorEnum getFormFactor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFormFactor(FormFactorEnum formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set } /** @@ -361,6 +410,7 @@ public void setFormFactor(FormFactorEnum formFactor) { */ public CardInfo threeDSecure(String threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set return this; } @@ -392,6 +442,7 @@ public String getThreeDSecure() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSecure(String threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set } /** @@ -405,6 +456,7 @@ public void setThreeDSecure(String threeDSecure) { */ public CardInfo usage(String usage) { this.usage = usage; + isSetUsage = true; // mark as set return this; } @@ -434,6 +486,27 @@ public String getUsage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUsage(String usage) { this.usage = usage; + isSetUsage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardInfo 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 CardInfo object is equal to o. */ @@ -498,6 +571,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 (isSetAuthentication) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION, this.authentication); + } + if (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetBrandVariant) { + addIfNull(nulls, JSON_PROPERTY_BRAND_VARIANT, this.brandVariant); + } + if (isSetCardholderName) { + addIfNull(nulls, JSON_PROPERTY_CARDHOLDER_NAME, this.cardholderName); + } + if (isSetConfiguration) { + addIfNull(nulls, JSON_PROPERTY_CONFIGURATION, this.configuration); + } + if (isSetDeliveryContact) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_CONTACT, this.deliveryContact); + } + if (isSetFormFactor) { + addIfNull(nulls, JSON_PROPERTY_FORM_FACTOR, this.formFactor); + } + if (isSetThreeDSecure) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_SECURE, this.threeDSecure); + } + if (isSetUsage) { + addIfNull(nulls, JSON_PROPERTY_USAGE, this.usage); + } + + 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 CardInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CardOrder.java b/src/main/java/com/adyen/model/balanceplatform/CardOrder.java index 92fc351c6..d7d180119 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CardOrder.java +++ b/src/main/java/com/adyen/model/balanceplatform/CardOrder.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,25 +39,46 @@ public class CardOrder { public static final String JSON_PROPERTY_BEGIN_DATE = "beginDate"; private OffsetDateTime beginDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBeginDate = false; + public static final String JSON_PROPERTY_CARD_MANUFACTURING_PROFILE_ID = "cardManufacturingProfileId"; private String cardManufacturingProfileId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardManufacturingProfileId = false; + public static final String JSON_PROPERTY_CLOSED_DATE = "closedDate"; private OffsetDateTime closedDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClosedDate = false; + public static final String JSON_PROPERTY_END_DATE = "endDate"; private OffsetDateTime endDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndDate = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_LOCK_DATE = "lockDate"; private OffsetDateTime lockDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLockDate = false; + public static final String JSON_PROPERTY_SERVICE_CENTER = "serviceCenter"; private String serviceCenter; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetServiceCenter = false; + /** The status of the card order. Possible values: **Open**, **Closed**. */ public enum StatusEnum { CLOSED(String.valueOf("closed")), @@ -100,6 +123,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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardOrder() {} /** @@ -110,6 +142,7 @@ public CardOrder() {} */ public CardOrder beginDate(OffsetDateTime beginDate) { this.beginDate = beginDate; + isSetBeginDate = true; // mark as set return this; } @@ -133,6 +166,7 @@ public OffsetDateTime getBeginDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBeginDate(OffsetDateTime beginDate) { this.beginDate = beginDate; + isSetBeginDate = true; // mark as set } /** @@ -143,6 +177,7 @@ public void setBeginDate(OffsetDateTime beginDate) { */ public CardOrder cardManufacturingProfileId(String cardManufacturingProfileId) { this.cardManufacturingProfileId = cardManufacturingProfileId; + isSetCardManufacturingProfileId = true; // mark as set return this; } @@ -166,6 +201,7 @@ public String getCardManufacturingProfileId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardManufacturingProfileId(String cardManufacturingProfileId) { this.cardManufacturingProfileId = cardManufacturingProfileId; + isSetCardManufacturingProfileId = true; // mark as set } /** @@ -176,6 +212,7 @@ public void setCardManufacturingProfileId(String cardManufacturingProfileId) { */ public CardOrder closedDate(OffsetDateTime closedDate) { this.closedDate = closedDate; + isSetClosedDate = true; // mark as set return this; } @@ -199,6 +236,7 @@ public OffsetDateTime getClosedDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClosedDate(OffsetDateTime closedDate) { this.closedDate = closedDate; + isSetClosedDate = true; // mark as set } /** @@ -213,6 +251,7 @@ public void setClosedDate(OffsetDateTime closedDate) { */ public CardOrder endDate(OffsetDateTime endDate) { this.endDate = endDate; + isSetEndDate = true; // mark as set return this; } @@ -244,6 +283,7 @@ public OffsetDateTime getEndDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndDate(OffsetDateTime endDate) { this.endDate = endDate; + isSetEndDate = true; // mark as set } /** @@ -254,6 +294,7 @@ public void setEndDate(OffsetDateTime endDate) { */ public CardOrder id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -277,6 +318,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -287,6 +329,7 @@ public void setId(String id) { */ public CardOrder lockDate(OffsetDateTime lockDate) { this.lockDate = lockDate; + isSetLockDate = true; // mark as set return this; } @@ -310,6 +353,7 @@ public OffsetDateTime getLockDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLockDate(OffsetDateTime lockDate) { this.lockDate = lockDate; + isSetLockDate = true; // mark as set } /** @@ -320,6 +364,7 @@ public void setLockDate(OffsetDateTime lockDate) { */ public CardOrder serviceCenter(String serviceCenter) { this.serviceCenter = serviceCenter; + isSetServiceCenter = true; // mark as set return this; } @@ -343,6 +388,7 @@ public String getServiceCenter() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setServiceCenter(String serviceCenter) { this.serviceCenter = serviceCenter; + isSetServiceCenter = true; // mark as set } /** @@ -353,6 +399,7 @@ public void setServiceCenter(String serviceCenter) { */ public CardOrder status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -376,6 +423,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardOrder 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 CardOrder object is equal to o. */ @@ -439,6 +507,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 (isSetBeginDate) { + addIfNull(nulls, JSON_PROPERTY_BEGIN_DATE, this.beginDate); + } + if (isSetCardManufacturingProfileId) { + addIfNull( + nulls, JSON_PROPERTY_CARD_MANUFACTURING_PROFILE_ID, this.cardManufacturingProfileId); + } + if (isSetClosedDate) { + addIfNull(nulls, JSON_PROPERTY_CLOSED_DATE, this.closedDate); + } + if (isSetEndDate) { + addIfNull(nulls, JSON_PROPERTY_END_DATE, this.endDate); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLockDate) { + addIfNull(nulls, JSON_PROPERTY_LOCK_DATE, this.lockDate); + } + if (isSetServiceCenter) { + addIfNull(nulls, JSON_PROPERTY_SERVICE_CENTER, this.serviceCenter); + } + 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 CardOrder given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CardOrderItem.java b/src/main/java/com/adyen/model/balanceplatform/CardOrderItem.java index 94ea7a405..97e508b95 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CardOrderItem.java +++ b/src/main/java/com/adyen/model/balanceplatform/CardOrderItem.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,27 +36,57 @@ public class CardOrderItem { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CARD = "card"; private CardOrderItemDeliveryStatus card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = false; + public static final String JSON_PROPERTY_CARD_ORDER_ITEM_ID = "cardOrderItemId"; private String cardOrderItemId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardOrderItemId = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + public static final String JSON_PROPERTY_PIN = "pin"; private CardOrderItemDeliveryStatus pin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPin = false; + public static final String JSON_PROPERTY_SHIPPING_METHOD = "shippingMethod"; private String shippingMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShippingMethod = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardOrderItem() {} @JsonCreator @@ -71,6 +103,7 @@ public CardOrderItem(@JsonProperty(JSON_PROPERTY_ID) String id) { */ public CardOrderItem balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -94,6 +127,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -104,6 +138,7 @@ public void setBalancePlatform(String balancePlatform) { */ public CardOrderItem card(CardOrderItemDeliveryStatus card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -127,6 +162,7 @@ public CardOrderItemDeliveryStatus getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(CardOrderItemDeliveryStatus card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -137,6 +173,7 @@ public void setCard(CardOrderItemDeliveryStatus card) { */ public CardOrderItem cardOrderItemId(String cardOrderItemId) { this.cardOrderItemId = cardOrderItemId; + isSetCardOrderItemId = true; // mark as set return this; } @@ -160,6 +197,7 @@ public String getCardOrderItemId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardOrderItemId(String cardOrderItemId) { this.cardOrderItemId = cardOrderItemId; + isSetCardOrderItemId = true; // mark as set } /** @@ -172,6 +210,7 @@ public void setCardOrderItemId(String cardOrderItemId) { */ public CardOrderItem creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -199,6 +238,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -221,6 +261,7 @@ public String getId() { */ public CardOrderItem paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -246,6 +287,7 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set } /** @@ -256,6 +298,7 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { */ public CardOrderItem pin(CardOrderItemDeliveryStatus pin) { this.pin = pin; + isSetPin = true; // mark as set return this; } @@ -279,6 +322,7 @@ public CardOrderItemDeliveryStatus getPin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPin(CardOrderItemDeliveryStatus pin) { this.pin = pin; + isSetPin = true; // mark as set } /** @@ -289,6 +333,7 @@ public void setPin(CardOrderItemDeliveryStatus pin) { */ public CardOrderItem shippingMethod(String shippingMethod) { this.shippingMethod = shippingMethod; + isSetShippingMethod = true; // mark as set return this; } @@ -312,6 +357,27 @@ public String getShippingMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShippingMethod(String shippingMethod) { this.shippingMethod = shippingMethod; + isSetShippingMethod = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardOrderItem 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 CardOrderItem object is equal to o. */ @@ -375,6 +441,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 (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetCardOrderItemId) { + addIfNull(nulls, JSON_PROPERTY_CARD_ORDER_ITEM_ID, this.cardOrderItemId); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + if (isSetPin) { + addIfNull(nulls, JSON_PROPERTY_PIN, this.pin); + } + if (isSetShippingMethod) { + addIfNull(nulls, JSON_PROPERTY_SHIPPING_METHOD, this.shippingMethod); + } + + 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 CardOrderItem given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CardOrderItemDeliveryStatus.java b/src/main/java/com/adyen/model/balanceplatform/CardOrderItemDeliveryStatus.java index 325c4e3e2..b8ff2cd97 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CardOrderItemDeliveryStatus.java +++ b/src/main/java/com/adyen/model/balanceplatform/CardOrderItemDeliveryStatus.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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 CardOrderItemDeliveryStatus { public static final String JSON_PROPERTY_ERROR_MESSAGE = "errorMessage"; private String errorMessage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorMessage = false; + /** The status of the PIN delivery. */ public enum StatusEnum { CREATED(String.valueOf("created")), @@ -87,9 +92,21 @@ 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_TRACKING_NUMBER = "trackingNumber"; private String trackingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrackingNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardOrderItemDeliveryStatus() {} /** @@ -100,6 +117,7 @@ public CardOrderItemDeliveryStatus() {} */ public CardOrderItemDeliveryStatus errorMessage(String errorMessage) { this.errorMessage = errorMessage; + isSetErrorMessage = true; // mark as set return this; } @@ -123,6 +141,7 @@ public String getErrorMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; + isSetErrorMessage = true; // mark as set } /** @@ -133,6 +152,7 @@ public void setErrorMessage(String errorMessage) { */ public CardOrderItemDeliveryStatus status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -156,6 +176,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -166,6 +187,7 @@ public void setStatus(StatusEnum status) { */ public CardOrderItemDeliveryStatus trackingNumber(String trackingNumber) { this.trackingNumber = trackingNumber; + isSetTrackingNumber = true; // mark as set return this; } @@ -189,6 +211,27 @@ public String getTrackingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrackingNumber(String trackingNumber) { this.trackingNumber = trackingNumber; + isSetTrackingNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardOrderItemDeliveryStatus 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 CardOrderItemDeliveryStatus object is equal to o. */ @@ -232,6 +275,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 (isSetErrorMessage) { + addIfNull(nulls, JSON_PROPERTY_ERROR_MESSAGE, this.errorMessage); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTrackingNumber) { + addIfNull(nulls, JSON_PROPERTY_TRACKING_NUMBER, this.trackingNumber); + } + + 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 CardOrderItemDeliveryStatus given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Condition.java b/src/main/java/com/adyen/model/balanceplatform/Condition.java index 413cfa8b5..2accbbad8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Condition.java +++ b/src/main/java/com/adyen/model/balanceplatform/Condition.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -81,6 +83,9 @@ public static BalanceTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_BALANCE_TYPE = "balanceType"; private BalanceTypeEnum balanceType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceType = false; + /** * Define when you want to get notified about a balance change. Possible values: * * **greaterThan**: the balance in the account(s) exceeds the specified `value`. * @@ -136,9 +141,21 @@ public static ConditionTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_CONDITION_TYPE = "conditionType"; private ConditionTypeEnum conditionType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConditionType = 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 Condition() {} /** @@ -155,6 +172,7 @@ public Condition() {} */ public Condition balanceType(BalanceTypeEnum balanceType) { this.balanceType = balanceType; + isSetBalanceType = true; // mark as set return this; } @@ -190,6 +208,7 @@ public BalanceTypeEnum getBalanceType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceType(BalanceTypeEnum balanceType) { this.balanceType = balanceType; + isSetBalanceType = true; // mark as set } /** @@ -210,6 +229,7 @@ public void setBalanceType(BalanceTypeEnum balanceType) { */ public Condition conditionType(ConditionTypeEnum conditionType) { this.conditionType = conditionType; + isSetConditionType = true; // mark as set return this; } @@ -253,6 +273,7 @@ public ConditionTypeEnum getConditionType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConditionType(ConditionTypeEnum conditionType) { this.conditionType = conditionType; + isSetConditionType = true; // mark as set } /** @@ -263,6 +284,7 @@ public void setConditionType(ConditionTypeEnum conditionType) { */ public Condition value(Long value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -286,6 +308,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 Condition 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 Condition object is equal to o. */ @@ -329,6 +372,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 (isSetBalanceType) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_TYPE, this.balanceType); + } + if (isSetConditionType) { + addIfNull(nulls, JSON_PROPERTY_CONDITION_TYPE, this.conditionType); + } + 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 Condition given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ContactDetails.java b/src/main/java/com/adyen/model/balanceplatform/ContactDetails.java index fcfef740d..4915dffae 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ContactDetails.java +++ b/src/main/java/com/adyen/model/balanceplatform/ContactDetails.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,15 +35,33 @@ public class ContactDetails { public static final String JSON_PROPERTY_ADDRESS = "address"; private Address address; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddress = false; + public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_PHONE = "phone"; private Phone phone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhone = false; + public static final String JSON_PROPERTY_WEB_ADDRESS = "webAddress"; private String webAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebAddress = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ContactDetails() {} /** @@ -52,6 +72,7 @@ public ContactDetails() {} */ public ContactDetails address(Address address) { this.address = address; + isSetAddress = true; // mark as set return this; } @@ -75,6 +96,7 @@ public Address getAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddress(Address address) { this.address = address; + isSetAddress = true; // mark as set } /** @@ -85,6 +107,7 @@ public void setAddress(Address address) { */ public ContactDetails email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -108,6 +131,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -118,6 +142,7 @@ public void setEmail(String email) { */ public ContactDetails phone(Phone phone) { this.phone = phone; + isSetPhone = true; // mark as set return this; } @@ -141,6 +166,7 @@ public Phone getPhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhone(Phone phone) { this.phone = phone; + isSetPhone = true; // mark as set } /** @@ -151,6 +177,7 @@ public void setPhone(Phone phone) { */ public ContactDetails webAddress(String webAddress) { this.webAddress = webAddress; + isSetWebAddress = true; // mark as set return this; } @@ -174,6 +201,27 @@ public String getWebAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebAddress(String webAddress) { this.webAddress = webAddress; + isSetWebAddress = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ContactDetails 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 ContactDetails object is equal to o. */ @@ -219,6 +267,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 (isSetAddress) { + addIfNull(nulls, JSON_PROPERTY_ADDRESS, this.address); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetPhone) { + addIfNull(nulls, JSON_PROPERTY_PHONE, this.phone); + } + if (isSetWebAddress) { + addIfNull(nulls, JSON_PROPERTY_WEB_ADDRESS, this.webAddress); + } + + 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 ContactDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Counterparty.java b/src/main/java/com/adyen/model/balanceplatform/Counterparty.java index 9cf7780d1..6b4675d68 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Counterparty.java +++ b/src/main/java/com/adyen/model/balanceplatform/Counterparty.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 Counterparty { 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_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Counterparty() {} /** @@ -39,6 +53,7 @@ public Counterparty() {} */ public Counterparty bankAccount(BankAccount bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -62,6 +77,7 @@ public BankAccount getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccount bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setBankAccount(BankAccount bankAccount) { */ public Counterparty transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -101,6 +118,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Counterparty 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 Counterparty object is equal to o. */ @@ -144,6 +182,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 (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + 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 Counterparty given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CounterpartyBankRestriction.java b/src/main/java/com/adyen/model/balanceplatform/CounterpartyBankRestriction.java index e42dbdcd9..6de217133 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CounterpartyBankRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/CounterpartyBankRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,9 +30,21 @@ public class CounterpartyBankRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private List 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 CounterpartyBankRestriction() {} /** @@ -41,6 +55,7 @@ public CounterpartyBankRestriction() {} */ public CounterpartyBankRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -64,6 +79,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setOperation(String operation) { */ public CounterpartyBankRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -105,6 +122,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CounterpartyBankRestriction 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 CounterpartyBankRestriction object is equal to o. */ @@ -146,6 +184,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 CounterpartyBankRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CounterpartyTypesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/CounterpartyTypesRestriction.java index 19e5a61a3..3a4759d98 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CounterpartyTypesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/CounterpartyTypesRestriction.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -32,6 +34,9 @@ public class CounterpartyTypesRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + /** Gets or Sets value */ public enum ValueEnum { BALANCEACCOUNT(String.valueOf("balanceAccount")), @@ -80,6 +85,15 @@ public static ValueEnum fromValue(String value) { public static final String JSON_PROPERTY_VALUE = "value"; private List 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 CounterpartyTypesRestriction() {} /** @@ -90,6 +104,7 @@ public CounterpartyTypesRestriction() {} */ public CounterpartyTypesRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -113,6 +128,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -123,6 +139,7 @@ public void setOperation(String operation) { */ public CounterpartyTypesRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -154,6 +171,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CounterpartyTypesRestriction 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 CounterpartyTypesRestriction object is equal to o. */ @@ -195,6 +233,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 CounterpartyTypesRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CountriesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/CountriesRestriction.java index 78d780e09..05ff35460 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CountriesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/CountriesRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,9 +30,21 @@ public class CountriesRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private List 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 CountriesRestriction() {} /** @@ -41,6 +55,7 @@ public CountriesRestriction() {} */ public CountriesRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -64,6 +79,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -76,6 +92,7 @@ public void setOperation(String operation) { */ public CountriesRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -111,6 +128,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CountriesRestriction 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 CountriesRestriction object is equal to o. */ @@ -152,6 +190,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 CountriesRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CreateScaInformation.java b/src/main/java/com/adyen/model/balanceplatform/CreateScaInformation.java index d0aeb7744..cae976e2d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CreateScaInformation.java +++ b/src/main/java/com/adyen/model/balanceplatform/CreateScaInformation.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 CreateScaInformation { public static final String JSON_PROPERTY_EXEMPTION = "exemption"; private ScaExemption exemption; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExemption = false; + public static final String JSON_PROPERTY_SCA_ON_APPROVAL = "scaOnApproval"; private Boolean scaOnApproval; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaOnApproval = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CreateScaInformation() {} /** @@ -39,6 +53,7 @@ public CreateScaInformation() {} */ public CreateScaInformation exemption(ScaExemption exemption) { this.exemption = exemption; + isSetExemption = true; // mark as set return this; } @@ -62,6 +77,7 @@ public ScaExemption getExemption() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExemption(ScaExemption exemption) { this.exemption = exemption; + isSetExemption = true; // mark as set } /** @@ -78,6 +94,7 @@ public void setExemption(ScaExemption exemption) { */ public CreateScaInformation scaOnApproval(Boolean scaOnApproval) { this.scaOnApproval = scaOnApproval; + isSetScaOnApproval = true; // mark as set return this; } @@ -113,6 +130,27 @@ public Boolean getScaOnApproval() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaOnApproval(Boolean scaOnApproval) { this.scaOnApproval = scaOnApproval; + isSetScaOnApproval = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CreateScaInformation 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 CreateScaInformation object is equal to o. */ @@ -154,6 +192,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 (isSetExemption) { + addIfNull(nulls, JSON_PROPERTY_EXEMPTION, this.exemption); + } + if (isSetScaOnApproval) { + addIfNull(nulls, JSON_PROPERTY_SCA_ON_APPROVAL, this.scaOnApproval); + } + + 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 CreateScaInformation given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CreateSweepConfigurationV2.java b/src/main/java/com/adyen/model/balanceplatform/CreateSweepConfigurationV2.java index 216b62e90..de6fceb5c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CreateSweepConfigurationV2.java +++ b/src/main/java/com/adyen/model/balanceplatform/CreateSweepConfigurationV2.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,15 +97,27 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private SweepCounterparty counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + /** Gets or Sets priorities */ public enum PrioritiesEnum { CROSSBORDER(String.valueOf("crossBorder")), @@ -156,6 +170,9 @@ public static PrioritiesEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITIES = "priorities"; private List priorities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriorities = false; + /** The reason for disabling the sweep. */ public enum ReasonEnum { ACCOUNTHIERARCHYNOTACTIVE(String.valueOf("accountHierarchyNotActive")), @@ -205,6 +222,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -247,18 +266,33 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_REASON_DETAIL = "reasonDetail"; private String reasonDetail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReasonDetail = 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_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; private String referenceForBeneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + public static final String JSON_PROPERTY_SCHEDULE = "schedule"; private SweepSchedule schedule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchedule = false; + /** * The status of the sweep. If not provided, by default, this is set to **active**. Possible * values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on @@ -307,15 +341,27 @@ 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_SWEEP_AMOUNT = "sweepAmount"; private Amount sweepAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSweepAmount = false; + public static final String JSON_PROPERTY_TARGET_AMOUNT = "targetAmount"; private Amount targetAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTargetAmount = false; + public static final String JSON_PROPERTY_TRIGGER_AMOUNT = "triggerAmount"; private Amount triggerAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTriggerAmount = false; + /** * The direction of sweep, whether pushing out or pulling in funds to the balance account. If not * provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to @@ -365,6 +411,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 CreateSweepConfigurationV2() {} @JsonCreator @@ -394,6 +449,7 @@ public CreateSweepConfigurationV2( */ public CreateSweepConfigurationV2 category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } @@ -437,6 +493,7 @@ public CategoryEnum getCategory() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -447,6 +504,7 @@ public void setCategory(CategoryEnum category) { */ public CreateSweepConfigurationV2 counterparty(SweepCounterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -470,6 +528,7 @@ public SweepCounterparty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(SweepCounterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -486,6 +545,7 @@ public void setCounterparty(SweepCounterparty counterparty) { */ public CreateSweepConfigurationV2 currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -521,6 +581,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -535,6 +596,7 @@ public void setCurrency(String currency) { */ public CreateSweepConfigurationV2 description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -566,6 +628,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -577,14 +640,14 @@ public void setDescription(String description) { * 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) @@ -600,14 +663,14 @@ public void setDescription(String description) { * 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) @@ -617,6 +680,7 @@ public void setDescription(String description) { */ public CreateSweepConfigurationV2 priorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set return this; } @@ -637,14 +701,14 @@ public CreateSweepConfigurationV2 addPrioritiesItem(PrioritiesEnum prioritiesIte * 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) @@ -660,14 +724,14 @@ public CreateSweepConfigurationV2 addPrioritiesItem(PrioritiesEnum prioritiesIte * 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) @@ -689,14 +753,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) @@ -712,14 +776,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) @@ -730,6 +794,7 @@ public List getPriorities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set } /** @@ -762,6 +827,7 @@ public String getReasonDetail() { */ public CreateSweepConfigurationV2 reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -785,6 +851,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -797,6 +864,7 @@ public void setReference(String reference) { */ public CreateSweepConfigurationV2 referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -824,6 +892,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -834,6 +903,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public CreateSweepConfigurationV2 schedule(SweepSchedule schedule) { this.schedule = schedule; + isSetSchedule = true; // mark as set return this; } @@ -857,6 +927,7 @@ public SweepSchedule getSchedule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchedule(SweepSchedule schedule) { this.schedule = schedule; + isSetSchedule = true; // mark as set } /** @@ -872,6 +943,7 @@ public void setSchedule(SweepSchedule schedule) { */ public CreateSweepConfigurationV2 status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -905,6 +977,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -915,6 +988,7 @@ public void setStatus(StatusEnum status) { */ public CreateSweepConfigurationV2 sweepAmount(Amount sweepAmount) { this.sweepAmount = sweepAmount; + isSetSweepAmount = true; // mark as set return this; } @@ -938,6 +1012,7 @@ public Amount getSweepAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSweepAmount(Amount sweepAmount) { this.sweepAmount = sweepAmount; + isSetSweepAmount = true; // mark as set } /** @@ -948,6 +1023,7 @@ public void setSweepAmount(Amount sweepAmount) { */ public CreateSweepConfigurationV2 targetAmount(Amount targetAmount) { this.targetAmount = targetAmount; + isSetTargetAmount = true; // mark as set return this; } @@ -971,6 +1047,7 @@ public Amount getTargetAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTargetAmount(Amount targetAmount) { this.targetAmount = targetAmount; + isSetTargetAmount = true; // mark as set } /** @@ -981,6 +1058,7 @@ public void setTargetAmount(Amount targetAmount) { */ public CreateSweepConfigurationV2 triggerAmount(Amount triggerAmount) { this.triggerAmount = triggerAmount; + isSetTriggerAmount = true; // mark as set return this; } @@ -1004,6 +1082,7 @@ public Amount getTriggerAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTriggerAmount(Amount triggerAmount) { this.triggerAmount = triggerAmount; + isSetTriggerAmount = true; // mark as set } /** @@ -1020,6 +1099,7 @@ public void setTriggerAmount(Amount triggerAmount) { */ public CreateSweepConfigurationV2 type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1055,6 +1135,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 CreateSweepConfigurationV2 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 CreateSweepConfigurationV2 object is equal to o. */ @@ -1140,6 +1241,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 (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetPriorities) { + addIfNull(nulls, JSON_PROPERTY_PRIORITIES, this.priorities); + } + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetReasonDetail) { + addIfNull(nulls, JSON_PROPERTY_REASON_DETAIL, this.reasonDetail); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetSchedule) { + addIfNull(nulls, JSON_PROPERTY_SCHEDULE, this.schedule); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetSweepAmount) { + addIfNull(nulls, JSON_PROPERTY_SWEEP_AMOUNT, this.sweepAmount); + } + if (isSetTargetAmount) { + addIfNull(nulls, JSON_PROPERTY_TARGET_AMOUNT, this.targetAmount); + } + if (isSetTriggerAmount) { + addIfNull(nulls, JSON_PROPERTY_TRIGGER_AMOUNT, this.triggerAmount); + } + 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 CreateSweepConfigurationV2 given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/CreateTransferLimitRequest.java b/src/main/java/com/adyen/model/balanceplatform/CreateTransferLimitRequest.java index daa5c4b86..186c8f61f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CreateTransferLimitRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/CreateTransferLimitRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,24 +34,51 @@ public class CreateTransferLimitRequest { 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_ENDS_AT = "endsAt"; private OffsetDateTime endsAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndsAt = 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_SCA_INFORMATION = "scaInformation"; private CreateScaInformation scaInformation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaInformation = false; + public static final String JSON_PROPERTY_SCOPE = "scope"; private Scope scope; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScope = false; + public static final String JSON_PROPERTY_STARTS_AT = "startsAt"; private OffsetDateTime startsAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartsAt = false; + public static final String JSON_PROPERTY_TRANSFER_TYPE = "transferType"; private TransferType transferType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CreateTransferLimitRequest() {} /** @@ -60,6 +89,7 @@ public CreateTransferLimitRequest() {} */ public CreateTransferLimitRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -83,6 +113,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -97,6 +128,7 @@ public void setAmount(Amount amount) { */ public CreateTransferLimitRequest endsAt(OffsetDateTime endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set return this; } @@ -128,6 +160,7 @@ public OffsetDateTime getEndsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndsAt(OffsetDateTime endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set } /** @@ -138,6 +171,7 @@ public void setEndsAt(OffsetDateTime endsAt) { */ public CreateTransferLimitRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -161,6 +195,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -171,6 +206,7 @@ public void setReference(String reference) { */ public CreateTransferLimitRequest scaInformation(CreateScaInformation scaInformation) { this.scaInformation = scaInformation; + isSetScaInformation = true; // mark as set return this; } @@ -194,6 +230,7 @@ public CreateScaInformation getScaInformation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaInformation(CreateScaInformation scaInformation) { this.scaInformation = scaInformation; + isSetScaInformation = true; // mark as set } /** @@ -204,6 +241,7 @@ public void setScaInformation(CreateScaInformation scaInformation) { */ public CreateTransferLimitRequest scope(Scope scope) { this.scope = scope; + isSetScope = true; // mark as set return this; } @@ -227,6 +265,7 @@ public Scope getScope() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScope(Scope scope) { this.scope = scope; + isSetScope = true; // mark as set } /** @@ -241,6 +280,7 @@ public void setScope(Scope scope) { */ public CreateTransferLimitRequest startsAt(OffsetDateTime startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set return this; } @@ -272,6 +312,7 @@ public OffsetDateTime getStartsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartsAt(OffsetDateTime startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set } /** @@ -282,6 +323,7 @@ public void setStartsAt(OffsetDateTime startsAt) { */ public CreateTransferLimitRequest transferType(TransferType transferType) { this.transferType = transferType; + isSetTransferType = true; // mark as set return this; } @@ -305,6 +347,27 @@ public TransferType getTransferType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferType(TransferType transferType) { this.transferType = transferType; + isSetTransferType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CreateTransferLimitRequest 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 CreateTransferLimitRequest object is equal to o. */ @@ -356,6 +419,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetEndsAt) { + addIfNull(nulls, JSON_PROPERTY_ENDS_AT, this.endsAt); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetScaInformation) { + addIfNull(nulls, JSON_PROPERTY_SCA_INFORMATION, this.scaInformation); + } + if (isSetScope) { + addIfNull(nulls, JSON_PROPERTY_SCOPE, this.scope); + } + if (isSetStartsAt) { + addIfNull(nulls, JSON_PROPERTY_STARTS_AT, this.startsAt); + } + if (isSetTransferType) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_TYPE, this.transferType); + } + + 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 CreateTransferLimitRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/DKLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/DKLocalAccountIdentification.java index d71699bac..5c01a9866 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/DKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,9 +33,15 @@ public class DKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + /** **dkLocal** */ public enum TypeEnum { DKLOCAL(String.valueOf("dkLocal")); @@ -76,6 +84,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 DKLocalAccountIdentification() {} /** @@ -87,6 +104,7 @@ public DKLocalAccountIdentification() {} */ public DKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -112,6 +130,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -122,6 +141,7 @@ public void setAccountNumber(String accountNumber) { */ public DKLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -146,6 +166,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -156,6 +177,7 @@ public void setBankCode(String bankCode) { */ public DKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -179,6 +201,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 DKLocalAccountIdentification 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 DKLocalAccountIdentification object is equal to o. */ @@ -222,6 +265,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + 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 DKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java b/src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java index 175e26def..c8a6ab296 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -32,6 +34,9 @@ public class DayOfWeekRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + /** Gets or Sets value */ public enum ValueEnum { FRIDAY(String.valueOf("friday")), @@ -86,6 +91,15 @@ public static ValueEnum fromValue(String value) { public static final String JSON_PROPERTY_VALUE = "value"; private List 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 DayOfWeekRestriction() {} /** @@ -96,6 +110,7 @@ public DayOfWeekRestriction() {} */ public DayOfWeekRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -119,6 +134,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -131,6 +147,7 @@ public void setOperation(String operation) { */ public DayOfWeekRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -166,6 +183,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DayOfWeekRestriction 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 DayOfWeekRestriction object is equal to o. */ @@ -207,6 +245,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 DayOfWeekRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/DefaultErrorResponseEntity.java b/src/main/java/com/adyen/model/balanceplatform/DefaultErrorResponseEntity.java index a83760921..24d7d61d8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DefaultErrorResponseEntity.java +++ b/src/main/java/com/adyen/model/balanceplatform/DefaultErrorResponseEntity.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,27 +36,57 @@ public class DefaultErrorResponseEntity { public static final String JSON_PROPERTY_DETAIL = "detail"; private String detail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetail = 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_INSTANCE = "instance"; private String instance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstance = false; + public static final String JSON_PROPERTY_INVALID_FIELDS = "invalidFields"; private List invalidFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInvalidFields = false; + public static final String JSON_PROPERTY_REQUEST_ID = "requestId"; private String requestId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestId = false; + public static final String JSON_PROPERTY_STATUS = "status"; private Integer status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TITLE = "title"; private String title; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTitle = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 DefaultErrorResponseEntity() {} /** @@ -65,6 +97,7 @@ public DefaultErrorResponseEntity() {} */ public DefaultErrorResponseEntity detail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set return this; } @@ -88,6 +121,7 @@ public String getDetail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set } /** @@ -98,6 +132,7 @@ public void setDetail(String detail) { */ public DefaultErrorResponseEntity errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -121,6 +156,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -131,6 +167,7 @@ public void setErrorCode(String errorCode) { */ public DefaultErrorResponseEntity instance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set return this; } @@ -154,6 +191,7 @@ public String getInstance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set } /** @@ -164,6 +202,7 @@ public void setInstance(String instance) { */ public DefaultErrorResponseEntity invalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set return this; } @@ -195,6 +234,7 @@ public List getInvalidFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInvalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set } /** @@ -205,6 +245,7 @@ public void setInvalidFields(List invalidFields) { */ public DefaultErrorResponseEntity requestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set return this; } @@ -228,6 +269,7 @@ public String getRequestId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set } /** @@ -238,6 +280,7 @@ public void setRequestId(String requestId) { */ public DefaultErrorResponseEntity status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -261,6 +304,7 @@ public Integer getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(Integer status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -271,6 +315,7 @@ public void setStatus(Integer status) { */ public DefaultErrorResponseEntity title(String title) { this.title = title; + isSetTitle = true; // mark as set return this; } @@ -294,6 +339,7 @@ public String getTitle() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTitle(String title) { this.title = title; + isSetTitle = true; // mark as set } /** @@ -306,6 +352,7 @@ public void setTitle(String title) { */ public DefaultErrorResponseEntity type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -333,6 +380,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DefaultErrorResponseEntity 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 DefaultErrorResponseEntity object is equal to o. */ @@ -386,6 +454,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 (isSetDetail) { + addIfNull(nulls, JSON_PROPERTY_DETAIL, this.detail); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetInstance) { + addIfNull(nulls, JSON_PROPERTY_INSTANCE, this.instance); + } + if (isSetInvalidFields) { + addIfNull(nulls, JSON_PROPERTY_INVALID_FIELDS, this.invalidFields); + } + if (isSetRequestId) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_ID, this.requestId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTitle) { + addIfNull(nulls, JSON_PROPERTY_TITLE, this.title); + } + 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 DefaultErrorResponseEntity given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/DelegatedAuthenticationData.java b/src/main/java/com/adyen/model/balanceplatform/DelegatedAuthenticationData.java index eea5efe3a..c4a64cb49 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DelegatedAuthenticationData.java +++ b/src/main/java/com/adyen/model/balanceplatform/DelegatedAuthenticationData.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 DelegatedAuthenticationData { public static final String JSON_PROPERTY_SDK_OUTPUT = "sdkOutput"; private String sdkOutput; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkOutput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DelegatedAuthenticationData() {} /** @@ -35,6 +46,7 @@ public DelegatedAuthenticationData() {} */ public DelegatedAuthenticationData sdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set return this; } @@ -62,6 +74,27 @@ public String getSdkOutput() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DelegatedAuthenticationData 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 DelegatedAuthenticationData object is equal to o. */ @@ -101,6 +134,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 (isSetSdkOutput) { + addIfNull(nulls, JSON_PROPERTY_SDK_OUTPUT, this.sdkOutput); + } + + 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 DelegatedAuthenticationData given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java b/src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java index a83f678b9..eb9f329fa 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java +++ b/src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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; @@ -31,24 +33,51 @@ public class DeliveryAddress { 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_LINE1 = "line1"; private String line1; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine1 = false; + public static final String JSON_PROPERTY_LINE2 = "line2"; private String line2; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine2 = false; + public static final String JSON_PROPERTY_LINE3 = "line3"; private String line3; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine3 = 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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DeliveryAddress() {} /** @@ -59,6 +88,7 @@ public DeliveryAddress() {} */ public DeliveryAddress city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -82,6 +112,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -96,6 +127,7 @@ public void setCity(String city) { */ public DeliveryAddress country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -127,6 +159,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -139,6 +172,7 @@ public void setCountry(String country) { */ public DeliveryAddress line1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set return this; } @@ -166,6 +200,7 @@ public String getLine1() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set } /** @@ -178,6 +213,7 @@ public void setLine1(String line1) { */ public DeliveryAddress line2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set return this; } @@ -205,6 +241,7 @@ public String getLine2() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set } /** @@ -215,6 +252,7 @@ public void setLine2(String line2) { */ public DeliveryAddress line3(String line3) { this.line3 = line3; + isSetLine3 = true; // mark as set return this; } @@ -238,6 +276,7 @@ public String getLine3() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine3(String line3) { this.line3 = line3; + isSetLine3 = true; // mark as set } /** @@ -250,6 +289,7 @@ public void setLine3(String line3) { */ public DeliveryAddress postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -277,6 +317,7 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set } /** @@ -290,6 +331,7 @@ public void setPostalCode(String postalCode) { */ public DeliveryAddress stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set return this; } @@ -319,6 +361,27 @@ public String getStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DeliveryAddress 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 DeliveryAddress object is equal to o. */ @@ -370,6 +433,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetLine1) { + addIfNull(nulls, JSON_PROPERTY_LINE1, this.line1); + } + if (isSetLine2) { + addIfNull(nulls, JSON_PROPERTY_LINE2, this.line2); + } + if (isSetLine3) { + addIfNull(nulls, JSON_PROPERTY_LINE3, this.line3); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + if (isSetStateOrProvince) { + addIfNull(nulls, JSON_PROPERTY_STATE_OR_PROVINCE, this.stateOrProvince); + } + + 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 DeliveryAddress given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java b/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java index 2060508f9..15d48967b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java +++ b/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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; @@ -31,24 +33,51 @@ public class DeliveryContact { public static final String JSON_PROPERTY_ADDRESS = "address"; private DeliveryAddress address; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddress = false; + public static final String JSON_PROPERTY_COMPANY = "company"; private String company; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCompany = false; + public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_FULL_PHONE_NUMBER = "fullPhoneNumber"; private String fullPhoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFullPhoneNumber = false; + public static final String JSON_PROPERTY_NAME = "name"; private Name name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_PHONE_NUMBER = "phoneNumber"; private PhoneNumber phoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneNumber = false; + public static final String JSON_PROPERTY_WEB_ADDRESS = "webAddress"; private String webAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebAddress = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DeliveryContact() {} /** @@ -59,6 +88,7 @@ public DeliveryContact() {} */ public DeliveryContact address(DeliveryAddress address) { this.address = address; + isSetAddress = true; // mark as set return this; } @@ -82,6 +112,7 @@ public DeliveryAddress getAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddress(DeliveryAddress address) { this.address = address; + isSetAddress = true; // mark as set } /** @@ -92,6 +123,7 @@ public void setAddress(DeliveryAddress address) { */ public DeliveryContact company(String company) { this.company = company; + isSetCompany = true; // mark as set return this; } @@ -115,6 +147,7 @@ public String getCompany() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCompany(String company) { this.company = company; + isSetCompany = true; // mark as set } /** @@ -125,6 +158,7 @@ public void setCompany(String company) { */ public DeliveryContact email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -148,6 +182,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -162,6 +197,7 @@ public void setEmail(String email) { */ public DeliveryContact fullPhoneNumber(String fullPhoneNumber) { this.fullPhoneNumber = fullPhoneNumber; + isSetFullPhoneNumber = true; // mark as set return this; } @@ -193,6 +229,7 @@ public String getFullPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFullPhoneNumber(String fullPhoneNumber) { this.fullPhoneNumber = fullPhoneNumber; + isSetFullPhoneNumber = true; // mark as set } /** @@ -203,6 +240,7 @@ public void setFullPhoneNumber(String fullPhoneNumber) { */ public DeliveryContact name(Name name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -226,6 +264,7 @@ public Name getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(Name name) { this.name = name; + isSetName = true; // mark as set } /** @@ -236,6 +275,7 @@ public void setName(Name name) { */ public DeliveryContact phoneNumber(PhoneNumber phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set return this; } @@ -259,6 +299,7 @@ public PhoneNumber getPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhoneNumber(PhoneNumber phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set } /** @@ -269,6 +310,7 @@ public void setPhoneNumber(PhoneNumber phoneNumber) { */ public DeliveryContact webAddress(String webAddress) { this.webAddress = webAddress; + isSetWebAddress = true; // mark as set return this; } @@ -292,6 +334,27 @@ public String getWebAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebAddress(String webAddress) { this.webAddress = webAddress; + isSetWebAddress = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DeliveryContact 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 DeliveryContact object is equal to o. */ @@ -343,6 +406,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAddress) { + addIfNull(nulls, JSON_PROPERTY_ADDRESS, this.address); + } + if (isSetCompany) { + addIfNull(nulls, JSON_PROPERTY_COMPANY, this.company); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetFullPhoneNumber) { + addIfNull(nulls, JSON_PROPERTY_FULL_PHONE_NUMBER, this.fullPhoneNumber); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPhoneNumber) { + addIfNull(nulls, JSON_PROPERTY_PHONE_NUMBER, this.phoneNumber); + } + if (isSetWebAddress) { + addIfNull(nulls, JSON_PROPERTY_WEB_ADDRESS, this.webAddress); + } + + 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 DeliveryContact given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Device.java b/src/main/java/com/adyen/model/balanceplatform/Device.java index 6ccc17a0d..e124486c0 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Device.java +++ b/src/main/java/com/adyen/model/balanceplatform/Device.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -32,12 +34,21 @@ public class Device { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + /** The type of device. Possible values: **ios**, **android**, **browser**. */ public enum TypeEnum { IOS(String.valueOf("ios")), @@ -84,6 +95,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 Device() {} /** @@ -94,6 +114,7 @@ public Device() {} */ public Device id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -117,6 +138,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -129,6 +151,7 @@ public void setId(String id) { */ public Device name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -156,6 +179,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -167,6 +191,7 @@ public void setName(String name) { */ public Device paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -192,6 +217,7 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set } /** @@ -202,6 +228,7 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { */ public Device type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -225,6 +252,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 Device 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 Device object is equal to o. */ @@ -272,6 +320,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + 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 Device given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/DeviceInfo.java b/src/main/java/com/adyen/model/balanceplatform/DeviceInfo.java index 720a344a6..a44cec78d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DeviceInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/DeviceInfo.java @@ -11,145 +11,53 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.core.JsonProcessingException; import java.util.*; -import java.util.ArrayList; -import java.util.List; /** DeviceInfo */ -@JsonPropertyOrder({ - DeviceInfo.JSON_PROPERTY_CARD_CAPTURE_TECHNOLOGY, - DeviceInfo.JSON_PROPERTY_DEVICE_NAME, - DeviceInfo.JSON_PROPERTY_FORM_FACTOR, - DeviceInfo.JSON_PROPERTY_IMEI, - DeviceInfo.JSON_PROPERTY_ISO_DEVICE_TYPE, - DeviceInfo.JSON_PROPERTY_MSISDN, - DeviceInfo.JSON_PROPERTY_OS_NAME, - DeviceInfo.JSON_PROPERTY_OS_VERSION, - DeviceInfo.JSON_PROPERTY_PAYMENT_TYPES, - DeviceInfo.JSON_PROPERTY_SERIAL_NUMBER, - DeviceInfo.JSON_PROPERTY_STORAGE_TECHNOLOGY -}) +@JsonPropertyOrder({DeviceInfo.JSON_PROPERTY_FORM_FACTOR, DeviceInfo.JSON_PROPERTY_OS_NAME}) public class DeviceInfo { - public static final String JSON_PROPERTY_CARD_CAPTURE_TECHNOLOGY = "cardCaptureTechnology"; - private String cardCaptureTechnology; - - public static final String JSON_PROPERTY_DEVICE_NAME = "deviceName"; - private String deviceName; - public static final String JSON_PROPERTY_FORM_FACTOR = "formFactor"; private String formFactor; - public static final String JSON_PROPERTY_IMEI = "imei"; - private String imei; - - public static final String JSON_PROPERTY_ISO_DEVICE_TYPE = "isoDeviceType"; - private String isoDeviceType; - - public static final String JSON_PROPERTY_MSISDN = "msisdn"; - private String msisdn; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFormFactor = false; public static final String JSON_PROPERTY_OS_NAME = "osName"; private String osName; - public static final String JSON_PROPERTY_OS_VERSION = "osVersion"; - private String osVersion; - - public static final String JSON_PROPERTY_PAYMENT_TYPES = "paymentTypes"; - private List paymentTypes; - - public static final String JSON_PROPERTY_SERIAL_NUMBER = "serialNumber"; - private String serialNumber; - - public static final String JSON_PROPERTY_STORAGE_TECHNOLOGY = "storageTechnology"; - private String storageTechnology; - - public DeviceInfo() {} - - /** - * The technology used to capture the card details. - * - * @param cardCaptureTechnology The technology used to capture the card details. - * @return the current {@code DeviceInfo} instance, allowing for method chaining - */ - public DeviceInfo cardCaptureTechnology(String cardCaptureTechnology) { - this.cardCaptureTechnology = cardCaptureTechnology; - return this; - } - - /** - * The technology used to capture the card details. - * - * @return cardCaptureTechnology The technology used to capture the card details. - */ - @JsonProperty(JSON_PROPERTY_CARD_CAPTURE_TECHNOLOGY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCardCaptureTechnology() { - return cardCaptureTechnology; - } - - /** - * The technology used to capture the card details. - * - * @param cardCaptureTechnology The technology used to capture the card details. - */ - @JsonProperty(JSON_PROPERTY_CARD_CAPTURE_TECHNOLOGY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCardCaptureTechnology(String cardCaptureTechnology) { - this.cardCaptureTechnology = cardCaptureTechnology; - } + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOsName = false; /** - * The name of the device. - * - * @param deviceName The name of the device. - * @return the current {@code DeviceInfo} instance, allowing for method chaining + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. */ - public DeviceInfo deviceName(String deviceName) { - this.deviceName = deviceName; - return this; - } + @JsonIgnore private boolean includeNullValues = false; - /** - * The name of the device. - * - * @return deviceName The name of the device. - */ - @JsonProperty(JSON_PROPERTY_DEVICE_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getDeviceName() { - return deviceName; - } - - /** - * The name of the device. - * - * @param deviceName The name of the device. - */ - @JsonProperty(JSON_PROPERTY_DEVICE_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeviceName(String deviceName) { - this.deviceName = deviceName; - } + public DeviceInfo() {} /** - * The form factor of the device to be provisioned. + * The type of device used to provision the network token. * - * @param formFactor The form factor of the device to be provisioned. + * @param formFactor The type of device used to provision the network token. * @return the current {@code DeviceInfo} instance, allowing for method chaining */ public DeviceInfo formFactor(String formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set return this; } /** - * The form factor of the device to be provisioned. + * The type of device used to provision the network token. * - * @return formFactor The form factor of the device to be provisioned. + * @return formFactor The type of device used to provision the network token. */ @JsonProperty(JSON_PROPERTY_FORM_FACTOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -158,133 +66,33 @@ public String getFormFactor() { } /** - * The form factor of the device to be provisioned. + * The type of device used to provision the network token. * - * @param formFactor The form factor of the device to be provisioned. + * @param formFactor The type of device used to provision the network token. */ @JsonProperty(JSON_PROPERTY_FORM_FACTOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFormFactor(String formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set } /** - * The IMEI number of the device being provisioned. + * The operating system of the device used to provision the network token. * - * @param imei The IMEI number of the device being provisioned. - * @return the current {@code DeviceInfo} instance, allowing for method chaining - */ - public DeviceInfo imei(String imei) { - this.imei = imei; - return this; - } - - /** - * The IMEI number of the device being provisioned. - * - * @return imei The IMEI number of the device being provisioned. - */ - @JsonProperty(JSON_PROPERTY_IMEI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getImei() { - return imei; - } - - /** - * The IMEI number of the device being provisioned. - * - * @param imei The IMEI number of the device being provisioned. - */ - @JsonProperty(JSON_PROPERTY_IMEI) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setImei(String imei) { - this.imei = imei; - } - - /** - * The 2-digit device type provided on the ISO messages that the token is being provisioned to. - * - * @param isoDeviceType The 2-digit device type provided on the ISO messages that the token is - * being provisioned to. - * @return the current {@code DeviceInfo} instance, allowing for method chaining - */ - public DeviceInfo isoDeviceType(String isoDeviceType) { - this.isoDeviceType = isoDeviceType; - return this; - } - - /** - * The 2-digit device type provided on the ISO messages that the token is being provisioned to. - * - * @return isoDeviceType The 2-digit device type provided on the ISO messages that the token is - * being provisioned to. - */ - @JsonProperty(JSON_PROPERTY_ISO_DEVICE_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getIsoDeviceType() { - return isoDeviceType; - } - - /** - * The 2-digit device type provided on the ISO messages that the token is being provisioned to. - * - * @param isoDeviceType The 2-digit device type provided on the ISO messages that the token is - * being provisioned to. - */ - @JsonProperty(JSON_PROPERTY_ISO_DEVICE_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIsoDeviceType(String isoDeviceType) { - this.isoDeviceType = isoDeviceType; - } - - /** - * The MSISDN of the device being provisioned. - * - * @param msisdn The MSISDN of the device being provisioned. - * @return the current {@code DeviceInfo} instance, allowing for method chaining - */ - public DeviceInfo msisdn(String msisdn) { - this.msisdn = msisdn; - return this; - } - - /** - * The MSISDN of the device being provisioned. - * - * @return msisdn The MSISDN of the device being provisioned. - */ - @JsonProperty(JSON_PROPERTY_MSISDN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMsisdn() { - return msisdn; - } - - /** - * The MSISDN of the device being provisioned. - * - * @param msisdn The MSISDN of the device being provisioned. - */ - @JsonProperty(JSON_PROPERTY_MSISDN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMsisdn(String msisdn) { - this.msisdn = msisdn; - } - - /** - * The name of the device operating system. - * - * @param osName The name of the device operating system. + * @param osName The operating system of the device used to provision the network token. * @return the current {@code DeviceInfo} instance, allowing for method chaining */ public DeviceInfo osName(String osName) { this.osName = osName; + isSetOsName = true; // mark as set return this; } /** - * The name of the device operating system. + * The operating system of the device used to provision the network token. * - * @return osName The name of the device operating system. + * @return osName The operating system of the device used to provision the network token. */ @JsonProperty(JSON_PROPERTY_OS_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -293,154 +101,35 @@ public String getOsName() { } /** - * The name of the device operating system. + * The operating system of the device used to provision the network token. * - * @param osName The name of the device operating system. + * @param osName The operating system of the device used to provision the network token. */ @JsonProperty(JSON_PROPERTY_OS_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOsName(String osName) { this.osName = osName; + isSetOsName = true; // mark as set } /** - * The version of the device operating system. - * - * @param osVersion The version of the device operating system. - * @return the current {@code DeviceInfo} instance, allowing for method chaining - */ - public DeviceInfo osVersion(String osVersion) { - this.osVersion = osVersion; - return this; - } - - /** - * The version of the device operating system. - * - * @return osVersion The version of the device operating system. - */ - @JsonProperty(JSON_PROPERTY_OS_VERSION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getOsVersion() { - return osVersion; - } - - /** - * The version of the device operating system. - * - * @param osVersion The version of the device operating system. - */ - @JsonProperty(JSON_PROPERTY_OS_VERSION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOsVersion(String osVersion) { - this.osVersion = osVersion; - } - - /** - * Different types of payments supported for the network token. - * - * @param paymentTypes Different types of payments supported for the network token. - * @return the current {@code DeviceInfo} instance, allowing for method chaining - */ - public DeviceInfo paymentTypes(List paymentTypes) { - this.paymentTypes = paymentTypes; - return this; - } - - public DeviceInfo addPaymentTypesItem(String paymentTypesItem) { - if (this.paymentTypes == null) { - this.paymentTypes = new ArrayList<>(); - } - this.paymentTypes.add(paymentTypesItem); - return this; - } - - /** - * Different types of payments supported for the network token. - * - * @return paymentTypes Different types of payments supported for the network token. - */ - @JsonProperty(JSON_PROPERTY_PAYMENT_TYPES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getPaymentTypes() { - return paymentTypes; - } - - /** - * Different types of payments supported for the network token. - * - * @param paymentTypes Different types of payments supported for the network token. - */ - @JsonProperty(JSON_PROPERTY_PAYMENT_TYPES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPaymentTypes(List paymentTypes) { - this.paymentTypes = paymentTypes; - } - - /** - * The serial number of the device. - * - * @param serialNumber The serial number of the device. - * @return the current {@code DeviceInfo} instance, allowing for method chaining + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. */ - public DeviceInfo serialNumber(String serialNumber) { - this.serialNumber = serialNumber; + public DeviceInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; return this; } - /** - * The serial number of the device. - * - * @return serialNumber The serial number of the device. - */ - @JsonProperty(JSON_PROPERTY_SERIAL_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSerialNumber() { - return serialNumber; + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; } /** - * The serial number of the device. - * - * @param serialNumber The serial number of the device. + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. */ - @JsonProperty(JSON_PROPERTY_SERIAL_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSerialNumber(String serialNumber) { - this.serialNumber = serialNumber; - } - - /** - * The architecture or technology used for network token storage. - * - * @param storageTechnology The architecture or technology used for network token storage. - * @return the current {@code DeviceInfo} instance, allowing for method chaining - */ - public DeviceInfo storageTechnology(String storageTechnology) { - this.storageTechnology = storageTechnology; - return this; - } - - /** - * The architecture or technology used for network token storage. - * - * @return storageTechnology The architecture or technology used for network token storage. - */ - @JsonProperty(JSON_PROPERTY_STORAGE_TECHNOLOGY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getStorageTechnology() { - return storageTechnology; - } - - /** - * The architecture or technology used for network token storage. - * - * @param storageTechnology The architecture or technology used for network token storage. - */ - @JsonProperty(JSON_PROPERTY_STORAGE_TECHNOLOGY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStorageTechnology(String storageTechnology) { - this.storageTechnology = storageTechnology; + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DeviceInfo object is equal to o. */ @@ -453,52 +142,21 @@ public boolean equals(Object o) { return false; } DeviceInfo deviceInfo = (DeviceInfo) o; - return Objects.equals(this.cardCaptureTechnology, deviceInfo.cardCaptureTechnology) - && Objects.equals(this.deviceName, deviceInfo.deviceName) - && Objects.equals(this.formFactor, deviceInfo.formFactor) - && Objects.equals(this.imei, deviceInfo.imei) - && Objects.equals(this.isoDeviceType, deviceInfo.isoDeviceType) - && Objects.equals(this.msisdn, deviceInfo.msisdn) - && Objects.equals(this.osName, deviceInfo.osName) - && Objects.equals(this.osVersion, deviceInfo.osVersion) - && Objects.equals(this.paymentTypes, deviceInfo.paymentTypes) - && Objects.equals(this.serialNumber, deviceInfo.serialNumber) - && Objects.equals(this.storageTechnology, deviceInfo.storageTechnology); + return Objects.equals(this.formFactor, deviceInfo.formFactor) + && Objects.equals(this.osName, deviceInfo.osName); } @Override public int hashCode() { - return Objects.hash( - cardCaptureTechnology, - deviceName, - formFactor, - imei, - isoDeviceType, - msisdn, - osName, - osVersion, - paymentTypes, - serialNumber, - storageTechnology); + return Objects.hash(formFactor, osName); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class DeviceInfo {\n"); - sb.append(" cardCaptureTechnology: ") - .append(toIndentedString(cardCaptureTechnology)) - .append("\n"); - sb.append(" deviceName: ").append(toIndentedString(deviceName)).append("\n"); sb.append(" formFactor: ").append(toIndentedString(formFactor)).append("\n"); - sb.append(" imei: ").append(toIndentedString(imei)).append("\n"); - sb.append(" isoDeviceType: ").append(toIndentedString(isoDeviceType)).append("\n"); - sb.append(" msisdn: ").append(toIndentedString(msisdn)).append("\n"); sb.append(" osName: ").append(toIndentedString(osName)).append("\n"); - sb.append(" osVersion: ").append(toIndentedString(osVersion)).append("\n"); - sb.append(" paymentTypes: ").append(toIndentedString(paymentTypes)).append("\n"); - sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); - sb.append(" storageTechnology: ").append(toIndentedString(storageTechnology)).append("\n"); sb.append("}"); return sb.toString(); } @@ -513,6 +171,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 (isSetFormFactor) { + addIfNull(nulls, JSON_PROPERTY_FORM_FACTOR, this.formFactor); + } + if (isSetOsName) { + addIfNull(nulls, JSON_PROPERTY_OS_NAME, this.osName); + } + + 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 DeviceInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/DifferentCurrenciesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/DifferentCurrenciesRestriction.java index a20738a43..3a5fc91d8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DifferentCurrenciesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/DifferentCurrenciesRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 DifferentCurrenciesRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Boolean 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 DifferentCurrenciesRestriction() {} /** @@ -40,6 +54,7 @@ public DifferentCurrenciesRestriction() {} */ public DifferentCurrenciesRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -63,6 +78,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -78,6 +94,7 @@ public void setOperation(String operation) { */ public DifferentCurrenciesRestriction value(Boolean value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -109,6 +126,27 @@ public Boolean getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Boolean value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DifferentCurrenciesRestriction 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 DifferentCurrenciesRestriction object is equal to o. */ @@ -151,6 +189,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 DifferentCurrenciesRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Duration.java b/src/main/java/com/adyen/model/balanceplatform/Duration.java index 67087e9a8..aa23def1a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Duration.java +++ b/src/main/java/com/adyen/model/balanceplatform/Duration.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,9 +79,21 @@ public static UnitEnum fromValue(String value) { public static final String JSON_PROPERTY_UNIT = "unit"; private UnitEnum unit; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUnit = 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 Duration() {} /** @@ -93,6 +107,7 @@ public Duration() {} */ public Duration unit(UnitEnum unit) { this.unit = unit; + isSetUnit = true; // mark as set return this; } @@ -122,6 +137,7 @@ public UnitEnum getUnit() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUnit(UnitEnum unit) { this.unit = unit; + isSetUnit = true; // mark as set } /** @@ -134,6 +150,7 @@ public void setUnit(UnitEnum unit) { */ public Duration value(Integer value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -161,6 +178,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 Duration 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 Duration object is equal to o. */ @@ -201,6 +239,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 (isSetUnit) { + addIfNull(nulls, JSON_PROPERTY_UNIT, this.unit); + } + 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 Duration given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/EntryModesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/EntryModesRestriction.java index 989e79ce3..dc2779b12 100644 --- a/src/main/java/com/adyen/model/balanceplatform/EntryModesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/EntryModesRestriction.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -32,6 +34,9 @@ public class EntryModesRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + /** Gets or Sets value */ public enum ValueEnum { BARCODE(String.valueOf("barcode")), @@ -90,6 +95,15 @@ public static ValueEnum fromValue(String value) { public static final String JSON_PROPERTY_VALUE = "value"; private List 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 EntryModesRestriction() {} /** @@ -100,6 +114,7 @@ public EntryModesRestriction() {} */ public EntryModesRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -123,6 +138,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -135,6 +151,7 @@ public void setOperation(String operation) { */ public EntryModesRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -170,6 +187,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public EntryModesRestriction 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 EntryModesRestriction object is equal to o. */ @@ -211,6 +249,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 EntryModesRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Expiry.java b/src/main/java/com/adyen/model/balanceplatform/Expiry.java index ad0235bcc..e9ed35e58 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Expiry.java +++ b/src/main/java/com/adyen/model/balanceplatform/Expiry.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 Expiry { public static final String JSON_PROPERTY_MONTH = "month"; private String month; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMonth = false; + public static final String JSON_PROPERTY_YEAR = "year"; private String year; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetYear = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Expiry() {} /** @@ -36,6 +50,7 @@ public Expiry() {} */ public Expiry month(String month) { this.month = month; + isSetMonth = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMonth(String month) { this.month = month; + isSetMonth = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setMonth(String month) { */ public Expiry year(String year) { this.year = year; + isSetYear = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setYear(String year) { this.year = year; + isSetYear = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Expiry 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 Expiry object is equal to o. */ @@ -132,6 +170,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 (isSetMonth) { + addIfNull(nulls, JSON_PROPERTY_MONTH, this.month); + } + if (isSetYear) { + addIfNull(nulls, JSON_PROPERTY_YEAR, this.year); + } + + 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 Expiry given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Fee.java b/src/main/java/com/adyen/model/balanceplatform/Fee.java index 160316204..b4afef08d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Fee.java +++ b/src/main/java/com/adyen/model/balanceplatform/Fee.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 Fee { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Fee() {} /** @@ -33,6 +44,7 @@ public Fee() {} */ public Fee amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -56,6 +68,27 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Fee 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 Fee object is equal to o. */ @@ -95,6 +128,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + + 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 Fee given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/FinishScaDeviceRegistrationRequest.java b/src/main/java/com/adyen/model/balanceplatform/FinishScaDeviceRegistrationRequest.java index e6a010450..092a959e8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/FinishScaDeviceRegistrationRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/FinishScaDeviceRegistrationRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 FinishScaDeviceRegistrationRequest { public static final String JSON_PROPERTY_SDK_OUTPUT = "sdkOutput"; private String sdkOutput; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkOutput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public FinishScaDeviceRegistrationRequest() {} /** @@ -36,6 +47,7 @@ public FinishScaDeviceRegistrationRequest() {} */ public FinishScaDeviceRegistrationRequest sdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getSdkOutput() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FinishScaDeviceRegistrationRequest 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 FinishScaDeviceRegistrationRequest object is equal to o. */ @@ -103,6 +136,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 (isSetSdkOutput) { + addIfNull(nulls, JSON_PROPERTY_SDK_OUTPUT, this.sdkOutput); + } + + 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 FinishScaDeviceRegistrationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/FinishScaDeviceRegistrationResponse.java b/src/main/java/com/adyen/model/balanceplatform/FinishScaDeviceRegistrationResponse.java index 201bd5cd0..f079a5c3a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/FinishScaDeviceRegistrationResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/FinishScaDeviceRegistrationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 FinishScaDeviceRegistrationResponse { public static final String JSON_PROPERTY_SCA_DEVICE = "scaDevice"; private ScaDevice scaDevice; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaDevice = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public FinishScaDeviceRegistrationResponse() {} /** @@ -34,6 +45,7 @@ public FinishScaDeviceRegistrationResponse() {} */ public FinishScaDeviceRegistrationResponse scaDevice(ScaDevice scaDevice) { this.scaDevice = scaDevice; + isSetScaDevice = true; // mark as set return this; } @@ -57,6 +69,27 @@ public ScaDevice getScaDevice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaDevice(ScaDevice scaDevice) { this.scaDevice = scaDevice; + isSetScaDevice = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FinishScaDeviceRegistrationResponse 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 FinishScaDeviceRegistrationResponse object is equal to o. */ @@ -97,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 (isSetScaDevice) { + addIfNull(nulls, JSON_PROPERTY_SCA_DEVICE, this.scaDevice); + } + + 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 FinishScaDeviceRegistrationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/GetNetworkTokenResponse.java b/src/main/java/com/adyen/model/balanceplatform/GetNetworkTokenResponse.java index a5b7260ca..9cae9c130 100644 --- a/src/main/java/com/adyen/model/balanceplatform/GetNetworkTokenResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/GetNetworkTokenResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 GetNetworkTokenResponse { public static final String JSON_PROPERTY_TOKEN = "token"; private NetworkToken token; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public GetNetworkTokenResponse() {} /** @@ -33,6 +44,7 @@ public GetNetworkTokenResponse() {} */ public GetNetworkTokenResponse token(NetworkToken token) { this.token = token; + isSetToken = true; // mark as set return this; } @@ -56,6 +68,27 @@ public NetworkToken getToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setToken(NetworkToken token) { this.token = token; + isSetToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GetNetworkTokenResponse 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 GetNetworkTokenResponse object is equal to o. */ @@ -95,6 +128,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 (isSetToken) { + addIfNull(nulls, JSON_PROPERTY_TOKEN, this.token); + } + + 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 GetNetworkTokenResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/GetTaxFormResponse.java b/src/main/java/com/adyen/model/balanceplatform/GetTaxFormResponse.java index 3a8702c6c..4ceb91439 100644 --- a/src/main/java/com/adyen/model/balanceplatform/GetTaxFormResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/GetTaxFormResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -30,6 +32,9 @@ public class GetTaxFormResponse { public static final String JSON_PROPERTY_CONTENT = "content"; private byte[] content; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContent = false; + /** The content type of the tax form. Possible values: * **application/pdf** */ public enum ContentTypeEnum { APPLICATION_PDF(String.valueOf("application/pdf")); @@ -72,6 +77,15 @@ public static ContentTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_CONTENT_TYPE = "contentType"; private ContentTypeEnum contentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContentType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public GetTaxFormResponse() {} /** @@ -82,6 +96,7 @@ public GetTaxFormResponse() {} */ public GetTaxFormResponse content(byte[] content) { this.content = content; + isSetContent = true; // mark as set return this; } @@ -105,6 +120,7 @@ public byte[] getContent() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContent(byte[] content) { this.content = content; + isSetContent = true; // mark as set } /** @@ -115,6 +131,7 @@ public void setContent(byte[] content) { */ public GetTaxFormResponse contentType(ContentTypeEnum contentType) { this.contentType = contentType; + isSetContentType = true; // mark as set return this; } @@ -138,6 +155,27 @@ public ContentTypeEnum getContentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContentType(ContentTypeEnum contentType) { this.contentType = contentType; + isSetContentType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GetTaxFormResponse 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 GetTaxFormResponse object is equal to o. */ @@ -179,6 +217,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 (isSetContent) { + addIfNull(nulls, JSON_PROPERTY_CONTENT, this.content); + } + if (isSetContentType) { + addIfNull(nulls, JSON_PROPERTY_CONTENT_TYPE, this.contentType); + } + + 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 GetTaxFormResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java b/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java index 3ca21beb3..e8d8d3fbe 100644 --- a/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java +++ b/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 GrantLimit { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public GrantLimit() {} /** @@ -33,6 +44,7 @@ public GrantLimit() {} */ public GrantLimit amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -56,6 +68,27 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GrantLimit 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 GrantLimit object is equal to o. */ @@ -95,6 +128,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + + 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 GrantLimit given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java b/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java index 533556a4b..cf355c215 100644 --- a/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java +++ b/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,9 +39,15 @@ public class GrantOffer { public static final String JSON_PROPERTY_ACCOUNT_HOLDER_ID = "accountHolderId"; private String accountHolderId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderId = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + /** The contract type of the grant offer. Possible value: **cashAdvance**, **loan**. */ public enum ContractTypeEnum { CASHADVANCE(String.valueOf("cashAdvance")), @@ -84,21 +92,45 @@ public static ContractTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_CONTRACT_TYPE = "contractType"; private ContractTypeEnum contractType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContractType = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private OffsetDateTime expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + public static final String JSON_PROPERTY_FEE = "fee"; private Fee fee; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFee = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REPAYMENT = "repayment"; private Repayment repayment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRepayment = false; + public static final String JSON_PROPERTY_STARTS_AT = "startsAt"; private OffsetDateTime 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 GrantOffer() {} /** @@ -109,6 +141,7 @@ public GrantOffer() {} */ public GrantOffer accountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set return this; } @@ -132,6 +165,7 @@ public String getAccountHolderId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set } /** @@ -142,6 +176,7 @@ public void setAccountHolderId(String accountHolderId) { */ public GrantOffer amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -165,6 +200,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -176,6 +212,7 @@ public void setAmount(Amount amount) { */ public GrantOffer contractType(ContractTypeEnum contractType) { this.contractType = contractType; + isSetContractType = true; // mark as set return this; } @@ -201,6 +238,7 @@ public ContractTypeEnum getContractType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContractType(ContractTypeEnum contractType) { this.contractType = contractType; + isSetContractType = true; // mark as set } /** @@ -211,6 +249,7 @@ public void setContractType(ContractTypeEnum contractType) { */ public GrantOffer expiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -234,6 +273,7 @@ public OffsetDateTime getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -244,6 +284,7 @@ public void setExpiresAt(OffsetDateTime expiresAt) { */ public GrantOffer fee(Fee fee) { this.fee = fee; + isSetFee = true; // mark as set return this; } @@ -267,6 +308,7 @@ public Fee getFee() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFee(Fee fee) { this.fee = fee; + isSetFee = true; // mark as set } /** @@ -277,6 +319,7 @@ public void setFee(Fee fee) { */ public GrantOffer id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -300,6 +343,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -310,6 +354,7 @@ public void setId(String id) { */ public GrantOffer repayment(Repayment repayment) { this.repayment = repayment; + isSetRepayment = true; // mark as set return this; } @@ -333,6 +378,7 @@ public Repayment getRepayment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRepayment(Repayment repayment) { this.repayment = repayment; + isSetRepayment = true; // mark as set } /** @@ -343,6 +389,7 @@ public void setRepayment(Repayment repayment) { */ public GrantOffer startsAt(OffsetDateTime startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set return this; } @@ -366,6 +413,27 @@ public OffsetDateTime getStartsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartsAt(OffsetDateTime startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GrantOffer 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 GrantOffer object is equal to o. */ @@ -420,6 +488,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 (isSetAccountHolderId) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_ID, this.accountHolderId); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetContractType) { + addIfNull(nulls, JSON_PROPERTY_CONTRACT_TYPE, this.contractType); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetFee) { + addIfNull(nulls, JSON_PROPERTY_FEE, this.fee); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetRepayment) { + addIfNull(nulls, JSON_PROPERTY_REPAYMENT, this.repayment); + } + 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 GrantOffer given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java b/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java index 31a8f8664..b6ea162f1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java +++ b/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,6 +27,15 @@ public class GrantOffers { public static final String JSON_PROPERTY_GRANT_OFFERS = "grantOffers"; private List grantOffers; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrantOffers = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public GrantOffers() {} /** @@ -35,6 +46,7 @@ public GrantOffers() {} */ public GrantOffers grantOffers(List grantOffers) { this.grantOffers = grantOffers; + isSetGrantOffers = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getGrantOffers() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGrantOffers(List grantOffers) { this.grantOffers = grantOffers; + isSetGrantOffers = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GrantOffers 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 GrantOffers object is equal to o. */ @@ -105,6 +138,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 (isSetGrantOffers) { + addIfNull(nulls, JSON_PROPERTY_GRANT_OFFERS, this.grantOffers); + } + + 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 GrantOffers given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/HKLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/HKLocalAccountIdentification.java index 1b30947e2..1192dbea7 100644 --- a/src/main/java/com/adyen/model/balanceplatform/HKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/HKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,9 +33,15 @@ public class HKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_CLEARING_CODE = "clearingCode"; private String clearingCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClearingCode = false; + /** **hkLocal** */ public enum TypeEnum { HKLOCAL(String.valueOf("hkLocal")); @@ -76,6 +84,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 HKLocalAccountIdentification() {} /** @@ -88,6 +105,7 @@ public HKLocalAccountIdentification() {} */ public HKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -115,6 +133,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -125,6 +144,7 @@ public void setAccountNumber(String accountNumber) { */ public HKLocalAccountIdentification clearingCode(String clearingCode) { this.clearingCode = clearingCode; + isSetClearingCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getClearingCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClearingCode(String clearingCode) { this.clearingCode = clearingCode; + isSetClearingCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setClearingCode(String clearingCode) { */ public HKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,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 HKLocalAccountIdentification 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 HKLocalAccountIdentification object is equal to o. */ @@ -224,6 +267,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetClearingCode) { + addIfNull(nulls, JSON_PROPERTY_CLEARING_CODE, this.clearingCode); + } + 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 HKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java index 5683cbc72..dd013c83c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -30,6 +32,9 @@ public class HULocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **huLocal** */ public enum TypeEnum { HULOCAL(String.valueOf("huLocal")); @@ -72,6 +77,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 HULocalAccountIdentification() {} /** @@ -82,6 +96,7 @@ public HULocalAccountIdentification() {} */ public HULocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -105,6 +120,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -115,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public HULocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -138,6 +155,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 HULocalAccountIdentification 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 HULocalAccountIdentification object is equal to o. */ @@ -179,6 +217,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + 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 HULocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Href.java b/src/main/java/com/adyen/model/balanceplatform/Href.java index c228ee0e0..fd87d96a8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Href.java +++ b/src/main/java/com/adyen/model/balanceplatform/Href.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 Href { public static final String JSON_PROPERTY_HREF = "href"; private String href; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHref = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Href() {} /** @@ -33,6 +44,7 @@ public Href() {} */ public Href href(String href) { this.href = href; + isSetHref = true; // mark as set return this; } @@ -56,6 +68,27 @@ public String getHref() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHref(String href) { this.href = href; + isSetHref = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Href 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 Href object is equal to o. */ @@ -95,6 +128,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 (isSetHref) { + addIfNull(nulls, JSON_PROPERTY_HREF, this.href); + } + + 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 Href given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java index 19889943a..47e0bf4a8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -30,6 +32,9 @@ public class IbanAccountIdentification { public static final String JSON_PROPERTY_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + /** **iban** */ public enum TypeEnum { IBAN(String.valueOf("iban")); @@ -72,6 +77,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 IbanAccountIdentification() {} /** @@ -84,6 +98,7 @@ public IbanAccountIdentification() {} */ public IbanAccountIdentification iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -111,6 +126,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -121,6 +137,7 @@ public void setIban(String iban) { */ public IbanAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -144,6 +161,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 IbanAccountIdentification 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 IbanAccountIdentification object is equal to o. */ @@ -185,6 +223,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 (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + 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 IbanAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentificationRequirement.java b/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentificationRequirement.java index f0747e208..0cac86a94 100644 --- a/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentificationRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentificationRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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 IbanAccountIdentificationRequirement { 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_IBAN_PREFIXES = "ibanPrefixes"; private List ibanPrefixes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIbanPrefixes = false; + /** **ibanAccountIdentificationRequirement** */ public enum TypeEnum { IBANACCOUNTIDENTIFICATIONREQUIREMENT(String.valueOf("ibanAccountIdentificationRequirement")); @@ -78,6 +86,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 IbanAccountIdentificationRequirement() {} /** @@ -91,6 +108,7 @@ public IbanAccountIdentificationRequirement() {} */ public IbanAccountIdentificationRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -118,6 +136,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -130,6 +149,7 @@ public void setDescription(String description) { */ public IbanAccountIdentificationRequirement ibanPrefixes(List ibanPrefixes) { this.ibanPrefixes = ibanPrefixes; + isSetIbanPrefixes = true; // mark as set return this; } @@ -163,6 +183,7 @@ public List getIbanPrefixes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIbanPrefixes(List ibanPrefixes) { this.ibanPrefixes = ibanPrefixes; + isSetIbanPrefixes = true; // mark as set } /** @@ -174,6 +195,7 @@ public void setIbanPrefixes(List ibanPrefixes) { */ public IbanAccountIdentificationRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -197,6 +219,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 IbanAccountIdentificationRequirement 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 IbanAccountIdentificationRequirement object is equal to o. */ @@ -241,6 +284,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetIbanPrefixes) { + addIfNull(nulls, JSON_PROPERTY_IBAN_PREFIXES, this.ibanPrefixes); + } + 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 IbanAccountIdentificationRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/InternationalTransactionRestriction.java b/src/main/java/com/adyen/model/balanceplatform/InternationalTransactionRestriction.java index 00236b240..f859327dc 100644 --- a/src/main/java/com/adyen/model/balanceplatform/InternationalTransactionRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/InternationalTransactionRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 InternationalTransactionRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Boolean 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 InternationalTransactionRestriction() {} /** @@ -40,6 +54,7 @@ public InternationalTransactionRestriction() {} */ public InternationalTransactionRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -63,6 +78,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -78,6 +94,7 @@ public void setOperation(String operation) { */ public InternationalTransactionRestriction value(Boolean value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -109,6 +126,27 @@ public Boolean getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Boolean value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InternationalTransactionRestriction 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 InternationalTransactionRestriction object is equal to o. */ @@ -151,6 +189,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 InternationalTransactionRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/InvalidField.java b/src/main/java/com/adyen/model/balanceplatform/InvalidField.java index 3d7f8e77f..06ae52514 100644 --- a/src/main/java/com/adyen/model/balanceplatform/InvalidField.java +++ b/src/main/java/com/adyen/model/balanceplatform/InvalidField.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 InvalidField { 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_VALUE = "value"; private String value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public InvalidField() {} /** @@ -43,6 +60,7 @@ public InvalidField() {} */ public InvalidField name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setName(String name) { */ public InvalidField value(String value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(String value) { this.value = value; + isSetValue = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setValue(String value) { */ public InvalidField message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InvalidField 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 InvalidField object is equal to o. */ @@ -175,6 +218,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 (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + + 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 InvalidField given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Link.java b/src/main/java/com/adyen/model/balanceplatform/Link.java index b8be30eab..d47d0ec15 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Link.java +++ b/src/main/java/com/adyen/model/balanceplatform/Link.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 Link { public static final String JSON_PROPERTY_FIRST = "first"; private Href first; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirst = false; + public static final String JSON_PROPERTY_LAST = "last"; private Href last; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLast = false; + public static final String JSON_PROPERTY_NEXT = "next"; private Href next; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNext = false; + public static final String JSON_PROPERTY_PREVIOUS = "previous"; private Href previous; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrevious = false; + public static final String JSON_PROPERTY_SELF = "self"; private Href self; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSelf = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Link() {} /** @@ -51,6 +74,7 @@ public Link() {} */ public Link first(Href first) { this.first = first; + isSetFirst = true; // mark as set return this; } @@ -74,6 +98,7 @@ public Href getFirst() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirst(Href first) { this.first = first; + isSetFirst = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setFirst(Href first) { */ public Link last(Href last) { this.last = last; + isSetLast = true; // mark as set return this; } @@ -107,6 +133,7 @@ public Href getLast() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLast(Href last) { this.last = last; + isSetLast = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setLast(Href last) { */ public Link next(Href next) { this.next = next; + isSetNext = true; // mark as set return this; } @@ -140,6 +168,7 @@ public Href getNext() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNext(Href next) { this.next = next; + isSetNext = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setNext(Href next) { */ public Link previous(Href previous) { this.previous = previous; + isSetPrevious = true; // mark as set return this; } @@ -173,6 +203,7 @@ public Href getPrevious() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrevious(Href previous) { this.previous = previous; + isSetPrevious = true; // mark as set } /** @@ -183,6 +214,7 @@ public void setPrevious(Href previous) { */ public Link self(Href self) { this.self = self; + isSetSelf = true; // mark as set return this; } @@ -206,6 +238,27 @@ public Href getSelf() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelf(Href self) { this.self = self; + isSetSelf = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Link 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 Link object is equal to o. */ @@ -253,6 +306,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 (isSetFirst) { + addIfNull(nulls, JSON_PROPERTY_FIRST, this.first); + } + if (isSetLast) { + addIfNull(nulls, JSON_PROPERTY_LAST, this.last); + } + if (isSetNext) { + addIfNull(nulls, JSON_PROPERTY_NEXT, this.next); + } + if (isSetPrevious) { + addIfNull(nulls, JSON_PROPERTY_PREVIOUS, this.previous); + } + if (isSetSelf) { + addIfNull(nulls, JSON_PROPERTY_SELF, this.self); + } + + 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 Link given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ListAssociationsResponse.java b/src/main/java/com/adyen/model/balanceplatform/ListAssociationsResponse.java index 8b2f837fa..5f28e7243 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ListAssociationsResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/ListAssociationsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,15 +32,33 @@ public class ListAssociationsResponse { public static final String JSON_PROPERTY_LINKS = "_links"; private Link links; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLinks = false; + public static final String JSON_PROPERTY_DATA = "data"; private List data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ITEMS_TOTAL = "itemsTotal"; private Integer itemsTotal; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetItemsTotal = false; + public static final String JSON_PROPERTY_PAGES_TOTAL = "pagesTotal"; private Integer pagesTotal; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPagesTotal = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ListAssociationsResponse() {} /** @@ -49,6 +69,7 @@ public ListAssociationsResponse() {} */ public ListAssociationsResponse links(Link links) { this.links = links; + isSetLinks = true; // mark as set return this; } @@ -72,6 +93,7 @@ public Link getLinks() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLinks(Link links) { this.links = links; + isSetLinks = true; // mark as set } /** @@ -82,6 +104,7 @@ public void setLinks(Link links) { */ public ListAssociationsResponse data(List data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -113,6 +136,7 @@ public List getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(List data) { this.data = data; + isSetData = true; // mark as set } /** @@ -123,6 +147,7 @@ public void setData(List data) { */ public ListAssociationsResponse itemsTotal(Integer itemsTotal) { this.itemsTotal = itemsTotal; + isSetItemsTotal = true; // mark as set return this; } @@ -146,6 +171,7 @@ public Integer getItemsTotal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setItemsTotal(Integer itemsTotal) { this.itemsTotal = itemsTotal; + isSetItemsTotal = true; // mark as set } /** @@ -156,6 +182,7 @@ public void setItemsTotal(Integer itemsTotal) { */ public ListAssociationsResponse pagesTotal(Integer pagesTotal) { this.pagesTotal = pagesTotal; + isSetPagesTotal = true; // mark as set return this; } @@ -179,6 +206,27 @@ public Integer getPagesTotal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPagesTotal(Integer pagesTotal) { this.pagesTotal = pagesTotal; + isSetPagesTotal = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ListAssociationsResponse 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 ListAssociationsResponse object is equal to o. */ @@ -224,6 +272,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 (isSetLinks) { + addIfNull(nulls, JSON_PROPERTY_LINKS, this.links); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetItemsTotal) { + addIfNull(nulls, JSON_PROPERTY_ITEMS_TOTAL, this.itemsTotal); + } + if (isSetPagesTotal) { + addIfNull(nulls, JSON_PROPERTY_PAGES_TOTAL, this.pagesTotal); + } + + 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 ListAssociationsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ListNetworkTokensResponse.java b/src/main/java/com/adyen/model/balanceplatform/ListNetworkTokensResponse.java index fb3fe0ebb..b587da39b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ListNetworkTokensResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/ListNetworkTokensResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,6 +27,15 @@ public class ListNetworkTokensResponse { public static final String JSON_PROPERTY_NETWORK_TOKENS = "networkTokens"; private List networkTokens; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkTokens = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ListNetworkTokensResponse() {} /** @@ -35,6 +46,7 @@ public ListNetworkTokensResponse() {} */ public ListNetworkTokensResponse networkTokens(List networkTokens) { this.networkTokens = networkTokens; + isSetNetworkTokens = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getNetworkTokens() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkTokens(List networkTokens) { this.networkTokens = networkTokens; + isSetNetworkTokens = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ListNetworkTokensResponse 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 ListNetworkTokensResponse object is equal to o. */ @@ -105,6 +138,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 (isSetNetworkTokens) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TOKENS, this.networkTokens); + } + + 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 ListNetworkTokensResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/MatchingTransactionsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MatchingTransactionsRestriction.java index afe47fe42..163375624 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MatchingTransactionsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MatchingTransactionsRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 MatchingTransactionsRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = 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 MatchingTransactionsRestriction() {} /** @@ -40,6 +54,7 @@ public MatchingTransactionsRestriction() {} */ public MatchingTransactionsRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -63,6 +78,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setOperation(String operation) { */ public MatchingTransactionsRestriction value(Integer value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -97,6 +114,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 MatchingTransactionsRestriction 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 MatchingTransactionsRestriction object is equal to o. */ @@ -139,6 +177,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 MatchingTransactionsRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/MatchingValuesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MatchingValuesRestriction.java index fead0fb06..2f7cc4dc0 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MatchingValuesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MatchingValuesRestriction.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -32,6 +34,9 @@ public class MatchingValuesRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + /** Gets or Sets value */ public enum ValueEnum { ACQUIRERID(String.valueOf("acquirerId")), @@ -82,6 +87,15 @@ public static ValueEnum fromValue(String value) { public static final String JSON_PROPERTY_VALUE = "value"; private List 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 MatchingValuesRestriction() {} /** @@ -92,6 +106,7 @@ public MatchingValuesRestriction() {} */ public MatchingValuesRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -115,6 +130,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -125,6 +141,7 @@ public void setOperation(String operation) { */ public MatchingValuesRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -156,6 +173,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MatchingValuesRestriction 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 MatchingValuesRestriction object is equal to o. */ @@ -197,6 +235,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 MatchingValuesRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/MccsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MccsRestriction.java index ad2ef17c7..382827fa3 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MccsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MccsRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 MccsRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private List 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 MccsRestriction() {} /** @@ -38,6 +52,7 @@ public MccsRestriction() {} */ public MccsRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -61,6 +76,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -71,6 +87,7 @@ public void setOperation(String operation) { */ public MccsRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -102,6 +119,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MccsRestriction 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 MccsRestriction object is equal to o. */ @@ -143,6 +181,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 MccsRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/MerchantAcquirerPair.java b/src/main/java/com/adyen/model/balanceplatform/MerchantAcquirerPair.java index 96533ff3e..d8c3448eb 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MerchantAcquirerPair.java +++ b/src/main/java/com/adyen/model/balanceplatform/MerchantAcquirerPair.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 MerchantAcquirerPair { public static final String JSON_PROPERTY_ACQUIRER_ID = "acquirerId"; private String acquirerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerId = false; + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantAcquirerPair() {} /** @@ -39,6 +53,7 @@ public MerchantAcquirerPair() {} */ public MerchantAcquirerPair acquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getAcquirerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setAcquirerId(String acquirerId) { */ public MerchantAcquirerPair merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -95,6 +112,27 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantAcquirerPair 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 MerchantAcquirerPair object is equal to o. */ @@ -136,6 +174,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 (isSetAcquirerId) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_ID, this.acquirerId); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + + 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 MerchantAcquirerPair given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java index c9224bdac..b11938386 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,9 +30,21 @@ public class MerchantNamesRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private List 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 MerchantNamesRestriction() {} /** @@ -41,6 +55,7 @@ public MerchantNamesRestriction() {} */ public MerchantNamesRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -64,6 +79,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setOperation(String operation) { */ public MerchantNamesRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -105,6 +122,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantNamesRestriction 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 MerchantNamesRestriction object is equal to o. */ @@ -146,6 +184,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 MerchantNamesRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java index b65cbd58d..73b71a48e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,9 +30,21 @@ public class MerchantsRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private List 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 MerchantsRestriction() {} /** @@ -41,6 +55,7 @@ public MerchantsRestriction() {} */ public MerchantsRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -64,6 +79,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setOperation(String operation) { */ public MerchantsRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -105,6 +122,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantsRestriction 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 MerchantsRestriction object is equal to o. */ @@ -146,6 +184,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 MerchantsRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java index 764bfed0a..d6ca1f7c0 100644 --- a/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -30,6 +32,9 @@ public class NOLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **noLocal** */ public enum TypeEnum { NOLOCAL(String.valueOf("noLocal")); @@ -72,6 +77,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 NOLocalAccountIdentification() {} /** @@ -82,6 +96,7 @@ public NOLocalAccountIdentification() {} */ public NOLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -105,6 +120,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -115,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public NOLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -138,6 +155,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 NOLocalAccountIdentification 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 NOLocalAccountIdentification object is equal to o. */ @@ -179,6 +217,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + 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 NOLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/NZLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/NZLocalAccountIdentification.java index 83606b6c9..c3e1c4a9f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/NZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/NZLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -30,6 +32,9 @@ public class NZLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **nzLocal** */ public enum TypeEnum { NZLOCAL(String.valueOf("nzLocal")); @@ -72,6 +77,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 NZLocalAccountIdentification() {} /** @@ -86,6 +100,7 @@ public NZLocalAccountIdentification() {} */ public NZLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +132,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +143,7 @@ public void setAccountNumber(String accountNumber) { */ public NZLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -150,6 +167,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 NZLocalAccountIdentification 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 NZLocalAccountIdentification object is equal to o. */ @@ -191,6 +229,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + 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 NZLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Name.java b/src/main/java/com/adyen/model/balanceplatform/Name.java index 66e9d37aa..9f8b1b4db 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Name.java +++ b/src/main/java/com/adyen/model/balanceplatform/Name.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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. */ @@ -133,6 +171,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/balanceplatform/NetworkToken.java b/src/main/java/com/adyen/model/balanceplatform/NetworkToken.java index 10a5f39d0..e6e2216fc 100644 --- a/src/main/java/com/adyen/model/balanceplatform/NetworkToken.java +++ b/src/main/java/com/adyen/model/balanceplatform/NetworkToken.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,18 +40,33 @@ public class NetworkToken { public static final String JSON_PROPERTY_BRAND_VARIANT = "brandVariant"; private String brandVariant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrandVariant = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_DEVICE = "device"; private DeviceInfo device; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDevice = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + /** * The status of the network token. Possible values: **active**, **inactive**, **suspended**, * **closed**. @@ -101,15 +118,33 @@ 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_TOKEN_LAST_FOUR = "tokenLastFour"; private String tokenLastFour; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenLastFour = false; + public static final String JSON_PROPERTY_TOKEN_REQUESTOR = "tokenRequestor"; private NetworkTokenRequestor tokenRequestor; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenRequestor = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 NetworkToken() {} /** @@ -122,6 +157,7 @@ public NetworkToken() {} */ public NetworkToken brandVariant(String brandVariant) { this.brandVariant = brandVariant; + isSetBrandVariant = true; // mark as set return this; } @@ -149,6 +185,7 @@ public String getBrandVariant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrandVariant(String brandVariant) { this.brandVariant = brandVariant; + isSetBrandVariant = true; // mark as set } /** @@ -163,6 +200,7 @@ public void setBrandVariant(String brandVariant) { */ public NetworkToken creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -194,6 +232,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -204,6 +243,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public NetworkToken device(DeviceInfo device) { this.device = device; + isSetDevice = true; // mark as set return this; } @@ -227,6 +267,7 @@ public DeviceInfo getDevice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDevice(DeviceInfo device) { this.device = device; + isSetDevice = true; // mark as set } /** @@ -237,6 +278,7 @@ public void setDevice(DeviceInfo device) { */ public NetworkToken id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -260,6 +302,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -271,6 +314,7 @@ public void setId(String id) { */ public NetworkToken paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -296,6 +340,7 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set } /** @@ -308,6 +353,7 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { */ public NetworkToken status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -335,6 +381,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -345,6 +392,7 @@ public void setStatus(StatusEnum status) { */ public NetworkToken tokenLastFour(String tokenLastFour) { this.tokenLastFour = tokenLastFour; + isSetTokenLastFour = true; // mark as set return this; } @@ -368,6 +416,7 @@ public String getTokenLastFour() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenLastFour(String tokenLastFour) { this.tokenLastFour = tokenLastFour; + isSetTokenLastFour = true; // mark as set } /** @@ -378,6 +427,7 @@ public void setTokenLastFour(String tokenLastFour) { */ public NetworkToken tokenRequestor(NetworkTokenRequestor tokenRequestor) { this.tokenRequestor = tokenRequestor; + isSetTokenRequestor = true; // mark as set return this; } @@ -401,6 +451,7 @@ public NetworkTokenRequestor getTokenRequestor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenRequestor(NetworkTokenRequestor tokenRequestor) { this.tokenRequestor = tokenRequestor; + isSetTokenRequestor = true; // mark as set } /** @@ -411,6 +462,7 @@ public void setTokenRequestor(NetworkTokenRequestor tokenRequestor) { */ public NetworkToken type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -434,6 +486,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NetworkToken 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 NetworkToken object is equal to o. */ @@ -500,6 +573,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 (isSetBrandVariant) { + addIfNull(nulls, JSON_PROPERTY_BRAND_VARIANT, this.brandVariant); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetDevice) { + addIfNull(nulls, JSON_PROPERTY_DEVICE, this.device); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTokenLastFour) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_LAST_FOUR, this.tokenLastFour); + } + if (isSetTokenRequestor) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_REQUESTOR, this.tokenRequestor); + } + 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 NetworkToken given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/NetworkTokenActivationDataRequest.java b/src/main/java/com/adyen/model/balanceplatform/NetworkTokenActivationDataRequest.java index 33a0c67e4..3ab5eb8be 100644 --- a/src/main/java/com/adyen/model/balanceplatform/NetworkTokenActivationDataRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/NetworkTokenActivationDataRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 NetworkTokenActivationDataRequest { public static final String JSON_PROPERTY_SDK_OUTPUT = "sdkOutput"; private String sdkOutput; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkOutput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NetworkTokenActivationDataRequest() {} /** @@ -43,6 +54,7 @@ public NetworkTokenActivationDataRequest() {} */ public NetworkTokenActivationDataRequest sdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set return this; } @@ -84,6 +96,27 @@ public String getSdkOutput() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkOutput(String sdkOutput) { this.sdkOutput = sdkOutput; + isSetSdkOutput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NetworkTokenActivationDataRequest 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 NetworkTokenActivationDataRequest object is equal to o. */ @@ -124,6 +157,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 (isSetSdkOutput) { + addIfNull(nulls, JSON_PROPERTY_SDK_OUTPUT, this.sdkOutput); + } + + 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 NetworkTokenActivationDataRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/NetworkTokenActivationDataResponse.java b/src/main/java/com/adyen/model/balanceplatform/NetworkTokenActivationDataResponse.java index 27bd58cba..b0a6ede0c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/NetworkTokenActivationDataResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/NetworkTokenActivationDataResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 NetworkTokenActivationDataResponse { public static final String JSON_PROPERTY_SDK_INPUT = "sdkInput"; private String sdkInput; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkInput = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NetworkTokenActivationDataResponse() {} /** @@ -44,6 +55,7 @@ public NetworkTokenActivationDataResponse() {} */ public NetworkTokenActivationDataResponse sdkInput(String sdkInput) { this.sdkInput = sdkInput; + isSetSdkInput = true; // mark as set return this; } @@ -87,6 +99,27 @@ public String getSdkInput() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkInput(String sdkInput) { this.sdkInput = sdkInput; + isSetSdkInput = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NetworkTokenActivationDataResponse 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 NetworkTokenActivationDataResponse object is equal to o. */ @@ -127,6 +160,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 (isSetSdkInput) { + addIfNull(nulls, JSON_PROPERTY_SDK_INPUT, this.sdkInput); + } + + 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 NetworkTokenActivationDataResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/NetworkTokenRequestor.java b/src/main/java/com/adyen/model/balanceplatform/NetworkTokenRequestor.java index 0949bb0a0..7195b7e40 100644 --- a/src/main/java/com/adyen/model/balanceplatform/NetworkTokenRequestor.java +++ b/src/main/java/com/adyen/model/balanceplatform/NetworkTokenRequestor.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 NetworkTokenRequestor { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_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 NetworkTokenRequestor() {} /** @@ -39,6 +53,7 @@ public NetworkTokenRequestor() {} */ public NetworkTokenRequestor id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setId(String id) { */ public NetworkTokenRequestor name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -95,6 +112,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 NetworkTokenRequestor 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 NetworkTokenRequestor object is equal to o. */ @@ -136,6 +174,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + 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 NetworkTokenRequestor given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java index fba8b6740..1c2d94e20 100644 --- a/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -32,13 +34,22 @@ public class NumberAndBicAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION = "additionalBankIdentification"; private AdditionalBankIdentification additionalBankIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalBankIdentification = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + /** **numberAndBic** */ public enum TypeEnum { NUMBERANDBIC(String.valueOf("numberAndBic")); @@ -81,6 +92,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 NumberAndBicAccountIdentification() {} /** @@ -94,6 +114,7 @@ public NumberAndBicAccountIdentification() {} */ public NumberAndBicAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -121,6 +142,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -133,6 +155,7 @@ public void setAccountNumber(String accountNumber) { public NumberAndBicAccountIdentification additionalBankIdentification( AdditionalBankIdentification additionalBankIdentification) { this.additionalBankIdentification = additionalBankIdentification; + isSetAdditionalBankIdentification = true; // mark as set return this; } @@ -157,6 +180,7 @@ public AdditionalBankIdentification getAdditionalBankIdentification() { public void setAdditionalBankIdentification( AdditionalBankIdentification additionalBankIdentification) { this.additionalBankIdentification = additionalBankIdentification; + isSetAdditionalBankIdentification = true; // mark as set } /** @@ -168,6 +192,7 @@ public void setAdditionalBankIdentification( */ public NumberAndBicAccountIdentification bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -191,6 +216,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -202,6 +228,7 @@ public void setBic(String bic) { */ public NumberAndBicAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -225,6 +252,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 NumberAndBicAccountIdentification 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 NumberAndBicAccountIdentification object is equal to o. */ @@ -275,6 +323,40 @@ 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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAdditionalBankIdentification) { + addIfNull( + nulls, JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION, this.additionalBankIdentification); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + 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 NumberAndBicAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java index fb7880c65..57407a312 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -30,6 +32,9 @@ public class PLLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **plLocal** */ public enum TypeEnum { PLLOCAL(String.valueOf("plLocal")); @@ -72,6 +77,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 PLLocalAccountIdentification() {} /** @@ -86,6 +100,7 @@ public PLLocalAccountIdentification() {} */ public PLLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +132,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +143,7 @@ public void setAccountNumber(String accountNumber) { */ public PLLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -150,6 +167,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 PLLocalAccountIdentification 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 PLLocalAccountIdentification object is equal to o. */ @@ -191,6 +229,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + 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 PLLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java index 9453624ea..a5c6abd3c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,12 +31,27 @@ public class PaginatedAccountHoldersResponse { public static final String JSON_PROPERTY_ACCOUNT_HOLDERS = "accountHolders"; private List accountHolders; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolders = false; + public static final String JSON_PROPERTY_HAS_NEXT = "hasNext"; private Boolean hasNext; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasNext = false; + public static final String JSON_PROPERTY_HAS_PREVIOUS = "hasPrevious"; private Boolean hasPrevious; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasPrevious = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaginatedAccountHoldersResponse() {} /** @@ -46,6 +63,7 @@ public PaginatedAccountHoldersResponse() {} */ public PaginatedAccountHoldersResponse accountHolders(List accountHolders) { this.accountHolders = accountHolders; + isSetAccountHolders = true; // mark as set return this; } @@ -77,6 +95,7 @@ public List getAccountHolders() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolders(List accountHolders) { this.accountHolders = accountHolders; + isSetAccountHolders = true; // mark as set } /** @@ -88,6 +107,7 @@ public void setAccountHolders(List accountHolders) { */ public PaginatedAccountHoldersResponse hasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set return this; } @@ -111,6 +131,7 @@ public Boolean getHasNext() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set } /** @@ -122,6 +143,7 @@ public void setHasNext(Boolean hasNext) { */ public PaginatedAccountHoldersResponse hasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set return this; } @@ -145,6 +167,27 @@ public Boolean getHasPrevious() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaginatedAccountHoldersResponse 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 PaginatedAccountHoldersResponse object is equal to o. */ @@ -189,6 +232,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 (isSetAccountHolders) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDERS, this.accountHolders); + } + if (isSetHasNext) { + addIfNull(nulls, JSON_PROPERTY_HAS_NEXT, this.hasNext); + } + if (isSetHasPrevious) { + addIfNull(nulls, JSON_PROPERTY_HAS_PREVIOUS, this.hasPrevious); + } + + 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 PaginatedAccountHoldersResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java index 34c37f969..c975436f5 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,12 +31,27 @@ public class PaginatedBalanceAccountsResponse { public static final String JSON_PROPERTY_BALANCE_ACCOUNTS = "balanceAccounts"; private List balanceAccounts; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccounts = false; + public static final String JSON_PROPERTY_HAS_NEXT = "hasNext"; private Boolean hasNext; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasNext = false; + public static final String JSON_PROPERTY_HAS_PREVIOUS = "hasPrevious"; private Boolean hasPrevious; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasPrevious = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaginatedBalanceAccountsResponse() {} /** @@ -47,6 +64,7 @@ public PaginatedBalanceAccountsResponse() {} public PaginatedBalanceAccountsResponse balanceAccounts( List balanceAccounts) { this.balanceAccounts = balanceAccounts; + isSetBalanceAccounts = true; // mark as set return this; } @@ -79,6 +97,7 @@ public List getBalanceAccounts() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccounts(List balanceAccounts) { this.balanceAccounts = balanceAccounts; + isSetBalanceAccounts = true; // mark as set } /** @@ -90,6 +109,7 @@ public void setBalanceAccounts(List balanceAccounts) { */ public PaginatedBalanceAccountsResponse hasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set return this; } @@ -113,6 +133,7 @@ public Boolean getHasNext() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set } /** @@ -124,6 +145,7 @@ public void setHasNext(Boolean hasNext) { */ public PaginatedBalanceAccountsResponse hasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set return this; } @@ -147,6 +169,27 @@ public Boolean getHasPrevious() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaginatedBalanceAccountsResponse 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 PaginatedBalanceAccountsResponse object is equal to o. */ @@ -191,6 +234,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 (isSetBalanceAccounts) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNTS, this.balanceAccounts); + } + if (isSetHasNext) { + addIfNull(nulls, JSON_PROPERTY_HAS_NEXT, this.hasNext); + } + if (isSetHasPrevious) { + addIfNull(nulls, JSON_PROPERTY_HAS_PREVIOUS, this.hasPrevious); + } + + 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 PaginatedBalanceAccountsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedGetCardOrderItemResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedGetCardOrderItemResponse.java index 3c817d137..35253b6da 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedGetCardOrderItemResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedGetCardOrderItemResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,12 +31,27 @@ public class PaginatedGetCardOrderItemResponse { public static final String JSON_PROPERTY_DATA = "data"; private List data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_HAS_NEXT = "hasNext"; private Boolean hasNext; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasNext = false; + public static final String JSON_PROPERTY_HAS_PREVIOUS = "hasPrevious"; private Boolean hasPrevious; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasPrevious = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaginatedGetCardOrderItemResponse() {} /** @@ -46,6 +63,7 @@ public PaginatedGetCardOrderItemResponse() {} */ public PaginatedGetCardOrderItemResponse data(List data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -77,6 +95,7 @@ public List getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(List data) { this.data = data; + isSetData = true; // mark as set } /** @@ -88,6 +107,7 @@ public void setData(List data) { */ public PaginatedGetCardOrderItemResponse hasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set return this; } @@ -111,6 +131,7 @@ public Boolean getHasNext() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set } /** @@ -122,6 +143,7 @@ public void setHasNext(Boolean hasNext) { */ public PaginatedGetCardOrderItemResponse hasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set return this; } @@ -145,6 +167,27 @@ public Boolean getHasPrevious() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaginatedGetCardOrderItemResponse 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 PaginatedGetCardOrderItemResponse object is equal to o. */ @@ -189,6 +232,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 (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetHasNext) { + addIfNull(nulls, JSON_PROPERTY_HAS_NEXT, this.hasNext); + } + if (isSetHasPrevious) { + addIfNull(nulls, JSON_PROPERTY_HAS_PREVIOUS, this.hasPrevious); + } + + 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 PaginatedGetCardOrderItemResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedGetCardOrderResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedGetCardOrderResponse.java index ef97d58f7..1311ac6e2 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedGetCardOrderResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedGetCardOrderResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,12 +31,27 @@ public class PaginatedGetCardOrderResponse { public static final String JSON_PROPERTY_CARD_ORDERS = "cardOrders"; private List cardOrders; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardOrders = false; + public static final String JSON_PROPERTY_HAS_NEXT = "hasNext"; private Boolean hasNext; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasNext = false; + public static final String JSON_PROPERTY_HAS_PREVIOUS = "hasPrevious"; private Boolean hasPrevious; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasPrevious = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaginatedGetCardOrderResponse() {} /** @@ -46,6 +63,7 @@ public PaginatedGetCardOrderResponse() {} */ public PaginatedGetCardOrderResponse cardOrders(List cardOrders) { this.cardOrders = cardOrders; + isSetCardOrders = true; // mark as set return this; } @@ -77,6 +95,7 @@ public List getCardOrders() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardOrders(List cardOrders) { this.cardOrders = cardOrders; + isSetCardOrders = true; // mark as set } /** @@ -88,6 +107,7 @@ public void setCardOrders(List cardOrders) { */ public PaginatedGetCardOrderResponse hasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set return this; } @@ -111,6 +131,7 @@ public Boolean getHasNext() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set } /** @@ -122,6 +143,7 @@ public void setHasNext(Boolean hasNext) { */ public PaginatedGetCardOrderResponse hasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set return this; } @@ -145,6 +167,27 @@ public Boolean getHasPrevious() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaginatedGetCardOrderResponse 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 PaginatedGetCardOrderResponse object is equal to o. */ @@ -188,6 +231,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 (isSetCardOrders) { + addIfNull(nulls, JSON_PROPERTY_CARD_ORDERS, this.cardOrders); + } + if (isSetHasNext) { + addIfNull(nulls, JSON_PROPERTY_HAS_NEXT, this.hasNext); + } + if (isSetHasPrevious) { + addIfNull(nulls, JSON_PROPERTY_HAS_PREVIOUS, this.hasPrevious); + } + + 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 PaginatedGetCardOrderResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java index 96ec52439..c3b871132 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,12 +31,27 @@ public class PaginatedPaymentInstrumentsResponse { public static final String JSON_PROPERTY_HAS_NEXT = "hasNext"; private Boolean hasNext; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasNext = false; + public static final String JSON_PROPERTY_HAS_PREVIOUS = "hasPrevious"; private Boolean hasPrevious; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHasPrevious = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENTS = "paymentInstruments"; private List paymentInstruments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstruments = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaginatedPaymentInstrumentsResponse() {} /** @@ -46,6 +63,7 @@ public PaginatedPaymentInstrumentsResponse() {} */ public PaginatedPaymentInstrumentsResponse hasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set return this; } @@ -69,6 +87,7 @@ public Boolean getHasNext() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasNext(Boolean hasNext) { this.hasNext = hasNext; + isSetHasNext = true; // mark as set } /** @@ -80,6 +99,7 @@ public void setHasNext(Boolean hasNext) { */ public PaginatedPaymentInstrumentsResponse hasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set return this; } @@ -103,6 +123,7 @@ public Boolean getHasPrevious() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHasPrevious(Boolean hasPrevious) { this.hasPrevious = hasPrevious; + isSetHasPrevious = true; // mark as set } /** @@ -115,6 +136,7 @@ public void setHasPrevious(Boolean hasPrevious) { public PaginatedPaymentInstrumentsResponse paymentInstruments( List paymentInstruments) { this.paymentInstruments = paymentInstruments; + isSetPaymentInstruments = true; // mark as set return this; } @@ -147,6 +169,27 @@ public List getPaymentInstruments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstruments(List paymentInstruments) { this.paymentInstruments = paymentInstruments; + isSetPaymentInstruments = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaginatedPaymentInstrumentsResponse 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 PaginatedPaymentInstrumentsResponse object is equal to o. */ @@ -192,6 +235,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 (isSetHasNext) { + addIfNull(nulls, JSON_PROPERTY_HAS_NEXT, this.hasNext); + } + if (isSetHasPrevious) { + addIfNull(nulls, JSON_PROPERTY_HAS_PREVIOUS, this.hasPrevious); + } + if (isSetPaymentInstruments) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENTS, this.paymentInstruments); + } + + 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 PaginatedPaymentInstrumentsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java index dd614b16b..834d3829c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -48,36 +50,69 @@ public class PaymentInstrument { private List additionalBankAccountIdentifications; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalBankAccountIdentifications = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountDetails bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = 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_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_ISSUING_COUNTRY_CODE = "issuingCountryCode"; private String issuingCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuingCountryCode = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_GROUP_ID = "paymentInstrumentGroupId"; private String paymentInstrumentGroupId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentGroupId = 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_REPLACED_BY_ID = "replacedById"; private String replacedById; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReplacedById = false; + public static final String JSON_PROPERTY_REPLACEMENT_OF_ID = "replacementOfId"; private String replacementOfId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReplacementOfId = false; + /** * The status of the payment instrument. If a status is not specified when creating a payment * instrument, it is set to **active** by default. However, there can be exceptions for cards @@ -135,9 +170,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_STATUS_COMMENT = "statusComment"; private String statusComment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusComment = false; + /** * The reason for the status of the payment instrument. Possible values: **accountClosure**, * **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, @@ -201,6 +242,9 @@ public static StatusReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS_REASON = "statusReason"; private StatusReasonEnum statusReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusReason = false; + /** The type of payment instrument. Possible values: **card**, **bankAccount**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("bankAccount")), @@ -245,6 +289,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 PaymentInstrument() {} /** @@ -262,6 +315,7 @@ public PaymentInstrument additionalBankAccountIdentifications( List additionalBankAccountIdentifications) { this.additionalBankAccountIdentifications = additionalBankAccountIdentifications; + isSetAdditionalBankAccountIdentifications = true; // mark as set return this; } @@ -308,6 +362,7 @@ public void setAdditionalBankAccountIdentifications( List additionalBankAccountIdentifications) { this.additionalBankAccountIdentifications = additionalBankAccountIdentifications; + isSetAdditionalBankAccountIdentifications = true; // mark as set } /** @@ -322,6 +377,7 @@ public void setAdditionalBankAccountIdentifications( */ public PaymentInstrument balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -353,6 +409,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -363,6 +420,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public PaymentInstrument bankAccount(BankAccountDetails bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -386,6 +444,7 @@ public BankAccountDetails getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountDetails bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -396,6 +455,7 @@ public void setBankAccount(BankAccountDetails bankAccount) { */ public PaymentInstrument card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -419,6 +479,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -429,6 +490,7 @@ public void setCard(Card card) { */ public PaymentInstrument description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -452,6 +514,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -462,6 +525,7 @@ public void setDescription(String description) { */ public PaymentInstrument id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -485,6 +549,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -498,6 +563,7 @@ public void setId(String id) { */ public PaymentInstrument issuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set return this; } @@ -527,6 +593,7 @@ public String getIssuingCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set } /** @@ -541,6 +608,7 @@ public void setIssuingCountryCode(String issuingCountryCode) { */ public PaymentInstrument paymentInstrumentGroupId(String paymentInstrumentGroupId) { this.paymentInstrumentGroupId = paymentInstrumentGroupId; + isSetPaymentInstrumentGroupId = true; // mark as set return this; } @@ -572,6 +640,7 @@ public String getPaymentInstrumentGroupId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentGroupId(String paymentInstrumentGroupId) { this.paymentInstrumentGroupId = paymentInstrumentGroupId; + isSetPaymentInstrumentGroupId = true; // mark as set } /** @@ -582,6 +651,7 @@ public void setPaymentInstrumentGroupId(String paymentInstrumentGroupId) { */ public PaymentInstrument reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -605,6 +675,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -616,6 +687,7 @@ public void setReference(String reference) { */ public PaymentInstrument replacedById(String replacedById) { this.replacedById = replacedById; + isSetReplacedById = true; // mark as set return this; } @@ -641,6 +713,7 @@ public String getReplacedById() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReplacedById(String replacedById) { this.replacedById = replacedById; + isSetReplacedById = true; // mark as set } /** @@ -652,6 +725,7 @@ public void setReplacedById(String replacedById) { */ public PaymentInstrument replacementOfId(String replacementOfId) { this.replacementOfId = replacementOfId; + isSetReplacementOfId = true; // mark as set return this; } @@ -677,6 +751,7 @@ public String getReplacementOfId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReplacementOfId(String replacementOfId) { this.replacementOfId = replacementOfId; + isSetReplacementOfId = true; // mark as set } /** @@ -702,6 +777,7 @@ public void setReplacementOfId(String replacementOfId) { */ public PaymentInstrument status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -755,6 +831,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -767,6 +844,7 @@ public void setStatus(StatusEnum status) { */ public PaymentInstrument statusComment(String statusComment) { this.statusComment = statusComment; + isSetStatusComment = true; // mark as set return this; } @@ -794,6 +872,7 @@ public String getStatusComment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusComment(String statusComment) { this.statusComment = statusComment; + isSetStatusComment = true; // mark as set } /** @@ -810,6 +889,7 @@ public void setStatusComment(String statusComment) { */ public PaymentInstrument statusReason(StatusReasonEnum statusReason) { this.statusReason = statusReason; + isSetStatusReason = true; // mark as set return this; } @@ -845,6 +925,7 @@ public StatusReasonEnum getStatusReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusReason(StatusReasonEnum statusReason) { this.statusReason = statusReason; + isSetStatusReason = true; // mark as set } /** @@ -855,6 +936,7 @@ public void setStatusReason(StatusReasonEnum statusReason) { */ public PaymentInstrument type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -878,6 +960,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 PaymentInstrument 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 PaymentInstrument object is equal to o. */ @@ -966,6 +1069,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 (isSetAdditionalBankAccountIdentifications) { + addIfNull( + nulls, + JSON_PROPERTY_ADDITIONAL_BANK_ACCOUNT_IDENTIFICATIONS, + this.additionalBankAccountIdentifications); + } + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetIssuingCountryCode) { + addIfNull(nulls, JSON_PROPERTY_ISSUING_COUNTRY_CODE, this.issuingCountryCode); + } + if (isSetPaymentInstrumentGroupId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_GROUP_ID, this.paymentInstrumentGroupId); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReplacedById) { + addIfNull(nulls, JSON_PROPERTY_REPLACED_BY_ID, this.replacedById); + } + if (isSetReplacementOfId) { + addIfNull(nulls, JSON_PROPERTY_REPLACEMENT_OF_ID, this.replacementOfId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetStatusComment) { + addIfNull(nulls, JSON_PROPERTY_STATUS_COMMENT, this.statusComment); + } + if (isSetStatusReason) { + addIfNull(nulls, JSON_PROPERTY_STATUS_REASON, this.statusReason); + } + 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 PaymentInstrument given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroup.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroup.java index 04a81415a..3f326a3f0 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroup.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroup.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 PaymentInstrumentGroup { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PROPERTIES = "properties"; private Map properties; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProperties = 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_TX_VARIANT = "txVariant"; private String txVariant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTxVariant = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrumentGroup() {} /** @@ -61,6 +87,7 @@ public PaymentInstrumentGroup() {} */ public PaymentInstrumentGroup balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -92,6 +119,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -102,6 +130,7 @@ public void setBalancePlatform(String balancePlatform) { */ public PaymentInstrumentGroup description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -125,6 +154,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -135,6 +165,7 @@ public void setDescription(String description) { */ public PaymentInstrumentGroup id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -158,6 +189,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -168,6 +200,7 @@ public void setId(String id) { */ public PaymentInstrumentGroup properties(Map properties) { this.properties = properties; + isSetProperties = true; // mark as set return this; } @@ -199,6 +232,7 @@ public Map getProperties() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProperties(Map properties) { this.properties = properties; + isSetProperties = true; // mark as set } /** @@ -209,6 +243,7 @@ public void setProperties(Map properties) { */ public PaymentInstrumentGroup reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -232,6 +267,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -242,6 +278,7 @@ public void setReference(String reference) { */ public PaymentInstrumentGroup txVariant(String txVariant) { this.txVariant = txVariant; + isSetTxVariant = true; // mark as set return this; } @@ -265,6 +302,27 @@ public String getTxVariant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTxVariant(String txVariant) { this.txVariant = txVariant; + isSetTxVariant = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrumentGroup 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 PaymentInstrumentGroup object is equal to o. */ @@ -314,6 +372,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 (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetProperties) { + addIfNull(nulls, JSON_PROPERTY_PROPERTIES, this.properties); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetTxVariant) { + addIfNull(nulls, JSON_PROPERTY_TX_VARIANT, this.txVariant); + } + + 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 PaymentInstrumentGroup given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroupInfo.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroupInfo.java index fdbe8a44f..3b9ae69a3 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroupInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroupInfo.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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; @@ -31,18 +33,39 @@ public class PaymentInstrumentGroupInfo { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_PROPERTIES = "properties"; private Map properties; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProperties = 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_TX_VARIANT = "txVariant"; private String txVariant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTxVariant = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrumentGroupInfo() {} /** @@ -57,6 +80,7 @@ public PaymentInstrumentGroupInfo() {} */ public PaymentInstrumentGroupInfo balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -88,6 +112,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -98,6 +123,7 @@ public void setBalancePlatform(String balancePlatform) { */ public PaymentInstrumentGroupInfo description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -121,6 +147,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -131,6 +158,7 @@ public void setDescription(String description) { */ public PaymentInstrumentGroupInfo properties(Map properties) { this.properties = properties; + isSetProperties = true; // mark as set return this; } @@ -162,6 +190,7 @@ public Map getProperties() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProperties(Map properties) { this.properties = properties; + isSetProperties = true; // mark as set } /** @@ -172,6 +201,7 @@ public void setProperties(Map properties) { */ public PaymentInstrumentGroupInfo reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -195,6 +225,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -205,6 +236,7 @@ public void setReference(String reference) { */ public PaymentInstrumentGroupInfo txVariant(String txVariant) { this.txVariant = txVariant; + isSetTxVariant = true; // mark as set return this; } @@ -228,6 +260,27 @@ public String getTxVariant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTxVariant(String txVariant) { this.txVariant = txVariant; + isSetTxVariant = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrumentGroupInfo 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 PaymentInstrumentGroupInfo object is equal to o. */ @@ -275,6 +328,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 (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetProperties) { + addIfNull(nulls, JSON_PROPERTY_PROPERTIES, this.properties); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetTxVariant) { + addIfNull(nulls, JSON_PROPERTY_TX_VARIANT, this.txVariant); + } + + 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 PaymentInstrumentGroupInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentInfo.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentInfo.java index 8b24392cf..3a43b4a9c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -39,24 +41,45 @@ public class PaymentInstrumentInfo { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountModel bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = false; + public static final String JSON_PROPERTY_CARD = "card"; private CardInfo card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = 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_ISSUING_COUNTRY_CODE = "issuingCountryCode"; private String issuingCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuingCountryCode = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_GROUP_ID = "paymentInstrumentGroupId"; private String paymentInstrumentGroupId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentGroupId = 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 payment instrument. If a status is not specified when creating a payment * instrument, it is set to **active** by default. However, there can be exceptions for cards @@ -114,9 +137,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_STATUS_COMMENT = "statusComment"; private String statusComment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusComment = false; + /** * The reason for the status of the payment instrument. Possible values: **accountClosure**, * **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, @@ -180,6 +209,9 @@ public static StatusReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS_REASON = "statusReason"; private StatusReasonEnum statusReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusReason = false; + /** The type of payment instrument. Possible values: **card**, **bankAccount**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("bankAccount")), @@ -224,6 +256,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 PaymentInstrumentInfo() {} /** @@ -238,6 +279,7 @@ public PaymentInstrumentInfo() {} */ public PaymentInstrumentInfo balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -269,6 +311,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -279,6 +322,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public PaymentInstrumentInfo bankAccount(BankAccountModel bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -302,6 +346,7 @@ public BankAccountModel getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountModel bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -312,6 +357,7 @@ public void setBankAccount(BankAccountModel bankAccount) { */ public PaymentInstrumentInfo card(CardInfo card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -335,6 +381,7 @@ public CardInfo getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(CardInfo card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -345,6 +392,7 @@ public void setCard(CardInfo card) { */ public PaymentInstrumentInfo description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -368,6 +416,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -381,6 +430,7 @@ public void setDescription(String description) { */ public PaymentInstrumentInfo issuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set return this; } @@ -410,6 +460,7 @@ public String getIssuingCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set } /** @@ -424,6 +475,7 @@ public void setIssuingCountryCode(String issuingCountryCode) { */ public PaymentInstrumentInfo paymentInstrumentGroupId(String paymentInstrumentGroupId) { this.paymentInstrumentGroupId = paymentInstrumentGroupId; + isSetPaymentInstrumentGroupId = true; // mark as set return this; } @@ -455,6 +507,7 @@ public String getPaymentInstrumentGroupId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentGroupId(String paymentInstrumentGroupId) { this.paymentInstrumentGroupId = paymentInstrumentGroupId; + isSetPaymentInstrumentGroupId = true; // mark as set } /** @@ -465,6 +518,7 @@ public void setPaymentInstrumentGroupId(String paymentInstrumentGroupId) { */ public PaymentInstrumentInfo reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -488,6 +542,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -513,6 +568,7 @@ public void setReference(String reference) { */ public PaymentInstrumentInfo status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -566,6 +622,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -578,6 +635,7 @@ public void setStatus(StatusEnum status) { */ public PaymentInstrumentInfo statusComment(String statusComment) { this.statusComment = statusComment; + isSetStatusComment = true; // mark as set return this; } @@ -605,6 +663,7 @@ public String getStatusComment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusComment(String statusComment) { this.statusComment = statusComment; + isSetStatusComment = true; // mark as set } /** @@ -621,6 +680,7 @@ public void setStatusComment(String statusComment) { */ public PaymentInstrumentInfo statusReason(StatusReasonEnum statusReason) { this.statusReason = statusReason; + isSetStatusReason = true; // mark as set return this; } @@ -656,6 +716,7 @@ public StatusReasonEnum getStatusReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusReason(StatusReasonEnum statusReason) { this.statusReason = statusReason; + isSetStatusReason = true; // mark as set } /** @@ -666,6 +727,7 @@ public void setStatusReason(StatusReasonEnum statusReason) { */ public PaymentInstrumentInfo type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -689,6 +751,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 PaymentInstrumentInfo 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 PaymentInstrumentInfo object is equal to o. */ @@ -762,6 +845,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 (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetIssuingCountryCode) { + addIfNull(nulls, JSON_PROPERTY_ISSUING_COUNTRY_CODE, this.issuingCountryCode); + } + if (isSetPaymentInstrumentGroupId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_GROUP_ID, this.paymentInstrumentGroupId); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetStatusComment) { + addIfNull(nulls, JSON_PROPERTY_STATUS_COMMENT, this.statusComment); + } + if (isSetStatusReason) { + addIfNull(nulls, JSON_PROPERTY_STATUS_REASON, this.statusReason); + } + 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 PaymentInstrumentInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRequirement.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRequirement.java index 60fb0e6b3..a620d7483 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -36,16 +38,28 @@ public class PaymentInstrumentRequirement { 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_ISSUING_COUNTRY_CODE = "issuingCountryCode"; private String issuingCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuingCountryCode = false; + public static final String JSON_PROPERTY_ISSUING_COUNTRY_CODES = "issuingCountryCodes"; private List issuingCountryCodes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuingCountryCodes = false; + public static final String JSON_PROPERTY_ONLY_FOR_CROSS_BALANCE_PLATFORM = "onlyForCrossBalancePlatform"; private Boolean onlyForCrossBalancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOnlyForCrossBalancePlatform = false; + /** * The type of the payment instrument. For example, \"BankAccount\" or * \"Card\". @@ -93,6 +107,9 @@ public static PaymentInstrumentTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_TYPE = "paymentInstrumentType"; private PaymentInstrumentTypeEnum paymentInstrumentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentType = false; + /** **paymentInstrumentRequirement** */ public enum TypeEnum { PAYMENTINSTRUMENTREQUIREMENT(String.valueOf("paymentInstrumentRequirement")); @@ -135,6 +152,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 PaymentInstrumentRequirement() {} /** @@ -147,6 +173,7 @@ public PaymentInstrumentRequirement() {} */ public PaymentInstrumentRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -174,6 +201,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 +215,7 @@ public void setDescription(String description) { */ public PaymentInstrumentRequirement issuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set return this; } @@ -216,6 +245,7 @@ public String getIssuingCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set } /** @@ -227,6 +257,7 @@ public void setIssuingCountryCode(String issuingCountryCode) { */ public PaymentInstrumentRequirement issuingCountryCodes(List issuingCountryCodes) { this.issuingCountryCodes = issuingCountryCodes; + isSetIssuingCountryCodes = true; // mark as set return this; } @@ -260,6 +291,7 @@ public List getIssuingCountryCodes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuingCountryCodes(List issuingCountryCodes) { this.issuingCountryCodes = issuingCountryCodes; + isSetIssuingCountryCodes = true; // mark as set } /** @@ -272,6 +304,7 @@ public void setIssuingCountryCodes(List issuingCountryCodes) { public PaymentInstrumentRequirement onlyForCrossBalancePlatform( Boolean onlyForCrossBalancePlatform) { this.onlyForCrossBalancePlatform = onlyForCrossBalancePlatform; + isSetOnlyForCrossBalancePlatform = true; // mark as set return this; } @@ -297,6 +330,7 @@ public Boolean getOnlyForCrossBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOnlyForCrossBalancePlatform(Boolean onlyForCrossBalancePlatform) { this.onlyForCrossBalancePlatform = onlyForCrossBalancePlatform; + isSetOnlyForCrossBalancePlatform = true; // mark as set } /** @@ -310,6 +344,7 @@ public void setOnlyForCrossBalancePlatform(Boolean onlyForCrossBalancePlatform) public PaymentInstrumentRequirement paymentInstrumentType( PaymentInstrumentTypeEnum paymentInstrumentType) { this.paymentInstrumentType = paymentInstrumentType; + isSetPaymentInstrumentType = true; // mark as set return this; } @@ -337,6 +372,7 @@ public PaymentInstrumentTypeEnum getPaymentInstrumentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentType(PaymentInstrumentTypeEnum paymentInstrumentType) { this.paymentInstrumentType = paymentInstrumentType; + isSetPaymentInstrumentType = true; // mark as set } /** @@ -347,6 +383,7 @@ public void setPaymentInstrumentType(PaymentInstrumentTypeEnum paymentInstrument */ public PaymentInstrumentRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -370,6 +407,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 PaymentInstrumentRequirement 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 PaymentInstrumentRequirement object is equal to o. */ @@ -435,6 +493,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetIssuingCountryCode) { + addIfNull(nulls, JSON_PROPERTY_ISSUING_COUNTRY_CODE, this.issuingCountryCode); + } + if (isSetIssuingCountryCodes) { + addIfNull(nulls, JSON_PROPERTY_ISSUING_COUNTRY_CODES, this.issuingCountryCodes); + } + if (isSetOnlyForCrossBalancePlatform) { + addIfNull( + nulls, JSON_PROPERTY_ONLY_FOR_CROSS_BALANCE_PLATFORM, this.onlyForCrossBalancePlatform); + } + if (isSetPaymentInstrumentType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_TYPE, this.paymentInstrumentType); + } + 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 PaymentInstrumentRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java index 3772295b1..cc487316c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 PaymentInstrumentRevealInfo { 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_EXPIRATION = "expiration"; private Expiry expiration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiration = false; + public static final String JSON_PROPERTY_PAN = "pan"; private String pan; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPan = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrumentRevealInfo() {} /** @@ -43,6 +60,7 @@ public PaymentInstrumentRevealInfo() {} */ public PaymentInstrumentRevealInfo cvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getCvc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setCvc(String cvc) { */ public PaymentInstrumentRevealInfo expiration(Expiry expiration) { this.expiration = expiration; + isSetExpiration = true; // mark as set return this; } @@ -99,6 +119,7 @@ public Expiry getExpiration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiration(Expiry expiration) { this.expiration = expiration; + isSetExpiration = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setExpiration(Expiry expiration) { */ public PaymentInstrumentRevealInfo pan(String pan) { this.pan = pan; + isSetPan = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getPan() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPan(String pan) { this.pan = pan; + isSetPan = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrumentRevealInfo 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 PaymentInstrumentRevealInfo object is equal to o. */ @@ -175,6 +218,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 (isSetCvc) { + addIfNull(nulls, JSON_PROPERTY_CVC, this.cvc); + } + if (isSetExpiration) { + addIfNull(nulls, JSON_PROPERTY_EXPIRATION, this.expiration); + } + if (isSetPan) { + addIfNull(nulls, JSON_PROPERTY_PAN, this.pan); + } + + 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 PaymentInstrumentRevealInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealRequest.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealRequest.java index 600da23f1..db4c11381 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 PaymentInstrumentRevealRequest { public static final String JSON_PROPERTY_ENCRYPTED_KEY = "encryptedKey"; private String encryptedKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedKey = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrumentRevealRequest() {} /** @@ -44,6 +58,7 @@ public PaymentInstrumentRevealRequest() {} */ public PaymentInstrumentRevealRequest encryptedKey(String encryptedKey) { this.encryptedKey = encryptedKey; + isSetEncryptedKey = true; // mark as set return this; } @@ -75,6 +90,7 @@ public String getEncryptedKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedKey(String encryptedKey) { this.encryptedKey = encryptedKey; + isSetEncryptedKey = true; // mark as set } /** @@ -88,6 +104,7 @@ public void setEncryptedKey(String encryptedKey) { */ public PaymentInstrumentRevealRequest paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -115,6 +132,27 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrumentRevealRequest 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 PaymentInstrumentRevealRequest object is equal to o. */ @@ -160,6 +198,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 (isSetEncryptedKey) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_KEY, this.encryptedKey); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + + 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 PaymentInstrumentRevealRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealResponse.java index 960d44b62..60fd99d7e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 PaymentInstrumentRevealResponse { public static final String JSON_PROPERTY_ENCRYPTED_DATA = "encryptedData"; private String encryptedData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrumentRevealResponse() {} /** @@ -34,6 +45,7 @@ public PaymentInstrumentRevealResponse() {} */ public PaymentInstrumentRevealResponse encryptedData(String encryptedData) { this.encryptedData = encryptedData; + isSetEncryptedData = true; // mark as set return this; } @@ -57,6 +69,27 @@ public String getEncryptedData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedData(String encryptedData) { this.encryptedData = encryptedData; + isSetEncryptedData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrumentRevealResponse 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 PaymentInstrumentRevealResponse object is equal to o. */ @@ -97,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 (isSetEncryptedData) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_DATA, this.encryptedData); + } + + 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 PaymentInstrumentRevealResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentUpdateRequest.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentUpdateRequest.java index 20cb3a261..ebe006423 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentUpdateRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentUpdateRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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 PaymentInstrumentUpdateRequest { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_CARD = "card"; private CardInfo card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = false; + /** * The status of the payment instrument. If a status is not specified when creating a payment * instrument, it is set to **active** by default. However, there can be exceptions for cards @@ -93,9 +101,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_STATUS_COMMENT = "statusComment"; private String statusComment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusComment = false; + /** * The reason for updating the status of the payment instrument. Possible values: **lost**, * **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, @@ -159,6 +173,15 @@ public static StatusReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS_REASON = "statusReason"; private StatusReasonEnum statusReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusReason = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrumentUpdateRequest() {} /** @@ -173,6 +196,7 @@ public PaymentInstrumentUpdateRequest() {} */ public PaymentInstrumentUpdateRequest balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -202,6 +226,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -213,6 +238,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public PaymentInstrumentUpdateRequest card(CardInfo card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -236,6 +262,7 @@ public CardInfo getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(CardInfo card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -262,6 +289,7 @@ public void setCard(CardInfo card) { */ public PaymentInstrumentUpdateRequest status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -315,6 +343,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -328,6 +357,7 @@ public void setStatus(StatusEnum status) { */ public PaymentInstrumentUpdateRequest statusComment(String statusComment) { this.statusComment = statusComment; + isSetStatusComment = true; // mark as set return this; } @@ -355,6 +385,7 @@ public String getStatusComment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusComment(String statusComment) { this.statusComment = statusComment; + isSetStatusComment = true; // mark as set } /** @@ -372,6 +403,7 @@ public void setStatusComment(String statusComment) { */ public PaymentInstrumentUpdateRequest statusReason(StatusReasonEnum statusReason) { this.statusReason = statusReason; + isSetStatusReason = true; // mark as set return this; } @@ -407,6 +439,27 @@ public StatusReasonEnum getStatusReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusReason(StatusReasonEnum statusReason) { this.statusReason = statusReason; + isSetStatusReason = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrumentUpdateRequest 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 PaymentInstrumentUpdateRequest object is equal to o. */ @@ -455,6 +508,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 (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetStatusComment) { + addIfNull(nulls, JSON_PROPERTY_STATUS_COMMENT, this.statusComment); + } + if (isSetStatusReason) { + addIfNull(nulls, JSON_PROPERTY_STATUS_REASON, this.statusReason); + } + + 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 PaymentInstrumentUpdateRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Phone.java b/src/main/java/com/adyen/model/balanceplatform/Phone.java index 6d10d0f8e..dd8a6c534 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Phone.java +++ b/src/main/java/com/adyen/model/balanceplatform/Phone.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -27,6 +29,9 @@ public class Phone { public static final String JSON_PROPERTY_NUMBER = "number"; private String number; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + /** Type of phone number. Possible values: **Landline**, **Mobile**. */ public enum TypeEnum { LANDLINE(String.valueOf("landline")), @@ -71,6 +76,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 Phone() {} /** @@ -84,6 +98,7 @@ public Phone() {} */ public Phone number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -113,6 +128,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -123,6 +139,7 @@ public void setNumber(String number) { */ public Phone type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -146,6 +163,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 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. */ @@ -186,6 +224,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 (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + 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 Phone given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java b/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java index cdc93e935..29a158bd8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java +++ b/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,9 +33,15 @@ public class PhoneNumber { public static final String JSON_PROPERTY_PHONE_COUNTRY_CODE = "phoneCountryCode"; private String phoneCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneCountryCode = false; + public static final String JSON_PROPERTY_PHONE_NUMBER = "phoneNumber"; private String phoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneNumber = false; + /** The type of the phone number. Possible values: **Landline**, **Mobile**, **SIP**, **Fax**. */ public enum PhoneTypeEnum { FAX(String.valueOf("Fax")), @@ -82,6 +90,15 @@ public static PhoneTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_PHONE_TYPE = "phoneType"; private PhoneTypeEnum phoneType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PhoneNumber() {} /** @@ -94,6 +111,7 @@ public PhoneNumber() {} */ public PhoneNumber phoneCountryCode(String phoneCountryCode) { this.phoneCountryCode = phoneCountryCode; + isSetPhoneCountryCode = true; // mark as set return this; } @@ -121,6 +139,7 @@ public String getPhoneCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhoneCountryCode(String phoneCountryCode) { this.phoneCountryCode = phoneCountryCode; + isSetPhoneCountryCode = true; // mark as set } /** @@ -132,6 +151,7 @@ public void setPhoneCountryCode(String phoneCountryCode) { */ public PhoneNumber phoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set return this; } @@ -157,6 +177,7 @@ public String getPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set } /** @@ -168,6 +189,7 @@ public void setPhoneNumber(String phoneNumber) { */ public PhoneNumber phoneType(PhoneTypeEnum phoneType) { this.phoneType = phoneType; + isSetPhoneType = true; // mark as set return this; } @@ -193,6 +215,27 @@ public PhoneTypeEnum getPhoneType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhoneType(PhoneTypeEnum phoneType) { this.phoneType = phoneType; + isSetPhoneType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PhoneNumber 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 PhoneNumber object is equal to o. */ @@ -236,6 +279,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 (isSetPhoneCountryCode) { + addIfNull(nulls, JSON_PROPERTY_PHONE_COUNTRY_CODE, this.phoneCountryCode); + } + if (isSetPhoneNumber) { + addIfNull(nulls, JSON_PROPERTY_PHONE_NUMBER, this.phoneNumber); + } + if (isSetPhoneType) { + addIfNull(nulls, JSON_PROPERTY_PHONE_TYPE, this.phoneType); + } + + 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 PhoneNumber given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PinChangeRequest.java b/src/main/java/com/adyen/model/balanceplatform/PinChangeRequest.java index ccc1df0a2..a8ba6739d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PinChangeRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/PinChangeRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 PinChangeRequest { public static final String JSON_PROPERTY_ENCRYPTED_KEY = "encryptedKey"; private String encryptedKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedKey = false; + public static final String JSON_PROPERTY_ENCRYPTED_PIN_BLOCK = "encryptedPinBlock"; private String encryptedPinBlock; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedPinBlock = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + public static final String JSON_PROPERTY_TOKEN = "token"; private String token; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PinChangeRequest() {} /** @@ -51,6 +71,7 @@ public PinChangeRequest() {} */ public PinChangeRequest encryptedKey(String encryptedKey) { this.encryptedKey = encryptedKey; + isSetEncryptedKey = true; // mark as set return this; } @@ -82,6 +103,7 @@ public String getEncryptedKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedKey(String encryptedKey) { this.encryptedKey = encryptedKey; + isSetEncryptedKey = true; // mark as set } /** @@ -93,6 +115,7 @@ public void setEncryptedKey(String encryptedKey) { */ public PinChangeRequest encryptedPinBlock(String encryptedPinBlock) { this.encryptedPinBlock = encryptedPinBlock; + isSetEncryptedPinBlock = true; // mark as set return this; } @@ -118,6 +141,7 @@ public String getEncryptedPinBlock() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedPinBlock(String encryptedPinBlock) { this.encryptedPinBlock = encryptedPinBlock; + isSetEncryptedPinBlock = true; // mark as set } /** @@ -130,6 +154,7 @@ public void setEncryptedPinBlock(String encryptedPinBlock) { */ public PinChangeRequest paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -157,6 +182,7 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set } /** @@ -167,6 +193,7 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { */ public PinChangeRequest token(String token) { this.token = token; + isSetToken = true; // mark as set return this; } @@ -190,6 +217,27 @@ public String getToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setToken(String token) { this.token = token; + isSetToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PinChangeRequest 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 PinChangeRequest object is equal to o. */ @@ -237,6 +285,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 (isSetEncryptedKey) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_KEY, this.encryptedKey); + } + if (isSetEncryptedPinBlock) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_PIN_BLOCK, this.encryptedPinBlock); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + if (isSetToken) { + addIfNull(nulls, JSON_PROPERTY_TOKEN, this.token); + } + + 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 PinChangeRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PinChangeResponse.java b/src/main/java/com/adyen/model/balanceplatform/PinChangeResponse.java index e917de51c..10c3c6626 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PinChangeResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PinChangeResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -73,6 +75,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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PinChangeResponse() {} /** @@ -85,6 +96,7 @@ public PinChangeResponse() {} */ public PinChangeResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -112,6 +124,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PinChangeResponse 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 PinChangeResponse object is equal to o. */ @@ -151,6 +184,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 (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 PinChangeResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PlatformPaymentConfiguration.java b/src/main/java/com/adyen/model/balanceplatform/PlatformPaymentConfiguration.java index b4cc3b6e1..9109818d1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PlatformPaymentConfiguration.java +++ b/src/main/java/com/adyen/model/balanceplatform/PlatformPaymentConfiguration.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 PlatformPaymentConfiguration { public static final String JSON_PROPERTY_SALES_DAY_CLOSING_TIME = "salesDayClosingTime"; private String salesDayClosingTime; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSalesDayClosingTime = false; + public static final String JSON_PROPERTY_SETTLEMENT_DELAY_DAYS = "settlementDelayDays"; private Integer settlementDelayDays; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSettlementDelayDays = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PlatformPaymentConfiguration() {} /** @@ -43,6 +57,7 @@ public PlatformPaymentConfiguration() {} */ public PlatformPaymentConfiguration salesDayClosingTime(String salesDayClosingTime) { this.salesDayClosingTime = salesDayClosingTime; + isSetSalesDayClosingTime = true; // mark as set return this; } @@ -74,6 +89,7 @@ public String getSalesDayClosingTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSalesDayClosingTime(String salesDayClosingTime) { this.salesDayClosingTime = salesDayClosingTime; + isSetSalesDayClosingTime = true; // mark as set } /** @@ -87,6 +103,7 @@ public void setSalesDayClosingTime(String salesDayClosingTime) { */ public PlatformPaymentConfiguration settlementDelayDays(Integer settlementDelayDays) { this.settlementDelayDays = settlementDelayDays; + isSetSettlementDelayDays = true; // mark as set return this; } @@ -116,6 +133,27 @@ public Integer getSettlementDelayDays() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSettlementDelayDays(Integer settlementDelayDays) { this.settlementDelayDays = settlementDelayDays; + isSetSettlementDelayDays = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PlatformPaymentConfiguration 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 PlatformPaymentConfiguration object is equal to o. */ @@ -163,6 +201,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 (isSetSalesDayClosingTime) { + addIfNull(nulls, JSON_PROPERTY_SALES_DAY_CLOSING_TIME, this.salesDayClosingTime); + } + if (isSetSettlementDelayDays) { + addIfNull(nulls, JSON_PROPERTY_SETTLEMENT_DELAY_DAYS, this.settlementDelayDays); + } + + 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 PlatformPaymentConfiguration given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ProcessingTypesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/ProcessingTypesRestriction.java index c51b0478d..17ca17106 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ProcessingTypesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/ProcessingTypesRestriction.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -32,6 +34,9 @@ public class ProcessingTypesRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + /** Gets or Sets value */ public enum ValueEnum { ATMWITHDRAW(String.valueOf("atmWithdraw")), @@ -88,6 +93,15 @@ public static ValueEnum fromValue(String value) { public static final String JSON_PROPERTY_VALUE = "value"; private List 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 ProcessingTypesRestriction() {} /** @@ -98,6 +112,7 @@ public ProcessingTypesRestriction() {} */ public ProcessingTypesRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -121,6 +136,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -133,6 +149,7 @@ public void setOperation(String operation) { */ public ProcessingTypesRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -168,6 +185,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ProcessingTypesRestriction 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 ProcessingTypesRestriction object is equal to o. */ @@ -209,6 +247,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 ProcessingTypesRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/PublicKeyResponse.java b/src/main/java/com/adyen/model/balanceplatform/PublicKeyResponse.java index 1e4eccac7..1743fe563 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PublicKeyResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PublicKeyResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 PublicKeyResponse { public static final String JSON_PROPERTY_PUBLIC_KEY = "publicKey"; private String publicKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPublicKey = false; + public static final String JSON_PROPERTY_PUBLIC_KEY_EXPIRY_DATE = "publicKeyExpiryDate"; private String publicKeyExpiryDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPublicKeyExpiryDate = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PublicKeyResponse() {} /** @@ -39,6 +53,7 @@ public PublicKeyResponse() {} */ public PublicKeyResponse publicKey(String publicKey) { this.publicKey = publicKey; + isSetPublicKey = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getPublicKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPublicKey(String publicKey) { this.publicKey = publicKey; + isSetPublicKey = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setPublicKey(String publicKey) { */ public PublicKeyResponse publicKeyExpiryDate(String publicKeyExpiryDate) { this.publicKeyExpiryDate = publicKeyExpiryDate; + isSetPublicKeyExpiryDate = true; // mark as set return this; } @@ -95,6 +112,27 @@ public String getPublicKeyExpiryDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPublicKeyExpiryDate(String publicKeyExpiryDate) { this.publicKeyExpiryDate = publicKeyExpiryDate; + isSetPublicKeyExpiryDate = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PublicKeyResponse 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 PublicKeyResponse object is equal to o. */ @@ -138,6 +176,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 (isSetPublicKey) { + addIfNull(nulls, JSON_PROPERTY_PUBLIC_KEY, this.publicKey); + } + if (isSetPublicKeyExpiryDate) { + addIfNull(nulls, JSON_PROPERTY_PUBLIC_KEY_EXPIRY_DATE, this.publicKeyExpiryDate); + } + + 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 PublicKeyResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RegisterSCAFinalResponse.java b/src/main/java/com/adyen/model/balanceplatform/RegisterSCAFinalResponse.java index 564b53724..75d59552e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RegisterSCAFinalResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/RegisterSCAFinalResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 RegisterSCAFinalResponse { public static final String JSON_PROPERTY_SUCCESS = "success"; private Boolean success; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSuccess = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RegisterSCAFinalResponse() {} /** @@ -33,6 +44,7 @@ public RegisterSCAFinalResponse() {} */ public RegisterSCAFinalResponse success(Boolean success) { this.success = success; + isSetSuccess = true; // mark as set return this; } @@ -56,6 +68,27 @@ public Boolean getSuccess() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSuccess(Boolean success) { this.success = success; + isSetSuccess = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RegisterSCAFinalResponse 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 RegisterSCAFinalResponse object is equal to o. */ @@ -95,6 +128,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 (isSetSuccess) { + addIfNull(nulls, JSON_PROPERTY_SUCCESS, this.success); + } + + 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 RegisterSCAFinalResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RegisterSCARequest.java b/src/main/java/com/adyen/model/balanceplatform/RegisterSCARequest.java index 31167cc89..7f64473ff 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RegisterSCARequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/RegisterSCARequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 RegisterSCARequest { 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_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + public static final String JSON_PROPERTY_STRONG_CUSTOMER_AUTHENTICATION = "strongCustomerAuthentication"; private DelegatedAuthenticationData strongCustomerAuthentication; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStrongCustomerAuthentication = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RegisterSCARequest() {} /** @@ -47,6 +64,7 @@ public RegisterSCARequest() {} */ public RegisterSCARequest name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -76,6 +94,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -87,6 +106,7 @@ public void setName(String name) { */ public RegisterSCARequest paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -112,6 +132,7 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set } /** @@ -123,6 +144,7 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { public RegisterSCARequest strongCustomerAuthentication( DelegatedAuthenticationData strongCustomerAuthentication) { this.strongCustomerAuthentication = strongCustomerAuthentication; + isSetStrongCustomerAuthentication = true; // mark as set return this; } @@ -147,6 +169,27 @@ public DelegatedAuthenticationData getStrongCustomerAuthentication() { public void setStrongCustomerAuthentication( DelegatedAuthenticationData strongCustomerAuthentication) { this.strongCustomerAuthentication = strongCustomerAuthentication; + isSetStrongCustomerAuthentication = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RegisterSCARequest 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 RegisterSCARequest object is equal to o. */ @@ -195,6 +238,37 @@ 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 (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + if (isSetStrongCustomerAuthentication) { + addIfNull( + nulls, JSON_PROPERTY_STRONG_CUSTOMER_AUTHENTICATION, this.strongCustomerAuthentication); + } + + 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 RegisterSCARequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RegisterSCAResponse.java b/src/main/java/com/adyen/model/balanceplatform/RegisterSCAResponse.java index 8f491a766..bd75c1e0e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RegisterSCAResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/RegisterSCAResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 RegisterSCAResponse { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + public static final String JSON_PROPERTY_SDK_INPUT = "sdkInput"; private String sdkInput; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkInput = false; + public static final String JSON_PROPERTY_SUCCESS = "success"; private Boolean success; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSuccess = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RegisterSCAResponse() {} /** @@ -47,6 +67,7 @@ public RegisterSCAResponse() {} */ public RegisterSCAResponse id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -70,6 +91,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -81,6 +103,7 @@ public void setId(String id) { */ public RegisterSCAResponse paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -106,6 +129,7 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set } /** @@ -118,6 +142,7 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { */ public RegisterSCAResponse sdkInput(String sdkInput) { this.sdkInput = sdkInput; + isSetSdkInput = true; // mark as set return this; } @@ -145,6 +170,7 @@ public String getSdkInput() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkInput(String sdkInput) { this.sdkInput = sdkInput; + isSetSdkInput = true; // mark as set } /** @@ -155,6 +181,7 @@ public void setSdkInput(String sdkInput) { */ public RegisterSCAResponse success(Boolean success) { this.success = success; + isSetSuccess = true; // mark as set return this; } @@ -178,6 +205,27 @@ public Boolean getSuccess() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSuccess(Boolean success) { this.success = success; + isSetSuccess = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RegisterSCAResponse 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 RegisterSCAResponse object is equal to o. */ @@ -225,6 +273,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + if (isSetSdkInput) { + addIfNull(nulls, JSON_PROPERTY_SDK_INPUT, this.sdkInput); + } + if (isSetSuccess) { + addIfNull(nulls, JSON_PROPERTY_SUCCESS, this.success); + } + + 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 RegisterSCAResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RemediatingAction.java b/src/main/java/com/adyen/model/balanceplatform/RemediatingAction.java index 70aba6fbc..7ff4fc8fa 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RemediatingAction.java +++ b/src/main/java/com/adyen/model/balanceplatform/RemediatingAction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 RemediatingAction { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RemediatingAction() {} /** @@ -36,6 +50,7 @@ public RemediatingAction() {} */ public RemediatingAction code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCode(String code) { */ public RemediatingAction message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RemediatingAction 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 RemediatingAction object is equal to o. */ @@ -133,6 +171,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 (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + + 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 RemediatingAction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RemoveAssociationRequest.java b/src/main/java/com/adyen/model/balanceplatform/RemoveAssociationRequest.java index db98f637e..9334b7aa8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RemoveAssociationRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/RemoveAssociationRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,12 +31,27 @@ public class RemoveAssociationRequest { public static final String JSON_PROPERTY_ENTITY_ID = "entityId"; private String entityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityId = false; + public static final String JSON_PROPERTY_ENTITY_TYPE = "entityType"; private ScaEntityType entityType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityType = false; + public static final String JSON_PROPERTY_SCA_DEVICE_IDS = "scaDeviceIds"; private List scaDeviceIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaDeviceIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RemoveAssociationRequest() {} /** @@ -45,6 +62,7 @@ public RemoveAssociationRequest() {} */ public RemoveAssociationRequest entityId(String entityId) { this.entityId = entityId; + isSetEntityId = true; // mark as set return this; } @@ -68,6 +86,7 @@ public String getEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityId(String entityId) { this.entityId = entityId; + isSetEntityId = true; // mark as set } /** @@ -78,6 +97,7 @@ public void setEntityId(String entityId) { */ public RemoveAssociationRequest entityType(ScaEntityType entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set return this; } @@ -101,6 +121,7 @@ public ScaEntityType getEntityType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityType(ScaEntityType entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set } /** @@ -111,6 +132,7 @@ public void setEntityType(ScaEntityType entityType) { */ public RemoveAssociationRequest scaDeviceIds(List scaDeviceIds) { this.scaDeviceIds = scaDeviceIds; + isSetScaDeviceIds = true; // mark as set return this; } @@ -142,6 +164,27 @@ public List getScaDeviceIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaDeviceIds(List scaDeviceIds) { this.scaDeviceIds = scaDeviceIds; + isSetScaDeviceIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RemoveAssociationRequest 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 RemoveAssociationRequest object is equal to o. */ @@ -185,6 +228,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 (isSetEntityId) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_ID, this.entityId); + } + if (isSetEntityType) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_TYPE, this.entityType); + } + if (isSetScaDeviceIds) { + addIfNull(nulls, JSON_PROPERTY_SCA_DEVICE_IDS, this.scaDeviceIds); + } + + 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 RemoveAssociationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Repayment.java b/src/main/java/com/adyen/model/balanceplatform/Repayment.java index aa2f906c7..8ab629b6e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Repayment.java +++ b/src/main/java/com/adyen/model/balanceplatform/Repayment.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 Repayment { public static final String JSON_PROPERTY_BASIS_POINTS = "basisPoints"; private Integer basisPoints; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasisPoints = false; + public static final String JSON_PROPERTY_TERM = "term"; private RepaymentTerm term; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTerm = false; + public static final String JSON_PROPERTY_THRESHOLD = "threshold"; private ThresholdRepayment threshold; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreshold = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Repayment() {} /** @@ -45,6 +62,7 @@ public Repayment() {} */ public Repayment basisPoints(Integer basisPoints) { this.basisPoints = basisPoints; + isSetBasisPoints = true; // mark as set return this; } @@ -72,6 +90,7 @@ public Integer getBasisPoints() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBasisPoints(Integer basisPoints) { this.basisPoints = basisPoints; + isSetBasisPoints = true; // mark as set } /** @@ -82,6 +101,7 @@ public void setBasisPoints(Integer basisPoints) { */ public Repayment term(RepaymentTerm term) { this.term = term; + isSetTerm = true; // mark as set return this; } @@ -105,6 +125,7 @@ public RepaymentTerm getTerm() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTerm(RepaymentTerm term) { this.term = term; + isSetTerm = true; // mark as set } /** @@ -115,6 +136,7 @@ public void setTerm(RepaymentTerm term) { */ public Repayment threshold(ThresholdRepayment threshold) { this.threshold = threshold; + isSetThreshold = true; // mark as set return this; } @@ -138,6 +160,27 @@ public ThresholdRepayment getThreshold() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreshold(ThresholdRepayment threshold) { this.threshold = threshold; + isSetThreshold = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Repayment 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 Repayment object is equal to o. */ @@ -181,6 +224,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 (isSetBasisPoints) { + addIfNull(nulls, JSON_PROPERTY_BASIS_POINTS, this.basisPoints); + } + if (isSetTerm) { + addIfNull(nulls, JSON_PROPERTY_TERM, this.term); + } + if (isSetThreshold) { + addIfNull(nulls, JSON_PROPERTY_THRESHOLD, this.threshold); + } + + 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 Repayment given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java b/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java index 66ff77e61..85ad8f1fd 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java +++ b/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 RepaymentTerm { public static final String JSON_PROPERTY_ESTIMATED_DAYS = "estimatedDays"; private Integer estimatedDays; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEstimatedDays = false; + public static final String JSON_PROPERTY_MAXIMUM_DAYS = "maximumDays"; private Integer maximumDays; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaximumDays = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RepaymentTerm() {} /** @@ -39,6 +53,7 @@ public RepaymentTerm() {} */ public RepaymentTerm estimatedDays(Integer estimatedDays) { this.estimatedDays = estimatedDays; + isSetEstimatedDays = true; // mark as set return this; } @@ -62,6 +77,7 @@ public Integer getEstimatedDays() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEstimatedDays(Integer estimatedDays) { this.estimatedDays = estimatedDays; + isSetEstimatedDays = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setEstimatedDays(Integer estimatedDays) { */ public RepaymentTerm maximumDays(Integer maximumDays) { this.maximumDays = maximumDays; + isSetMaximumDays = true; // mark as set return this; } @@ -101,6 +118,27 @@ public Integer getMaximumDays() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaximumDays(Integer maximumDays) { this.maximumDays = maximumDays; + isSetMaximumDays = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RepaymentTerm 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 RepaymentTerm object is equal to o. */ @@ -142,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 (isSetEstimatedDays) { + addIfNull(nulls, JSON_PROPERTY_ESTIMATED_DAYS, this.estimatedDays); + } + if (isSetMaximumDays) { + addIfNull(nulls, JSON_PROPERTY_MAXIMUM_DAYS, this.maximumDays); + } + + 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 RepaymentTerm given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java b/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java index 02871dfeb..c46605d11 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java +++ b/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,30 +37,63 @@ public class RestServiceError { public static final String JSON_PROPERTY_DETAIL = "detail"; private String detail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetail = 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_INSTANCE = "instance"; private String instance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstance = false; + public static final String JSON_PROPERTY_INVALID_FIELDS = "invalidFields"; private List invalidFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInvalidFields = false; + public static final String JSON_PROPERTY_REQUEST_ID = "requestId"; private String requestId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestId = false; + public static final String JSON_PROPERTY_RESPONSE = "response"; private Object response; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + public static final String JSON_PROPERTY_STATUS = "status"; private Integer status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TITLE = "title"; private String title; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTitle = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 RestServiceError() {} /** @@ -69,6 +104,7 @@ public RestServiceError() {} */ public RestServiceError detail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set return this; } @@ -92,6 +128,7 @@ public String getDetail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set } /** @@ -102,6 +139,7 @@ public void setDetail(String detail) { */ public RestServiceError errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -125,6 +163,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -135,6 +174,7 @@ public void setErrorCode(String errorCode) { */ public RestServiceError instance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set return this; } @@ -158,6 +198,7 @@ public String getInstance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set } /** @@ -168,6 +209,7 @@ public void setInstance(String instance) { */ public RestServiceError invalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set return this; } @@ -199,6 +241,7 @@ public List getInvalidFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInvalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set } /** @@ -210,6 +253,7 @@ public void setInvalidFields(List invalidFields) { */ public RestServiceError requestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set return this; } @@ -235,6 +279,7 @@ public String getRequestId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set } /** @@ -245,6 +290,7 @@ public void setRequestId(String requestId) { */ public RestServiceError response(Object response) { this.response = response; + isSetResponse = true; // mark as set return this; } @@ -268,6 +314,7 @@ public Object getResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResponse(Object response) { this.response = response; + isSetResponse = true; // mark as set } /** @@ -278,6 +325,7 @@ public void setResponse(Object response) { */ public RestServiceError status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -301,6 +349,7 @@ public Integer getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(Integer status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -311,6 +360,7 @@ public void setStatus(Integer status) { */ public RestServiceError title(String title) { this.title = title; + isSetTitle = true; // mark as set return this; } @@ -334,6 +384,7 @@ public String getTitle() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTitle(String title) { this.title = title; + isSetTitle = true; // mark as set } /** @@ -346,6 +397,7 @@ public void setTitle(String title) { */ public RestServiceError type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -373,6 +425,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RestServiceError 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 RestServiceError object is equal to o. */ @@ -429,6 +502,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 (isSetDetail) { + addIfNull(nulls, JSON_PROPERTY_DETAIL, this.detail); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetInstance) { + addIfNull(nulls, JSON_PROPERTY_INSTANCE, this.instance); + } + if (isSetInvalidFields) { + addIfNull(nulls, JSON_PROPERTY_INVALID_FIELDS, this.invalidFields); + } + if (isSetRequestId) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_ID, this.requestId); + } + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTitle) { + addIfNull(nulls, JSON_PROPERTY_TITLE, this.title); + } + 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 RestServiceError given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RevealPinRequest.java b/src/main/java/com/adyen/model/balanceplatform/RevealPinRequest.java index ea1075b73..9332aecec 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RevealPinRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/RevealPinRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 RevealPinRequest { public static final String JSON_PROPERTY_ENCRYPTED_KEY = "encryptedKey"; private String encryptedKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedKey = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RevealPinRequest() {} /** @@ -43,6 +57,7 @@ public RevealPinRequest() {} */ public RevealPinRequest encryptedKey(String encryptedKey) { this.encryptedKey = encryptedKey; + isSetEncryptedKey = true; // mark as set return this; } @@ -74,6 +89,7 @@ public String getEncryptedKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedKey(String encryptedKey) { this.encryptedKey = encryptedKey; + isSetEncryptedKey = true; // mark as set } /** @@ -86,6 +102,7 @@ public void setEncryptedKey(String encryptedKey) { */ public RevealPinRequest paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -113,6 +130,27 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RevealPinRequest 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 RevealPinRequest object is equal to o. */ @@ -156,6 +194,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 (isSetEncryptedKey) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_KEY, this.encryptedKey); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + + 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 RevealPinRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RevealPinResponse.java b/src/main/java/com/adyen/model/balanceplatform/RevealPinResponse.java index 395dcab77..98b06871f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RevealPinResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/RevealPinResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 RevealPinResponse { public static final String JSON_PROPERTY_ENCRYPTED_PIN_BLOCK = "encryptedPinBlock"; private String encryptedPinBlock; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedPinBlock = false; + public static final String JSON_PROPERTY_TOKEN = "token"; private String token; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RevealPinResponse() {} /** @@ -40,6 +54,7 @@ public RevealPinResponse() {} */ public RevealPinResponse encryptedPinBlock(String encryptedPinBlock) { this.encryptedPinBlock = encryptedPinBlock; + isSetEncryptedPinBlock = true; // mark as set return this; } @@ -65,6 +80,7 @@ public String getEncryptedPinBlock() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedPinBlock(String encryptedPinBlock) { this.encryptedPinBlock = encryptedPinBlock; + isSetEncryptedPinBlock = true; // mark as set } /** @@ -75,6 +91,7 @@ public void setEncryptedPinBlock(String encryptedPinBlock) { */ public RevealPinResponse token(String token) { this.token = token; + isSetToken = true; // mark as set return this; } @@ -98,6 +115,27 @@ public String getToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setToken(String token) { this.token = token; + isSetToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RevealPinResponse 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 RevealPinResponse object is equal to o. */ @@ -139,6 +177,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 (isSetEncryptedPinBlock) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_PIN_BLOCK, this.encryptedPinBlock); + } + if (isSetToken) { + addIfNull(nulls, JSON_PROPERTY_TOKEN, this.token); + } + + 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 RevealPinResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RiskScores.java b/src/main/java/com/adyen/model/balanceplatform/RiskScores.java index 6e1742123..a4fe03239 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RiskScores.java +++ b/src/main/java/com/adyen/model/balanceplatform/RiskScores.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 RiskScores { public static final String JSON_PROPERTY_MASTERCARD = "mastercard"; private Integer mastercard; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMastercard = false; + public static final String JSON_PROPERTY_VISA = "visa"; private Integer visa; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVisa = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RiskScores() {} /** @@ -38,6 +52,7 @@ public RiskScores() {} */ public RiskScores mastercard(Integer mastercard) { this.mastercard = mastercard; + isSetMastercard = true; // mark as set return this; } @@ -65,6 +80,7 @@ public Integer getMastercard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMastercard(Integer mastercard) { this.mastercard = mastercard; + isSetMastercard = true; // mark as set } /** @@ -77,6 +93,7 @@ public void setMastercard(Integer mastercard) { */ public RiskScores visa(Integer visa) { this.visa = visa; + isSetVisa = true; // mark as set return this; } @@ -104,6 +121,27 @@ public Integer getVisa() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVisa(Integer visa) { this.visa = visa; + isSetVisa = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RiskScores 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 RiskScores object is equal to o. */ @@ -145,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 (isSetMastercard) { + addIfNull(nulls, JSON_PROPERTY_MASTERCARD, this.mastercard); + } + if (isSetVisa) { + addIfNull(nulls, JSON_PROPERTY_VISA, this.visa); + } + + 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 RiskScores given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/RiskScoresRestriction.java b/src/main/java/com/adyen/model/balanceplatform/RiskScoresRestriction.java index 46afd17bb..4f74d6c89 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RiskScoresRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/RiskScoresRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 RiskScoresRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private RiskScores 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 RiskScoresRestriction() {} /** @@ -39,6 +53,7 @@ public RiskScoresRestriction() {} */ public RiskScoresRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setOperation(String operation) { */ public RiskScoresRestriction value(RiskScores value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -95,6 +112,27 @@ public RiskScores getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(RiskScores value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RiskScoresRestriction 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 RiskScoresRestriction object is equal to o. */ @@ -136,6 +174,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 RiskScoresRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java index a316850d9..478cd28d7 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,9 +33,15 @@ public class SELocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_CLEARING_NUMBER = "clearingNumber"; private String clearingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClearingNumber = false; + /** **seLocal** */ public enum TypeEnum { SELOCAL(String.valueOf("seLocal")); @@ -76,6 +84,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 SELocalAccountIdentification() {} /** @@ -90,6 +107,7 @@ public SELocalAccountIdentification() {} */ public SELocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -121,6 +139,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -135,6 +154,7 @@ public void setAccountNumber(String accountNumber) { */ public SELocalAccountIdentification clearingNumber(String clearingNumber) { this.clearingNumber = clearingNumber; + isSetClearingNumber = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getClearingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClearingNumber(String clearingNumber) { this.clearingNumber = clearingNumber; + isSetClearingNumber = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setClearingNumber(String clearingNumber) { */ public SELocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -199,6 +221,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 SELocalAccountIdentification 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 SELocalAccountIdentification object is equal to o. */ @@ -242,6 +285,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetClearingNumber) { + addIfNull(nulls, JSON_PROPERTY_CLEARING_NUMBER, this.clearingNumber); + } + 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 SELocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java index 0d9892271..b6375ce45 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,9 +33,15 @@ public class SGLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + /** **sgLocal** */ public enum TypeEnum { SGLOCAL(String.valueOf("sgLocal")); @@ -76,6 +84,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 SGLocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public SGLocalAccountIdentification() {} */ public SGLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -119,6 +138,7 @@ public void setAccountNumber(String accountNumber) { */ public SGLocalAccountIdentification bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -142,6 +162,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -152,6 +173,7 @@ public void setBic(String bic) { */ public SGLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -175,6 +197,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 SGLocalAccountIdentification 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 SGLocalAccountIdentification object is equal to o. */ @@ -218,6 +261,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + 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 SGLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SameAmountRestriction.java b/src/main/java/com/adyen/model/balanceplatform/SameAmountRestriction.java index 907568935..7e9359e63 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SameAmountRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/SameAmountRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 SameAmountRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Boolean 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 SameAmountRestriction() {} /** @@ -39,6 +53,7 @@ public SameAmountRestriction() {} */ public SameAmountRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setOperation(String operation) { */ public SameAmountRestriction value(Boolean value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -95,6 +112,27 @@ public Boolean getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Boolean value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SameAmountRestriction 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 SameAmountRestriction object is equal to o. */ @@ -136,6 +174,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 SameAmountRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SameCounterpartyRestriction.java b/src/main/java/com/adyen/model/balanceplatform/SameCounterpartyRestriction.java index 995cdf7da..6ff5c4d10 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SameCounterpartyRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/SameCounterpartyRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 SameCounterpartyRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Boolean 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 SameCounterpartyRestriction() {} /** @@ -39,6 +53,7 @@ public SameCounterpartyRestriction() {} */ public SameCounterpartyRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setOperation(String operation) { */ public SameCounterpartyRestriction value(Boolean value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -95,6 +112,27 @@ public Boolean getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Boolean value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SameCounterpartyRestriction 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 SameCounterpartyRestriction object is equal to o. */ @@ -136,6 +174,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 SameCounterpartyRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ScaDevice.java b/src/main/java/com/adyen/model/balanceplatform/ScaDevice.java index 774e5178d..2ddd19882 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ScaDevice.java +++ b/src/main/java/com/adyen/model/balanceplatform/ScaDevice.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 ScaDevice { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_TYPE = "type"; private ScaDeviceType 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 ScaDevice() {} /** @@ -43,6 +60,7 @@ public ScaDevice() {} */ public ScaDevice id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -78,6 +97,7 @@ public void setId(String id) { */ public ScaDevice name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -105,6 +125,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -115,6 +136,7 @@ public void setName(String name) { */ public ScaDevice type(ScaDeviceType type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -138,6 +160,27 @@ public ScaDeviceType getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(ScaDeviceType type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ScaDevice 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 ScaDevice object is equal to o. */ @@ -181,6 +224,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + 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 ScaDevice given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ScaEntity.java b/src/main/java/com/adyen/model/balanceplatform/ScaEntity.java index 67442f106..dde090b6a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ScaEntity.java +++ b/src/main/java/com/adyen/model/balanceplatform/ScaEntity.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 ScaEntity { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_TYPE = "type"; private ScaEntityType 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 ScaEntity() {} /** @@ -36,6 +50,7 @@ public ScaEntity() {} */ public ScaEntity id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setId(String id) { */ public ScaEntity type(ScaEntityType type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -92,6 +109,27 @@ public ScaEntityType getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(ScaEntityType type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ScaEntity 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 ScaEntity object is equal to o. */ @@ -132,6 +170,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + 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 ScaEntity given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ScaInformation.java b/src/main/java/com/adyen/model/balanceplatform/ScaInformation.java index 8572ebad0..8e79696fa 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ScaInformation.java +++ b/src/main/java/com/adyen/model/balanceplatform/ScaInformation.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 ScaInformation { public static final String JSON_PROPERTY_EXEMPTION = "exemption"; private ScaExemption exemption; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExemption = false; + public static final String JSON_PROPERTY_STATUS = "status"; private ScaStatus 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 ScaInformation() {} /** @@ -36,6 +50,7 @@ public ScaInformation() {} */ public ScaInformation exemption(ScaExemption exemption) { this.exemption = exemption; + isSetExemption = true; // mark as set return this; } @@ -59,6 +74,7 @@ public ScaExemption getExemption() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExemption(ScaExemption exemption) { this.exemption = exemption; + isSetExemption = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setExemption(ScaExemption exemption) { */ public ScaInformation status(ScaStatus status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -92,6 +109,27 @@ public ScaStatus getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(ScaStatus status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ScaInformation 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 ScaInformation object is equal to o. */ @@ -133,6 +171,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 (isSetExemption) { + addIfNull(nulls, JSON_PROPERTY_EXEMPTION, this.exemption); + } + 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 ScaInformation given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SearchRegisteredDevicesResponse.java b/src/main/java/com/adyen/model/balanceplatform/SearchRegisteredDevicesResponse.java index 099cdc84f..9a7dd6a75 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SearchRegisteredDevicesResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/SearchRegisteredDevicesResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,15 +32,33 @@ public class SearchRegisteredDevicesResponse { public static final String JSON_PROPERTY_DATA = "data"; private List data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ITEMS_TOTAL = "itemsTotal"; private Integer itemsTotal; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetItemsTotal = false; + public static final String JSON_PROPERTY_LINK = "link"; private Link link; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLink = false; + public static final String JSON_PROPERTY_PAGES_TOTAL = "pagesTotal"; private Integer pagesTotal; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPagesTotal = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SearchRegisteredDevicesResponse() {} /** @@ -50,6 +70,7 @@ public SearchRegisteredDevicesResponse() {} */ public SearchRegisteredDevicesResponse data(List data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -81,6 +102,7 @@ public List getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(List data) { this.data = data; + isSetData = true; // mark as set } /** @@ -92,6 +114,7 @@ public void setData(List data) { */ public SearchRegisteredDevicesResponse itemsTotal(Integer itemsTotal) { this.itemsTotal = itemsTotal; + isSetItemsTotal = true; // mark as set return this; } @@ -115,6 +138,7 @@ public Integer getItemsTotal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setItemsTotal(Integer itemsTotal) { this.itemsTotal = itemsTotal; + isSetItemsTotal = true; // mark as set } /** @@ -126,6 +150,7 @@ public void setItemsTotal(Integer itemsTotal) { */ public SearchRegisteredDevicesResponse link(Link link) { this.link = link; + isSetLink = true; // mark as set return this; } @@ -149,6 +174,7 @@ public Link getLink() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLink(Link link) { this.link = link; + isSetLink = true; // mark as set } /** @@ -160,6 +186,7 @@ public void setLink(Link link) { */ public SearchRegisteredDevicesResponse pagesTotal(Integer pagesTotal) { this.pagesTotal = pagesTotal; + isSetPagesTotal = true; // mark as set return this; } @@ -183,6 +210,27 @@ public Integer getPagesTotal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPagesTotal(Integer pagesTotal) { this.pagesTotal = pagesTotal; + isSetPagesTotal = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SearchRegisteredDevicesResponse 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 SearchRegisteredDevicesResponse object is equal to o. */ @@ -229,6 +277,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetItemsTotal) { + addIfNull(nulls, JSON_PROPERTY_ITEMS_TOTAL, this.itemsTotal); + } + if (isSetLink) { + addIfNull(nulls, JSON_PROPERTY_LINK, this.link); + } + if (isSetPagesTotal) { + addIfNull(nulls, JSON_PROPERTY_PAGES_TOTAL, this.pagesTotal); + } + + 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 SearchRegisteredDevicesResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SourceAccountTypesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/SourceAccountTypesRestriction.java index b8f3fcb1f..bd30a88fa 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SourceAccountTypesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/SourceAccountTypesRestriction.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -32,6 +34,9 @@ public class SourceAccountTypesRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + /** Gets or Sets value */ public enum ValueEnum { BALANCEACCOUNT(String.valueOf("balanceAccount")), @@ -76,6 +81,15 @@ public static ValueEnum fromValue(String value) { public static final String JSON_PROPERTY_VALUE = "value"; private List 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 SourceAccountTypesRestriction() {} /** @@ -87,6 +101,7 @@ public SourceAccountTypesRestriction() {} */ public SourceAccountTypesRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -110,6 +125,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -121,6 +137,7 @@ public void setOperation(String operation) { */ public SourceAccountTypesRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -152,6 +169,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SourceAccountTypesRestriction 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 SourceAccountTypesRestriction object is equal to o. */ @@ -193,6 +231,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 SourceAccountTypesRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/StringMatch.java b/src/main/java/com/adyen/model/balanceplatform/StringMatch.java index 9c2f29d09..e06c192dd 100644 --- a/src/main/java/com/adyen/model/balanceplatform/StringMatch.java +++ b/src/main/java/com/adyen/model/balanceplatform/StringMatch.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,9 +77,21 @@ public static OperationEnum fromValue(String value) { public static final String JSON_PROPERTY_OPERATION = "operation"; private OperationEnum operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private String 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 StringMatch() {} /** @@ -90,6 +104,7 @@ public StringMatch() {} */ public StringMatch operation(OperationEnum operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -117,6 +132,7 @@ public OperationEnum getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(OperationEnum operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -127,6 +143,7 @@ public void setOperation(OperationEnum operation) { */ public StringMatch value(String value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -150,6 +167,27 @@ public String getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(String value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StringMatch 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 StringMatch object is equal to o. */ @@ -191,6 +229,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 StringMatch given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SubmitScaAssociationRequest.java b/src/main/java/com/adyen/model/balanceplatform/SubmitScaAssociationRequest.java index a52b29041..0c874107a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SubmitScaAssociationRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/SubmitScaAssociationRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,6 +27,15 @@ public class SubmitScaAssociationRequest { public static final String JSON_PROPERTY_ENTITIES = "entities"; private List entities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntities = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SubmitScaAssociationRequest() {} /** @@ -35,6 +46,7 @@ public SubmitScaAssociationRequest() {} */ public SubmitScaAssociationRequest entities(List entities) { this.entities = entities; + isSetEntities = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getEntities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntities(List entities) { this.entities = entities; + isSetEntities = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SubmitScaAssociationRequest 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 SubmitScaAssociationRequest object is equal to o. */ @@ -105,6 +138,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 (isSetEntities) { + addIfNull(nulls, JSON_PROPERTY_ENTITIES, this.entities); + } + + 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 SubmitScaAssociationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SubmitScaAssociationResponse.java b/src/main/java/com/adyen/model/balanceplatform/SubmitScaAssociationResponse.java index 3de49bf54..89aa4d069 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SubmitScaAssociationResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/SubmitScaAssociationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,6 +27,15 @@ public class SubmitScaAssociationResponse { public static final String JSON_PROPERTY_SCA_ASSOCIATIONS = "scaAssociations"; private List scaAssociations; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaAssociations = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SubmitScaAssociationResponse() {} /** @@ -35,6 +46,7 @@ public SubmitScaAssociationResponse() {} */ public SubmitScaAssociationResponse scaAssociations(List scaAssociations) { this.scaAssociations = scaAssociations; + isSetScaAssociations = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getScaAssociations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaAssociations(List scaAssociations) { this.scaAssociations = scaAssociations; + isSetScaAssociations = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SubmitScaAssociationResponse 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 SubmitScaAssociationResponse object is equal to o. */ @@ -105,6 +138,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 (isSetScaAssociations) { + addIfNull(nulls, JSON_PROPERTY_SCA_ASSOCIATIONS, this.scaAssociations); + } + + 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 SubmitScaAssociationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java index 08b97b895..c0b26eabd 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -96,18 +98,33 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private SweepCounterparty counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + /** Gets or Sets priorities */ public enum PrioritiesEnum { CROSSBORDER(String.valueOf("crossBorder")), @@ -160,6 +177,9 @@ public static PrioritiesEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITIES = "priorities"; private List priorities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriorities = false; + /** The reason for disabling the sweep. */ public enum ReasonEnum { ACCOUNTHIERARCHYNOTACTIVE(String.valueOf("accountHierarchyNotActive")), @@ -209,6 +229,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -251,18 +273,33 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_REASON_DETAIL = "reasonDetail"; private String reasonDetail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReasonDetail = 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_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; private String referenceForBeneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + public static final String JSON_PROPERTY_SCHEDULE = "schedule"; private SweepSchedule schedule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchedule = false; + /** * The status of the sweep. If not provided, by default, this is set to **active**. Possible * values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on @@ -311,15 +348,27 @@ 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_SWEEP_AMOUNT = "sweepAmount"; private Amount sweepAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSweepAmount = false; + public static final String JSON_PROPERTY_TARGET_AMOUNT = "targetAmount"; private Amount targetAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTargetAmount = false; + public static final String JSON_PROPERTY_TRIGGER_AMOUNT = "triggerAmount"; private Amount triggerAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTriggerAmount = false; + /** * The direction of sweep, whether pushing out or pulling in funds to the balance account. If not * provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to @@ -369,6 +418,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 SweepConfigurationV2() {} @JsonCreator @@ -400,6 +458,7 @@ public SweepConfigurationV2( */ public SweepConfigurationV2 category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } @@ -443,6 +502,7 @@ public CategoryEnum getCategory() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -453,6 +513,7 @@ public void setCategory(CategoryEnum category) { */ public SweepConfigurationV2 counterparty(SweepCounterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -476,6 +537,7 @@ public SweepCounterparty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(SweepCounterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -492,6 +554,7 @@ public void setCounterparty(SweepCounterparty counterparty) { */ public SweepConfigurationV2 currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -527,6 +590,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -541,6 +605,7 @@ public void setCurrency(String currency) { */ public SweepConfigurationV2 description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -572,6 +637,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -594,14 +660,14 @@ public String getId() { * 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) @@ -617,14 +683,14 @@ public String getId() { * 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) @@ -634,6 +700,7 @@ public String getId() { */ public SweepConfigurationV2 priorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set return this; } @@ -654,14 +721,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) @@ -677,14 +744,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) @@ -706,14 +773,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) @@ -729,14 +796,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) @@ -747,6 +814,7 @@ public List getPriorities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set } /** @@ -779,6 +847,7 @@ public String getReasonDetail() { */ public SweepConfigurationV2 reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -802,6 +871,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -814,6 +884,7 @@ public void setReference(String reference) { */ public SweepConfigurationV2 referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -841,6 +912,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -851,6 +923,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public SweepConfigurationV2 schedule(SweepSchedule schedule) { this.schedule = schedule; + isSetSchedule = true; // mark as set return this; } @@ -874,6 +947,7 @@ public SweepSchedule getSchedule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchedule(SweepSchedule schedule) { this.schedule = schedule; + isSetSchedule = true; // mark as set } /** @@ -889,6 +963,7 @@ public void setSchedule(SweepSchedule schedule) { */ public SweepConfigurationV2 status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -922,6 +997,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -932,6 +1008,7 @@ public void setStatus(StatusEnum status) { */ public SweepConfigurationV2 sweepAmount(Amount sweepAmount) { this.sweepAmount = sweepAmount; + isSetSweepAmount = true; // mark as set return this; } @@ -955,6 +1032,7 @@ public Amount getSweepAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSweepAmount(Amount sweepAmount) { this.sweepAmount = sweepAmount; + isSetSweepAmount = true; // mark as set } /** @@ -965,6 +1043,7 @@ public void setSweepAmount(Amount sweepAmount) { */ public SweepConfigurationV2 targetAmount(Amount targetAmount) { this.targetAmount = targetAmount; + isSetTargetAmount = true; // mark as set return this; } @@ -988,6 +1067,7 @@ public Amount getTargetAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTargetAmount(Amount targetAmount) { this.targetAmount = targetAmount; + isSetTargetAmount = true; // mark as set } /** @@ -998,6 +1078,7 @@ public void setTargetAmount(Amount targetAmount) { */ public SweepConfigurationV2 triggerAmount(Amount triggerAmount) { this.triggerAmount = triggerAmount; + isSetTriggerAmount = true; // mark as set return this; } @@ -1021,6 +1102,7 @@ public Amount getTriggerAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTriggerAmount(Amount triggerAmount) { this.triggerAmount = triggerAmount; + isSetTriggerAmount = true; // mark as set } /** @@ -1037,6 +1119,7 @@ public void setTriggerAmount(Amount triggerAmount) { */ public SweepConfigurationV2 type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1072,6 +1155,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 SweepConfigurationV2 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 SweepConfigurationV2 object is equal to o. */ @@ -1160,6 +1264,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 (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPriorities) { + addIfNull(nulls, JSON_PROPERTY_PRIORITIES, this.priorities); + } + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetReasonDetail) { + addIfNull(nulls, JSON_PROPERTY_REASON_DETAIL, this.reasonDetail); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetSchedule) { + addIfNull(nulls, JSON_PROPERTY_SCHEDULE, this.schedule); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetSweepAmount) { + addIfNull(nulls, JSON_PROPERTY_SWEEP_AMOUNT, this.sweepAmount); + } + if (isSetTargetAmount) { + addIfNull(nulls, JSON_PROPERTY_TARGET_AMOUNT, this.targetAmount); + } + if (isSetTriggerAmount) { + addIfNull(nulls, JSON_PROPERTY_TRIGGER_AMOUNT, this.triggerAmount); + } + 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 SweepConfigurationV2 given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepCounterparty.java b/src/main/java/com/adyen/model/balanceplatform/SweepCounterparty.java index e12f86ab6..9d595ec17 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepCounterparty.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepCounterparty.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 SweepCounterparty { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SweepCounterparty() {} /** @@ -49,6 +66,7 @@ public SweepCounterparty() {} */ public SweepCounterparty balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -84,6 +102,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -97,6 +116,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public SweepCounterparty merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -126,6 +146,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -155,6 +176,7 @@ public void setMerchantAccount(String merchantAccount) { */ public SweepCounterparty transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -216,6 +238,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SweepCounterparty 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 SweepCounterparty object is equal to o. */ @@ -261,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 (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + 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 SweepCounterparty given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java b/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java index 7b309ae0b..f9c4445a4 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -27,6 +29,9 @@ public class SweepSchedule { public static final String JSON_PROPERTY_CRON_EXPRESSION = "cronExpression"; private String cronExpression; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCronExpression = false; + /** * The schedule type. Possible values: * **cron**: push out funds based on a * `cronExpression`. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: @@ -83,6 +88,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 SweepSchedule() {} /** @@ -108,6 +122,7 @@ public SweepSchedule() {} */ public SweepSchedule cronExpression(String cronExpression) { this.cronExpression = cronExpression; + isSetCronExpression = true; // mark as set return this; } @@ -161,6 +176,7 @@ public String getCronExpression() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCronExpression(String cronExpression) { this.cronExpression = cronExpression; + isSetCronExpression = true; // mark as set } /** @@ -179,6 +195,7 @@ public void setCronExpression(String cronExpression) { */ public SweepSchedule type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -218,6 +235,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 SweepSchedule 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 SweepSchedule object is equal to o. */ @@ -259,6 +297,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 (isSetCronExpression) { + addIfNull(nulls, JSON_PROPERTY_CRON_EXPRESSION, this.cronExpression); + } + 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 SweepSchedule given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/Target.java b/src/main/java/com/adyen/model/balanceplatform/Target.java index f88f96c2a..fddb9436b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Target.java +++ b/src/main/java/com/adyen/model/balanceplatform/Target.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -27,6 +29,9 @@ public class Target { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + /** * The resource for which you want to receive notifications. Possible values: * * **balancePlatform**: receive notifications about balance changes in your entire balance @@ -79,6 +84,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 Target() {} /** @@ -91,6 +105,7 @@ public Target() {} */ public Target id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -118,6 +133,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -136,6 +152,7 @@ public void setId(String id) { */ public Target type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -175,6 +192,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 Target 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 Target object is equal to o. */ @@ -215,6 +253,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + 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 Target given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TargetUpdate.java b/src/main/java/com/adyen/model/balanceplatform/TargetUpdate.java index 240936b7b..df019fe8e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TargetUpdate.java +++ b/src/main/java/com/adyen/model/balanceplatform/TargetUpdate.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -27,6 +29,9 @@ public class TargetUpdate { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + /** * The resource for which you want to receive notifications. Possible values: * * **balancePlatform**: receive notifications about balance changes in your entire balance @@ -79,6 +84,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 TargetUpdate() {} /** @@ -91,6 +105,7 @@ public TargetUpdate() {} */ public TargetUpdate id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -118,6 +133,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -136,6 +152,7 @@ public void setId(String id) { */ public TargetUpdate type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -175,6 +192,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 TargetUpdate 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 TargetUpdate object is equal to o. */ @@ -215,6 +253,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + 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 TargetUpdate given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java b/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java index 591e826a3..bb402ba29 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java +++ b/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 ThresholdRepayment { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThresholdRepayment() {} /** @@ -33,6 +44,7 @@ public ThresholdRepayment() {} */ public ThresholdRepayment amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -56,6 +68,27 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThresholdRepayment 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 ThresholdRepayment object is equal to o. */ @@ -95,6 +128,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + + 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 ThresholdRepayment given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TimeOfDay.java b/src/main/java/com/adyen/model/balanceplatform/TimeOfDay.java index f975493f6..43c33b979 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TimeOfDay.java +++ b/src/main/java/com/adyen/model/balanceplatform/TimeOfDay.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 TimeOfDay { public static final String JSON_PROPERTY_END_TIME = "endTime"; private String endTime; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndTime = false; + public static final String JSON_PROPERTY_START_TIME = "startTime"; private String startTime; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartTime = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TimeOfDay() {} /** @@ -38,6 +52,7 @@ public TimeOfDay() {} */ public TimeOfDay endTime(String endTime) { this.endTime = endTime; + isSetEndTime = true; // mark as set return this; } @@ -65,6 +80,7 @@ public String getEndTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndTime(String endTime) { this.endTime = endTime; + isSetEndTime = true; // mark as set } /** @@ -77,6 +93,7 @@ public void setEndTime(String endTime) { */ public TimeOfDay startTime(String startTime) { this.startTime = startTime; + isSetStartTime = true; // mark as set return this; } @@ -104,6 +121,27 @@ public String getStartTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartTime(String startTime) { this.startTime = startTime; + isSetStartTime = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TimeOfDay 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 TimeOfDay object is equal to o. */ @@ -145,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 (isSetEndTime) { + addIfNull(nulls, JSON_PROPERTY_END_TIME, this.endTime); + } + if (isSetStartTime) { + addIfNull(nulls, JSON_PROPERTY_START_TIME, this.startTime); + } + + 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 TimeOfDay given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TimeOfDayRestriction.java b/src/main/java/com/adyen/model/balanceplatform/TimeOfDayRestriction.java index 0bed38d2a..23849ff60 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TimeOfDayRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/TimeOfDayRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 TimeOfDayRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private TimeOfDay 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 TimeOfDayRestriction() {} /** @@ -39,6 +53,7 @@ public TimeOfDayRestriction() {} */ public TimeOfDayRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setOperation(String operation) { */ public TimeOfDayRestriction value(TimeOfDay value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -95,6 +112,27 @@ public TimeOfDay getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(TimeOfDay value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TimeOfDayRestriction 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 TimeOfDayRestriction object is equal to o. */ @@ -136,6 +174,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 TimeOfDayRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TokenRequestorsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/TokenRequestorsRestriction.java index bb4db99db..f0a0cae61 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TokenRequestorsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/TokenRequestorsRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,9 +30,21 @@ public class TokenRequestorsRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private List 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 TokenRequestorsRestriction() {} /** @@ -41,6 +55,7 @@ public TokenRequestorsRestriction() {} */ public TokenRequestorsRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -64,6 +79,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setOperation(String operation) { */ public TokenRequestorsRestriction value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -105,6 +122,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TokenRequestorsRestriction 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 TokenRequestorsRestriction object is equal to o. */ @@ -146,6 +184,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 TokenRequestorsRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TotalAmountRestriction.java b/src/main/java/com/adyen/model/balanceplatform/TotalAmountRestriction.java index 6327e440f..920250e26 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TotalAmountRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/TotalAmountRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 TotalAmountRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Amount 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 TotalAmountRestriction() {} /** @@ -39,6 +53,7 @@ public TotalAmountRestriction() {} */ public TotalAmountRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setOperation(String operation) { */ public TotalAmountRestriction value(Amount value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -95,6 +112,27 @@ public Amount getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Amount value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TotalAmountRestriction 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 TotalAmountRestriction object is equal to o. */ @@ -136,6 +174,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 TotalAmountRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java index 55cbd7732..2565efb38 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,21 +44,39 @@ public class TransactionRule { public static final String JSON_PROPERTY_AGGREGATION_LEVEL = "aggregationLevel"; private String aggregationLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAggregationLevel = 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_END_DATE = "endDate"; private String endDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndDate = false; + public static final String JSON_PROPERTY_ENTITY_KEY = "entityKey"; private TransactionRuleEntityKey entityKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityKey = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_INTERVAL = "interval"; private TransactionRuleInterval interval; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInterval = false; + /** * The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied * when a transaction meets the conditions of the rule. Possible values: * **hardBlock** @@ -115,9 +135,15 @@ public static OutcomeTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_OUTCOME_TYPE = "outcomeType"; private OutcomeTypeEnum outcomeType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutcomeType = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * Indicates the type of request to which the rule applies. If not provided, by default, this is * set to **authorization**. Possible values: **authorization**, **authentication**, @@ -170,15 +196,27 @@ public static RequestTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_REQUEST_TYPE = "requestType"; private RequestTypeEnum requestType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestType = false; + public static final String JSON_PROPERTY_RULE_RESTRICTIONS = "ruleRestrictions"; private TransactionRuleRestrictions ruleRestrictions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRuleRestrictions = false; + public static final String JSON_PROPERTY_SCORE = "score"; private Integer score; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScore = false; + public static final String JSON_PROPERTY_START_DATE = "startDate"; private String startDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartDate = false; + /** * The status of the transaction rule. If you provide a `startDate` in the request, the * rule is automatically created with an **active** status. Possible values: **active**, @@ -227,6 +265,9 @@ 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; + /** * The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which defines * if a rule blocks transactions based on individual characteristics or accumulates data. Possible @@ -283,6 +324,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 TransactionRule() {} /** @@ -303,6 +353,7 @@ public TransactionRule() {} */ public TransactionRule aggregationLevel(String aggregationLevel) { this.aggregationLevel = aggregationLevel; + isSetAggregationLevel = true; // mark as set return this; } @@ -346,6 +397,7 @@ public String getAggregationLevel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAggregationLevel(String aggregationLevel) { this.aggregationLevel = aggregationLevel; + isSetAggregationLevel = true; // mark as set } /** @@ -356,6 +408,7 @@ public void setAggregationLevel(String aggregationLevel) { */ public TransactionRule description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -379,6 +432,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -393,6 +447,7 @@ public void setDescription(String description) { */ public TransactionRule endDate(String endDate) { this.endDate = endDate; + isSetEndDate = true; // mark as set return this; } @@ -424,6 +479,7 @@ public String getEndDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndDate(String endDate) { this.endDate = endDate; + isSetEndDate = true; // mark as set } /** @@ -434,6 +490,7 @@ public void setEndDate(String endDate) { */ public TransactionRule entityKey(TransactionRuleEntityKey entityKey) { this.entityKey = entityKey; + isSetEntityKey = true; // mark as set return this; } @@ -457,6 +514,7 @@ public TransactionRuleEntityKey getEntityKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityKey(TransactionRuleEntityKey entityKey) { this.entityKey = entityKey; + isSetEntityKey = true; // mark as set } /** @@ -467,6 +525,7 @@ public void setEntityKey(TransactionRuleEntityKey entityKey) { */ public TransactionRule id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -490,6 +549,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -500,6 +560,7 @@ public void setId(String id) { */ public TransactionRule interval(TransactionRuleInterval interval) { this.interval = interval; + isSetInterval = true; // mark as set return this; } @@ -523,6 +584,7 @@ public TransactionRuleInterval getInterval() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInterval(TransactionRuleInterval interval) { this.interval = interval; + isSetInterval = true; // mark as set } /** @@ -550,6 +612,7 @@ public void setInterval(TransactionRuleInterval interval) { */ public TransactionRule outcomeType(OutcomeTypeEnum outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set return this; } @@ -607,6 +670,7 @@ public OutcomeTypeEnum getOutcomeType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOutcomeType(OutcomeTypeEnum outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set } /** @@ -617,6 +681,7 @@ public void setOutcomeType(OutcomeTypeEnum outcomeType) { */ public TransactionRule reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -640,6 +705,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -654,6 +720,7 @@ public void setReference(String reference) { */ public TransactionRule requestType(RequestTypeEnum requestType) { this.requestType = requestType; + isSetRequestType = true; // mark as set return this; } @@ -685,6 +752,7 @@ public RequestTypeEnum getRequestType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestType(RequestTypeEnum requestType) { this.requestType = requestType; + isSetRequestType = true; // mark as set } /** @@ -695,6 +763,7 @@ public void setRequestType(RequestTypeEnum requestType) { */ public TransactionRule ruleRestrictions(TransactionRuleRestrictions ruleRestrictions) { this.ruleRestrictions = ruleRestrictions; + isSetRuleRestrictions = true; // mark as set return this; } @@ -718,6 +787,7 @@ public TransactionRuleRestrictions getRuleRestrictions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRuleRestrictions(TransactionRuleRestrictions ruleRestrictions) { this.ruleRestrictions = ruleRestrictions; + isSetRuleRestrictions = true; // mark as set } /** @@ -732,6 +802,7 @@ public void setRuleRestrictions(TransactionRuleRestrictions ruleRestrictions) { */ public TransactionRule score(Integer score) { this.score = score; + isSetScore = true; // mark as set return this; } @@ -763,6 +834,7 @@ public Integer getScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScore(Integer score) { this.score = score; + isSetScore = true; // mark as set } /** @@ -778,6 +850,7 @@ public void setScore(Integer score) { */ public TransactionRule startDate(String startDate) { this.startDate = startDate; + isSetStartDate = true; // mark as set return this; } @@ -811,6 +884,7 @@ public String getStartDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartDate(String startDate) { this.startDate = startDate; + isSetStartDate = true; // mark as set } /** @@ -825,6 +899,7 @@ public void setStartDate(String startDate) { */ public TransactionRule status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -856,6 +931,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -878,6 +954,7 @@ public void setStatus(StatusEnum status) { */ public TransactionRule type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -925,6 +1002,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 TransactionRule 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 TransactionRule object is equal to o. */ @@ -1004,6 +1102,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 (isSetAggregationLevel) { + addIfNull(nulls, JSON_PROPERTY_AGGREGATION_LEVEL, this.aggregationLevel); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetEndDate) { + addIfNull(nulls, JSON_PROPERTY_END_DATE, this.endDate); + } + if (isSetEntityKey) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_KEY, this.entityKey); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetInterval) { + addIfNull(nulls, JSON_PROPERTY_INTERVAL, this.interval); + } + if (isSetOutcomeType) { + addIfNull(nulls, JSON_PROPERTY_OUTCOME_TYPE, this.outcomeType); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetRequestType) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_TYPE, this.requestType); + } + if (isSetRuleRestrictions) { + addIfNull(nulls, JSON_PROPERTY_RULE_RESTRICTIONS, this.ruleRestrictions); + } + if (isSetScore) { + addIfNull(nulls, JSON_PROPERTY_SCORE, this.score); + } + if (isSetStartDate) { + addIfNull(nulls, JSON_PROPERTY_START_DATE, this.startDate); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + 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 TransactionRule given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleEntityKey.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleEntityKey.java index 1a0616f80..a9e17aaa4 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleEntityKey.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleEntityKey.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 TransactionRuleEntityKey { public static final String JSON_PROPERTY_ENTITY_REFERENCE = "entityReference"; private String entityReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityReference = false; + public static final String JSON_PROPERTY_ENTITY_TYPE = "entityType"; private String entityType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRuleEntityKey() {} /** @@ -39,6 +53,7 @@ public TransactionRuleEntityKey() {} */ public TransactionRuleEntityKey entityReference(String entityReference) { this.entityReference = entityReference; + isSetEntityReference = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getEntityReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityReference(String entityReference) { this.entityReference = entityReference; + isSetEntityReference = true; // mark as set } /** @@ -75,6 +91,7 @@ public void setEntityReference(String entityReference) { */ public TransactionRuleEntityKey entityType(String entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set return this; } @@ -104,6 +121,27 @@ public String getEntityType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityType(String entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRuleEntityKey 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 TransactionRuleEntityKey object is equal to o. */ @@ -145,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 (isSetEntityReference) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_REFERENCE, this.entityReference); + } + if (isSetEntityType) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_TYPE, this.entityType); + } + + 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 TransactionRuleEntityKey given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java index f80632c35..98b8e6a31 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,18 +43,33 @@ public class TransactionRuleInfo { public static final String JSON_PROPERTY_AGGREGATION_LEVEL = "aggregationLevel"; private String aggregationLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAggregationLevel = 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_END_DATE = "endDate"; private String endDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndDate = false; + public static final String JSON_PROPERTY_ENTITY_KEY = "entityKey"; private TransactionRuleEntityKey entityKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityKey = false; + public static final String JSON_PROPERTY_INTERVAL = "interval"; private TransactionRuleInterval interval; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInterval = false; + /** * The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied * when a transaction meets the conditions of the rule. Possible values: * **hardBlock** @@ -111,9 +128,15 @@ public static OutcomeTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_OUTCOME_TYPE = "outcomeType"; private OutcomeTypeEnum outcomeType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutcomeType = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * Indicates the type of request to which the rule applies. If not provided, by default, this is * set to **authorization**. Possible values: **authorization**, **authentication**, @@ -166,15 +189,27 @@ public static RequestTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_REQUEST_TYPE = "requestType"; private RequestTypeEnum requestType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestType = false; + public static final String JSON_PROPERTY_RULE_RESTRICTIONS = "ruleRestrictions"; private TransactionRuleRestrictions ruleRestrictions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRuleRestrictions = false; + public static final String JSON_PROPERTY_SCORE = "score"; private Integer score; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScore = false; + public static final String JSON_PROPERTY_START_DATE = "startDate"; private String startDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartDate = false; + /** * The status of the transaction rule. If you provide a `startDate` in the request, the * rule is automatically created with an **active** status. Possible values: **active**, @@ -223,6 +258,9 @@ 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; + /** * The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which defines * if a rule blocks transactions based on individual characteristics or accumulates data. Possible @@ -279,6 +317,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 TransactionRuleInfo() {} /** @@ -299,6 +346,7 @@ public TransactionRuleInfo() {} */ public TransactionRuleInfo aggregationLevel(String aggregationLevel) { this.aggregationLevel = aggregationLevel; + isSetAggregationLevel = true; // mark as set return this; } @@ -342,6 +390,7 @@ public String getAggregationLevel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAggregationLevel(String aggregationLevel) { this.aggregationLevel = aggregationLevel; + isSetAggregationLevel = true; // mark as set } /** @@ -352,6 +401,7 @@ public void setAggregationLevel(String aggregationLevel) { */ public TransactionRuleInfo description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -375,6 +425,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -389,6 +440,7 @@ public void setDescription(String description) { */ public TransactionRuleInfo endDate(String endDate) { this.endDate = endDate; + isSetEndDate = true; // mark as set return this; } @@ -420,6 +472,7 @@ public String getEndDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndDate(String endDate) { this.endDate = endDate; + isSetEndDate = true; // mark as set } /** @@ -430,6 +483,7 @@ public void setEndDate(String endDate) { */ public TransactionRuleInfo entityKey(TransactionRuleEntityKey entityKey) { this.entityKey = entityKey; + isSetEntityKey = true; // mark as set return this; } @@ -453,6 +507,7 @@ public TransactionRuleEntityKey getEntityKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityKey(TransactionRuleEntityKey entityKey) { this.entityKey = entityKey; + isSetEntityKey = true; // mark as set } /** @@ -463,6 +518,7 @@ public void setEntityKey(TransactionRuleEntityKey entityKey) { */ public TransactionRuleInfo interval(TransactionRuleInterval interval) { this.interval = interval; + isSetInterval = true; // mark as set return this; } @@ -486,6 +542,7 @@ public TransactionRuleInterval getInterval() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInterval(TransactionRuleInterval interval) { this.interval = interval; + isSetInterval = true; // mark as set } /** @@ -513,6 +570,7 @@ public void setInterval(TransactionRuleInterval interval) { */ public TransactionRuleInfo outcomeType(OutcomeTypeEnum outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set return this; } @@ -570,6 +628,7 @@ public OutcomeTypeEnum getOutcomeType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOutcomeType(OutcomeTypeEnum outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set } /** @@ -580,6 +639,7 @@ public void setOutcomeType(OutcomeTypeEnum outcomeType) { */ public TransactionRuleInfo reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -603,6 +663,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -617,6 +678,7 @@ public void setReference(String reference) { */ public TransactionRuleInfo requestType(RequestTypeEnum requestType) { this.requestType = requestType; + isSetRequestType = true; // mark as set return this; } @@ -648,6 +710,7 @@ public RequestTypeEnum getRequestType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestType(RequestTypeEnum requestType) { this.requestType = requestType; + isSetRequestType = true; // mark as set } /** @@ -658,6 +721,7 @@ public void setRequestType(RequestTypeEnum requestType) { */ public TransactionRuleInfo ruleRestrictions(TransactionRuleRestrictions ruleRestrictions) { this.ruleRestrictions = ruleRestrictions; + isSetRuleRestrictions = true; // mark as set return this; } @@ -681,6 +745,7 @@ public TransactionRuleRestrictions getRuleRestrictions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRuleRestrictions(TransactionRuleRestrictions ruleRestrictions) { this.ruleRestrictions = ruleRestrictions; + isSetRuleRestrictions = true; // mark as set } /** @@ -695,6 +760,7 @@ public void setRuleRestrictions(TransactionRuleRestrictions ruleRestrictions) { */ public TransactionRuleInfo score(Integer score) { this.score = score; + isSetScore = true; // mark as set return this; } @@ -726,6 +792,7 @@ public Integer getScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScore(Integer score) { this.score = score; + isSetScore = true; // mark as set } /** @@ -741,6 +808,7 @@ public void setScore(Integer score) { */ public TransactionRuleInfo startDate(String startDate) { this.startDate = startDate; + isSetStartDate = true; // mark as set return this; } @@ -774,6 +842,7 @@ public String getStartDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartDate(String startDate) { this.startDate = startDate; + isSetStartDate = true; // mark as set } /** @@ -788,6 +857,7 @@ public void setStartDate(String startDate) { */ public TransactionRuleInfo status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -819,6 +889,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -841,6 +912,7 @@ public void setStatus(StatusEnum status) { */ public TransactionRuleInfo type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -888,6 +960,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 TransactionRuleInfo 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 TransactionRuleInfo object is equal to o. */ @@ -964,6 +1057,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 (isSetAggregationLevel) { + addIfNull(nulls, JSON_PROPERTY_AGGREGATION_LEVEL, this.aggregationLevel); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetEndDate) { + addIfNull(nulls, JSON_PROPERTY_END_DATE, this.endDate); + } + if (isSetEntityKey) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_KEY, this.entityKey); + } + if (isSetInterval) { + addIfNull(nulls, JSON_PROPERTY_INTERVAL, this.interval); + } + if (isSetOutcomeType) { + addIfNull(nulls, JSON_PROPERTY_OUTCOME_TYPE, this.outcomeType); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetRequestType) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_TYPE, this.requestType); + } + if (isSetRuleRestrictions) { + addIfNull(nulls, JSON_PROPERTY_RULE_RESTRICTIONS, this.ruleRestrictions); + } + if (isSetScore) { + addIfNull(nulls, JSON_PROPERTY_SCORE, this.score); + } + if (isSetStartDate) { + addIfNull(nulls, JSON_PROPERTY_START_DATE, this.startDate); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + 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 TransactionRuleInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInterval.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInterval.java index e9ecdc45d..e5745783c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInterval.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInterval.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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 TransactionRuleInterval { public static final String JSON_PROPERTY_DAY_OF_MONTH = "dayOfMonth"; private Integer dayOfMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDayOfMonth = false; + /** * The day of week, used when the `duration.unit` is **weeks**. If not provided, by * default, this is set to **monday**. Possible values: **sunday**, **monday**, **tuesday**, @@ -92,15 +97,27 @@ public static DayOfWeekEnum fromValue(String value) { public static final String JSON_PROPERTY_DAY_OF_WEEK = "dayOfWeek"; private DayOfWeekEnum dayOfWeek; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDayOfWeek = false; + public static final String JSON_PROPERTY_DURATION = "duration"; private Duration duration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDuration = false; + public static final String JSON_PROPERTY_TIME_OF_DAY = "timeOfDay"; private String timeOfDay; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeOfDay = false; + public static final String JSON_PROPERTY_TIME_ZONE = "timeZone"; private String timeZone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZone = false; + /** * The [type of interval](https://docs.adyen.com/issuing/transaction-rules#time-intervals) during * which the rule conditions and limits apply, and how often counters are reset. Possible values: @@ -167,6 +184,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 TransactionRuleInterval() {} /** @@ -179,6 +205,7 @@ public TransactionRuleInterval() {} */ public TransactionRuleInterval dayOfMonth(Integer dayOfMonth) { this.dayOfMonth = dayOfMonth; + isSetDayOfMonth = true; // mark as set return this; } @@ -206,6 +233,7 @@ public Integer getDayOfMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDayOfMonth(Integer dayOfMonth) { this.dayOfMonth = dayOfMonth; + isSetDayOfMonth = true; // mark as set } /** @@ -220,6 +248,7 @@ public void setDayOfMonth(Integer dayOfMonth) { */ public TransactionRuleInterval dayOfWeek(DayOfWeekEnum dayOfWeek) { this.dayOfWeek = dayOfWeek; + isSetDayOfWeek = true; // mark as set return this; } @@ -251,6 +280,7 @@ public DayOfWeekEnum getDayOfWeek() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDayOfWeek(DayOfWeekEnum dayOfWeek) { this.dayOfWeek = dayOfWeek; + isSetDayOfWeek = true; // mark as set } /** @@ -261,6 +291,7 @@ public void setDayOfWeek(DayOfWeekEnum dayOfWeek) { */ public TransactionRuleInterval duration(Duration duration) { this.duration = duration; + isSetDuration = true; // mark as set return this; } @@ -284,6 +315,7 @@ public Duration getDuration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDuration(Duration duration) { this.duration = duration; + isSetDuration = true; // mark as set } /** @@ -297,6 +329,7 @@ public void setDuration(Duration duration) { */ public TransactionRuleInterval timeOfDay(String timeOfDay) { this.timeOfDay = timeOfDay; + isSetTimeOfDay = true; // mark as set return this; } @@ -326,6 +359,7 @@ public String getTimeOfDay() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeOfDay(String timeOfDay) { this.timeOfDay = timeOfDay; + isSetTimeOfDay = true; // mark as set } /** @@ -338,6 +372,7 @@ public void setTimeOfDay(String timeOfDay) { */ public TransactionRuleInterval timeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set return this; } @@ -365,6 +400,7 @@ public String getTimeZone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set } /** @@ -397,6 +433,7 @@ public void setTimeZone(String timeZone) { */ public TransactionRuleInterval type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -464,6 +501,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 TransactionRuleInterval 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 TransactionRuleInterval object is equal to o. */ @@ -513,6 +571,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 (isSetDayOfMonth) { + addIfNull(nulls, JSON_PROPERTY_DAY_OF_MONTH, this.dayOfMonth); + } + if (isSetDayOfWeek) { + addIfNull(nulls, JSON_PROPERTY_DAY_OF_WEEK, this.dayOfWeek); + } + if (isSetDuration) { + addIfNull(nulls, JSON_PROPERTY_DURATION, this.duration); + } + if (isSetTimeOfDay) { + addIfNull(nulls, JSON_PROPERTY_TIME_OF_DAY, this.timeOfDay); + } + if (isSetTimeZone) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE, this.timeZone); + } + 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 TransactionRuleInterval given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleResponse.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleResponse.java index 71abff1aa..2d06ba6da 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 TransactionRuleResponse { public static final String JSON_PROPERTY_TRANSACTION_RULE = "transactionRule"; private TransactionRule transactionRule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRule = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRuleResponse() {} /** @@ -33,6 +44,7 @@ public TransactionRuleResponse() {} */ public TransactionRuleResponse transactionRule(TransactionRule transactionRule) { this.transactionRule = transactionRule; + isSetTransactionRule = true; // mark as set return this; } @@ -56,6 +68,27 @@ public TransactionRule getTransactionRule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRule(TransactionRule transactionRule) { this.transactionRule = transactionRule; + isSetTransactionRule = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRuleResponse 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 TransactionRuleResponse object is equal to o. */ @@ -95,6 +128,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 (isSetTransactionRule) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULE, this.transactionRule); + } + + 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 TransactionRuleResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java index 82b143bc8..5eef44649 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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; @@ -49,81 +51,162 @@ public class TransactionRuleRestrictions { public static final String JSON_PROPERTY_ACTIVE_NETWORK_TOKENS = "activeNetworkTokens"; private ActiveNetworkTokensRestriction activeNetworkTokens; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetActiveNetworkTokens = false; + public static final String JSON_PROPERTY_BRAND_VARIANTS = "brandVariants"; private BrandVariantsRestriction brandVariants; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrandVariants = false; + public static final String JSON_PROPERTY_COUNTERPARTY_BANK = "counterpartyBank"; private CounterpartyBankRestriction counterpartyBank; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterpartyBank = false; + public static final String JSON_PROPERTY_COUNTERPARTY_TYPES = "counterpartyTypes"; private CounterpartyTypesRestriction counterpartyTypes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterpartyTypes = false; + public static final String JSON_PROPERTY_COUNTRIES = "countries"; private CountriesRestriction countries; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountries = false; + public static final String JSON_PROPERTY_DAY_OF_WEEK = "dayOfWeek"; private DayOfWeekRestriction dayOfWeek; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDayOfWeek = false; + public static final String JSON_PROPERTY_DIFFERENT_CURRENCIES = "differentCurrencies"; private DifferentCurrenciesRestriction differentCurrencies; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDifferentCurrencies = false; + public static final String JSON_PROPERTY_ENTRY_MODES = "entryModes"; private EntryModesRestriction entryModes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntryModes = false; + public static final String JSON_PROPERTY_INTERNATIONAL_TRANSACTION = "internationalTransaction"; private InternationalTransactionRestriction internationalTransaction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInternationalTransaction = false; + public static final String JSON_PROPERTY_MATCHING_TRANSACTIONS = "matchingTransactions"; private MatchingTransactionsRestriction matchingTransactions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMatchingTransactions = false; + public static final String JSON_PROPERTY_MATCHING_VALUES = "matchingValues"; private MatchingValuesRestriction matchingValues; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMatchingValues = false; + public static final String JSON_PROPERTY_MCCS = "mccs"; private MccsRestriction mccs; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMccs = false; + public static final String JSON_PROPERTY_MERCHANT_NAMES = "merchantNames"; private MerchantNamesRestriction merchantNames; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantNames = false; + public static final String JSON_PROPERTY_MERCHANTS = "merchants"; private MerchantsRestriction merchants; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchants = false; + public static final String JSON_PROPERTY_PROCESSING_TYPES = "processingTypes"; private ProcessingTypesRestriction processingTypes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProcessingTypes = false; + public static final String JSON_PROPERTY_RISK_SCORES = "riskScores"; private RiskScoresRestriction riskScores; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskScores = false; + public static final String JSON_PROPERTY_SAME_AMOUNT_RESTRICTION = "sameAmountRestriction"; private SameAmountRestriction sameAmountRestriction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSameAmountRestriction = false; + public static final String JSON_PROPERTY_SAME_COUNTERPARTY_RESTRICTION = "sameCounterpartyRestriction"; private SameCounterpartyRestriction sameCounterpartyRestriction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSameCounterpartyRestriction = false; + public static final String JSON_PROPERTY_SOURCE_ACCOUNT_TYPES = "sourceAccountTypes"; private SourceAccountTypesRestriction sourceAccountTypes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSourceAccountTypes = false; + public static final String JSON_PROPERTY_TIME_OF_DAY = "timeOfDay"; private TimeOfDayRestriction timeOfDay; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeOfDay = false; + public static final String JSON_PROPERTY_TOKEN_REQUESTORS = "tokenRequestors"; private TokenRequestorsRestriction tokenRequestors; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenRequestors = false; + public static final String JSON_PROPERTY_TOTAL_AMOUNT = "totalAmount"; private TotalAmountRestriction totalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalAmount = false; + public static final String JSON_PROPERTY_WALLET_PROVIDER_ACCOUNT_SCORE = "walletProviderAccountScore"; private WalletProviderAccountScoreRestriction walletProviderAccountScore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWalletProviderAccountScore = false; + public static final String JSON_PROPERTY_WALLET_PROVIDER_DEVICE_SCORE = "walletProviderDeviceScore"; private WalletProviderDeviceScore walletProviderDeviceScore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWalletProviderDeviceScore = false; + public static final String JSON_PROPERTY_WALLET_PROVIDER_DEVICE_TYPE = "walletProviderDeviceType"; private WalletProviderDeviceType walletProviderDeviceType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWalletProviderDeviceType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRuleRestrictions() {} /** @@ -135,6 +218,7 @@ public TransactionRuleRestrictions() {} public TransactionRuleRestrictions activeNetworkTokens( ActiveNetworkTokensRestriction activeNetworkTokens) { this.activeNetworkTokens = activeNetworkTokens; + isSetActiveNetworkTokens = true; // mark as set return this; } @@ -158,6 +242,7 @@ public ActiveNetworkTokensRestriction getActiveNetworkTokens() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setActiveNetworkTokens(ActiveNetworkTokensRestriction activeNetworkTokens) { this.activeNetworkTokens = activeNetworkTokens; + isSetActiveNetworkTokens = true; // mark as set } /** @@ -168,6 +253,7 @@ public void setActiveNetworkTokens(ActiveNetworkTokensRestriction activeNetworkT */ public TransactionRuleRestrictions brandVariants(BrandVariantsRestriction brandVariants) { this.brandVariants = brandVariants; + isSetBrandVariants = true; // mark as set return this; } @@ -191,6 +277,7 @@ public BrandVariantsRestriction getBrandVariants() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrandVariants(BrandVariantsRestriction brandVariants) { this.brandVariants = brandVariants; + isSetBrandVariants = true; // mark as set } /** @@ -202,6 +289,7 @@ public void setBrandVariants(BrandVariantsRestriction brandVariants) { public TransactionRuleRestrictions counterpartyBank( CounterpartyBankRestriction counterpartyBank) { this.counterpartyBank = counterpartyBank; + isSetCounterpartyBank = true; // mark as set return this; } @@ -225,6 +313,7 @@ public CounterpartyBankRestriction getCounterpartyBank() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterpartyBank(CounterpartyBankRestriction counterpartyBank) { this.counterpartyBank = counterpartyBank; + isSetCounterpartyBank = true; // mark as set } /** @@ -236,6 +325,7 @@ public void setCounterpartyBank(CounterpartyBankRestriction counterpartyBank) { public TransactionRuleRestrictions counterpartyTypes( CounterpartyTypesRestriction counterpartyTypes) { this.counterpartyTypes = counterpartyTypes; + isSetCounterpartyTypes = true; // mark as set return this; } @@ -259,6 +349,7 @@ public CounterpartyTypesRestriction getCounterpartyTypes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterpartyTypes(CounterpartyTypesRestriction counterpartyTypes) { this.counterpartyTypes = counterpartyTypes; + isSetCounterpartyTypes = true; // mark as set } /** @@ -269,6 +360,7 @@ public void setCounterpartyTypes(CounterpartyTypesRestriction counterpartyTypes) */ public TransactionRuleRestrictions countries(CountriesRestriction countries) { this.countries = countries; + isSetCountries = true; // mark as set return this; } @@ -292,6 +384,7 @@ public CountriesRestriction getCountries() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountries(CountriesRestriction countries) { this.countries = countries; + isSetCountries = true; // mark as set } /** @@ -302,6 +395,7 @@ public void setCountries(CountriesRestriction countries) { */ public TransactionRuleRestrictions dayOfWeek(DayOfWeekRestriction dayOfWeek) { this.dayOfWeek = dayOfWeek; + isSetDayOfWeek = true; // mark as set return this; } @@ -325,6 +419,7 @@ public DayOfWeekRestriction getDayOfWeek() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDayOfWeek(DayOfWeekRestriction dayOfWeek) { this.dayOfWeek = dayOfWeek; + isSetDayOfWeek = true; // mark as set } /** @@ -336,6 +431,7 @@ public void setDayOfWeek(DayOfWeekRestriction dayOfWeek) { public TransactionRuleRestrictions differentCurrencies( DifferentCurrenciesRestriction differentCurrencies) { this.differentCurrencies = differentCurrencies; + isSetDifferentCurrencies = true; // mark as set return this; } @@ -359,6 +455,7 @@ public DifferentCurrenciesRestriction getDifferentCurrencies() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDifferentCurrencies(DifferentCurrenciesRestriction differentCurrencies) { this.differentCurrencies = differentCurrencies; + isSetDifferentCurrencies = true; // mark as set } /** @@ -369,6 +466,7 @@ public void setDifferentCurrencies(DifferentCurrenciesRestriction differentCurre */ public TransactionRuleRestrictions entryModes(EntryModesRestriction entryModes) { this.entryModes = entryModes; + isSetEntryModes = true; // mark as set return this; } @@ -392,6 +490,7 @@ public EntryModesRestriction getEntryModes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntryModes(EntryModesRestriction entryModes) { this.entryModes = entryModes; + isSetEntryModes = true; // mark as set } /** @@ -403,6 +502,7 @@ public void setEntryModes(EntryModesRestriction entryModes) { public TransactionRuleRestrictions internationalTransaction( InternationalTransactionRestriction internationalTransaction) { this.internationalTransaction = internationalTransaction; + isSetInternationalTransaction = true; // mark as set return this; } @@ -427,6 +527,7 @@ public InternationalTransactionRestriction getInternationalTransaction() { public void setInternationalTransaction( InternationalTransactionRestriction internationalTransaction) { this.internationalTransaction = internationalTransaction; + isSetInternationalTransaction = true; // mark as set } /** @@ -438,6 +539,7 @@ public void setInternationalTransaction( public TransactionRuleRestrictions matchingTransactions( MatchingTransactionsRestriction matchingTransactions) { this.matchingTransactions = matchingTransactions; + isSetMatchingTransactions = true; // mark as set return this; } @@ -461,6 +563,7 @@ public MatchingTransactionsRestriction getMatchingTransactions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMatchingTransactions(MatchingTransactionsRestriction matchingTransactions) { this.matchingTransactions = matchingTransactions; + isSetMatchingTransactions = true; // mark as set } /** @@ -471,6 +574,7 @@ public void setMatchingTransactions(MatchingTransactionsRestriction matchingTran */ public TransactionRuleRestrictions matchingValues(MatchingValuesRestriction matchingValues) { this.matchingValues = matchingValues; + isSetMatchingValues = true; // mark as set return this; } @@ -494,6 +598,7 @@ public MatchingValuesRestriction getMatchingValues() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMatchingValues(MatchingValuesRestriction matchingValues) { this.matchingValues = matchingValues; + isSetMatchingValues = true; // mark as set } /** @@ -504,6 +609,7 @@ public void setMatchingValues(MatchingValuesRestriction matchingValues) { */ public TransactionRuleRestrictions mccs(MccsRestriction mccs) { this.mccs = mccs; + isSetMccs = true; // mark as set return this; } @@ -527,6 +633,7 @@ public MccsRestriction getMccs() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMccs(MccsRestriction mccs) { this.mccs = mccs; + isSetMccs = true; // mark as set } /** @@ -537,6 +644,7 @@ public void setMccs(MccsRestriction mccs) { */ public TransactionRuleRestrictions merchantNames(MerchantNamesRestriction merchantNames) { this.merchantNames = merchantNames; + isSetMerchantNames = true; // mark as set return this; } @@ -560,6 +668,7 @@ public MerchantNamesRestriction getMerchantNames() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantNames(MerchantNamesRestriction merchantNames) { this.merchantNames = merchantNames; + isSetMerchantNames = true; // mark as set } /** @@ -570,6 +679,7 @@ public void setMerchantNames(MerchantNamesRestriction merchantNames) { */ public TransactionRuleRestrictions merchants(MerchantsRestriction merchants) { this.merchants = merchants; + isSetMerchants = true; // mark as set return this; } @@ -593,6 +703,7 @@ public MerchantsRestriction getMerchants() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchants(MerchantsRestriction merchants) { this.merchants = merchants; + isSetMerchants = true; // mark as set } /** @@ -603,6 +714,7 @@ public void setMerchants(MerchantsRestriction merchants) { */ public TransactionRuleRestrictions processingTypes(ProcessingTypesRestriction processingTypes) { this.processingTypes = processingTypes; + isSetProcessingTypes = true; // mark as set return this; } @@ -626,6 +738,7 @@ public ProcessingTypesRestriction getProcessingTypes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProcessingTypes(ProcessingTypesRestriction processingTypes) { this.processingTypes = processingTypes; + isSetProcessingTypes = true; // mark as set } /** @@ -636,6 +749,7 @@ public void setProcessingTypes(ProcessingTypesRestriction processingTypes) { */ public TransactionRuleRestrictions riskScores(RiskScoresRestriction riskScores) { this.riskScores = riskScores; + isSetRiskScores = true; // mark as set return this; } @@ -659,6 +773,7 @@ public RiskScoresRestriction getRiskScores() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskScores(RiskScoresRestriction riskScores) { this.riskScores = riskScores; + isSetRiskScores = true; // mark as set } /** @@ -670,6 +785,7 @@ public void setRiskScores(RiskScoresRestriction riskScores) { public TransactionRuleRestrictions sameAmountRestriction( SameAmountRestriction sameAmountRestriction) { this.sameAmountRestriction = sameAmountRestriction; + isSetSameAmountRestriction = true; // mark as set return this; } @@ -693,6 +809,7 @@ public SameAmountRestriction getSameAmountRestriction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSameAmountRestriction(SameAmountRestriction sameAmountRestriction) { this.sameAmountRestriction = sameAmountRestriction; + isSetSameAmountRestriction = true; // mark as set } /** @@ -704,6 +821,7 @@ public void setSameAmountRestriction(SameAmountRestriction sameAmountRestriction public TransactionRuleRestrictions sameCounterpartyRestriction( SameCounterpartyRestriction sameCounterpartyRestriction) { this.sameCounterpartyRestriction = sameCounterpartyRestriction; + isSetSameCounterpartyRestriction = true; // mark as set return this; } @@ -728,6 +846,7 @@ public SameCounterpartyRestriction getSameCounterpartyRestriction() { public void setSameCounterpartyRestriction( SameCounterpartyRestriction sameCounterpartyRestriction) { this.sameCounterpartyRestriction = sameCounterpartyRestriction; + isSetSameCounterpartyRestriction = true; // mark as set } /** @@ -739,6 +858,7 @@ public void setSameCounterpartyRestriction( public TransactionRuleRestrictions sourceAccountTypes( SourceAccountTypesRestriction sourceAccountTypes) { this.sourceAccountTypes = sourceAccountTypes; + isSetSourceAccountTypes = true; // mark as set return this; } @@ -762,6 +882,7 @@ public SourceAccountTypesRestriction getSourceAccountTypes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSourceAccountTypes(SourceAccountTypesRestriction sourceAccountTypes) { this.sourceAccountTypes = sourceAccountTypes; + isSetSourceAccountTypes = true; // mark as set } /** @@ -772,6 +893,7 @@ public void setSourceAccountTypes(SourceAccountTypesRestriction sourceAccountTyp */ public TransactionRuleRestrictions timeOfDay(TimeOfDayRestriction timeOfDay) { this.timeOfDay = timeOfDay; + isSetTimeOfDay = true; // mark as set return this; } @@ -795,6 +917,7 @@ public TimeOfDayRestriction getTimeOfDay() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeOfDay(TimeOfDayRestriction timeOfDay) { this.timeOfDay = timeOfDay; + isSetTimeOfDay = true; // mark as set } /** @@ -805,6 +928,7 @@ public void setTimeOfDay(TimeOfDayRestriction timeOfDay) { */ public TransactionRuleRestrictions tokenRequestors(TokenRequestorsRestriction tokenRequestors) { this.tokenRequestors = tokenRequestors; + isSetTokenRequestors = true; // mark as set return this; } @@ -828,6 +952,7 @@ public TokenRequestorsRestriction getTokenRequestors() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenRequestors(TokenRequestorsRestriction tokenRequestors) { this.tokenRequestors = tokenRequestors; + isSetTokenRequestors = true; // mark as set } /** @@ -838,6 +963,7 @@ public void setTokenRequestors(TokenRequestorsRestriction tokenRequestors) { */ public TransactionRuleRestrictions totalAmount(TotalAmountRestriction totalAmount) { this.totalAmount = totalAmount; + isSetTotalAmount = true; // mark as set return this; } @@ -861,6 +987,7 @@ public TotalAmountRestriction getTotalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTotalAmount(TotalAmountRestriction totalAmount) { this.totalAmount = totalAmount; + isSetTotalAmount = true; // mark as set } /** @@ -872,6 +999,7 @@ public void setTotalAmount(TotalAmountRestriction totalAmount) { public TransactionRuleRestrictions walletProviderAccountScore( WalletProviderAccountScoreRestriction walletProviderAccountScore) { this.walletProviderAccountScore = walletProviderAccountScore; + isSetWalletProviderAccountScore = true; // mark as set return this; } @@ -896,6 +1024,7 @@ public WalletProviderAccountScoreRestriction getWalletProviderAccountScore() { public void setWalletProviderAccountScore( WalletProviderAccountScoreRestriction walletProviderAccountScore) { this.walletProviderAccountScore = walletProviderAccountScore; + isSetWalletProviderAccountScore = true; // mark as set } /** @@ -907,6 +1036,7 @@ public void setWalletProviderAccountScore( public TransactionRuleRestrictions walletProviderDeviceScore( WalletProviderDeviceScore walletProviderDeviceScore) { this.walletProviderDeviceScore = walletProviderDeviceScore; + isSetWalletProviderDeviceScore = true; // mark as set return this; } @@ -930,6 +1060,7 @@ public WalletProviderDeviceScore getWalletProviderDeviceScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWalletProviderDeviceScore(WalletProviderDeviceScore walletProviderDeviceScore) { this.walletProviderDeviceScore = walletProviderDeviceScore; + isSetWalletProviderDeviceScore = true; // mark as set } /** @@ -941,6 +1072,7 @@ public void setWalletProviderDeviceScore(WalletProviderDeviceScore walletProvide public TransactionRuleRestrictions walletProviderDeviceType( WalletProviderDeviceType walletProviderDeviceType) { this.walletProviderDeviceType = walletProviderDeviceType; + isSetWalletProviderDeviceType = true; // mark as set return this; } @@ -964,6 +1096,27 @@ public WalletProviderDeviceType getWalletProviderDeviceType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWalletProviderDeviceType(WalletProviderDeviceType walletProviderDeviceType) { this.walletProviderDeviceType = walletProviderDeviceType; + isSetWalletProviderDeviceType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRuleRestrictions 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 TransactionRuleRestrictions object is equal to o. */ @@ -1102,6 +1255,104 @@ 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 (isSetActiveNetworkTokens) { + addIfNull(nulls, JSON_PROPERTY_ACTIVE_NETWORK_TOKENS, this.activeNetworkTokens); + } + if (isSetBrandVariants) { + addIfNull(nulls, JSON_PROPERTY_BRAND_VARIANTS, this.brandVariants); + } + if (isSetCounterpartyBank) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY_BANK, this.counterpartyBank); + } + if (isSetCounterpartyTypes) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY_TYPES, this.counterpartyTypes); + } + if (isSetCountries) { + addIfNull(nulls, JSON_PROPERTY_COUNTRIES, this.countries); + } + if (isSetDayOfWeek) { + addIfNull(nulls, JSON_PROPERTY_DAY_OF_WEEK, this.dayOfWeek); + } + if (isSetDifferentCurrencies) { + addIfNull(nulls, JSON_PROPERTY_DIFFERENT_CURRENCIES, this.differentCurrencies); + } + if (isSetEntryModes) { + addIfNull(nulls, JSON_PROPERTY_ENTRY_MODES, this.entryModes); + } + if (isSetInternationalTransaction) { + addIfNull(nulls, JSON_PROPERTY_INTERNATIONAL_TRANSACTION, this.internationalTransaction); + } + if (isSetMatchingTransactions) { + addIfNull(nulls, JSON_PROPERTY_MATCHING_TRANSACTIONS, this.matchingTransactions); + } + if (isSetMatchingValues) { + addIfNull(nulls, JSON_PROPERTY_MATCHING_VALUES, this.matchingValues); + } + if (isSetMccs) { + addIfNull(nulls, JSON_PROPERTY_MCCS, this.mccs); + } + if (isSetMerchantNames) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_NAMES, this.merchantNames); + } + if (isSetMerchants) { + addIfNull(nulls, JSON_PROPERTY_MERCHANTS, this.merchants); + } + if (isSetProcessingTypes) { + addIfNull(nulls, JSON_PROPERTY_PROCESSING_TYPES, this.processingTypes); + } + if (isSetRiskScores) { + addIfNull(nulls, JSON_PROPERTY_RISK_SCORES, this.riskScores); + } + if (isSetSameAmountRestriction) { + addIfNull(nulls, JSON_PROPERTY_SAME_AMOUNT_RESTRICTION, this.sameAmountRestriction); + } + if (isSetSameCounterpartyRestriction) { + addIfNull( + nulls, JSON_PROPERTY_SAME_COUNTERPARTY_RESTRICTION, this.sameCounterpartyRestriction); + } + if (isSetSourceAccountTypes) { + addIfNull(nulls, JSON_PROPERTY_SOURCE_ACCOUNT_TYPES, this.sourceAccountTypes); + } + if (isSetTimeOfDay) { + addIfNull(nulls, JSON_PROPERTY_TIME_OF_DAY, this.timeOfDay); + } + if (isSetTokenRequestors) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_REQUESTORS, this.tokenRequestors); + } + if (isSetTotalAmount) { + addIfNull(nulls, JSON_PROPERTY_TOTAL_AMOUNT, this.totalAmount); + } + if (isSetWalletProviderAccountScore) { + addIfNull( + nulls, JSON_PROPERTY_WALLET_PROVIDER_ACCOUNT_SCORE, this.walletProviderAccountScore); + } + if (isSetWalletProviderDeviceScore) { + addIfNull(nulls, JSON_PROPERTY_WALLET_PROVIDER_DEVICE_SCORE, this.walletProviderDeviceScore); + } + if (isSetWalletProviderDeviceType) { + addIfNull(nulls, JSON_PROPERTY_WALLET_PROVIDER_DEVICE_TYPE, this.walletProviderDeviceType); + } + + 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 TransactionRuleRestrictions given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java index cae4762b0..dddc2c2c9 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,6 +27,15 @@ public class TransactionRulesResponse { public static final String JSON_PROPERTY_TRANSACTION_RULES = "transactionRules"; private List transactionRules; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRules = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRulesResponse() {} /** @@ -35,6 +46,7 @@ public TransactionRulesResponse() {} */ public TransactionRulesResponse transactionRules(List transactionRules) { this.transactionRules = transactionRules; + isSetTransactionRules = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getTransactionRules() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRules(List transactionRules) { this.transactionRules = transactionRules; + isSetTransactionRules = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRulesResponse 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 TransactionRulesResponse object is equal to o. */ @@ -105,6 +138,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 (isSetTransactionRules) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULES, this.transactionRules); + } + + 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 TransactionRulesResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransferLimit.java b/src/main/java/com/adyen/model/balanceplatform/TransferLimit.java index 1b14a390b..fbbf043ba 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransferLimit.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransferLimit.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,30 +36,63 @@ public class TransferLimit { 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_ENDS_AT = "endsAt"; private OffsetDateTime endsAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndsAt = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_LIMIT_STATUS = "limitStatus"; private LimitStatus limitStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLimitStatus = 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_SCA_INFORMATION = "scaInformation"; private ScaInformation scaInformation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaInformation = false; + public static final String JSON_PROPERTY_SCOPE = "scope"; private Scope scope; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScope = false; + public static final String JSON_PROPERTY_STARTS_AT = "startsAt"; private OffsetDateTime startsAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartsAt = false; + public static final String JSON_PROPERTY_TRANSFER_TYPE = "transferType"; private TransferType transferType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferLimit() {} /** @@ -68,6 +103,7 @@ public TransferLimit() {} */ public TransferLimit amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -91,6 +127,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -105,6 +142,7 @@ public void setAmount(Amount amount) { */ public TransferLimit endsAt(OffsetDateTime endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set return this; } @@ -136,6 +174,7 @@ public OffsetDateTime getEndsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndsAt(OffsetDateTime endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set } /** @@ -146,6 +185,7 @@ public void setEndsAt(OffsetDateTime endsAt) { */ public TransferLimit id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -169,6 +209,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -179,6 +220,7 @@ public void setId(String id) { */ public TransferLimit limitStatus(LimitStatus limitStatus) { this.limitStatus = limitStatus; + isSetLimitStatus = true; // mark as set return this; } @@ -202,6 +244,7 @@ public LimitStatus getLimitStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLimitStatus(LimitStatus limitStatus) { this.limitStatus = limitStatus; + isSetLimitStatus = true; // mark as set } /** @@ -212,6 +255,7 @@ public void setLimitStatus(LimitStatus limitStatus) { */ public TransferLimit reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -235,6 +279,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -245,6 +290,7 @@ public void setReference(String reference) { */ public TransferLimit scaInformation(ScaInformation scaInformation) { this.scaInformation = scaInformation; + isSetScaInformation = true; // mark as set return this; } @@ -268,6 +314,7 @@ public ScaInformation getScaInformation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaInformation(ScaInformation scaInformation) { this.scaInformation = scaInformation; + isSetScaInformation = true; // mark as set } /** @@ -278,6 +325,7 @@ public void setScaInformation(ScaInformation scaInformation) { */ public TransferLimit scope(Scope scope) { this.scope = scope; + isSetScope = true; // mark as set return this; } @@ -301,6 +349,7 @@ public Scope getScope() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScope(Scope scope) { this.scope = scope; + isSetScope = true; // mark as set } /** @@ -315,6 +364,7 @@ public void setScope(Scope scope) { */ public TransferLimit startsAt(OffsetDateTime startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set return this; } @@ -346,6 +396,7 @@ public OffsetDateTime getStartsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartsAt(OffsetDateTime startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set } /** @@ -356,6 +407,7 @@ public void setStartsAt(OffsetDateTime startsAt) { */ public TransferLimit transferType(TransferType transferType) { this.transferType = transferType; + isSetTransferType = true; // mark as set return this; } @@ -379,6 +431,27 @@ public TransferType getTransferType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferType(TransferType transferType) { this.transferType = transferType; + isSetTransferType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferLimit 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 TransferLimit object is equal to o. */ @@ -435,6 +508,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 (isSetEndsAt) { + addIfNull(nulls, JSON_PROPERTY_ENDS_AT, this.endsAt); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLimitStatus) { + addIfNull(nulls, JSON_PROPERTY_LIMIT_STATUS, this.limitStatus); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetScaInformation) { + addIfNull(nulls, JSON_PROPERTY_SCA_INFORMATION, this.scaInformation); + } + if (isSetScope) { + addIfNull(nulls, JSON_PROPERTY_SCOPE, this.scope); + } + if (isSetStartsAt) { + addIfNull(nulls, JSON_PROPERTY_STARTS_AT, this.startsAt); + } + if (isSetTransferType) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_TYPE, this.transferType); + } + + 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 TransferLimit given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransferLimitListResponse.java b/src/main/java/com/adyen/model/balanceplatform/TransferLimitListResponse.java index e6cbc46d4..0680c6d9a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransferLimitListResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransferLimitListResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,6 +27,15 @@ public class TransferLimitListResponse { public static final String JSON_PROPERTY_TRANSFER_LIMITS = "transferLimits"; private List transferLimits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferLimits = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferLimitListResponse() {} /** @@ -35,6 +46,7 @@ public TransferLimitListResponse() {} */ public TransferLimitListResponse transferLimits(List transferLimits) { this.transferLimits = transferLimits; + isSetTransferLimits = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getTransferLimits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferLimits(List transferLimits) { this.transferLimits = transferLimits; + isSetTransferLimits = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferLimitListResponse 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 TransferLimitListResponse object is equal to o. */ @@ -105,6 +138,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 (isSetTransferLimits) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_LIMITS, this.transferLimits); + } + + 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 TransferLimitListResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransferRoute.java b/src/main/java/com/adyen/model/balanceplatform/TransferRoute.java index 723c0542e..783e44d8a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransferRoute.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransferRoute.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -96,22 +98,31 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = 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_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the - * fees that you have to pay. 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 + * fees that you have to pay. 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 United States and in [SEPA + * 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 { @@ -165,9 +176,21 @@ public static PriorityEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITY = "priority"; private PriorityEnum priority; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriority = false; + public static final String JSON_PROPERTY_REQUIREMENTS = "requirements"; private List requirements; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequirements = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferRoute() {} /** @@ -182,6 +205,7 @@ public TransferRoute() {} */ public TransferRoute category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } @@ -213,6 +237,7 @@ public CategoryEnum getCategory() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -225,6 +250,7 @@ public void setCategory(CategoryEnum category) { */ public TransferRoute country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -252,6 +278,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -263,6 +290,7 @@ public void setCountry(String country) { */ public TransferRoute currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -288,60 +316,62 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the - * fees that you have to pay. 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 + * fees that you have to pay. 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 United States and in [SEPA + * 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. 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 + * is sent and the fees that you have to pay. 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 United States and in + * 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 TransferRoute} instance, allowing for method chaining */ public TransferRoute priority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set return this; } /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the - * fees that you have to pay. 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 + * fees that you have to pay. 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 United States and in [SEPA + * 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. 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 + * is sent and the fees that you have to pay. 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 United States and in + * 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) @@ -352,32 +382,33 @@ 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. 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 + * fees that you have to pay. 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 United States and in [SEPA + * 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. 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 + * is sent and the fees that you have to pay. 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 United States and in + * 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) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set } /** @@ -394,6 +425,7 @@ public void setPriority(PriorityEnum priority) { */ public TransferRoute requirements(List requirements) { this.requirements = requirements; + isSetRequirements = true; // mark as set return this; } @@ -437,6 +469,27 @@ public List getRequirements() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequirements(List requirements) { this.requirements = requirements; + isSetRequirements = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferRoute 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 TransferRoute object is equal to o. */ @@ -484,6 +537,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 (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetPriority) { + addIfNull(nulls, JSON_PROPERTY_PRIORITY, this.priority); + } + if (isSetRequirements) { + addIfNull(nulls, JSON_PROPERTY_REQUIREMENTS, this.requirements); + } + + 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 TransferRoute given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransferRouteRequest.java b/src/main/java/com/adyen/model/balanceplatform/TransferRouteRequest.java index 0809b00a2..3de00e506 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransferRouteRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransferRouteRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,9 +39,15 @@ public class TransferRouteRequest { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + /** * The type of transfer. Possible values: - **bank**: Transfer to a [transfer * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) @@ -86,15 +94,27 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private Counterparty counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = 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_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + /** Gets or Sets priorities */ public enum PrioritiesEnum { CROSSBORDER(String.valueOf("crossBorder")), @@ -147,6 +167,15 @@ public static PrioritiesEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITIES = "priorities"; private List priorities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriorities = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferRouteRequest() {} /** @@ -161,6 +190,7 @@ public TransferRouteRequest() {} */ public TransferRouteRequest balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -192,6 +222,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -203,6 +234,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public TransferRouteRequest balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -228,6 +260,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -242,6 +275,7 @@ public void setBalancePlatform(String balancePlatform) { */ public TransferRouteRequest category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } @@ -273,6 +307,7 @@ public CategoryEnum getCategory() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -283,6 +318,7 @@ public void setCategory(CategoryEnum category) { */ public TransferRouteRequest counterparty(Counterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -306,6 +342,7 @@ public Counterparty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(Counterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -320,6 +357,7 @@ public void setCounterparty(Counterparty counterparty) { */ public TransferRouteRequest country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -351,6 +389,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -362,6 +401,7 @@ public void setCountry(String country) { */ public TransferRouteRequest currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -387,36 +427,38 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** * The list of priorities for the bank transfer. Priorities set the speed at which the transfer is * sent and the fees that you have to pay. Multiple values can be provided. 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 + * **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 United States + * 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 priorities The list of priorities for the bank transfer. Priorities set the speed at * which the transfer is sent and the fees that you have to pay. Multiple values can be - * provided. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * provided. 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 TransferRouteRequest} instance, allowing for method chaining */ public TransferRouteRequest priorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set return this; } @@ -431,26 +473,26 @@ public TransferRouteRequest addPrioritiesItem(PrioritiesEnum prioritiesItem) { /** * The list of priorities for the bank transfer. Priorities set the speed at which the transfer is * sent and the fees that you have to pay. Multiple values can be provided. 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 + * **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 United States + * 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 priorities The list of priorities for the bank transfer. Priorities set the speed at * which the transfer is sent and the fees that you have to pay. Multiple values can be - * provided. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * provided. 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_PRIORITIES) @@ -462,32 +504,53 @@ public List getPriorities() { /** * The list of priorities for the bank transfer. Priorities set the speed at which the transfer is * sent and the fees that you have to pay. Multiple values can be provided. 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 + * **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 United States + * 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 priorities The list of priorities for the bank transfer. Priorities set the speed at * which the transfer is sent and the fees that you have to pay. Multiple values can be - * provided. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * provided. 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_PRIORITIES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferRouteRequest 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 TransferRouteRequest object is equal to o. */ @@ -540,6 +603,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetPriorities) { + addIfNull(nulls, JSON_PROPERTY_PRIORITIES, this.priorities); + } + + 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 TransferRouteRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/TransferRouteResponse.java b/src/main/java/com/adyen/model/balanceplatform/TransferRouteResponse.java index 70da671ca..d4b57f44b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransferRouteResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransferRouteResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,6 +27,15 @@ public class TransferRouteResponse { public static final String JSON_PROPERTY_TRANSFER_ROUTES = "transferRoutes"; private List transferRoutes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferRoutes = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferRouteResponse() {} /** @@ -37,6 +48,7 @@ public TransferRouteResponse() {} */ public TransferRouteResponse transferRoutes(List transferRoutes) { this.transferRoutes = transferRoutes; + isSetTransferRoutes = true; // mark as set return this; } @@ -72,6 +84,27 @@ public List getTransferRoutes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferRoutes(List transferRoutes) { this.transferRoutes = transferRoutes; + isSetTransferRoutes = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferRouteResponse 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 TransferRouteResponse object is equal to o. */ @@ -111,6 +144,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 (isSetTransferRoutes) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_ROUTES, this.transferRoutes); + } + + 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 TransferRouteResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java index c2179eeb7..3feca116b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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,9 +33,15 @@ public class UKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_SORT_CODE = "sortCode"; private String sortCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSortCode = false; + /** **ukLocal** */ public enum TypeEnum { UKLOCAL(String.valueOf("ukLocal")); @@ -76,6 +84,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 UKLocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public UKLocalAccountIdentification() {} */ public UKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -121,6 +140,7 @@ public void setAccountNumber(String accountNumber) { */ public UKLocalAccountIdentification sortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getSortCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setSortCode(String sortCode) { */ public UKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,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 UKLocalAccountIdentification 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 UKLocalAccountIdentification object is equal to o. */ @@ -224,6 +267,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetSortCode) { + addIfNull(nulls, JSON_PROPERTY_SORT_CODE, this.sortCode); + } + 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 UKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/USInstantPayoutAddressRequirement.java b/src/main/java/com/adyen/model/balanceplatform/USInstantPayoutAddressRequirement.java index 08b0c1d1a..e012153da 100644 --- a/src/main/java/com/adyen/model/balanceplatform/USInstantPayoutAddressRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/USInstantPayoutAddressRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -30,6 +32,9 @@ public class USInstantPayoutAddressRequirement { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + /** **usInstantPayoutAddressRequirement** */ public enum TypeEnum { USINSTANTPAYOUTADDRESSREQUIREMENT(String.valueOf("usInstantPayoutAddressRequirement")); @@ -72,6 +77,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 USInstantPayoutAddressRequirement() {} /** @@ -85,6 +99,7 @@ public USInstantPayoutAddressRequirement() {} */ public USInstantPayoutAddressRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -112,6 +127,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -123,6 +139,7 @@ public void setDescription(String description) { */ public USInstantPayoutAddressRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -146,6 +163,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 USInstantPayoutAddressRequirement 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 USInstantPayoutAddressRequirement object is equal to o. */ @@ -188,6 +226,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + 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 USInstantPayoutAddressRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/USInternationalAchAddressRequirement.java b/src/main/java/com/adyen/model/balanceplatform/USInternationalAchAddressRequirement.java index 2c4fc47bd..a769abf7a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/USInternationalAchAddressRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/USInternationalAchAddressRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -30,6 +32,9 @@ public class USInternationalAchAddressRequirement { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + /** **usInternationalAchAddressRequirement** */ public enum TypeEnum { USINTERNATIONALACHADDRESSREQUIREMENT(String.valueOf("usInternationalAchAddressRequirement")); @@ -72,6 +77,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 USInternationalAchAddressRequirement() {} /** @@ -85,6 +99,7 @@ public USInternationalAchAddressRequirement() {} */ public USInternationalAchAddressRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -112,6 +127,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -123,6 +139,7 @@ public void setDescription(String description) { */ public USInternationalAchAddressRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -146,6 +163,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 USInternationalAchAddressRequirement 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 USInternationalAchAddressRequirement object is equal to o. */ @@ -188,6 +226,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + 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 USInternationalAchAddressRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/USInternationalAchPriorityRequirement.java b/src/main/java/com/adyen/model/balanceplatform/USInternationalAchPriorityRequirement.java index e83b85ed3..de7919c7f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/USInternationalAchPriorityRequirement.java +++ b/src/main/java/com/adyen/model/balanceplatform/USInternationalAchPriorityRequirement.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -30,6 +32,9 @@ public class USInternationalAchPriorityRequirement { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + /** **usInternationalAchPriorityRequirement** */ public enum TypeEnum { USINTERNATIONALACHPRIORITYREQUIREMENT(String.valueOf("usInternationalAchPriorityRequirement")); @@ -72,6 +77,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 USInternationalAchPriorityRequirement() {} /** @@ -85,6 +99,7 @@ public USInternationalAchPriorityRequirement() {} */ public USInternationalAchPriorityRequirement description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -112,6 +127,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -123,6 +139,7 @@ public void setDescription(String description) { */ public USInternationalAchPriorityRequirement type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -146,6 +163,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 USInternationalAchPriorityRequirement 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 USInternationalAchPriorityRequirement object is equal to o. */ @@ -188,6 +226,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + 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 USInternationalAchPriorityRequirement given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java index 9a27421eb..8361b3fd6 100644 --- a/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -32,6 +34,9 @@ public class USLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. */ @@ -78,9 +83,15 @@ 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_ROUTING_NUMBER = "routingNumber"; private String routingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRoutingNumber = false; + /** **usLocal** */ public enum TypeEnum { USLOCAL(String.valueOf("usLocal")); @@ -123,6 +134,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 USLocalAccountIdentification() {} /** @@ -133,6 +153,7 @@ public USLocalAccountIdentification() {} */ public USLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -156,6 +177,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -167,6 +189,7 @@ public void setAccountNumber(String accountNumber) { */ public USLocalAccountIdentification accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -192,6 +215,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -205,6 +229,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public USLocalAccountIdentification routingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set return this; } @@ -234,6 +259,7 @@ public String getRoutingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRoutingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set } /** @@ -244,6 +270,7 @@ public void setRoutingNumber(String routingNumber) { */ public USLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -267,6 +294,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 USLocalAccountIdentification 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 USLocalAccountIdentification object is equal to o. */ @@ -312,6 +360,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetRoutingNumber) { + addIfNull(nulls, JSON_PROPERTY_ROUTING_NUMBER, this.routingNumber); + } + 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 USLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/UpdateNetworkTokenRequest.java b/src/main/java/com/adyen/model/balanceplatform/UpdateNetworkTokenRequest.java index 646fdf789..c26221d79 100644 --- a/src/main/java/com/adyen/model/balanceplatform/UpdateNetworkTokenRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/UpdateNetworkTokenRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -73,6 +75,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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UpdateNetworkTokenRequest() {} /** @@ -85,6 +96,7 @@ public UpdateNetworkTokenRequest() {} */ public UpdateNetworkTokenRequest status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -112,6 +124,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UpdateNetworkTokenRequest 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 UpdateNetworkTokenRequest object is equal to o. */ @@ -151,6 +184,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 (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 UpdateNetworkTokenRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java b/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java index ef7c6c6d7..ce3a65db2 100644 --- a/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java +++ b/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -48,36 +50,69 @@ public class UpdatePaymentInstrument { private List additionalBankAccountIdentifications; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalBankAccountIdentifications = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountDetails bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = 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_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_ISSUING_COUNTRY_CODE = "issuingCountryCode"; private String issuingCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuingCountryCode = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_GROUP_ID = "paymentInstrumentGroupId"; private String paymentInstrumentGroupId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentGroupId = 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_REPLACED_BY_ID = "replacedById"; private String replacedById; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReplacedById = false; + public static final String JSON_PROPERTY_REPLACEMENT_OF_ID = "replacementOfId"; private String replacementOfId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReplacementOfId = false; + /** * The status of the payment instrument. If a status is not specified when creating a payment * instrument, it is set to **active** by default. However, there can be exceptions for cards @@ -135,9 +170,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_STATUS_COMMENT = "statusComment"; private String statusComment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusComment = false; + /** * The reason for the status of the payment instrument. Possible values: **accountClosure**, * **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, @@ -201,6 +242,9 @@ public static StatusReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS_REASON = "statusReason"; private StatusReasonEnum statusReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusReason = false; + /** The type of payment instrument. Possible values: **card**, **bankAccount**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("bankAccount")), @@ -245,6 +289,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 UpdatePaymentInstrument() {} /** @@ -262,6 +315,7 @@ public UpdatePaymentInstrument additionalBankAccountIdentifications( List additionalBankAccountIdentifications) { this.additionalBankAccountIdentifications = additionalBankAccountIdentifications; + isSetAdditionalBankAccountIdentifications = true; // mark as set return this; } @@ -308,6 +362,7 @@ public void setAdditionalBankAccountIdentifications( List additionalBankAccountIdentifications) { this.additionalBankAccountIdentifications = additionalBankAccountIdentifications; + isSetAdditionalBankAccountIdentifications = true; // mark as set } /** @@ -322,6 +377,7 @@ public void setAdditionalBankAccountIdentifications( */ public UpdatePaymentInstrument balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -353,6 +409,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -363,6 +420,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public UpdatePaymentInstrument bankAccount(BankAccountDetails bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -386,6 +444,7 @@ public BankAccountDetails getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountDetails bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -396,6 +455,7 @@ public void setBankAccount(BankAccountDetails bankAccount) { */ public UpdatePaymentInstrument card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -419,6 +479,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -429,6 +490,7 @@ public void setCard(Card card) { */ public UpdatePaymentInstrument description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -452,6 +514,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -462,6 +525,7 @@ public void setDescription(String description) { */ public UpdatePaymentInstrument id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -485,6 +549,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -498,6 +563,7 @@ public void setId(String id) { */ public UpdatePaymentInstrument issuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set return this; } @@ -527,6 +593,7 @@ public String getIssuingCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set } /** @@ -541,6 +608,7 @@ public void setIssuingCountryCode(String issuingCountryCode) { */ public UpdatePaymentInstrument paymentInstrumentGroupId(String paymentInstrumentGroupId) { this.paymentInstrumentGroupId = paymentInstrumentGroupId; + isSetPaymentInstrumentGroupId = true; // mark as set return this; } @@ -572,6 +640,7 @@ public String getPaymentInstrumentGroupId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentGroupId(String paymentInstrumentGroupId) { this.paymentInstrumentGroupId = paymentInstrumentGroupId; + isSetPaymentInstrumentGroupId = true; // mark as set } /** @@ -582,6 +651,7 @@ public void setPaymentInstrumentGroupId(String paymentInstrumentGroupId) { */ public UpdatePaymentInstrument reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -605,6 +675,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -616,6 +687,7 @@ public void setReference(String reference) { */ public UpdatePaymentInstrument replacedById(String replacedById) { this.replacedById = replacedById; + isSetReplacedById = true; // mark as set return this; } @@ -641,6 +713,7 @@ public String getReplacedById() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReplacedById(String replacedById) { this.replacedById = replacedById; + isSetReplacedById = true; // mark as set } /** @@ -652,6 +725,7 @@ public void setReplacedById(String replacedById) { */ public UpdatePaymentInstrument replacementOfId(String replacementOfId) { this.replacementOfId = replacementOfId; + isSetReplacementOfId = true; // mark as set return this; } @@ -677,6 +751,7 @@ public String getReplacementOfId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReplacementOfId(String replacementOfId) { this.replacementOfId = replacementOfId; + isSetReplacementOfId = true; // mark as set } /** @@ -702,6 +777,7 @@ public void setReplacementOfId(String replacementOfId) { */ public UpdatePaymentInstrument status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -755,6 +831,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -767,6 +844,7 @@ public void setStatus(StatusEnum status) { */ public UpdatePaymentInstrument statusComment(String statusComment) { this.statusComment = statusComment; + isSetStatusComment = true; // mark as set return this; } @@ -794,6 +872,7 @@ public String getStatusComment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusComment(String statusComment) { this.statusComment = statusComment; + isSetStatusComment = true; // mark as set } /** @@ -810,6 +889,7 @@ public void setStatusComment(String statusComment) { */ public UpdatePaymentInstrument statusReason(StatusReasonEnum statusReason) { this.statusReason = statusReason; + isSetStatusReason = true; // mark as set return this; } @@ -845,6 +925,7 @@ public StatusReasonEnum getStatusReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusReason(StatusReasonEnum statusReason) { this.statusReason = statusReason; + isSetStatusReason = true; // mark as set } /** @@ -855,6 +936,7 @@ public void setStatusReason(StatusReasonEnum statusReason) { */ public UpdatePaymentInstrument type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -878,6 +960,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 UpdatePaymentInstrument 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 UpdatePaymentInstrument object is equal to o. */ @@ -967,6 +1070,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 (isSetAdditionalBankAccountIdentifications) { + addIfNull( + nulls, + JSON_PROPERTY_ADDITIONAL_BANK_ACCOUNT_IDENTIFICATIONS, + this.additionalBankAccountIdentifications); + } + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetIssuingCountryCode) { + addIfNull(nulls, JSON_PROPERTY_ISSUING_COUNTRY_CODE, this.issuingCountryCode); + } + if (isSetPaymentInstrumentGroupId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_GROUP_ID, this.paymentInstrumentGroupId); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReplacedById) { + addIfNull(nulls, JSON_PROPERTY_REPLACED_BY_ID, this.replacedById); + } + if (isSetReplacementOfId) { + addIfNull(nulls, JSON_PROPERTY_REPLACEMENT_OF_ID, this.replacementOfId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetStatusComment) { + addIfNull(nulls, JSON_PROPERTY_STATUS_COMMENT, this.statusComment); + } + if (isSetStatusReason) { + addIfNull(nulls, JSON_PROPERTY_STATUS_REASON, this.statusReason); + } + 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 UpdatePaymentInstrument given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/UpdateSweepConfigurationV2.java b/src/main/java/com/adyen/model/balanceplatform/UpdateSweepConfigurationV2.java index ff6417562..d1a8dad68 100644 --- a/src/main/java/com/adyen/model/balanceplatform/UpdateSweepConfigurationV2.java +++ b/src/main/java/com/adyen/model/balanceplatform/UpdateSweepConfigurationV2.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -96,18 +98,33 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private SweepCounterparty counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + /** Gets or Sets priorities */ public enum PrioritiesEnum { CROSSBORDER(String.valueOf("crossBorder")), @@ -160,6 +177,9 @@ public static PrioritiesEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITIES = "priorities"; private List priorities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriorities = false; + /** The reason for disabling the sweep. */ public enum ReasonEnum { ACCOUNTHIERARCHYNOTACTIVE(String.valueOf("accountHierarchyNotActive")), @@ -209,6 +229,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -251,18 +273,33 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_REASON_DETAIL = "reasonDetail"; private String reasonDetail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReasonDetail = 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_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; private String referenceForBeneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + public static final String JSON_PROPERTY_SCHEDULE = "schedule"; private SweepSchedule schedule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchedule = false; + /** * The status of the sweep. If not provided, by default, this is set to **active**. Possible * values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on @@ -311,15 +348,27 @@ 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_SWEEP_AMOUNT = "sweepAmount"; private Amount sweepAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSweepAmount = false; + public static final String JSON_PROPERTY_TARGET_AMOUNT = "targetAmount"; private Amount targetAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTargetAmount = false; + public static final String JSON_PROPERTY_TRIGGER_AMOUNT = "triggerAmount"; private Amount triggerAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTriggerAmount = false; + /** * The direction of sweep, whether pushing out or pulling in funds to the balance account. If not * provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to @@ -369,6 +418,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 UpdateSweepConfigurationV2() {} @JsonCreator @@ -400,6 +458,7 @@ public UpdateSweepConfigurationV2( */ public UpdateSweepConfigurationV2 category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } @@ -443,6 +502,7 @@ public CategoryEnum getCategory() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -453,6 +513,7 @@ public void setCategory(CategoryEnum category) { */ public UpdateSweepConfigurationV2 counterparty(SweepCounterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -476,6 +537,7 @@ public SweepCounterparty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(SweepCounterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -492,6 +554,7 @@ public void setCounterparty(SweepCounterparty counterparty) { */ public UpdateSweepConfigurationV2 currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -527,6 +590,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -541,6 +605,7 @@ public void setCurrency(String currency) { */ public UpdateSweepConfigurationV2 description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -572,6 +637,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -594,14 +660,14 @@ public String getId() { * 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) @@ -617,14 +683,14 @@ public String getId() { * 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) @@ -634,6 +700,7 @@ public String getId() { */ public UpdateSweepConfigurationV2 priorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set return this; } @@ -654,14 +721,14 @@ public UpdateSweepConfigurationV2 addPrioritiesItem(PrioritiesEnum prioritiesIte * 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) @@ -677,14 +744,14 @@ public UpdateSweepConfigurationV2 addPrioritiesItem(PrioritiesEnum prioritiesIte * 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) @@ -706,14 +773,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) @@ -729,14 +796,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) @@ -747,6 +814,7 @@ public List getPriorities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set } /** @@ -779,6 +847,7 @@ public String getReasonDetail() { */ public UpdateSweepConfigurationV2 reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -802,6 +871,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -814,6 +884,7 @@ public void setReference(String reference) { */ public UpdateSweepConfigurationV2 referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -841,6 +912,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -851,6 +923,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public UpdateSweepConfigurationV2 schedule(SweepSchedule schedule) { this.schedule = schedule; + isSetSchedule = true; // mark as set return this; } @@ -874,6 +947,7 @@ public SweepSchedule getSchedule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchedule(SweepSchedule schedule) { this.schedule = schedule; + isSetSchedule = true; // mark as set } /** @@ -889,6 +963,7 @@ public void setSchedule(SweepSchedule schedule) { */ public UpdateSweepConfigurationV2 status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -922,6 +997,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -932,6 +1008,7 @@ public void setStatus(StatusEnum status) { */ public UpdateSweepConfigurationV2 sweepAmount(Amount sweepAmount) { this.sweepAmount = sweepAmount; + isSetSweepAmount = true; // mark as set return this; } @@ -955,6 +1032,7 @@ public Amount getSweepAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSweepAmount(Amount sweepAmount) { this.sweepAmount = sweepAmount; + isSetSweepAmount = true; // mark as set } /** @@ -965,6 +1043,7 @@ public void setSweepAmount(Amount sweepAmount) { */ public UpdateSweepConfigurationV2 targetAmount(Amount targetAmount) { this.targetAmount = targetAmount; + isSetTargetAmount = true; // mark as set return this; } @@ -988,6 +1067,7 @@ public Amount getTargetAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTargetAmount(Amount targetAmount) { this.targetAmount = targetAmount; + isSetTargetAmount = true; // mark as set } /** @@ -998,6 +1078,7 @@ public void setTargetAmount(Amount targetAmount) { */ public UpdateSweepConfigurationV2 triggerAmount(Amount triggerAmount) { this.triggerAmount = triggerAmount; + isSetTriggerAmount = true; // mark as set return this; } @@ -1021,6 +1102,7 @@ public Amount getTriggerAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTriggerAmount(Amount triggerAmount) { this.triggerAmount = triggerAmount; + isSetTriggerAmount = true; // mark as set } /** @@ -1037,6 +1119,7 @@ public void setTriggerAmount(Amount triggerAmount) { */ public UpdateSweepConfigurationV2 type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1072,6 +1155,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 UpdateSweepConfigurationV2 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 UpdateSweepConfigurationV2 object is equal to o. */ @@ -1160,6 +1264,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 (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPriorities) { + addIfNull(nulls, JSON_PROPERTY_PRIORITIES, this.priorities); + } + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetReasonDetail) { + addIfNull(nulls, JSON_PROPERTY_REASON_DETAIL, this.reasonDetail); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetSchedule) { + addIfNull(nulls, JSON_PROPERTY_SCHEDULE, this.schedule); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetSweepAmount) { + addIfNull(nulls, JSON_PROPERTY_SWEEP_AMOUNT, this.sweepAmount); + } + if (isSetTargetAmount) { + addIfNull(nulls, JSON_PROPERTY_TARGET_AMOUNT, this.targetAmount); + } + if (isSetTriggerAmount) { + addIfNull(nulls, JSON_PROPERTY_TRIGGER_AMOUNT, this.triggerAmount); + } + 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 UpdateSweepConfigurationV2 given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java b/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java index 1b1306286..9efc39e74 100644 --- a/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java +++ b/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -192,12 +194,27 @@ public static CapabilitiesEnum fromValue(String value) { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private List capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_ENTITY_IDS = "entityIds"; private List entityIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityIds = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private OffsetDateTime expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public VerificationDeadline() {} @JsonCreator @@ -244,6 +261,26 @@ public OffsetDateTime getExpiresAt() { return expiresAt; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public VerificationDeadline 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 VerificationDeadline object is equal to o. */ @Override public boolean equals(Object o) { @@ -285,6 +322,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 (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetEntityIds) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_IDS, this.entityIds); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + + 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 VerificationDeadline given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/VerificationError.java b/src/main/java/com/adyen/model/balanceplatform/VerificationError.java index 364903afa..3a3e5f3c2 100644 --- a/src/main/java/com/adyen/model/balanceplatform/VerificationError.java +++ b/src/main/java/com/adyen/model/balanceplatform/VerificationError.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -195,18 +197,33 @@ public static CapabilitiesEnum fromValue(String value) { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private List capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = 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_REMEDIATING_ACTIONS = "remediatingActions"; private List remediatingActions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemediatingActions = false; + public static final String JSON_PROPERTY_SUB_ERRORS = "subErrors"; private List subErrors; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubErrors = false; + /** * The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * * **dataReview** @@ -258,6 +275,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 VerificationError() {} /** @@ -268,6 +294,7 @@ public VerificationError() {} */ public VerificationError capabilities(List capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -299,6 +326,7 @@ public List getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(List capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -309,6 +337,7 @@ public void setCapabilities(List capabilities) { */ public VerificationError code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -332,6 +361,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -342,6 +372,7 @@ public void setCode(String code) { */ public VerificationError message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -365,6 +396,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -376,6 +408,7 @@ public void setMessage(String message) { */ public VerificationError remediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set return this; } @@ -409,6 +442,7 @@ public List getRemediatingActions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set } /** @@ -419,6 +453,7 @@ public void setRemediatingActions(List remediatingActions) { */ public VerificationError subErrors(List subErrors) { this.subErrors = subErrors; + isSetSubErrors = true; // mark as set return this; } @@ -450,6 +485,7 @@ public List getSubErrors() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubErrors(List subErrors) { this.subErrors = subErrors; + isSetSubErrors = true; // mark as set } /** @@ -462,6 +498,7 @@ public void setSubErrors(List subErrors) { */ public VerificationError type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -489,6 +526,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 VerificationError 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 VerificationError object is equal to o. */ @@ -538,6 +596,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 (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetRemediatingActions) { + addIfNull(nulls, JSON_PROPERTY_REMEDIATING_ACTIONS, this.remediatingActions); + } + if (isSetSubErrors) { + addIfNull(nulls, JSON_PROPERTY_SUB_ERRORS, this.subErrors); + } + 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 VerificationError given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/VerificationErrorRecursive.java b/src/main/java/com/adyen/model/balanceplatform/VerificationErrorRecursive.java index c5f0f6f94..2cd41dc20 100644 --- a/src/main/java/com/adyen/model/balanceplatform/VerificationErrorRecursive.java +++ b/src/main/java/com/adyen/model/balanceplatform/VerificationErrorRecursive.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -196,12 +198,21 @@ public static CapabilitiesEnum fromValue(String value) { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private List capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + /** * The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * * **dataReview** @@ -253,9 +264,21 @@ 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; + public static final String JSON_PROPERTY_REMEDIATING_ACTIONS = "remediatingActions"; private List remediatingActions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemediatingActions = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public VerificationErrorRecursive() {} /** @@ -266,6 +289,7 @@ public VerificationErrorRecursive() {} */ public VerificationErrorRecursive capabilities(List capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -297,6 +321,7 @@ public List getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(List capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -307,6 +332,7 @@ public void setCapabilities(List capabilities) { */ public VerificationErrorRecursive code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -330,6 +356,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -340,6 +367,7 @@ public void setCode(String code) { */ public VerificationErrorRecursive message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -363,6 +391,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -375,6 +404,7 @@ public void setMessage(String message) { */ public VerificationErrorRecursive type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -402,6 +432,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -413,6 +444,7 @@ public void setType(TypeEnum type) { */ public VerificationErrorRecursive remediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set return this; } @@ -447,6 +479,27 @@ public List getRemediatingActions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public VerificationErrorRecursive 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 VerificationError-recursive object is equal to o. */ @@ -494,6 +547,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 (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetRemediatingActions) { + addIfNull(nulls, JSON_PROPERTY_REMEDIATING_ACTIONS, this.remediatingActions); + } + + 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 VerificationErrorRecursive given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/WalletProviderAccountScoreRestriction.java b/src/main/java/com/adyen/model/balanceplatform/WalletProviderAccountScoreRestriction.java index ceef30825..c37edf90e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/WalletProviderAccountScoreRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/WalletProviderAccountScoreRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 WalletProviderAccountScoreRestriction { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = 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 WalletProviderAccountScoreRestriction() {} /** @@ -40,6 +54,7 @@ public WalletProviderAccountScoreRestriction() {} */ public WalletProviderAccountScoreRestriction operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -63,6 +78,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setOperation(String operation) { */ public WalletProviderAccountScoreRestriction value(Integer value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -97,6 +114,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 WalletProviderAccountScoreRestriction 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 WalletProviderAccountScoreRestriction object is equal to o. */ @@ -139,6 +177,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 WalletProviderAccountScoreRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/WalletProviderDeviceScore.java b/src/main/java/com/adyen/model/balanceplatform/WalletProviderDeviceScore.java index 2d91ed64f..0dff00370 100644 --- a/src/main/java/com/adyen/model/balanceplatform/WalletProviderDeviceScore.java +++ b/src/main/java/com/adyen/model/balanceplatform/WalletProviderDeviceScore.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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 WalletProviderDeviceScore { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = 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 WalletProviderDeviceScore() {} /** @@ -39,6 +53,7 @@ public WalletProviderDeviceScore() {} */ public WalletProviderDeviceScore operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setOperation(String operation) { */ public WalletProviderDeviceScore value(Integer value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -95,6 +112,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 WalletProviderDeviceScore 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 WalletProviderDeviceScore object is equal to o. */ @@ -136,6 +174,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 WalletProviderDeviceScore given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/WalletProviderDeviceType.java b/src/main/java/com/adyen/model/balanceplatform/WalletProviderDeviceType.java index 8a06909da..f47ad47a6 100644 --- a/src/main/java/com/adyen/model/balanceplatform/WalletProviderDeviceType.java +++ b/src/main/java/com/adyen/model/balanceplatform/WalletProviderDeviceType.java @@ -11,7 +11,9 @@ package com.adyen.model.balanceplatform; +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; @@ -32,6 +34,9 @@ public class WalletProviderDeviceType { public static final String JSON_PROPERTY_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = false; + /** Gets or Sets value */ public enum ValueEnum { CARD(String.valueOf("CARD")), @@ -88,6 +93,15 @@ public static ValueEnum fromValue(String value) { public static final String JSON_PROPERTY_VALUE = "value"; private List 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 WalletProviderDeviceType() {} /** @@ -98,6 +112,7 @@ public WalletProviderDeviceType() {} */ public WalletProviderDeviceType operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -121,6 +136,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -131,6 +147,7 @@ public void setOperation(String operation) { */ public WalletProviderDeviceType value(List value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -162,6 +179,27 @@ public List getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(List value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public WalletProviderDeviceType 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 WalletProviderDeviceType object is equal to o. */ @@ -203,6 +241,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 (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + 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 WalletProviderDeviceType given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/WebhookSetting.java b/src/main/java/com/adyen/model/balanceplatform/WebhookSetting.java index 973e2fec5..ddf92027b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/WebhookSetting.java +++ b/src/main/java/com/adyen/model/balanceplatform/WebhookSetting.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -46,18 +48,39 @@ public class WebhookSetting { public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_STATUS = "status"; private String status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TARGET = "target"; private Target target; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTarget = false; + public static final String JSON_PROPERTY_TYPE = "type"; private SettingType 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 WebhookSetting() {} /** @@ -70,6 +93,7 @@ public WebhookSetting() {} */ public WebhookSetting currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -97,6 +121,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -107,6 +132,7 @@ public void setCurrency(String currency) { */ public WebhookSetting id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -130,6 +156,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -140,6 +167,7 @@ public void setId(String id) { */ public WebhookSetting status(String status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -163,6 +191,7 @@ public String getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(String status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -173,6 +202,7 @@ public void setStatus(String status) { */ public WebhookSetting target(Target target) { this.target = target; + isSetTarget = true; // mark as set return this; } @@ -196,6 +226,7 @@ public Target getTarget() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTarget(Target target) { this.target = target; + isSetTarget = true; // mark as set } /** @@ -206,6 +237,7 @@ public void setTarget(Target target) { */ public WebhookSetting type(SettingType type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -229,6 +261,27 @@ public SettingType getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(SettingType type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public WebhookSetting 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 WebhookSetting object is equal to o. */ @@ -284,6 +337,42 @@ private String toIndentedString(Object o) { JSON.registerDiscriminator(WebhookSetting.class, "type", mappings); } + /** 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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTarget) { + addIfNull(nulls, JSON_PROPERTY_TARGET, this.target); + } + 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 WebhookSetting given an JSON string * diff --git a/src/main/java/com/adyen/model/balanceplatform/WebhookSettings.java b/src/main/java/com/adyen/model/balanceplatform/WebhookSettings.java index b28a145a0..bb863f7b6 100644 --- a/src/main/java/com/adyen/model/balanceplatform/WebhookSettings.java +++ b/src/main/java/com/adyen/model/balanceplatform/WebhookSettings.java @@ -11,6 +11,8 @@ package com.adyen.model.balanceplatform; +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,6 +27,15 @@ public class WebhookSettings { public static final String JSON_PROPERTY_WEBHOOK_SETTINGS = "webhookSettings"; private List webhookSettings; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebhookSettings = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public WebhookSettings() {} /** @@ -35,6 +46,7 @@ public WebhookSettings() {} */ public WebhookSettings webhookSettings(List webhookSettings) { this.webhookSettings = webhookSettings; + isSetWebhookSettings = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getWebhookSettings() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebhookSettings(List webhookSettings) { this.webhookSettings = webhookSettings; + isSetWebhookSettings = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public WebhookSettings 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 WebhookSettings object is equal to o. */ @@ -105,6 +138,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 (isSetWebhookSettings) { + addIfNull(nulls, JSON_PROPERTY_WEBHOOK_SETTINGS, this.webhookSettings); + } + + 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 WebhookSettings given an JSON string * diff --git a/src/main/java/com/adyen/model/balancewebhooks/Amount.java b/src/main/java/com/adyen/model/balancewebhooks/Amount.java new file mode 100644 index 000000000..be70619c6 --- /dev/null +++ b/src/main/java/com/adyen/model/balancewebhooks/Amount.java @@ -0,0 +1,238 @@ +/* + * Balance webhook + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balancewebhooks; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** Amount */ +@JsonPropertyOrder({Amount.JSON_PROPERTY_CURRENCY, Amount.JSON_PROPERTY_VALUE}) +public class Amount { + public static final String JSON_PROPERTY_CURRENCY = "currency"; + private String currency; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + + public static final String JSON_PROPERTY_VALUE = "value"; + private Long value; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Amount() {} + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. + * + * @param currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. + * @return the current {@code Amount} instance, allowing for method chaining + */ + public Amount currency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + return this; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. + * + * @return currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCurrency() { + return currency; + } + + /** + * The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. + * + * @param currency The three-character [ISO currency + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. + */ + @JsonProperty(JSON_PROPERTY_CURRENCY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurrency(String currency) { + this.currency = currency; + isSetCurrency = true; // mark as set + } + + /** + * The numeric value of the amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * + * @param value The numeric value of the amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * @return the current {@code Amount} instance, allowing for method chaining + */ + public Amount value(Long value) { + this.value = value; + isSetValue = true; // mark as set + return this; + } + + /** + * The numeric value of the amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * + * @return value The numeric value of the amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getValue() { + return value; + } + + /** + * The numeric value of the amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * + * @param value The numeric value of the amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(Long value) { + this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Amount includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Amount object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Amount amount = (Amount) o; + return Objects.equals(this.currency, amount.currency) + && Objects.equals(this.value, amount.value); + } + + @Override + public int hashCode() { + return Objects.hash(currency, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Amount {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Amount given an JSON string + * + * @param jsonString JSON string + * @return An instance of Amount + * @throws JsonProcessingException if the JSON string is invalid with respect to Amount + */ + public static Amount fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Amount.class); + } + + /** + * Convert an instance of Amount to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/balancewebhooks/BalanceAccountBalanceNotificationRequest.java b/src/main/java/com/adyen/model/balancewebhooks/BalanceAccountBalanceNotificationRequest.java index 7d2e5378e..38982ec41 100644 --- a/src/main/java/com/adyen/model/balancewebhooks/BalanceAccountBalanceNotificationRequest.java +++ b/src/main/java/com/adyen/model/balancewebhooks/BalanceAccountBalanceNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.balancewebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class BalanceAccountBalanceNotificationRequest { public static final String JSON_PROPERTY_DATA = "data"; private BalanceNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + /** Type of webhook. */ public enum TypeEnum { BALANCEPLATFORM_BALANCEACCOUNT_BALANCE_UPDATED( @@ -82,6 +93,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceAccountBalanceNotificationRequest() {} /** @@ -93,6 +113,7 @@ public BalanceAccountBalanceNotificationRequest() {} */ public BalanceAccountBalanceNotificationRequest data(BalanceNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -116,6 +137,7 @@ public BalanceNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(BalanceNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -128,6 +150,7 @@ public void setData(BalanceNotificationData data) { */ public BalanceAccountBalanceNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -153,6 +176,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -164,6 +188,7 @@ public void setEnvironment(String environment) { */ public BalanceAccountBalanceNotificationRequest timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set return this; } @@ -187,6 +212,7 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set } /** @@ -198,6 +224,7 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public BalanceAccountBalanceNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -221,6 +248,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceAccountBalanceNotificationRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalanceAccountBalanceNotificationRequest object is equal to o. */ @@ -267,6 +315,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceAccountBalanceNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/balancewebhooks/BalanceNotificationData.java b/src/main/java/com/adyen/model/balancewebhooks/BalanceNotificationData.java index 61f6bab65..9ad45631c 100644 --- a/src/main/java/com/adyen/model/balancewebhooks/BalanceNotificationData.java +++ b/src/main/java/com/adyen/model/balancewebhooks/BalanceNotificationData.java @@ -11,7 +11,9 @@ package com.adyen.model.balancewebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,24 +37,51 @@ public class BalanceNotificationData { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_BALANCES = "balances"; private Balances balances; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalances = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_SETTING_IDS = "settingIds"; private List settingIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSettingIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceNotificationData() {} @JsonCreator @@ -69,6 +98,7 @@ public BalanceNotificationData(@JsonProperty(JSON_PROPERTY_ID) String id) { */ public BalanceNotificationData balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -92,6 +122,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -102,6 +133,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public BalanceNotificationData balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -125,6 +157,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -135,6 +168,7 @@ public void setBalancePlatform(String balancePlatform) { */ public BalanceNotificationData balances(Balances balances) { this.balances = balances; + isSetBalances = true; // mark as set return this; } @@ -158,6 +192,7 @@ public Balances getBalances() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalances(Balances balances) { this.balances = balances; + isSetBalances = true; // mark as set } /** @@ -170,6 +205,7 @@ public void setBalances(Balances balances) { */ public BalanceNotificationData creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -197,6 +233,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -209,6 +246,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public BalanceNotificationData currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -236,6 +274,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -257,6 +296,7 @@ public String getId() { */ public BalanceNotificationData settingIds(List settingIds) { this.settingIds = settingIds; + isSetSettingIds = true; // mark as set return this; } @@ -288,6 +328,27 @@ public List getSettingIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSettingIds(List settingIds) { this.settingIds = settingIds; + isSetSettingIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceNotificationData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalanceNotificationData object is equal to o. */ @@ -340,6 +401,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetBalances) { + addIfNull(nulls, JSON_PROPERTY_BALANCES, this.balances); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetSettingIds) { + addIfNull(nulls, JSON_PROPERTY_SETTING_IDS, this.settingIds); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceNotificationData given an JSON string * diff --git a/src/main/java/com/adyen/model/balancewebhooks/BalancePlatformNotificationResponse.java b/src/main/java/com/adyen/model/balancewebhooks/BalancePlatformNotificationResponse.java index 535426b80..06d647dca 100644 --- a/src/main/java/com/adyen/model/balancewebhooks/BalancePlatformNotificationResponse.java +++ b/src/main/java/com/adyen/model/balancewebhooks/BalancePlatformNotificationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.balancewebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class BalancePlatformNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalancePlatformNotificationResponse() {} /** @@ -36,6 +47,7 @@ public BalancePlatformNotificationResponse() {} */ public BalancePlatformNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalancePlatformNotificationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalancePlatformNotificationResponse object is equal to o. */ @@ -106,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalancePlatformNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/balancewebhooks/BalanceWebhooksHandler.java b/src/main/java/com/adyen/model/balancewebhooks/BalanceWebhooksHandler.java index eedb9fc25..da61aa0d2 100644 --- a/src/main/java/com/adyen/model/balancewebhooks/BalanceWebhooksHandler.java +++ b/src/main/java/com/adyen/model/balancewebhooks/BalanceWebhooksHandler.java @@ -58,6 +58,30 @@ public BalanceWebhooksHandler(String payload) { return Optional.empty(); } + /** + * Attempts to deserialize the webhook payload into a ReleasedBlockedBalanceNotificationRequest + * + * @return an Optional containing the deserialized object, or empty if deserialization fails + */ + public Optional + getReleasedBlockedBalanceNotificationRequest() { + + var optionalReleasedBlockedBalanceNotificationRequest = + getOptionalField(ReleasedBlockedBalanceNotificationRequest.class); + + if (optionalReleasedBlockedBalanceNotificationRequest.isPresent()) { + // verify event type + for (var value : ReleasedBlockedBalanceNotificationRequest.TypeEnum.values()) { + if (value.equals(optionalReleasedBlockedBalanceNotificationRequest.get().getType())) { + // found matching event type + return optionalReleasedBlockedBalanceNotificationRequest; + } + } + } + + return Optional.empty(); + } + /** * Deserializes the payload into the specified class type. * diff --git a/src/main/java/com/adyen/model/balancewebhooks/Balances.java b/src/main/java/com/adyen/model/balancewebhooks/Balances.java index 4ea9ac6e9..0bf5e2327 100644 --- a/src/main/java/com/adyen/model/balancewebhooks/Balances.java +++ b/src/main/java/com/adyen/model/balancewebhooks/Balances.java @@ -11,6 +11,8 @@ package com.adyen.model.balancewebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class Balances { public static final String JSON_PROPERTY_AVAILABLE = "available"; private Long available; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAvailable = false; + public static final String JSON_PROPERTY_BALANCE = "balance"; private Long balance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalance = false; + public static final String JSON_PROPERTY_PENDING = "pending"; private Long pending; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPending = false; + public static final String JSON_PROPERTY_RESERVED = "reserved"; private Long reserved; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReserved = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Balances() {} /** @@ -47,6 +67,7 @@ public Balances() {} */ public Balances available(Long available) { this.available = available; + isSetAvailable = true; // mark as set return this; } @@ -70,6 +91,7 @@ public Long getAvailable() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAvailable(Long available) { this.available = available; + isSetAvailable = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setAvailable(Long available) { */ public Balances balance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set return this; } @@ -103,6 +126,7 @@ public Long getBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setBalance(Long balance) { */ public Balances pending(Long pending) { this.pending = pending; + isSetPending = true; // mark as set return this; } @@ -136,6 +161,7 @@ public Long getPending() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPending(Long pending) { this.pending = pending; + isSetPending = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setPending(Long pending) { */ public Balances reserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set return this; } @@ -169,6 +196,27 @@ public Long getReserved() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Balances includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Balances object is equal to o. */ @@ -214,6 +262,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAvailable) { + addIfNull(nulls, JSON_PROPERTY_AVAILABLE, this.available); + } + if (isSetBalance) { + addIfNull(nulls, JSON_PROPERTY_BALANCE, this.balance); + } + if (isSetPending) { + addIfNull(nulls, JSON_PROPERTY_PENDING, this.pending); + } + if (isSetReserved) { + addIfNull(nulls, JSON_PROPERTY_RESERVED, this.reserved); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Balances given an JSON string * diff --git a/src/main/java/com/adyen/model/balancewebhooks/ReleaseBlockedBalanceNotificationData.java b/src/main/java/com/adyen/model/balancewebhooks/ReleaseBlockedBalanceNotificationData.java new file mode 100644 index 000000000..2e1715f5d --- /dev/null +++ b/src/main/java/com/adyen/model/balancewebhooks/ReleaseBlockedBalanceNotificationData.java @@ -0,0 +1,624 @@ +/* + * Balance webhook + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balancewebhooks; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.time.OffsetDateTime; +import java.util.*; + +/** ReleaseBlockedBalanceNotificationData */ +@JsonPropertyOrder({ + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_ACCOUNT_HOLDER, + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_AMOUNT, + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_BALANCE_ACCOUNT, + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_BALANCE_PLATFORM, + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_BATCH_REFERENCE, + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_BLOCKED_BALANCE_AFTER, + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_BLOCKED_BALANCE_BEFORE, + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_CREATION_DATE, + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_ID, + ReleaseBlockedBalanceNotificationData.JSON_PROPERTY_VALUE_DATE +}) +public class ReleaseBlockedBalanceNotificationData { + public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; + private ResourceReference accountHolder; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + + public static final String JSON_PROPERTY_AMOUNT = "amount"; + private Amount amount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + public static final String JSON_PROPERTY_BALANCE_ACCOUNT = "balanceAccount"; + private ResourceReference balanceAccount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccount = false; + + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; + private String balancePlatform; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + + public static final String JSON_PROPERTY_BATCH_REFERENCE = "batchReference"; + private String batchReference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBatchReference = false; + + public static final String JSON_PROPERTY_BLOCKED_BALANCE_AFTER = "blockedBalanceAfter"; + private Amount blockedBalanceAfter; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBlockedBalanceAfter = false; + + public static final String JSON_PROPERTY_BLOCKED_BALANCE_BEFORE = "blockedBalanceBefore"; + private Amount blockedBalanceBefore; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBlockedBalanceBefore = false; + + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; + private OffsetDateTime creationDate; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + public static final String JSON_PROPERTY_VALUE_DATE = "valueDate"; + private OffsetDateTime valueDate; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValueDate = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ReleaseBlockedBalanceNotificationData() {} + + @JsonCreator + public ReleaseBlockedBalanceNotificationData(@JsonProperty(JSON_PROPERTY_ID) String id) { + this(); + this.id = id; + } + + /** + * accountHolder + * + * @param accountHolder + * @return the current {@code ReleaseBlockedBalanceNotificationData} instance, allowing for method + * chaining + */ + public ReleaseBlockedBalanceNotificationData accountHolder(ResourceReference accountHolder) { + this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set + return this; + } + + /** + * Get accountHolder + * + * @return accountHolder + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ResourceReference getAccountHolder() { + return accountHolder; + } + + /** + * accountHolder + * + * @param accountHolder + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_HOLDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountHolder(ResourceReference accountHolder) { + this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set + } + + /** + * amount + * + * @param amount + * @return the current {@code ReleaseBlockedBalanceNotificationData} instance, allowing for method + * chaining + */ + public ReleaseBlockedBalanceNotificationData amount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + return this; + } + + /** + * Get amount + * + * @return amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getAmount() { + return amount; + } + + /** + * amount + * + * @param amount + */ + @JsonProperty(JSON_PROPERTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAmount(Amount amount) { + this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * balanceAccount + * + * @param balanceAccount + * @return the current {@code ReleaseBlockedBalanceNotificationData} instance, allowing for method + * chaining + */ + public ReleaseBlockedBalanceNotificationData balanceAccount(ResourceReference balanceAccount) { + this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set + return this; + } + + /** + * Get balanceAccount + * + * @return balanceAccount + */ + @JsonProperty(JSON_PROPERTY_BALANCE_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ResourceReference getBalanceAccount() { + return balanceAccount; + } + + /** + * balanceAccount + * + * @param balanceAccount + */ + @JsonProperty(JSON_PROPERTY_BALANCE_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalanceAccount(ResourceReference balanceAccount) { + this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set + } + + /** + * The unique identifier of the balance platform. + * + * @param balancePlatform The unique identifier of the balance platform. + * @return the current {@code ReleaseBlockedBalanceNotificationData} instance, allowing for method + * chaining + */ + public ReleaseBlockedBalanceNotificationData balancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set + return this; + } + + /** + * The unique identifier of the balance platform. + * + * @return balancePlatform The unique identifier of the balance platform. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_PLATFORM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBalancePlatform() { + return balancePlatform; + } + + /** + * The unique identifier of the balance platform. + * + * @param balancePlatform The unique identifier of the balance platform. + */ + @JsonProperty(JSON_PROPERTY_BALANCE_PLATFORM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBalancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set + } + + /** + * The reference of the batch that was released. + * + * @param batchReference The reference of the batch that was released. + * @return the current {@code ReleaseBlockedBalanceNotificationData} instance, allowing for method + * chaining + */ + public ReleaseBlockedBalanceNotificationData batchReference(String batchReference) { + this.batchReference = batchReference; + isSetBatchReference = true; // mark as set + return this; + } + + /** + * The reference of the batch that was released. + * + * @return batchReference The reference of the batch that was released. + */ + @JsonProperty(JSON_PROPERTY_BATCH_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBatchReference() { + return batchReference; + } + + /** + * The reference of the batch that was released. + * + * @param batchReference The reference of the batch that was released. + */ + @JsonProperty(JSON_PROPERTY_BATCH_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBatchReference(String batchReference) { + this.batchReference = batchReference; + isSetBatchReference = true; // mark as set + } + + /** + * blockedBalanceAfter + * + * @param blockedBalanceAfter + * @return the current {@code ReleaseBlockedBalanceNotificationData} instance, allowing for method + * chaining + */ + public ReleaseBlockedBalanceNotificationData blockedBalanceAfter(Amount blockedBalanceAfter) { + this.blockedBalanceAfter = blockedBalanceAfter; + isSetBlockedBalanceAfter = true; // mark as set + return this; + } + + /** + * Get blockedBalanceAfter + * + * @return blockedBalanceAfter + */ + @JsonProperty(JSON_PROPERTY_BLOCKED_BALANCE_AFTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getBlockedBalanceAfter() { + return blockedBalanceAfter; + } + + /** + * blockedBalanceAfter + * + * @param blockedBalanceAfter + */ + @JsonProperty(JSON_PROPERTY_BLOCKED_BALANCE_AFTER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlockedBalanceAfter(Amount blockedBalanceAfter) { + this.blockedBalanceAfter = blockedBalanceAfter; + isSetBlockedBalanceAfter = true; // mark as set + } + + /** + * blockedBalanceBefore + * + * @param blockedBalanceBefore + * @return the current {@code ReleaseBlockedBalanceNotificationData} instance, allowing for method + * chaining + */ + public ReleaseBlockedBalanceNotificationData blockedBalanceBefore(Amount blockedBalanceBefore) { + this.blockedBalanceBefore = blockedBalanceBefore; + isSetBlockedBalanceBefore = true; // mark as set + return this; + } + + /** + * Get blockedBalanceBefore + * + * @return blockedBalanceBefore + */ + @JsonProperty(JSON_PROPERTY_BLOCKED_BALANCE_BEFORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Amount getBlockedBalanceBefore() { + return blockedBalanceBefore; + } + + /** + * blockedBalanceBefore + * + * @param blockedBalanceBefore + */ + @JsonProperty(JSON_PROPERTY_BLOCKED_BALANCE_BEFORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBlockedBalanceBefore(Amount blockedBalanceBefore) { + this.blockedBalanceBefore = blockedBalanceBefore; + isSetBlockedBalanceBefore = true; // mark as set + } + + /** + * The date and time when the event was triggered, in ISO 8601 extended format. For example, + * **2025-03-19T10:15:30+01:00**. + * + * @param creationDate The date and time when the event was triggered, in ISO 8601 extended + * format. For example, **2025-03-19T10:15:30+01:00**. + * @return the current {@code ReleaseBlockedBalanceNotificationData} instance, allowing for method + * chaining + */ + public ReleaseBlockedBalanceNotificationData creationDate(OffsetDateTime creationDate) { + this.creationDate = creationDate; + isSetCreationDate = true; // mark as set + return this; + } + + /** + * The date and time when the event was triggered, in ISO 8601 extended format. For example, + * **2025-03-19T10:15:30+01:00**. + * + * @return creationDate The date and time when the event was triggered, in ISO 8601 extended + * format. For example, **2025-03-19T10:15:30+01:00**. + */ + @JsonProperty(JSON_PROPERTY_CREATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreationDate() { + return creationDate; + } + + /** + * The date and time when the event was triggered, in ISO 8601 extended format. For example, + * **2025-03-19T10:15:30+01:00**. + * + * @param creationDate The date and time when the event was triggered, in ISO 8601 extended + * format. For example, **2025-03-19T10:15:30+01:00**. + */ + @JsonProperty(JSON_PROPERTY_CREATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCreationDate(OffsetDateTime creationDate) { + this.creationDate = creationDate; + isSetCreationDate = true; // mark as set + } + + /** + * The ID of the resource. + * + * @return id The ID of the resource. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The date and time when the amount was released, in ISO 8601 extended format. For example, + * **2025-03-19T10:15:30+01:00**. + * + * @param valueDate The date and time when the amount was released, in ISO 8601 extended format. + * For example, **2025-03-19T10:15:30+01:00**. + * @return the current {@code ReleaseBlockedBalanceNotificationData} instance, allowing for method + * chaining + */ + public ReleaseBlockedBalanceNotificationData valueDate(OffsetDateTime valueDate) { + this.valueDate = valueDate; + isSetValueDate = true; // mark as set + return this; + } + + /** + * The date and time when the amount was released, in ISO 8601 extended format. For example, + * **2025-03-19T10:15:30+01:00**. + * + * @return valueDate The date and time when the amount was released, in ISO 8601 extended format. + * For example, **2025-03-19T10:15:30+01:00**. + */ + @JsonProperty(JSON_PROPERTY_VALUE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getValueDate() { + return valueDate; + } + + /** + * The date and time when the amount was released, in ISO 8601 extended format. For example, + * **2025-03-19T10:15:30+01:00**. + * + * @param valueDate The date and time when the amount was released, in ISO 8601 extended format. + * For example, **2025-03-19T10:15:30+01:00**. + */ + @JsonProperty(JSON_PROPERTY_VALUE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValueDate(OffsetDateTime valueDate) { + this.valueDate = valueDate; + isSetValueDate = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ReleaseBlockedBalanceNotificationData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this ReleaseBlockedBalanceNotificationData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReleaseBlockedBalanceNotificationData releaseBlockedBalanceNotificationData = + (ReleaseBlockedBalanceNotificationData) o; + return Objects.equals(this.accountHolder, releaseBlockedBalanceNotificationData.accountHolder) + && Objects.equals(this.amount, releaseBlockedBalanceNotificationData.amount) + && Objects.equals(this.balanceAccount, releaseBlockedBalanceNotificationData.balanceAccount) + && Objects.equals( + this.balancePlatform, releaseBlockedBalanceNotificationData.balancePlatform) + && Objects.equals(this.batchReference, releaseBlockedBalanceNotificationData.batchReference) + && Objects.equals( + this.blockedBalanceAfter, releaseBlockedBalanceNotificationData.blockedBalanceAfter) + && Objects.equals( + this.blockedBalanceBefore, releaseBlockedBalanceNotificationData.blockedBalanceBefore) + && Objects.equals(this.creationDate, releaseBlockedBalanceNotificationData.creationDate) + && Objects.equals(this.id, releaseBlockedBalanceNotificationData.id) + && Objects.equals(this.valueDate, releaseBlockedBalanceNotificationData.valueDate); + } + + @Override + public int hashCode() { + return Objects.hash( + accountHolder, + amount, + balanceAccount, + balancePlatform, + batchReference, + blockedBalanceAfter, + blockedBalanceBefore, + creationDate, + id, + valueDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReleaseBlockedBalanceNotificationData {\n"); + sb.append(" accountHolder: ").append(toIndentedString(accountHolder)).append("\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" balanceAccount: ").append(toIndentedString(balanceAccount)).append("\n"); + sb.append(" balancePlatform: ").append(toIndentedString(balancePlatform)).append("\n"); + sb.append(" batchReference: ").append(toIndentedString(batchReference)).append("\n"); + sb.append(" blockedBalanceAfter: ") + .append(toIndentedString(blockedBalanceAfter)) + .append("\n"); + sb.append(" blockedBalanceBefore: ") + .append(toIndentedString(blockedBalanceBefore)) + .append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" valueDate: ").append(toIndentedString(valueDate)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBalanceAccount) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT, this.balanceAccount); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetBatchReference) { + addIfNull(nulls, JSON_PROPERTY_BATCH_REFERENCE, this.batchReference); + } + if (isSetBlockedBalanceAfter) { + addIfNull(nulls, JSON_PROPERTY_BLOCKED_BALANCE_AFTER, this.blockedBalanceAfter); + } + if (isSetBlockedBalanceBefore) { + addIfNull(nulls, JSON_PROPERTY_BLOCKED_BALANCE_BEFORE, this.blockedBalanceBefore); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetValueDate) { + addIfNull(nulls, JSON_PROPERTY_VALUE_DATE, this.valueDate); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of ReleaseBlockedBalanceNotificationData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReleaseBlockedBalanceNotificationData + * @throws JsonProcessingException if the JSON string is invalid with respect to + * ReleaseBlockedBalanceNotificationData + */ + public static ReleaseBlockedBalanceNotificationData fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ReleaseBlockedBalanceNotificationData.class); + } + + /** + * Convert an instance of ReleaseBlockedBalanceNotificationData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/balancewebhooks/ReleasedBlockedBalanceNotificationRequest.java b/src/main/java/com/adyen/model/balancewebhooks/ReleasedBlockedBalanceNotificationRequest.java new file mode 100644 index 000000000..007a279dc --- /dev/null +++ b/src/main/java/com/adyen/model/balancewebhooks/ReleasedBlockedBalanceNotificationRequest.java @@ -0,0 +1,373 @@ +/* + * Balance webhook + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balancewebhooks; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.time.OffsetDateTime; +import java.util.*; +import java.util.Arrays; +import java.util.logging.Logger; + +/** ReleasedBlockedBalanceNotificationRequest */ +@JsonPropertyOrder({ + ReleasedBlockedBalanceNotificationRequest.JSON_PROPERTY_DATA, + ReleasedBlockedBalanceNotificationRequest.JSON_PROPERTY_ENVIRONMENT, + ReleasedBlockedBalanceNotificationRequest.JSON_PROPERTY_TIMESTAMP, + ReleasedBlockedBalanceNotificationRequest.JSON_PROPERTY_TYPE +}) +public class ReleasedBlockedBalanceNotificationRequest { + public static final String JSON_PROPERTY_DATA = "data"; + private ReleaseBlockedBalanceNotificationData data; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; + private String environment; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; + private OffsetDateTime timestamp; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + + /** Type of webhook. */ + public enum TypeEnum { + BALANCEPLATFORM_BALANCEACCOUNT_BALANCE_BLOCK_RELEASED( + String.valueOf("balancePlatform.balanceAccount.balance.block.released")); + + private static final Logger LOG = Logger.getLogger(TypeEnum.class.getName()); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "TypeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(TypeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ReleasedBlockedBalanceNotificationRequest() {} + + /** + * data + * + * @param data + * @return the current {@code ReleasedBlockedBalanceNotificationRequest} instance, allowing for + * method chaining + */ + public ReleasedBlockedBalanceNotificationRequest data( + ReleaseBlockedBalanceNotificationData data) { + this.data = data; + isSetData = true; // mark as set + return this; + } + + /** + * Get data + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ReleaseBlockedBalanceNotificationData getData() { + return data; + } + + /** + * data + * + * @param data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(ReleaseBlockedBalanceNotificationData data) { + this.data = data; + isSetData = true; // mark as set + } + + /** + * The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @param environment The environment from which the webhook originated. Possible values: + * **test**, **live**. + * @return the current {@code ReleasedBlockedBalanceNotificationRequest} instance, allowing for + * method chaining + */ + public ReleasedBlockedBalanceNotificationRequest environment(String environment) { + this.environment = environment; + isSetEnvironment = true; // mark as set + return this; + } + + /** + * The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @return environment The environment from which the webhook originated. Possible values: + * **test**, **live**. + */ + @JsonProperty(JSON_PROPERTY_ENVIRONMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEnvironment() { + return environment; + } + + /** + * The environment from which the webhook originated. Possible values: **test**, **live**. + * + * @param environment The environment from which the webhook originated. Possible values: + * **test**, **live**. + */ + @JsonProperty(JSON_PROPERTY_ENVIRONMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnvironment(String environment) { + this.environment = environment; + isSetEnvironment = true; // mark as set + } + + /** + * When the event was queued. + * + * @param timestamp When the event was queued. + * @return the current {@code ReleasedBlockedBalanceNotificationRequest} instance, allowing for + * method chaining + */ + public ReleasedBlockedBalanceNotificationRequest timestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + isSetTimestamp = true; // mark as set + return this; + } + + /** + * When the event was queued. + * + * @return timestamp When the event was queued. + */ + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getTimestamp() { + return timestamp; + } + + /** + * When the event was queued. + * + * @param timestamp When the event was queued. + */ + @JsonProperty(JSON_PROPERTY_TIMESTAMP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimestamp(OffsetDateTime timestamp) { + this.timestamp = timestamp; + isSetTimestamp = true; // mark as set + } + + /** + * Type of webhook. + * + * @param type Type of webhook. + * @return the current {@code ReleasedBlockedBalanceNotificationRequest} instance, allowing for + * method chaining + */ + public ReleasedBlockedBalanceNotificationRequest type(TypeEnum type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * Type of webhook. + * + * @return type Type of webhook. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TypeEnum getType() { + return type; + } + + /** + * Type of webhook. + * + * @param type Type of webhook. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ReleasedBlockedBalanceNotificationRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this ReleasedBlockedBalanceNotificationRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReleasedBlockedBalanceNotificationRequest releasedBlockedBalanceNotificationRequest = + (ReleasedBlockedBalanceNotificationRequest) o; + return Objects.equals(this.data, releasedBlockedBalanceNotificationRequest.data) + && Objects.equals(this.environment, releasedBlockedBalanceNotificationRequest.environment) + && Objects.equals(this.timestamp, releasedBlockedBalanceNotificationRequest.timestamp) + && Objects.equals(this.type, releasedBlockedBalanceNotificationRequest.type); + } + + @Override + public int hashCode() { + return Objects.hash(data, environment, timestamp, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReleasedBlockedBalanceNotificationRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of ReleasedBlockedBalanceNotificationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReleasedBlockedBalanceNotificationRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * ReleasedBlockedBalanceNotificationRequest + */ + public static ReleasedBlockedBalanceNotificationRequest fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ReleasedBlockedBalanceNotificationRequest.class); + } + + /** + * Convert an instance of ReleasedBlockedBalanceNotificationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/balancewebhooks/ResourceReference.java b/src/main/java/com/adyen/model/balancewebhooks/ResourceReference.java new file mode 100644 index 000000000..699e5c78e --- /dev/null +++ b/src/main/java/com/adyen/model/balancewebhooks/ResourceReference.java @@ -0,0 +1,270 @@ +/* + * Balance webhook + * + * The version of the OpenAPI document: 1 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.balancewebhooks; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** ResourceReference */ +@JsonPropertyOrder({ + ResourceReference.JSON_PROPERTY_DESCRIPTION, + ResourceReference.JSON_PROPERTY_ID, + ResourceReference.JSON_PROPERTY_REFERENCE +}) +public class ResourceReference { + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + public static final String JSON_PROPERTY_REFERENCE = "reference"; + private String reference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ResourceReference() {} + + /** + * The description of the resource. + * + * @param description The description of the resource. + * @return the current {@code ResourceReference} instance, allowing for method chaining + */ + public ResourceReference description(String description) { + this.description = description; + isSetDescription = true; // mark as set + return this; + } + + /** + * The description of the resource. + * + * @return description The description of the resource. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + /** + * The description of the resource. + * + * @param description The description of the resource. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + isSetDescription = true; // mark as set + } + + /** + * The unique identifier of the resource. + * + * @param id The unique identifier of the resource. + * @return the current {@code ResourceReference} instance, allowing for method chaining + */ + public ResourceReference id(String id) { + this.id = id; + isSetId = true; // mark as set + return this; + } + + /** + * The unique identifier of the resource. + * + * @return id The unique identifier of the resource. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The unique identifier of the resource. + * + * @param id The unique identifier of the resource. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + isSetId = true; // mark as set + } + + /** + * The reference for the resource. + * + * @param reference The reference for the resource. + * @return the current {@code ResourceReference} instance, allowing for method chaining + */ + public ResourceReference reference(String reference) { + this.reference = reference; + isSetReference = true; // mark as set + return this; + } + + /** + * The reference for the resource. + * + * @return reference The reference for the resource. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReference() { + return reference; + } + + /** + * The reference for the resource. + * + * @param reference The reference for the resource. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReference(String reference) { + this.reference = reference; + isSetReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResourceReference includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this ResourceReference object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResourceReference resourceReference = (ResourceReference) o; + return Objects.equals(this.description, resourceReference.description) + && Objects.equals(this.id, resourceReference.id) + && Objects.equals(this.reference, resourceReference.reference); + } + + @Override + public int hashCode() { + return Objects.hash(description, id, reference); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResourceReference {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of ResourceReference given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResourceReference + * @throws JsonProcessingException if the JSON string is invalid with respect to ResourceReference + */ + public static ResourceReference fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ResourceReference.class); + } + + /** + * Convert an instance of ResourceReference to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/binlookup/Amount.java b/src/main/java/com/adyen/model/binlookup/Amount.java index fe8b80909..90d4d8a99 100644 --- a/src/main/java/com/adyen/model/binlookup/Amount.java +++ b/src/main/java/com/adyen/model/binlookup/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.binlookup; +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. */ @@ -145,6 +189,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/binlookup/BinDetail.java b/src/main/java/com/adyen/model/binlookup/BinDetail.java index 8d557c070..f715ec440 100644 --- a/src/main/java/com/adyen/model/binlookup/BinDetail.java +++ b/src/main/java/com/adyen/model/binlookup/BinDetail.java @@ -11,6 +11,8 @@ package com.adyen.model.binlookup; +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 BinDetail { public static final String JSON_PROPERTY_ISSUER_COUNTRY = "issuerCountry"; private String issuerCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuerCountry = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BinDetail() {} /** @@ -33,6 +44,7 @@ public BinDetail() {} */ public BinDetail issuerCountry(String issuerCountry) { this.issuerCountry = issuerCountry; + isSetIssuerCountry = true; // mark as set return this; } @@ -56,6 +68,27 @@ public String getIssuerCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuerCountry(String issuerCountry) { this.issuerCountry = issuerCountry; + isSetIssuerCountry = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BinDetail 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 BinDetail object is equal to o. */ @@ -95,6 +128,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 (isSetIssuerCountry) { + addIfNull(nulls, JSON_PROPERTY_ISSUER_COUNTRY, this.issuerCountry); + } + + 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 BinDetail given an JSON string * diff --git a/src/main/java/com/adyen/model/binlookup/CardBin.java b/src/main/java/com/adyen/model/binlookup/CardBin.java index afada99d5..b14848e22 100644 --- a/src/main/java/com/adyen/model/binlookup/CardBin.java +++ b/src/main/java/com/adyen/model/binlookup/CardBin.java @@ -11,6 +11,8 @@ package com.adyen.model.binlookup; +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,36 +37,75 @@ public class CardBin { 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_COMMERCIAL = "commercial"; private Boolean commercial; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCommercial = 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_ISSUER_BIN = "issuerBin"; private String issuerBin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuerBin = false; + public static final String JSON_PROPERTY_ISSUING_BANK = "issuingBank"; private String issuingBank; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuingBank = false; + public static final String JSON_PROPERTY_ISSUING_COUNTRY = "issuingCountry"; private String issuingCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuingCountry = false; + public static final String JSON_PROPERTY_ISSUING_CURRENCY = "issuingCurrency"; private String issuingCurrency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuingCurrency = 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_PAYOUT_ELIGIBLE = "payoutEligible"; private String payoutEligible; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayoutEligible = false; + public static final String JSON_PROPERTY_SUMMARY = "summary"; private String summary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSummary = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardBin() {} /** @@ -76,6 +117,7 @@ public CardBin() {} */ public CardBin bin(String bin) { this.bin = bin; + isSetBin = true; // mark as set return this; } @@ -101,6 +143,7 @@ public String getBin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBin(String bin) { this.bin = bin; + isSetBin = true; // mark as set } /** @@ -112,6 +155,7 @@ public void setBin(String bin) { */ public CardBin commercial(Boolean commercial) { this.commercial = commercial; + isSetCommercial = true; // mark as set return this; } @@ -137,6 +181,7 @@ public Boolean getCommercial() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCommercial(Boolean commercial) { this.commercial = commercial; + isSetCommercial = true; // mark as set } /** @@ -151,6 +196,7 @@ public void setCommercial(Boolean commercial) { */ public CardBin fundingSource(String fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -182,6 +228,7 @@ public String getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(String fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -200,6 +247,7 @@ public void setFundingSource(String fundingSource) { */ public CardBin fundsAvailability(String fundsAvailability) { this.fundsAvailability = fundsAvailability; + isSetFundsAvailability = true; // mark as set return this; } @@ -239,6 +287,7 @@ public String getFundsAvailability() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundsAvailability(String fundsAvailability) { this.fundsAvailability = fundsAvailability; + isSetFundsAvailability = true; // mark as set } /** @@ -250,6 +299,7 @@ public void setFundsAvailability(String fundsAvailability) { */ public CardBin issuerBin(String issuerBin) { this.issuerBin = issuerBin; + isSetIssuerBin = true; // mark as set return this; } @@ -275,6 +325,7 @@ public String getIssuerBin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuerBin(String issuerBin) { this.issuerBin = issuerBin; + isSetIssuerBin = true; // mark as set } /** @@ -285,6 +336,7 @@ public void setIssuerBin(String issuerBin) { */ public CardBin issuingBank(String issuingBank) { this.issuingBank = issuingBank; + isSetIssuingBank = true; // mark as set return this; } @@ -308,6 +360,7 @@ public String getIssuingBank() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuingBank(String issuingBank) { this.issuingBank = issuingBank; + isSetIssuingBank = true; // mark as set } /** @@ -318,6 +371,7 @@ public void setIssuingBank(String issuingBank) { */ public CardBin issuingCountry(String issuingCountry) { this.issuingCountry = issuingCountry; + isSetIssuingCountry = true; // mark as set return this; } @@ -341,6 +395,7 @@ public String getIssuingCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuingCountry(String issuingCountry) { this.issuingCountry = issuingCountry; + isSetIssuingCountry = true; // mark as set } /** @@ -351,6 +406,7 @@ public void setIssuingCountry(String issuingCountry) { */ public CardBin issuingCurrency(String issuingCurrency) { this.issuingCurrency = issuingCurrency; + isSetIssuingCurrency = true; // mark as set return this; } @@ -374,6 +430,7 @@ public String getIssuingCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuingCurrency(String issuingCurrency) { this.issuingCurrency = issuingCurrency; + isSetIssuingCurrency = true; // mark as set } /** @@ -384,6 +441,7 @@ public void setIssuingCurrency(String issuingCurrency) { */ public CardBin paymentMethod(String paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -407,6 +465,7 @@ public String getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(String paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -425,6 +484,7 @@ public void setPaymentMethod(String paymentMethod) { */ public CardBin payoutEligible(String payoutEligible) { this.payoutEligible = payoutEligible; + isSetPayoutEligible = true; // mark as set return this; } @@ -464,6 +524,7 @@ public String getPayoutEligible() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayoutEligible(String payoutEligible) { this.payoutEligible = payoutEligible; + isSetPayoutEligible = true; // mark as set } /** @@ -474,6 +535,7 @@ public void setPayoutEligible(String payoutEligible) { */ public CardBin summary(String summary) { this.summary = summary; + isSetSummary = true; // mark as set return this; } @@ -497,6 +559,27 @@ public String getSummary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSummary(String summary) { this.summary = summary; + isSetSummary = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardBin 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 CardBin object is equal to o. */ @@ -567,6 +650,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 (isSetBin) { + addIfNull(nulls, JSON_PROPERTY_BIN, this.bin); + } + if (isSetCommercial) { + addIfNull(nulls, JSON_PROPERTY_COMMERCIAL, this.commercial); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetFundsAvailability) { + addIfNull(nulls, JSON_PROPERTY_FUNDS_AVAILABILITY, this.fundsAvailability); + } + if (isSetIssuerBin) { + addIfNull(nulls, JSON_PROPERTY_ISSUER_BIN, this.issuerBin); + } + if (isSetIssuingBank) { + addIfNull(nulls, JSON_PROPERTY_ISSUING_BANK, this.issuingBank); + } + if (isSetIssuingCountry) { + addIfNull(nulls, JSON_PROPERTY_ISSUING_COUNTRY, this.issuingCountry); + } + if (isSetIssuingCurrency) { + addIfNull(nulls, JSON_PROPERTY_ISSUING_CURRENCY, this.issuingCurrency); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetPayoutEligible) { + addIfNull(nulls, JSON_PROPERTY_PAYOUT_ELIGIBLE, this.payoutEligible); + } + if (isSetSummary) { + addIfNull(nulls, JSON_PROPERTY_SUMMARY, this.summary); + } + + 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 CardBin given an JSON string * diff --git a/src/main/java/com/adyen/model/binlookup/CostEstimateAssumptions.java b/src/main/java/com/adyen/model/binlookup/CostEstimateAssumptions.java index b9d3e0d55..ba4db9b23 100644 --- a/src/main/java/com/adyen/model/binlookup/CostEstimateAssumptions.java +++ b/src/main/java/com/adyen/model/binlookup/CostEstimateAssumptions.java @@ -11,6 +11,8 @@ package com.adyen.model.binlookup; +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,12 +30,27 @@ public class CostEstimateAssumptions { "assume3DSecureAuthenticated"; private Boolean assume3DSecureAuthenticated; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAssume3DSecureAuthenticated = false; + public static final String JSON_PROPERTY_ASSUME_LEVEL3_DATA = "assumeLevel3Data"; private Boolean assumeLevel3Data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAssumeLevel3Data = false; + public static final String JSON_PROPERTY_INSTALLMENTS = "installments"; private Integer installments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallments = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CostEstimateAssumptions() {} /** @@ -45,6 +62,7 @@ public CostEstimateAssumptions() {} */ public CostEstimateAssumptions assume3DSecureAuthenticated(Boolean assume3DSecureAuthenticated) { this.assume3DSecureAuthenticated = assume3DSecureAuthenticated; + isSetAssume3DSecureAuthenticated = true; // mark as set return this; } @@ -70,6 +88,7 @@ public Boolean getAssume3DSecureAuthenticated() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAssume3DSecureAuthenticated(Boolean assume3DSecureAuthenticated) { this.assume3DSecureAuthenticated = assume3DSecureAuthenticated; + isSetAssume3DSecureAuthenticated = true; // mark as set } /** @@ -80,6 +99,7 @@ public void setAssume3DSecureAuthenticated(Boolean assume3DSecureAuthenticated) */ public CostEstimateAssumptions assumeLevel3Data(Boolean assumeLevel3Data) { this.assumeLevel3Data = assumeLevel3Data; + isSetAssumeLevel3Data = true; // mark as set return this; } @@ -103,6 +123,7 @@ public Boolean getAssumeLevel3Data() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAssumeLevel3Data(Boolean assumeLevel3Data) { this.assumeLevel3Data = assumeLevel3Data; + isSetAssumeLevel3Data = true; // mark as set } /** @@ -113,6 +134,7 @@ public void setAssumeLevel3Data(Boolean assumeLevel3Data) { */ public CostEstimateAssumptions installments(Integer installments) { this.installments = installments; + isSetInstallments = true; // mark as set return this; } @@ -136,6 +158,27 @@ public Integer getInstallments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallments(Integer installments) { this.installments = installments; + isSetInstallments = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CostEstimateAssumptions 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 CostEstimateAssumptions object is equal to o. */ @@ -182,6 +225,37 @@ 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 (isSetAssume3DSecureAuthenticated) { + addIfNull( + nulls, JSON_PROPERTY_ASSUME3_D_SECURE_AUTHENTICATED, this.assume3DSecureAuthenticated); + } + if (isSetAssumeLevel3Data) { + addIfNull(nulls, JSON_PROPERTY_ASSUME_LEVEL3_DATA, this.assumeLevel3Data); + } + if (isSetInstallments) { + addIfNull(nulls, JSON_PROPERTY_INSTALLMENTS, this.installments); + } + + 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 CostEstimateAssumptions given an JSON string * diff --git a/src/main/java/com/adyen/model/binlookup/CostEstimateRequest.java b/src/main/java/com/adyen/model/binlookup/CostEstimateRequest.java index 297e83756..e9d777a70 100644 --- a/src/main/java/com/adyen/model/binlookup/CostEstimateRequest.java +++ b/src/main/java/com/adyen/model/binlookup/CostEstimateRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.binlookup; +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,28 +40,52 @@ public class CostEstimateRequest { 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_ASSUMPTIONS = "assumptions"; private CostEstimateAssumptions assumptions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAssumptions = false; + public static final String JSON_PROPERTY_CARD_NUMBER = "cardNumber"; private String cardNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardNumber = false; + public static final String JSON_PROPERTY_ENCRYPTED_CARD_NUMBER = "encryptedCardNumber"; private String encryptedCardNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedCardNumber = 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_DETAILS = "merchantDetails"; private MerchantDetails merchantDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantDetails = false; + public static final String JSON_PROPERTY_RECURRING = "recurring"; private Recurring recurring; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurring = 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; + /** * 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 @@ -120,9 +146,21 @@ 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_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CostEstimateRequest() {} /** @@ -133,6 +171,7 @@ public CostEstimateRequest() {} */ public CostEstimateRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -156,6 +195,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -166,6 +206,7 @@ public void setAmount(Amount amount) { */ public CostEstimateRequest assumptions(CostEstimateAssumptions assumptions) { this.assumptions = assumptions; + isSetAssumptions = true; // mark as set return this; } @@ -189,6 +230,7 @@ public CostEstimateAssumptions getAssumptions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAssumptions(CostEstimateAssumptions assumptions) { this.assumptions = assumptions; + isSetAssumptions = true; // mark as set } /** @@ -203,6 +245,7 @@ public void setAssumptions(CostEstimateAssumptions assumptions) { */ public CostEstimateRequest cardNumber(String cardNumber) { this.cardNumber = cardNumber; + isSetCardNumber = true; // mark as set return this; } @@ -234,6 +277,7 @@ public String getCardNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardNumber(String cardNumber) { this.cardNumber = cardNumber; + isSetCardNumber = true; // mark as set } /** @@ -251,6 +295,7 @@ public void setCardNumber(String cardNumber) { */ public CostEstimateRequest encryptedCardNumber(String encryptedCardNumber) { this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set return this; } @@ -288,6 +333,7 @@ public String getEncryptedCardNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedCardNumber(String encryptedCardNumber) { this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set } /** @@ -299,6 +345,7 @@ public void setEncryptedCardNumber(String encryptedCardNumber) { */ public CostEstimateRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -324,6 +371,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -334,6 +382,7 @@ public void setMerchantAccount(String merchantAccount) { */ public CostEstimateRequest merchantDetails(MerchantDetails merchantDetails) { this.merchantDetails = merchantDetails; + isSetMerchantDetails = true; // mark as set return this; } @@ -357,6 +406,7 @@ public MerchantDetails getMerchantDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantDetails(MerchantDetails merchantDetails) { this.merchantDetails = merchantDetails; + isSetMerchantDetails = true; // mark as set } /** @@ -367,6 +417,7 @@ public void setMerchantDetails(MerchantDetails merchantDetails) { */ public CostEstimateRequest recurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set return this; } @@ -390,6 +441,7 @@ public Recurring getRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set } /** @@ -404,6 +456,7 @@ public void setRecurring(Recurring recurring) { public CostEstimateRequest selectedRecurringDetailReference( String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set return this; } @@ -433,6 +486,7 @@ public String getSelectedRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelectedRecurringDetailReference(String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set } /** @@ -464,6 +518,7 @@ public void setSelectedRecurringDetailReference(String selectedRecurringDetailRe */ public CostEstimateRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -529,6 +584,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -545,6 +601,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public CostEstimateRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -580,6 +637,27 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CostEstimateRequest 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 CostEstimateRequest object is equal to o. */ @@ -653,6 +731,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetAssumptions) { + addIfNull(nulls, JSON_PROPERTY_ASSUMPTIONS, this.assumptions); + } + if (isSetCardNumber) { + addIfNull(nulls, JSON_PROPERTY_CARD_NUMBER, this.cardNumber); + } + if (isSetEncryptedCardNumber) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_CARD_NUMBER, this.encryptedCardNumber); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetMerchantDetails) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_DETAILS, this.merchantDetails); + } + if (isSetRecurring) { + addIfNull(nulls, JSON_PROPERTY_RECURRING, this.recurring); + } + if (isSetSelectedRecurringDetailReference) { + addIfNull( + nulls, + JSON_PROPERTY_SELECTED_RECURRING_DETAIL_REFERENCE, + this.selectedRecurringDetailReference); + } + if (isSetShopperInteraction) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION, this.shopperInteraction); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + + 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 CostEstimateRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/binlookup/CostEstimateResponse.java b/src/main/java/com/adyen/model/binlookup/CostEstimateResponse.java index 4a4746707..62fcc9ea3 100644 --- a/src/main/java/com/adyen/model/binlookup/CostEstimateResponse.java +++ b/src/main/java/com/adyen/model/binlookup/CostEstimateResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.binlookup; +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 CostEstimateResponse { public static final String JSON_PROPERTY_CARD_BIN = "cardBin"; private CardBin cardBin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardBin = false; + public static final String JSON_PROPERTY_COST_ESTIMATE_AMOUNT = "costEstimateAmount"; private Amount costEstimateAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCostEstimateAmount = false; + public static final String JSON_PROPERTY_COST_ESTIMATE_REFERENCE = "costEstimateReference"; private String costEstimateReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCostEstimateReference = false; + public static final String JSON_PROPERTY_RESULT_CODE = "resultCode"; private String 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 CostEstimateResponse() {} /** @@ -47,6 +67,7 @@ public CostEstimateResponse() {} */ public CostEstimateResponse cardBin(CardBin cardBin) { this.cardBin = cardBin; + isSetCardBin = true; // mark as set return this; } @@ -70,6 +91,7 @@ public CardBin getCardBin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardBin(CardBin cardBin) { this.cardBin = cardBin; + isSetCardBin = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setCardBin(CardBin cardBin) { */ public CostEstimateResponse costEstimateAmount(Amount costEstimateAmount) { this.costEstimateAmount = costEstimateAmount; + isSetCostEstimateAmount = true; // mark as set return this; } @@ -103,6 +126,7 @@ public Amount getCostEstimateAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCostEstimateAmount(Amount costEstimateAmount) { this.costEstimateAmount = costEstimateAmount; + isSetCostEstimateAmount = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setCostEstimateAmount(Amount costEstimateAmount) { */ public CostEstimateResponse costEstimateReference(String costEstimateReference) { this.costEstimateReference = costEstimateReference; + isSetCostEstimateReference = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getCostEstimateReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCostEstimateReference(String costEstimateReference) { this.costEstimateReference = costEstimateReference; + isSetCostEstimateReference = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setCostEstimateReference(String costEstimateReference) { */ public CostEstimateResponse resultCode(String resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -169,6 +196,27 @@ public String getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(String resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CostEstimateResponse 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 CostEstimateResponse object is equal to o. */ @@ -216,6 +264,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 (isSetCardBin) { + addIfNull(nulls, JSON_PROPERTY_CARD_BIN, this.cardBin); + } + if (isSetCostEstimateAmount) { + addIfNull(nulls, JSON_PROPERTY_COST_ESTIMATE_AMOUNT, this.costEstimateAmount); + } + if (isSetCostEstimateReference) { + addIfNull(nulls, JSON_PROPERTY_COST_ESTIMATE_REFERENCE, this.costEstimateReference); + } + 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 CostEstimateResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/binlookup/DSPublicKeyDetail.java b/src/main/java/com/adyen/model/binlookup/DSPublicKeyDetail.java index c19037c43..5888246b5 100644 --- a/src/main/java/com/adyen/model/binlookup/DSPublicKeyDetail.java +++ b/src/main/java/com/adyen/model/binlookup/DSPublicKeyDetail.java @@ -11,6 +11,8 @@ package com.adyen.model.binlookup; +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,18 +32,39 @@ public class DSPublicKeyDetail { public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_DIRECTORY_SERVER_ID = "directoryServerId"; private String directoryServerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirectoryServerId = false; + public static final String JSON_PROPERTY_FROM_S_D_K_VERSION = "fromSDKVersion"; private String fromSDKVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFromSDKVersion = false; + public static final String JSON_PROPERTY_PUBLIC_KEY = "publicKey"; private byte[] publicKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPublicKey = false; + public static final String JSON_PROPERTY_ROOT_CERTIFICATES = "rootCertificates"; private String rootCertificates; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRootCertificates = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DSPublicKeyDetail() {} /** @@ -52,6 +75,7 @@ public DSPublicKeyDetail() {} */ public DSPublicKeyDetail brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -75,6 +99,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -85,6 +110,7 @@ public void setBrand(String brand) { */ public DSPublicKeyDetail directoryServerId(String directoryServerId) { this.directoryServerId = directoryServerId; + isSetDirectoryServerId = true; // mark as set return this; } @@ -108,6 +134,7 @@ public String getDirectoryServerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirectoryServerId(String directoryServerId) { this.directoryServerId = directoryServerId; + isSetDirectoryServerId = true; // mark as set } /** @@ -123,6 +150,7 @@ public void setDirectoryServerId(String directoryServerId) { */ public DSPublicKeyDetail fromSDKVersion(String fromSDKVersion) { this.fromSDKVersion = fromSDKVersion; + isSetFromSDKVersion = true; // mark as set return this; } @@ -156,6 +184,7 @@ public String getFromSDKVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFromSDKVersion(String fromSDKVersion) { this.fromSDKVersion = fromSDKVersion; + isSetFromSDKVersion = true; // mark as set } /** @@ -167,6 +196,7 @@ public void setFromSDKVersion(String fromSDKVersion) { */ public DSPublicKeyDetail publicKey(byte[] publicKey) { this.publicKey = publicKey; + isSetPublicKey = true; // mark as set return this; } @@ -192,6 +222,7 @@ public byte[] getPublicKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPublicKey(byte[] publicKey) { this.publicKey = publicKey; + isSetPublicKey = true; // mark as set } /** @@ -204,6 +235,7 @@ public void setPublicKey(byte[] publicKey) { */ public DSPublicKeyDetail rootCertificates(String rootCertificates) { this.rootCertificates = rootCertificates; + isSetRootCertificates = true; // mark as set return this; } @@ -231,6 +263,27 @@ public String getRootCertificates() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRootCertificates(String rootCertificates) { this.rootCertificates = rootCertificates; + isSetRootCertificates = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DSPublicKeyDetail 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 DSPublicKeyDetail object is equal to o. */ @@ -279,6 +332,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 (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetDirectoryServerId) { + addIfNull(nulls, JSON_PROPERTY_DIRECTORY_SERVER_ID, this.directoryServerId); + } + if (isSetFromSDKVersion) { + addIfNull(nulls, JSON_PROPERTY_FROM_S_D_K_VERSION, this.fromSDKVersion); + } + if (isSetPublicKey) { + addIfNull(nulls, JSON_PROPERTY_PUBLIC_KEY, this.publicKey); + } + if (isSetRootCertificates) { + addIfNull(nulls, JSON_PROPERTY_ROOT_CERTIFICATES, this.rootCertificates); + } + + 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 DSPublicKeyDetail given an JSON string * diff --git a/src/main/java/com/adyen/model/binlookup/MerchantDetails.java b/src/main/java/com/adyen/model/binlookup/MerchantDetails.java index 02bbc179b..9646b1cbe 100644 --- a/src/main/java/com/adyen/model/binlookup/MerchantDetails.java +++ b/src/main/java/com/adyen/model/binlookup/MerchantDetails.java @@ -11,6 +11,8 @@ package com.adyen.model.binlookup; +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 MerchantDetails { 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_ENROLLED_IN3_D_SECURE = "enrolledIn3DSecure"; private Boolean enrolledIn3DSecure; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnrolledIn3DSecure = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantDetails() {} /** @@ -46,6 +63,7 @@ public MerchantDetails() {} */ public MerchantDetails countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -75,6 +93,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -86,6 +105,7 @@ public void setCountryCode(String countryCode) { */ public MerchantDetails enrolledIn3DSecure(Boolean enrolledIn3DSecure) { this.enrolledIn3DSecure = enrolledIn3DSecure; + isSetEnrolledIn3DSecure = true; // mark as set return this; } @@ -111,6 +131,7 @@ public Boolean getEnrolledIn3DSecure() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnrolledIn3DSecure(Boolean enrolledIn3DSecure) { this.enrolledIn3DSecure = enrolledIn3DSecure; + isSetEnrolledIn3DSecure = true; // mark as set } /** @@ -126,6 +147,7 @@ public void setEnrolledIn3DSecure(Boolean enrolledIn3DSecure) { */ public MerchantDetails mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -159,6 +181,27 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantDetails 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 MerchantDetails object is equal to o. */ @@ -202,6 +245,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 (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetEnrolledIn3DSecure) { + addIfNull(nulls, JSON_PROPERTY_ENROLLED_IN3_D_SECURE, this.enrolledIn3DSecure); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + + 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 MerchantDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/binlookup/Recurring.java b/src/main/java/com/adyen/model/binlookup/Recurring.java index 340775631..eb5e7439c 100644 --- a/src/main/java/com/adyen/model/binlookup/Recurring.java +++ b/src/main/java/com/adyen/model/binlookup/Recurring.java @@ -11,7 +11,9 @@ package com.adyen.model.binlookup; +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. */ @@ -435,6 +488,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/binlookup/ServiceError.java b/src/main/java/com/adyen/model/binlookup/ServiceError.java index 287ed2970..935dcd501 100644 --- a/src/main/java/com/adyen/model/binlookup/ServiceError.java +++ b/src/main/java/com/adyen/model/binlookup/ServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.binlookup; +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. */ @@ -311,6 +369,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/binlookup/ThreeDS2CardRangeDetail.java b/src/main/java/com/adyen/model/binlookup/ThreeDS2CardRangeDetail.java index 4da57d9ad..9894afc5c 100644 --- a/src/main/java/com/adyen/model/binlookup/ThreeDS2CardRangeDetail.java +++ b/src/main/java/com/adyen/model/binlookup/ThreeDS2CardRangeDetail.java @@ -11,6 +11,8 @@ package com.adyen.model.binlookup; +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 ThreeDS2CardRangeDetail { public static final String JSON_PROPERTY_ACS_INFO_IND = "acsInfoInd"; private List acsInfoInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsInfoInd = false; + public static final String JSON_PROPERTY_BRAND_CODE = "brandCode"; private String brandCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrandCode = false; + public static final String JSON_PROPERTY_END_RANGE = "endRange"; private String endRange; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndRange = false; + public static final String JSON_PROPERTY_START_RANGE = "startRange"; private String startRange; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartRange = false; + public static final String JSON_PROPERTY_THREE_D_S2_VERSIONS = "threeDS2Versions"; private List threeDS2Versions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2Versions = false; + public static final String JSON_PROPERTY_THREE_D_S_METHOD_U_R_L = "threeDSMethodURL"; private String threeDSMethodURL; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSMethodURL = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDS2CardRangeDetail() {} /** @@ -61,6 +87,7 @@ public ThreeDS2CardRangeDetail() {} */ public ThreeDS2CardRangeDetail acsInfoInd(List acsInfoInd) { this.acsInfoInd = acsInfoInd; + isSetAcsInfoInd = true; // mark as set return this; } @@ -100,6 +127,7 @@ public List getAcsInfoInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsInfoInd(List acsInfoInd) { this.acsInfoInd = acsInfoInd; + isSetAcsInfoInd = true; // mark as set } /** @@ -110,6 +138,7 @@ public void setAcsInfoInd(List acsInfoInd) { */ public ThreeDS2CardRangeDetail brandCode(String brandCode) { this.brandCode = brandCode; + isSetBrandCode = true; // mark as set return this; } @@ -133,6 +162,7 @@ public String getBrandCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrandCode(String brandCode) { this.brandCode = brandCode; + isSetBrandCode = true; // mark as set } /** @@ -143,6 +173,7 @@ public void setBrandCode(String brandCode) { */ public ThreeDS2CardRangeDetail endRange(String endRange) { this.endRange = endRange; + isSetEndRange = true; // mark as set return this; } @@ -166,6 +197,7 @@ public String getEndRange() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndRange(String endRange) { this.endRange = endRange; + isSetEndRange = true; // mark as set } /** @@ -176,6 +208,7 @@ public void setEndRange(String endRange) { */ public ThreeDS2CardRangeDetail startRange(String startRange) { this.startRange = startRange; + isSetStartRange = true; // mark as set return this; } @@ -199,6 +232,7 @@ public String getStartRange() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartRange(String startRange) { this.startRange = startRange; + isSetStartRange = true; // mark as set } /** @@ -209,6 +243,7 @@ public void setStartRange(String startRange) { */ public ThreeDS2CardRangeDetail threeDS2Versions(List threeDS2Versions) { this.threeDS2Versions = threeDS2Versions; + isSetThreeDS2Versions = true; // mark as set return this; } @@ -240,6 +275,7 @@ public List getThreeDS2Versions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2Versions(List threeDS2Versions) { this.threeDS2Versions = threeDS2Versions; + isSetThreeDS2Versions = true; // mark as set } /** @@ -252,6 +288,7 @@ public void setThreeDS2Versions(List threeDS2Versions) { */ public ThreeDS2CardRangeDetail threeDSMethodURL(String threeDSMethodURL) { this.threeDSMethodURL = threeDSMethodURL; + isSetThreeDSMethodURL = true; // mark as set return this; } @@ -279,6 +316,27 @@ public String getThreeDSMethodURL() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSMethodURL(String threeDSMethodURL) { this.threeDSMethodURL = threeDSMethodURL; + isSetThreeDSMethodURL = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDS2CardRangeDetail 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 ThreeDS2CardRangeDetail object is equal to o. */ @@ -329,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 (isSetAcsInfoInd) { + addIfNull(nulls, JSON_PROPERTY_ACS_INFO_IND, this.acsInfoInd); + } + if (isSetBrandCode) { + addIfNull(nulls, JSON_PROPERTY_BRAND_CODE, this.brandCode); + } + if (isSetEndRange) { + addIfNull(nulls, JSON_PROPERTY_END_RANGE, this.endRange); + } + if (isSetStartRange) { + addIfNull(nulls, JSON_PROPERTY_START_RANGE, this.startRange); + } + if (isSetThreeDS2Versions) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_VERSIONS, this.threeDS2Versions); + } + if (isSetThreeDSMethodURL) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_METHOD_U_R_L, this.threeDSMethodURL); + } + + 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 ThreeDS2CardRangeDetail given an JSON string * diff --git a/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityRequest.java b/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityRequest.java index 5f9adbbf1..18be5651a 100644 --- a/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityRequest.java +++ b/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.binlookup; +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,21 +36,45 @@ public class ThreeDSAvailabilityRequest { 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_BRANDS = "brands"; private List brands; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrands = false; + public static final String JSON_PROPERTY_CARD_NUMBER = "cardNumber"; private String cardNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardNumber = 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_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = 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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDSAvailabilityRequest() {} /** @@ -63,6 +89,7 @@ public ThreeDSAvailabilityRequest() {} */ public ThreeDSAvailabilityRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -102,6 +129,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -112,6 +140,7 @@ public void setAdditionalData(Map additionalData) { */ public ThreeDSAvailabilityRequest brands(List brands) { this.brands = brands; + isSetBrands = true; // mark as set return this; } @@ -143,6 +172,7 @@ public List getBrands() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrands(List brands) { this.brands = brands; + isSetBrands = true; // mark as set } /** @@ -153,6 +183,7 @@ public void setBrands(List brands) { */ public ThreeDSAvailabilityRequest cardNumber(String cardNumber) { this.cardNumber = cardNumber; + isSetCardNumber = true; // mark as set return this; } @@ -176,6 +207,7 @@ public String getCardNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardNumber(String cardNumber) { this.cardNumber = cardNumber; + isSetCardNumber = true; // mark as set } /** @@ -186,6 +218,7 @@ public void setCardNumber(String cardNumber) { */ public ThreeDSAvailabilityRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -209,6 +242,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -219,6 +253,7 @@ public void setMerchantAccount(String merchantAccount) { */ public ThreeDSAvailabilityRequest recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -242,6 +277,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -253,6 +289,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public ThreeDSAvailabilityRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -278,6 +315,27 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDSAvailabilityRequest 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 ThreeDSAvailabilityRequest object is equal to o. */ @@ -336,6 +394,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 (isSetBrands) { + addIfNull(nulls, JSON_PROPERTY_BRANDS, this.brands); + } + if (isSetCardNumber) { + addIfNull(nulls, JSON_PROPERTY_CARD_NUMBER, this.cardNumber); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + + 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 ThreeDSAvailabilityRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityResponse.java b/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityResponse.java index 0192d75a3..343f30494 100644 --- a/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityResponse.java +++ b/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.binlookup; +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; @@ -31,19 +33,40 @@ public class ThreeDSAvailabilityResponse { public static final String JSON_PROPERTY_BIN_DETAILS = "binDetails"; private BinDetail binDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBinDetails = false; + public static final String JSON_PROPERTY_DS_PUBLIC_KEYS = "dsPublicKeys"; private List dsPublicKeys; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDsPublicKeys = false; + public static final String JSON_PROPERTY_THREE_D_S1_SUPPORTED = "threeDS1Supported"; private Boolean threeDS1Supported; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS1Supported = false; + public static final String JSON_PROPERTY_THREE_D_S2_CARD_RANGE_DETAILS = "threeDS2CardRangeDetails"; private List threeDS2CardRangeDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2CardRangeDetails = false; + public static final String JSON_PROPERTY_THREE_D_S2SUPPORTED = "threeDS2supported"; private Boolean threeDS2supported; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2supported = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDSAvailabilityResponse() {} /** @@ -54,6 +77,7 @@ public ThreeDSAvailabilityResponse() {} */ public ThreeDSAvailabilityResponse binDetails(BinDetail binDetails) { this.binDetails = binDetails; + isSetBinDetails = true; // mark as set return this; } @@ -77,6 +101,7 @@ public BinDetail getBinDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBinDetails(BinDetail binDetails) { this.binDetails = binDetails; + isSetBinDetails = true; // mark as set } /** @@ -87,6 +112,7 @@ public void setBinDetails(BinDetail binDetails) { */ public ThreeDSAvailabilityResponse dsPublicKeys(List dsPublicKeys) { this.dsPublicKeys = dsPublicKeys; + isSetDsPublicKeys = true; // mark as set return this; } @@ -118,6 +144,7 @@ public List getDsPublicKeys() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDsPublicKeys(List dsPublicKeys) { this.dsPublicKeys = dsPublicKeys; + isSetDsPublicKeys = true; // mark as set } /** @@ -128,6 +155,7 @@ public void setDsPublicKeys(List dsPublicKeys) { */ public ThreeDSAvailabilityResponse threeDS1Supported(Boolean threeDS1Supported) { this.threeDS1Supported = threeDS1Supported; + isSetThreeDS1Supported = true; // mark as set return this; } @@ -151,6 +179,7 @@ public Boolean getThreeDS1Supported() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS1Supported(Boolean threeDS1Supported) { this.threeDS1Supported = threeDS1Supported; + isSetThreeDS1Supported = true; // mark as set } /** @@ -162,6 +191,7 @@ public void setThreeDS1Supported(Boolean threeDS1Supported) { public ThreeDSAvailabilityResponse threeDS2CardRangeDetails( List threeDS2CardRangeDetails) { this.threeDS2CardRangeDetails = threeDS2CardRangeDetails; + isSetThreeDS2CardRangeDetails = true; // mark as set return this; } @@ -194,6 +224,7 @@ public List getThreeDS2CardRangeDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2CardRangeDetails(List threeDS2CardRangeDetails) { this.threeDS2CardRangeDetails = threeDS2CardRangeDetails; + isSetThreeDS2CardRangeDetails = true; // mark as set } /** @@ -204,6 +235,7 @@ public void setThreeDS2CardRangeDetails(List threeDS2Ca */ public ThreeDSAvailabilityResponse threeDS2supported(Boolean threeDS2supported) { this.threeDS2supported = threeDS2supported; + isSetThreeDS2supported = true; // mark as set return this; } @@ -227,6 +259,27 @@ public Boolean getThreeDS2supported() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2supported(Boolean threeDS2supported) { this.threeDS2supported = threeDS2supported; + isSetThreeDS2supported = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDSAvailabilityResponse 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 ThreeDSAvailabilityResponse object is equal to o. */ @@ -278,6 +331,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 (isSetBinDetails) { + addIfNull(nulls, JSON_PROPERTY_BIN_DETAILS, this.binDetails); + } + if (isSetDsPublicKeys) { + addIfNull(nulls, JSON_PROPERTY_DS_PUBLIC_KEYS, this.dsPublicKeys); + } + if (isSetThreeDS1Supported) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S1_SUPPORTED, this.threeDS1Supported); + } + if (isSetThreeDS2CardRangeDetails) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_CARD_RANGE_DETAILS, this.threeDS2CardRangeDetails); + } + if (isSetThreeDS2supported) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2SUPPORTED, this.threeDS2supported); + } + + 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 ThreeDSAvailabilityResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AccountInfo.java b/src/main/java/com/adyen/model/checkout/AccountInfo.java index 248c546f8..6b2117900 100644 --- a/src/main/java/com/adyen/model/checkout/AccountInfo.java +++ b/src/main/java/com/adyen/model/checkout/AccountInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 Checkout 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 Checkout 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 Checkout 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. */ @@ -1246,6 +1369,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/checkout/AcctInfo.java b/src/main/java/com/adyen/model/checkout/AcctInfo.java index 89c0eda53..b9b7d99b4 100644 --- a/src/main/java/com/adyen/model/checkout/AcctInfo.java +++ b/src/main/java/com/adyen/model/checkout/AcctInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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. */ @@ -1211,6 +1319,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/checkout/AchDetails.java b/src/main/java/com/adyen/model/checkout/AchDetails.java index 887e5ce4b..3b9037ce4 100644 --- a/src/main/java/com/adyen/model/checkout/AchDetails.java +++ b/src/main/java/com/adyen/model/checkout/AchDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -82,9 +84,15 @@ public static AccountHolderTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCOUNT_HOLDER_TYPE = "accountHolderType"; private AccountHolderTypeEnum accountHolderType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderType = false; + 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; + /** The bank account type (checking, savings...). */ public enum BankAccountTypeEnum { BALANCE(String.valueOf("balance")), @@ -139,35 +147,65 @@ public static BankAccountTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_BANK_ACCOUNT_TYPE = "bankAccountType"; private BankAccountTypeEnum bankAccountType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccountType = 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_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ENCRYPTED_BANK_ACCOUNT_NUMBER = "encryptedBankAccountNumber"; private String encryptedBankAccountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedBankAccountNumber = false; + public static final String JSON_PROPERTY_ENCRYPTED_BANK_LOCATION_ID = "encryptedBankLocationId"; private String encryptedBankLocationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedBankLocationId = 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_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + /** **ach** */ public enum TypeEnum { ACH(String.valueOf("ach")), @@ -212,6 +250,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 AchDetails() {} /** @@ -222,6 +269,7 @@ public AchDetails() {} */ public AchDetails accountHolderType(AccountHolderTypeEnum accountHolderType) { this.accountHolderType = accountHolderType; + isSetAccountHolderType = true; // mark as set return this; } @@ -245,6 +293,7 @@ public AccountHolderTypeEnum getAccountHolderType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolderType(AccountHolderTypeEnum accountHolderType) { this.accountHolderType = accountHolderType; + isSetAccountHolderType = true; // mark as set } /** @@ -255,6 +304,7 @@ public void setAccountHolderType(AccountHolderTypeEnum accountHolderType) { */ public AchDetails bankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set return this; } @@ -278,6 +328,7 @@ public String getBankAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set } /** @@ -288,6 +339,7 @@ public void setBankAccountNumber(String bankAccountNumber) { */ public AchDetails bankAccountType(BankAccountTypeEnum bankAccountType) { this.bankAccountType = bankAccountType; + isSetBankAccountType = true; // mark as set return this; } @@ -311,6 +363,7 @@ public BankAccountTypeEnum getBankAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccountType(BankAccountTypeEnum bankAccountType) { this.bankAccountType = bankAccountType; + isSetBankAccountType = true; // mark as set } /** @@ -322,6 +375,7 @@ public void setBankAccountType(BankAccountTypeEnum bankAccountType) { */ public AchDetails bankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set return this; } @@ -347,6 +401,7 @@ public String getBankLocationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set } /** @@ -357,6 +412,7 @@ public void setBankLocationId(String bankLocationId) { */ public AchDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -380,6 +436,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -391,6 +448,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public AchDetails encryptedBankAccountNumber(String encryptedBankAccountNumber) { this.encryptedBankAccountNumber = encryptedBankAccountNumber; + isSetEncryptedBankAccountNumber = true; // mark as set return this; } @@ -416,6 +474,7 @@ public String getEncryptedBankAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedBankAccountNumber(String encryptedBankAccountNumber) { this.encryptedBankAccountNumber = encryptedBankAccountNumber; + isSetEncryptedBankAccountNumber = true; // mark as set } /** @@ -428,6 +487,7 @@ public void setEncryptedBankAccountNumber(String encryptedBankAccountNumber) { */ public AchDetails encryptedBankLocationId(String encryptedBankLocationId) { this.encryptedBankLocationId = encryptedBankLocationId; + isSetEncryptedBankLocationId = true; // mark as set return this; } @@ -455,6 +515,7 @@ public String getEncryptedBankLocationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedBankLocationId(String encryptedBankLocationId) { this.encryptedBankLocationId = encryptedBankLocationId; + isSetEncryptedBankLocationId = true; // mark as set } /** @@ -481,6 +542,7 @@ public void setEncryptedBankLocationId(String encryptedBankLocationId) { */ public AchDetails ownerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set return this; } @@ -536,6 +598,7 @@ public String getOwnerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwnerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set } /** @@ -550,6 +613,7 @@ public void setOwnerName(String ownerName) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public AchDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -581,6 +645,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -591,6 +656,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public AchDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -615,6 +681,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -627,6 +694,7 @@ public void setSdkData(String sdkData) { */ public AchDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -654,6 +722,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -666,6 +735,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public AchDetails transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -693,6 +763,7 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set } /** @@ -703,6 +774,7 @@ public void setTransferInstrumentId(String transferInstrumentId) { */ public AchDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -726,6 +798,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 AchDetails 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 AchDetails object is equal to o. */ @@ -812,6 +905,67 @@ 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 (isSetAccountHolderType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_TYPE, this.accountHolderType); + } + if (isSetBankAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT_NUMBER, this.bankAccountNumber); + } + if (isSetBankAccountType) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT_TYPE, this.bankAccountType); + } + if (isSetBankLocationId) { + addIfNull(nulls, JSON_PROPERTY_BANK_LOCATION_ID, this.bankLocationId); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetEncryptedBankAccountNumber) { + addIfNull( + nulls, JSON_PROPERTY_ENCRYPTED_BANK_ACCOUNT_NUMBER, this.encryptedBankAccountNumber); + } + if (isSetEncryptedBankLocationId) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_BANK_LOCATION_ID, this.encryptedBankLocationId); + } + if (isSetOwnerName) { + addIfNull(nulls, JSON_PROPERTY_OWNER_NAME, this.ownerName); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + 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 AchDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AdditionalData3DSecure.java b/src/main/java/com/adyen/model/checkout/AdditionalData3DSecure.java index f70e4ecfc..0bdab112e 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalData3DSecure.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalData3DSecure.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -36,6 +38,9 @@ public class AdditionalData3DSecure { // `authenticationData.threeDSRequestData.nativeThreeDS` instead. 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 @@ -90,20 +95,41 @@ 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"; @Deprecated // deprecated since Adyen Checkout API v69: Use // [`authenticationData.attemptAuthentication`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments?target=_blank#request-authenticationData-attemptAuthentication) instead 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() {} /** @@ -140,6 +166,7 @@ public AdditionalData3DSecure() {} // `authenticationData.threeDSRequestData.nativeThreeDS` instead. public AdditionalData3DSecure allow3DS2(String allow3DS2) { this.allow3DS2 = allow3DS2; + isSetAllow3DS2 = true; // mark as set return this; } @@ -215,6 +242,7 @@ public String getAllow3DS2() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllow3DS2(String allow3DS2) { this.allow3DS2 = allow3DS2; + isSetAllow3DS2 = true; // mark as set } /** @@ -229,6 +257,7 @@ public void setAllow3DS2(String allow3DS2) { */ public AdditionalData3DSecure challengeWindowSize(ChallengeWindowSizeEnum challengeWindowSize) { this.challengeWindowSize = challengeWindowSize; + isSetChallengeWindowSize = true; // mark as set return this; } @@ -260,6 +289,7 @@ public ChallengeWindowSizeEnum getChallengeWindowSize() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallengeWindowSize(ChallengeWindowSizeEnum challengeWindowSize) { this.challengeWindowSize = challengeWindowSize; + isSetChallengeWindowSize = true; // mark as set } /** @@ -284,6 +314,7 @@ public void setChallengeWindowSize(ChallengeWindowSizeEnum challengeWindowSize) // [`authenticationData.attemptAuthentication`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments?target=_blank#request-authenticationData-attemptAuthentication) instead public AdditionalData3DSecure executeThreeD(String executeThreeD) { this.executeThreeD = executeThreeD; + isSetExecuteThreeD = true; // mark as set return this; } @@ -335,6 +366,7 @@ public String getExecuteThreeD() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExecuteThreeD(String executeThreeD) { this.executeThreeD = executeThreeD; + isSetExecuteThreeD = true; // mark as set } /** @@ -345,6 +377,7 @@ public void setExecuteThreeD(String executeThreeD) { */ public AdditionalData3DSecure mpiImplementationType(String mpiImplementationType) { this.mpiImplementationType = mpiImplementationType; + isSetMpiImplementationType = true; // mark as set return this; } @@ -368,6 +401,7 @@ public String getMpiImplementationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiImplementationType(String mpiImplementationType) { this.mpiImplementationType = mpiImplementationType; + isSetMpiImplementationType = true; // mark as set } /** @@ -384,6 +418,7 @@ public void setMpiImplementationType(String mpiImplementationType) { */ public AdditionalData3DSecure scaExemption(String scaExemption) { this.scaExemption = scaExemption; + isSetScaExemption = true; // mark as set return this; } @@ -419,6 +454,7 @@ public String getScaExemption() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaExemption(String scaExemption) { this.scaExemption = scaExemption; + isSetScaExemption = true; // mark as set } /** @@ -443,6 +479,7 @@ public void setScaExemption(String scaExemption) { */ public AdditionalData3DSecure threeDSVersion(String threeDSVersion) { this.threeDSVersion = threeDSVersion; + isSetThreeDSVersion = true; // mark as set return this; } @@ -494,6 +531,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. */ @@ -553,6 +611,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/checkout/AdditionalDataAirline.java b/src/main/java/com/adyen/model/checkout/AdditionalDataAirline.java index 5e580f112..0c9a0b6ab 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataAirline.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataAirline.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -1632,6 +1805,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/checkout/AdditionalDataCarRental.java b/src/main/java/com/adyen/model/checkout/AdditionalDataCarRental.java index 4369495af..d53eb0d3b 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataCarRental.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataCarRental.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -1257,6 +1400,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/checkout/AdditionalDataCommon.java b/src/main/java/com/adyen/model/checkout/AdditionalDataCommon.java index 5e60cc065..e113d509a 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataCommon.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataCommon.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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. */ @@ -1392,6 +1525,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/checkout/AdditionalDataLevel23.java b/src/main/java/com/adyen/model/checkout/AdditionalDataLevel23.java index 12c5a5ef1..31fbaebce 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataLevel23.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataLevel23.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -1160,6 +1273,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/checkout/AdditionalDataLodging.java b/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java index 66f480469..3b2b5ef3d 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -945,6 +1058,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/checkout/AdditionalDataOpenInvoice.java b/src/main/java/com/adyen/model/checkout/AdditionalDataOpenInvoice.java index f7d5a7cf1..dff87e9fb 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataOpenInvoice.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataOpenInvoice.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -1000,6 +1118,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/checkout/AdditionalDataOpi.java b/src/main/java/com/adyen/model/checkout/AdditionalDataOpi.java index 95283e1af..1736ac611 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataOpi.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataOpi.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -118,6 +151,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/checkout/AdditionalDataRatepay.java b/src/main/java/com/adyen/model/checkout/AdditionalDataRatepay.java index a51848a87..b06a4c796 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataRatepay.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataRatepay.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -405,6 +473,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/checkout/AdditionalDataRetry.java b/src/main/java/com/adyen/model/checkout/AdditionalDataRetry.java index 39af136d2..8fd7cdc2e 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataRetry.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataRetry.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -266,6 +309,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/checkout/AdditionalDataRisk.java b/src/main/java/com/adyen/model/checkout/AdditionalDataRisk.java index f8f352421..35cfa7729 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataRisk.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataRisk.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -1107,6 +1240,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/checkout/AdditionalDataRiskStandalone.java b/src/main/java/com/adyen/model/checkout/AdditionalDataRiskStandalone.java index b3afd2db9..8a8de5e54 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataRiskStandalone.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataRiskStandalone.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -724,6 +827,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/checkout/AdditionalDataSubMerchant.java b/src/main/java/com/adyen/model/checkout/AdditionalDataSubMerchant.java index b4fd35e7c..cc49086bd 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataSubMerchant.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataSubMerchant.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -752,6 +840,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/checkout/AdditionalDataTemporaryServices.java b/src/main/java/com/adyen/model/checkout/AdditionalDataTemporaryServices.java index f27f68c52..c18de2b7e 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataTemporaryServices.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataTemporaryServices.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -536,6 +609,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/checkout/AdditionalDataWallets.java b/src/main/java/com/adyen/model/checkout/AdditionalDataWallets.java index d5c3315b8..cda8c3d43 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataWallets.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataWallets.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -302,6 +360,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/checkout/Address.java b/src/main/java/com/adyen/model/checkout/Address.java index b8f2434e7..5808793ad 100644 --- a/src/main/java/com/adyen/model/checkout/Address.java +++ b/src/main/java/com/adyen/model/checkout/Address.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -325,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 (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/checkout/AffirmDetails.java b/src/main/java/com/adyen/model/checkout/AffirmDetails.java index 3e873314a..de34ef24b 100644 --- a/src/main/java/com/adyen/model/checkout/AffirmDetails.java +++ b/src/main/java/com/adyen/model/checkout/AffirmDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,9 +33,15 @@ public class AffirmDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **affirm** */ public enum TypeEnum { AFFIRM(String.valueOf("affirm")); @@ -76,6 +84,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 AffirmDetails() {} /** @@ -86,6 +103,7 @@ public AffirmDetails() {} */ public AffirmDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -119,6 +138,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public AffirmDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -143,6 +163,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -153,6 +174,7 @@ public void setSdkData(String sdkData) { */ public AffirmDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -176,6 +198,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 AffirmDetails 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 AffirmDetails object is equal to o. */ @@ -219,6 +262,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + 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 AffirmDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AfterpayDetails.java b/src/main/java/com/adyen/model/checkout/AfterpayDetails.java index 989e36972..305b47942 100644 --- a/src/main/java/com/adyen/model/checkout/AfterpayDetails.java +++ b/src/main/java/com/adyen/model/checkout/AfterpayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -36,25 +38,46 @@ public class AfterpayDetails { public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private String billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private String deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_PERSONAL_DETAILS = "personalDetails"; private String personalDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPersonalDetails = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **afterpay_default** */ public enum TypeEnum { AFTERPAY_DEFAULT(String.valueOf("afterpay_default")), @@ -103,6 +126,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 AfterpayDetails() {} /** @@ -113,6 +145,7 @@ public AfterpayDetails() {} */ public AfterpayDetails billingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -136,6 +169,7 @@ public String getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -146,6 +180,7 @@ public void setBillingAddress(String billingAddress) { */ public AfterpayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -169,6 +204,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -179,6 +215,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public AfterpayDetails deliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -202,6 +239,7 @@ public String getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -212,6 +250,7 @@ public void setDeliveryAddress(String deliveryAddress) { */ public AfterpayDetails personalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set return this; } @@ -235,6 +274,7 @@ public String getPersonalDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPersonalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set } /** @@ -249,6 +289,7 @@ public void setPersonalDetails(String personalDetails) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public AfterpayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -280,6 +321,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -290,6 +332,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public AfterpayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -314,6 +357,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -326,6 +370,7 @@ public void setSdkData(String sdkData) { */ public AfterpayDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -353,6 +398,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -363,6 +409,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public AfterpayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -386,6 +433,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 AfterpayDetails 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 AfterpayDetails object is equal to o. */ @@ -451,6 +519,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 (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetPersonalDetails) { + addIfNull(nulls, JSON_PROPERTY_PERSONAL_DETAILS, this.personalDetails); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 AfterpayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Agency.java b/src/main/java/com/adyen/model/checkout/Agency.java index 1f4e0105e..60b6bd317 100644 --- a/src/main/java/com/adyen/model/checkout/Agency.java +++ b/src/main/java/com/adyen/model/checkout/Agency.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 Agency { public static final String JSON_PROPERTY_INVOICE_NUMBER = "invoiceNumber"; private String invoiceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInvoiceNumber = false; + public static final String JSON_PROPERTY_PLAN_NAME = "planName"; private String planName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlanName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Agency() {} /** @@ -38,6 +52,7 @@ public Agency() {} */ public Agency invoiceNumber(String invoiceNumber) { this.invoiceNumber = invoiceNumber; + isSetInvoiceNumber = true; // mark as set return this; } @@ -65,6 +80,7 @@ public String getInvoiceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInvoiceNumber(String invoiceNumber) { this.invoiceNumber = invoiceNumber; + isSetInvoiceNumber = true; // mark as set } /** @@ -77,6 +93,7 @@ public void setInvoiceNumber(String invoiceNumber) { */ public Agency planName(String planName) { this.planName = planName; + isSetPlanName = true; // mark as set return this; } @@ -104,6 +121,27 @@ public String getPlanName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlanName(String planName) { this.planName = planName; + isSetPlanName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Agency 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 Agency object is equal to o. */ @@ -145,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 (isSetInvoiceNumber) { + addIfNull(nulls, JSON_PROPERTY_INVOICE_NUMBER, this.invoiceNumber); + } + if (isSetPlanName) { + addIfNull(nulls, JSON_PROPERTY_PLAN_NAME, this.planName); + } + + 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 Agency given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Airline.java b/src/main/java/com/adyen/model/checkout/Airline.java index 96e8b1138..253c32c19 100644 --- a/src/main/java/com/adyen/model/checkout/Airline.java +++ b/src/main/java/com/adyen/model/checkout/Airline.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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; @@ -40,43 +42,88 @@ public class Airline { public static final String JSON_PROPERTY_AGENCY = "agency"; private Agency agency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAgency = false; + public static final String JSON_PROPERTY_BOARDING_FEE = "boardingFee"; private Long boardingFee; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBoardingFee = false; + public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_COMPUTERIZED_RESERVATION_SYSTEM = "computerizedReservationSystem"; private String computerizedReservationSystem; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetComputerizedReservationSystem = false; + public static final String JSON_PROPERTY_CUSTOMER_REFERENCE_NUMBER = "customerReferenceNumber"; private String customerReferenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCustomerReferenceNumber = false; + public static final String JSON_PROPERTY_DESIGNATOR_CODE = "designatorCode"; private String designatorCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDesignatorCode = false; + public static final String JSON_PROPERTY_DOCUMENT_TYPE = "documentType"; private String documentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocumentType = false; + public static final String JSON_PROPERTY_FLIGHT_DATE = "flightDate"; private OffsetDateTime flightDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFlightDate = false; + public static final String JSON_PROPERTY_LEGS = "legs"; private List legs; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegs = false; + public static final String JSON_PROPERTY_PASSENGER_NAME = "passengerName"; private String passengerName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPassengerName = false; + public static final String JSON_PROPERTY_PASSENGERS = "passengers"; private List passengers; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPassengers = false; + public static final String JSON_PROPERTY_TICKET = "ticket"; private Ticket ticket; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTicket = false; + public static final String JSON_PROPERTY_TRAVEL_AGENCY = "travelAgency"; private TravelAgency travelAgency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTravelAgency = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Airline() {} /** @@ -87,6 +134,7 @@ public Airline() {} */ public Airline agency(Agency agency) { this.agency = agency; + isSetAgency = true; // mark as set return this; } @@ -110,6 +158,7 @@ public Agency getAgency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAgency(Agency agency) { this.agency = agency; + isSetAgency = true; // mark as set } /** @@ -124,6 +173,7 @@ public void setAgency(Agency agency) { */ public Airline boardingFee(Long boardingFee) { this.boardingFee = boardingFee; + isSetBoardingFee = true; // mark as set return this; } @@ -155,6 +205,7 @@ public Long getBoardingFee() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBoardingFee(Long boardingFee) { this.boardingFee = boardingFee; + isSetBoardingFee = true; // mark as set } /** @@ -171,6 +222,7 @@ public void setBoardingFee(Long boardingFee) { */ public Airline code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -206,6 +258,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -221,6 +274,7 @@ public void setCode(String code) { */ public Airline computerizedReservationSystem(String computerizedReservationSystem) { this.computerizedReservationSystem = computerizedReservationSystem; + isSetComputerizedReservationSystem = true; // mark as set return this; } @@ -254,6 +308,7 @@ public String getComputerizedReservationSystem() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setComputerizedReservationSystem(String computerizedReservationSystem) { this.computerizedReservationSystem = computerizedReservationSystem; + isSetComputerizedReservationSystem = true; // mark as set } /** @@ -268,6 +323,7 @@ public void setComputerizedReservationSystem(String computerizedReservationSyste */ public Airline customerReferenceNumber(String customerReferenceNumber) { this.customerReferenceNumber = customerReferenceNumber; + isSetCustomerReferenceNumber = true; // mark as set return this; } @@ -299,6 +355,7 @@ public String getCustomerReferenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCustomerReferenceNumber(String customerReferenceNumber) { this.customerReferenceNumber = customerReferenceNumber; + isSetCustomerReferenceNumber = true; // mark as set } /** @@ -314,6 +371,7 @@ public void setCustomerReferenceNumber(String customerReferenceNumber) { */ public Airline designatorCode(String designatorCode) { this.designatorCode = designatorCode; + isSetDesignatorCode = true; // mark as set return this; } @@ -347,6 +405,7 @@ public String getDesignatorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDesignatorCode(String designatorCode) { this.designatorCode = designatorCode; + isSetDesignatorCode = true; // mark as set } /** @@ -361,6 +420,7 @@ public void setDesignatorCode(String designatorCode) { */ public Airline documentType(String documentType) { this.documentType = documentType; + isSetDocumentType = true; // mark as set return this; } @@ -392,6 +452,7 @@ public String getDocumentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocumentType(String documentType) { this.documentType = documentType; + isSetDocumentType = true; // mark as set } /** @@ -406,6 +467,7 @@ public void setDocumentType(String documentType) { */ public Airline flightDate(OffsetDateTime flightDate) { this.flightDate = flightDate; + isSetFlightDate = true; // mark as set return this; } @@ -437,6 +499,7 @@ public OffsetDateTime getFlightDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFlightDate(OffsetDateTime flightDate) { this.flightDate = flightDate; + isSetFlightDate = true; // mark as set } /** @@ -447,6 +510,7 @@ public void setFlightDate(OffsetDateTime flightDate) { */ public Airline legs(List legs) { this.legs = legs; + isSetLegs = true; // mark as set return this; } @@ -478,6 +542,7 @@ public List getLegs() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegs(List legs) { this.legs = legs; + isSetLegs = true; // mark as set } /** @@ -494,6 +559,7 @@ public void setLegs(List legs) { */ public Airline passengerName(String passengerName) { this.passengerName = passengerName; + isSetPassengerName = true; // mark as set return this; } @@ -529,6 +595,7 @@ public String getPassengerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPassengerName(String passengerName) { this.passengerName = passengerName; + isSetPassengerName = true; // mark as set } /** @@ -539,6 +606,7 @@ public void setPassengerName(String passengerName) { */ public Airline passengers(List passengers) { this.passengers = passengers; + isSetPassengers = true; // mark as set return this; } @@ -570,6 +638,7 @@ public List getPassengers() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPassengers(List passengers) { this.passengers = passengers; + isSetPassengers = true; // mark as set } /** @@ -580,6 +649,7 @@ public void setPassengers(List passengers) { */ public Airline ticket(Ticket ticket) { this.ticket = ticket; + isSetTicket = true; // mark as set return this; } @@ -603,6 +673,7 @@ public Ticket getTicket() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTicket(Ticket ticket) { this.ticket = ticket; + isSetTicket = true; // mark as set } /** @@ -613,6 +684,7 @@ public void setTicket(Ticket ticket) { */ public Airline travelAgency(TravelAgency travelAgency) { this.travelAgency = travelAgency; + isSetTravelAgency = true; // mark as set return this; } @@ -636,6 +708,27 @@ public TravelAgency getTravelAgency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTravelAgency(TravelAgency travelAgency) { this.travelAgency = travelAgency; + isSetTravelAgency = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Airline 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 Airline object is equal to o. */ @@ -716,6 +809,67 @@ 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 (isSetAgency) { + addIfNull(nulls, JSON_PROPERTY_AGENCY, this.agency); + } + if (isSetBoardingFee) { + addIfNull(nulls, JSON_PROPERTY_BOARDING_FEE, this.boardingFee); + } + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetComputerizedReservationSystem) { + addIfNull( + nulls, JSON_PROPERTY_COMPUTERIZED_RESERVATION_SYSTEM, this.computerizedReservationSystem); + } + if (isSetCustomerReferenceNumber) { + addIfNull(nulls, JSON_PROPERTY_CUSTOMER_REFERENCE_NUMBER, this.customerReferenceNumber); + } + if (isSetDesignatorCode) { + addIfNull(nulls, JSON_PROPERTY_DESIGNATOR_CODE, this.designatorCode); + } + if (isSetDocumentType) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENT_TYPE, this.documentType); + } + if (isSetFlightDate) { + addIfNull(nulls, JSON_PROPERTY_FLIGHT_DATE, this.flightDate); + } + if (isSetLegs) { + addIfNull(nulls, JSON_PROPERTY_LEGS, this.legs); + } + if (isSetPassengerName) { + addIfNull(nulls, JSON_PROPERTY_PASSENGER_NAME, this.passengerName); + } + if (isSetPassengers) { + addIfNull(nulls, JSON_PROPERTY_PASSENGERS, this.passengers); + } + if (isSetTicket) { + addIfNull(nulls, JSON_PROPERTY_TICKET, this.ticket); + } + if (isSetTravelAgency) { + addIfNull(nulls, JSON_PROPERTY_TRAVEL_AGENCY, this.travelAgency); + } + + 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 Airline given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AmazonPayDetails.java b/src/main/java/com/adyen/model/checkout/AmazonPayDetails.java index cd92a982a..f0f67d2ed 100644 --- a/src/main/java/com/adyen/model/checkout/AmazonPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/AmazonPayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 AmazonPayDetails { public static final String JSON_PROPERTY_AMAZON_PAY_TOKEN = "amazonPayToken"; private String amazonPayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmazonPayToken = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_CHECKOUT_SESSION_ID = "checkoutSessionId"; private String checkoutSessionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutSessionId = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **amazonpay** */ public enum TypeEnum { AMAZONPAY(String.valueOf("amazonpay")); @@ -84,6 +98,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 AmazonPayDetails() {} /** @@ -99,6 +122,7 @@ public AmazonPayDetails() {} */ public AmazonPayDetails amazonPayToken(String amazonPayToken) { this.amazonPayToken = amazonPayToken; + isSetAmazonPayToken = true; // mark as set return this; } @@ -132,6 +156,7 @@ public String getAmazonPayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmazonPayToken(String amazonPayToken) { this.amazonPayToken = amazonPayToken; + isSetAmazonPayToken = true; // mark as set } /** @@ -142,6 +167,7 @@ public void setAmazonPayToken(String amazonPayToken) { */ public AmazonPayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -165,6 +191,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -179,6 +206,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public AmazonPayDetails checkoutSessionId(String checkoutSessionId) { this.checkoutSessionId = checkoutSessionId; + isSetCheckoutSessionId = true; // mark as set return this; } @@ -210,6 +238,7 @@ public String getCheckoutSessionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutSessionId(String checkoutSessionId) { this.checkoutSessionId = checkoutSessionId; + isSetCheckoutSessionId = true; // mark as set } /** @@ -220,6 +249,7 @@ public void setCheckoutSessionId(String checkoutSessionId) { */ public AmazonPayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -244,6 +274,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -254,6 +285,7 @@ public void setSdkData(String sdkData) { */ public AmazonPayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -277,6 +309,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 AmazonPayDetails 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 AmazonPayDetails object is equal to o. */ @@ -324,6 +377,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 (isSetAmazonPayToken) { + addIfNull(nulls, JSON_PROPERTY_AMAZON_PAY_TOKEN, this.amazonPayToken); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetCheckoutSessionId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_SESSION_ID, this.checkoutSessionId); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + 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 AmazonPayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Amount.java b/src/main/java/com/adyen/model/checkout/Amount.java index 7f0b61d65..ec7eac345 100644 --- a/src/main/java/com/adyen/model/checkout/Amount.java +++ b/src/main/java/com/adyen/model/checkout/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -145,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 (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/checkout/Amounts.java b/src/main/java/com/adyen/model/checkout/Amounts.java index a0ecfc893..3b342e560 100644 --- a/src/main/java/com/adyen/model/checkout/Amounts.java +++ b/src/main/java/com/adyen/model/checkout/Amounts.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 Amounts { 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_VALUES = "values"; private List values; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValues = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Amounts() {} /** @@ -40,6 +54,7 @@ public Amounts() {} */ public Amounts currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -67,6 +82,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -79,6 +95,7 @@ public void setCurrency(String currency) { */ public Amounts values(List values) { this.values = values; + isSetValues = true; // mark as set return this; } @@ -114,6 +131,27 @@ public List getValues() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValues(List values) { this.values = values; + isSetValues = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Amounts 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 Amounts object is equal to o. */ @@ -155,6 +193,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 (isSetValues) { + addIfNull(nulls, JSON_PROPERTY_VALUES, this.values); + } + + 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 Amounts given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AncvDetails.java b/src/main/java/com/adyen/model/checkout/AncvDetails.java index 414b19ebe..aaab1abb2 100644 --- a/src/main/java/com/adyen/model/checkout/AncvDetails.java +++ b/src/main/java/com/adyen/model/checkout/AncvDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,19 +36,34 @@ public class AncvDetails { public static final String JSON_PROPERTY_BENEFICIARY_ID = "beneficiaryId"; private String beneficiaryId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBeneficiaryId = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **ancv** */ public enum TypeEnum { ANCV(String.valueOf("ancv")); @@ -89,6 +106,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 AncvDetails() {} /** @@ -99,6 +125,7 @@ public AncvDetails() {} */ public AncvDetails beneficiaryId(String beneficiaryId) { this.beneficiaryId = beneficiaryId; + isSetBeneficiaryId = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getBeneficiaryId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBeneficiaryId(String beneficiaryId) { this.beneficiaryId = beneficiaryId; + isSetBeneficiaryId = true; // mark as set } /** @@ -132,6 +160,7 @@ public void setBeneficiaryId(String beneficiaryId) { */ public AncvDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -155,6 +184,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -169,6 +199,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public AncvDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -200,6 +231,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -210,6 +242,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public AncvDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -234,6 +267,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -246,6 +280,7 @@ public void setSdkData(String sdkData) { */ public AncvDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -273,6 +308,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -283,6 +319,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public AncvDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -306,6 +343,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 AncvDetails 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 AncvDetails object is equal to o. */ @@ -365,6 +423,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 (isSetBeneficiaryId) { + addIfNull(nulls, JSON_PROPERTY_BENEFICIARY_ID, this.beneficiaryId); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 AncvDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AndroidPayDetails.java b/src/main/java/com/adyen/model/checkout/AndroidPayDetails.java index 5ec29d824..b26214e98 100644 --- a/src/main/java/com/adyen/model/checkout/AndroidPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/AndroidPayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,9 +33,15 @@ public class AndroidPayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **androidpay** */ public enum TypeEnum { ANDROIDPAY(String.valueOf("androidpay")); @@ -76,6 +84,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 AndroidPayDetails() {} /** @@ -86,6 +103,7 @@ public AndroidPayDetails() {} */ public AndroidPayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -119,6 +138,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public AndroidPayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -143,6 +163,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -153,6 +174,7 @@ public void setSdkData(String sdkData) { */ public AndroidPayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -176,6 +198,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 AndroidPayDetails 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 AndroidPayDetails object is equal to o. */ @@ -219,6 +262,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + 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 AndroidPayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ApplePayDetails.java b/src/main/java/com/adyen/model/checkout/ApplePayDetails.java index df1ec1622..12cb7767f 100644 --- a/src/main/java/com/adyen/model/checkout/ApplePayDetails.java +++ b/src/main/java/com/adyen/model/checkout/ApplePayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +37,15 @@ public class ApplePayDetails { public static final String JSON_PROPERTY_APPLE_PAY_TOKEN = "applePayToken"; private String applePayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplePayToken = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = 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**. @@ -85,16 +93,28 @@ 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_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **applepay** */ public enum TypeEnum { APPLEPAY(String.valueOf("applepay")); @@ -137,6 +157,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 ApplePayDetails() {} /** @@ -149,6 +178,7 @@ public ApplePayDetails() {} */ public ApplePayDetails applePayToken(String applePayToken) { this.applePayToken = applePayToken; + isSetApplePayToken = true; // mark as set return this; } @@ -176,6 +206,7 @@ public String getApplePayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplePayToken(String applePayToken) { this.applePayToken = applePayToken; + isSetApplePayToken = true; // mark as set } /** @@ -186,6 +217,7 @@ public void setApplePayToken(String applePayToken) { */ public ApplePayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -209,6 +241,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -222,6 +255,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public ApplePayDetails fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -251,6 +285,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -265,6 +300,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public ApplePayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -296,6 +332,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -306,6 +343,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public ApplePayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -330,6 +368,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -342,6 +381,7 @@ public void setSdkData(String sdkData) { */ public ApplePayDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -369,6 +409,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -379,6 +420,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public ApplePayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -402,6 +444,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 ApplePayDetails 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 ApplePayDetails object is equal to o. */ @@ -464,6 +527,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetApplePayToken) { + addIfNull(nulls, JSON_PROPERTY_APPLE_PAY_TOKEN, this.applePayToken); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 ApplePayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ApplePayDonations.java b/src/main/java/com/adyen/model/checkout/ApplePayDonations.java index 641efc502..1f6af007f 100644 --- a/src/main/java/com/adyen/model/checkout/ApplePayDonations.java +++ b/src/main/java/com/adyen/model/checkout/ApplePayDonations.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +37,15 @@ public class ApplePayDonations { public static final String JSON_PROPERTY_APPLE_PAY_TOKEN = "applePayToken"; private String applePayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplePayToken = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = 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**. @@ -85,16 +93,28 @@ 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_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **applepay** */ public enum TypeEnum { APPLEPAY(String.valueOf("applepay")); @@ -137,6 +157,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 ApplePayDonations() {} /** @@ -149,6 +178,7 @@ public ApplePayDonations() {} */ public ApplePayDonations applePayToken(String applePayToken) { this.applePayToken = applePayToken; + isSetApplePayToken = true; // mark as set return this; } @@ -176,6 +206,7 @@ public String getApplePayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplePayToken(String applePayToken) { this.applePayToken = applePayToken; + isSetApplePayToken = true; // mark as set } /** @@ -186,6 +217,7 @@ public void setApplePayToken(String applePayToken) { */ public ApplePayDonations checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -209,6 +241,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -222,6 +255,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public ApplePayDonations fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -251,6 +285,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -265,6 +300,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public ApplePayDonations recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -296,6 +332,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -306,6 +343,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public ApplePayDonations sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -330,6 +368,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -342,6 +381,7 @@ public void setSdkData(String sdkData) { */ public ApplePayDonations storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -369,6 +409,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -379,6 +420,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public ApplePayDonations type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -402,6 +444,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 ApplePayDonations 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 ApplePayDonations object is equal to o. */ @@ -464,6 +527,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetApplePayToken) { + addIfNull(nulls, JSON_PROPERTY_APPLE_PAY_TOKEN, this.applePayToken); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 ApplePayDonations given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ApplePaySessionRequest.java b/src/main/java/com/adyen/model/checkout/ApplePaySessionRequest.java index bf154ed7c..0ea74dd6a 100644 --- a/src/main/java/com/adyen/model/checkout/ApplePaySessionRequest.java +++ b/src/main/java/com/adyen/model/checkout/ApplePaySessionRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 ApplePaySessionRequest { public static final String JSON_PROPERTY_DISPLAY_NAME = "displayName"; private String displayName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisplayName = false; + public static final String JSON_PROPERTY_DOMAIN_NAME = "domainName"; private String domainName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDomainName = false; + public static final String JSON_PROPERTY_MERCHANT_IDENTIFIER = "merchantIdentifier"; private String merchantIdentifier; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantIdentifier = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ApplePaySessionRequest() {} /** @@ -49,6 +66,7 @@ public ApplePaySessionRequest() {} */ public ApplePaySessionRequest displayName(String displayName) { this.displayName = displayName; + isSetDisplayName = true; // mark as set return this; } @@ -84,6 +102,7 @@ public String getDisplayName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDisplayName(String displayName) { this.displayName = displayName; + isSetDisplayName = true; // mark as set } /** @@ -96,6 +115,7 @@ public void setDisplayName(String displayName) { */ public ApplePaySessionRequest domainName(String domainName) { this.domainName = domainName; + isSetDomainName = true; // mark as set return this; } @@ -123,6 +143,7 @@ public String getDomainName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDomainName(String domainName) { this.domainName = domainName; + isSetDomainName = true; // mark as set } /** @@ -139,6 +160,7 @@ public void setDomainName(String domainName) { */ public ApplePaySessionRequest merchantIdentifier(String merchantIdentifier) { this.merchantIdentifier = merchantIdentifier; + isSetMerchantIdentifier = true; // mark as set return this; } @@ -174,6 +196,27 @@ public String getMerchantIdentifier() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantIdentifier(String merchantIdentifier) { this.merchantIdentifier = merchantIdentifier; + isSetMerchantIdentifier = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ApplePaySessionRequest 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 ApplePaySessionRequest object is equal to o. */ @@ -217,6 +260,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 (isSetDisplayName) { + addIfNull(nulls, JSON_PROPERTY_DISPLAY_NAME, this.displayName); + } + if (isSetDomainName) { + addIfNull(nulls, JSON_PROPERTY_DOMAIN_NAME, this.domainName); + } + if (isSetMerchantIdentifier) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_IDENTIFIER, this.merchantIdentifier); + } + + 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 ApplePaySessionRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ApplePaySessionResponse.java b/src/main/java/com/adyen/model/checkout/ApplePaySessionResponse.java index 2befc8166..504d6fbd5 100644 --- a/src/main/java/com/adyen/model/checkout/ApplePaySessionResponse.java +++ b/src/main/java/com/adyen/model/checkout/ApplePaySessionResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 ApplePaySessionResponse { public static final String JSON_PROPERTY_DATA = "data"; private String data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ApplePaySessionResponse() {} /** @@ -35,6 +46,7 @@ public ApplePaySessionResponse() {} */ public ApplePaySessionResponse data(String data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -62,6 +74,27 @@ public String getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(String data) { this.data = data; + isSetData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ApplePaySessionResponse 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 ApplePaySessionResponse object is equal to o. */ @@ -101,6 +134,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 (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + + 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 ApplePaySessionResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ApplicationInfo.java b/src/main/java/com/adyen/model/checkout/ApplicationInfo.java index 973a8bdf4..d5fd416b3 100644 --- a/src/main/java/com/adyen/model/checkout/ApplicationInfo.java +++ b/src/main/java/com/adyen/model/checkout/ApplicationInfo.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -303,6 +361,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/checkout/AuthenticationData.java b/src/main/java/com/adyen/model/checkout/AuthenticationData.java index 912b2ba23..f56a77d51 100644 --- a/src/main/java/com/adyen/model/checkout/AuthenticationData.java +++ b/src/main/java/com/adyen/model/checkout/AuthenticationData.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,12 +81,27 @@ public static AttemptAuthenticationEnum fromValue(String value) { public static final String JSON_PROPERTY_ATTEMPT_AUTHENTICATION = "attemptAuthentication"; private AttemptAuthenticationEnum attemptAuthentication; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAttemptAuthentication = false; + public static final String JSON_PROPERTY_AUTHENTICATION_ONLY = "authenticationOnly"; private Boolean authenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationOnly = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUEST_DATA = "threeDSRequestData"; private ThreeDSRequestData threeDSRequestData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AuthenticationData() {} /** @@ -105,6 +122,7 @@ public AuthenticationData() {} */ public AuthenticationData attemptAuthentication(AttemptAuthenticationEnum attemptAuthentication) { this.attemptAuthentication = attemptAuthentication; + isSetAttemptAuthentication = true; // mark as set return this; } @@ -148,6 +166,7 @@ public AttemptAuthenticationEnum getAttemptAuthentication() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAttemptAuthentication(AttemptAuthenticationEnum attemptAuthentication) { this.attemptAuthentication = attemptAuthentication; + isSetAttemptAuthentication = true; // mark as set } /** @@ -164,6 +183,7 @@ public void setAttemptAuthentication(AttemptAuthenticationEnum attemptAuthentica */ public AuthenticationData authenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; + isSetAuthenticationOnly = true; // mark as set return this; } @@ -199,6 +219,7 @@ public Boolean getAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; + isSetAuthenticationOnly = true; // mark as set } /** @@ -209,6 +230,7 @@ public void setAuthenticationOnly(Boolean authenticationOnly) { */ public AuthenticationData threeDSRequestData(ThreeDSRequestData threeDSRequestData) { this.threeDSRequestData = threeDSRequestData; + isSetThreeDSRequestData = true; // mark as set return this; } @@ -232,6 +254,27 @@ public ThreeDSRequestData getThreeDSRequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestData(ThreeDSRequestData threeDSRequestData) { this.threeDSRequestData = threeDSRequestData; + isSetThreeDSRequestData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AuthenticationData 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 AuthenticationData object is equal to o. */ @@ -277,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 (isSetAttemptAuthentication) { + addIfNull(nulls, JSON_PROPERTY_ATTEMPT_AUTHENTICATION, this.attemptAuthentication); + } + if (isSetAuthenticationOnly) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_ONLY, this.authenticationOnly); + } + if (isSetThreeDSRequestData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQUEST_DATA, this.threeDSRequestData); + } + + 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 AuthenticationData given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/BacsDirectDebitDetails.java b/src/main/java/com/adyen/model/checkout/BacsDirectDebitDetails.java index 831246a56..28c22967e 100644 --- a/src/main/java/com/adyen/model/checkout/BacsDirectDebitDetails.java +++ b/src/main/java/com/adyen/model/checkout/BacsDirectDebitDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,28 +39,52 @@ public class BacsDirectDebitDetails { 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_LOCATION_ID = "bankLocationId"; private String bankLocationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankLocationId = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = 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_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + /** **directdebit_GB** */ public enum TypeEnum { DIRECTDEBIT_GB(String.valueOf("directdebit_GB")); @@ -101,6 +127,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 BacsDirectDebitDetails() {} /** @@ -111,6 +146,7 @@ public BacsDirectDebitDetails() {} */ public BacsDirectDebitDetails bankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set return this; } @@ -134,6 +170,7 @@ public String getBankAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set } /** @@ -144,6 +181,7 @@ public void setBankAccountNumber(String bankAccountNumber) { */ public BacsDirectDebitDetails bankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set return this; } @@ -167,6 +205,7 @@ public String getBankLocationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set } /** @@ -177,6 +216,7 @@ public void setBankLocationId(String bankLocationId) { */ public BacsDirectDebitDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -200,6 +240,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -210,6 +251,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public BacsDirectDebitDetails holderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set return this; } @@ -233,6 +275,7 @@ public String getHolderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHolderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set } /** @@ -247,6 +290,7 @@ public void setHolderName(String holderName) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public BacsDirectDebitDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -278,6 +322,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -288,6 +333,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public BacsDirectDebitDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -312,6 +358,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -324,6 +371,7 @@ public void setSdkData(String sdkData) { */ public BacsDirectDebitDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -351,6 +399,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -363,6 +412,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public BacsDirectDebitDetails transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -390,6 +440,7 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set } /** @@ -400,6 +451,7 @@ public void setTransferInstrumentId(String transferInstrumentId) { */ public BacsDirectDebitDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -423,6 +475,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 BacsDirectDebitDetails 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 BacsDirectDebitDetails object is equal to o. */ @@ -494,6 +567,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 (isSetBankLocationId) { + addIfNull(nulls, JSON_PROPERTY_BANK_LOCATION_ID, this.bankLocationId); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetHolderName) { + addIfNull(nulls, JSON_PROPERTY_HOLDER_NAME, this.holderName); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + 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 BacsDirectDebitDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/BalanceCheckRequest.java b/src/main/java/com/adyen/model/checkout/BalanceCheckRequest.java index 445ece698..e98e94e49 100644 --- a/src/main/java/com/adyen/model/checkout/BalanceCheckRequest.java +++ b/src/main/java/com/adyen/model/checkout/BalanceCheckRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -78,76 +80,148 @@ public class BalanceCheckRequest { 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_PAYMENT_METHOD = "paymentMethod"; private Map paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = 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 @@ -205,25 +279,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 @@ -284,45 +379,90 @@ 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"; @Deprecated // deprecated since Adyen Checkout API v69: Use // `authenticationData.authenticationOnly` instead. 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 BalanceCheckRequest() {} /** @@ -333,6 +473,7 @@ public BalanceCheckRequest() {} */ public BalanceCheckRequest accountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set return this; } @@ -356,6 +497,7 @@ public AccountInfo getAccountInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set } /** @@ -366,6 +508,7 @@ public void setAccountInfo(AccountInfo accountInfo) { */ public BalanceCheckRequest additionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set return this; } @@ -389,6 +532,7 @@ public Amount getAdditionalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set } /** @@ -403,6 +547,7 @@ public void setAdditionalAmount(Amount additionalAmount) { */ public BalanceCheckRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -442,6 +587,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -452,6 +598,7 @@ public void setAdditionalData(Map additionalData) { */ public BalanceCheckRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -475,6 +622,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -485,6 +633,7 @@ public void setAmount(Amount amount) { */ public BalanceCheckRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -508,6 +657,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -518,6 +668,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public BalanceCheckRequest billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -541,6 +692,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -551,6 +703,7 @@ public void setBillingAddress(Address billingAddress) { */ public BalanceCheckRequest browserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set return this; } @@ -574,6 +727,7 @@ public BrowserInfo getBrowserInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrowserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set } /** @@ -585,6 +739,7 @@ public void setBrowserInfo(BrowserInfo browserInfo) { */ public BalanceCheckRequest captureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set return this; } @@ -610,6 +765,7 @@ public Integer getCaptureDelayHours() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set } /** @@ -622,6 +778,7 @@ public void setCaptureDelayHours(Integer captureDelayHours) { */ public BalanceCheckRequest dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -649,6 +806,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -659,6 +817,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public BalanceCheckRequest dccQuote(ForexQuote dccQuote) { this.dccQuote = dccQuote; + isSetDccQuote = true; // mark as set return this; } @@ -682,6 +841,7 @@ public ForexQuote getDccQuote() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDccQuote(ForexQuote dccQuote) { this.dccQuote = dccQuote; + isSetDccQuote = true; // mark as set } /** @@ -692,6 +852,7 @@ public void setDccQuote(ForexQuote dccQuote) { */ public BalanceCheckRequest deliveryAddress(Address deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -715,6 +876,7 @@ public Address getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(Address deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -729,6 +891,7 @@ public void setDeliveryAddress(Address deliveryAddress) { */ public BalanceCheckRequest deliveryDate(OffsetDateTime deliveryDate) { this.deliveryDate = deliveryDate; + isSetDeliveryDate = true; // mark as set return this; } @@ -760,6 +923,7 @@ public OffsetDateTime getDeliveryDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryDate(OffsetDateTime deliveryDate) { this.deliveryDate = deliveryDate; + isSetDeliveryDate = true; // mark as set } /** @@ -773,6 +937,7 @@ public void setDeliveryDate(OffsetDateTime deliveryDate) { */ public BalanceCheckRequest deviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set return this; } @@ -802,6 +967,7 @@ public String getDeviceFingerprint() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set } /** @@ -814,6 +980,7 @@ public void setDeviceFingerprint(String deviceFingerprint) { */ public BalanceCheckRequest fraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set return this; } @@ -841,6 +1008,7 @@ public Integer getFraudOffset() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set } /** @@ -851,6 +1019,7 @@ public void setFraudOffset(Integer fraudOffset) { */ public BalanceCheckRequest installments(Installments installments) { this.installments = installments; + isSetInstallments = true; // mark as set return this; } @@ -874,6 +1043,7 @@ public Installments getInstallments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallments(Installments installments) { this.installments = installments; + isSetInstallments = true; // mark as set } /** @@ -895,6 +1065,7 @@ public void setInstallments(Installments installments) { public BalanceCheckRequest localizedShopperStatement( Map localizedShopperStatement) { this.localizedShopperStatement = localizedShopperStatement; + isSetLocalizedShopperStatement = true; // mark as set return this; } @@ -947,6 +1118,7 @@ public Map getLocalizedShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLocalizedShopperStatement(Map localizedShopperStatement) { this.localizedShopperStatement = localizedShopperStatement; + isSetLocalizedShopperStatement = true; // mark as set } /** @@ -961,6 +1133,7 @@ public void setLocalizedShopperStatement(Map localizedShopperSta */ public BalanceCheckRequest mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -992,6 +1165,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 +1177,7 @@ public void setMcc(String mcc) { */ public BalanceCheckRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -1028,6 +1203,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -1052,6 +1228,7 @@ public void setMerchantAccount(String merchantAccount) { */ public BalanceCheckRequest merchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set return this; } @@ -1104,6 +1281,7 @@ public String getMerchantOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set } /** @@ -1114,6 +1292,7 @@ public void setMerchantOrderReference(String merchantOrderReference) { */ public BalanceCheckRequest merchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator) { this.merchantRiskIndicator = merchantRiskIndicator; + isSetMerchantRiskIndicator = true; // mark as set return this; } @@ -1137,6 +1316,7 @@ public MerchantRiskIndicator getMerchantRiskIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator) { this.merchantRiskIndicator = merchantRiskIndicator; + isSetMerchantRiskIndicator = true; // mark as set } /** @@ -1153,6 +1333,7 @@ public void setMerchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator */ public BalanceCheckRequest metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -1196,6 +1377,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -1211,6 +1393,7 @@ public void setMetadata(Map metadata) { */ public BalanceCheckRequest orderReference(String orderReference) { this.orderReference = orderReference; + isSetOrderReference = true; // mark as set return this; } @@ -1244,6 +1427,7 @@ public String getOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrderReference(String orderReference) { this.orderReference = orderReference; + isSetOrderReference = true; // mark as set } /** @@ -1255,6 +1439,7 @@ public void setOrderReference(String orderReference) { */ public BalanceCheckRequest paymentMethod(Map paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -1288,6 +1473,7 @@ public Map getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(Map paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -1298,6 +1484,7 @@ public void setPaymentMethod(Map paymentMethod) { */ public BalanceCheckRequest recurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set return this; } @@ -1321,6 +1508,7 @@ public Recurring getRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set } /** @@ -1349,6 +1537,7 @@ public void setRecurring(Recurring recurring) { public BalanceCheckRequest recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -1406,6 +1595,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -1422,6 +1612,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public BalanceCheckRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -1457,6 +1648,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -1473,6 +1665,7 @@ public void setReference(String reference) { */ public BalanceCheckRequest selectedBrand(String selectedBrand) { this.selectedBrand = selectedBrand; + isSetSelectedBrand = true; // mark as set return this; } @@ -1508,6 +1701,7 @@ public String getSelectedBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelectedBrand(String selectedBrand) { this.selectedBrand = selectedBrand; + isSetSelectedBrand = true; // mark as set } /** @@ -1522,6 +1716,7 @@ public void setSelectedBrand(String selectedBrand) { public BalanceCheckRequest selectedRecurringDetailReference( String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set return this; } @@ -1551,6 +1746,7 @@ public String getSelectedRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelectedRecurringDetailReference(String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set } /** @@ -1561,6 +1757,7 @@ public void setSelectedRecurringDetailReference(String selectedRecurringDetailRe */ public BalanceCheckRequest sessionId(String sessionId) { this.sessionId = sessionId; + isSetSessionId = true; // mark as set return this; } @@ -1584,6 +1781,7 @@ public String getSessionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSessionId(String sessionId) { this.sessionId = sessionId; + isSetSessionId = true; // mark as set } /** @@ -1598,6 +1796,7 @@ public void setSessionId(String sessionId) { */ public BalanceCheckRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -1629,6 +1828,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -1652,6 +1852,7 @@ public void setShopperEmail(String shopperEmail) { */ public BalanceCheckRequest shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -1701,6 +1902,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -1732,6 +1934,7 @@ public void setShopperIP(String shopperIP) { */ public BalanceCheckRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -1797,6 +2000,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -1809,6 +2013,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public BalanceCheckRequest shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -1836,6 +2041,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -1846,6 +2052,7 @@ public void setShopperLocale(String shopperLocale) { */ public BalanceCheckRequest shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -1869,6 +2076,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -1885,6 +2093,7 @@ public void setShopperName(Name shopperName) { */ public BalanceCheckRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -1920,6 +2129,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -1935,6 +2145,7 @@ public void setShopperReference(String shopperReference) { */ public BalanceCheckRequest shopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set return this; } @@ -1968,6 +2179,7 @@ public String getShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set } /** @@ -1978,6 +2190,7 @@ public void setShopperStatement(String shopperStatement) { */ public BalanceCheckRequest socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -2001,6 +2214,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -2017,6 +2231,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public BalanceCheckRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -2060,6 +2275,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -2083,6 +2299,7 @@ public void setSplits(List splits) { */ public BalanceCheckRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -2132,6 +2349,7 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set } /** @@ -2150,6 +2368,7 @@ public void setStore(String store) { */ public BalanceCheckRequest telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -2189,6 +2408,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -2199,6 +2419,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public BalanceCheckRequest threeDS2RequestData(ThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set return this; } @@ -2222,6 +2443,7 @@ public ThreeDS2RequestData getThreeDS2RequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2RequestData(ThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set } /** @@ -2242,6 +2464,7 @@ public void setThreeDS2RequestData(ThreeDS2RequestData threeDS2RequestData) { // `authenticationData.authenticationOnly` instead. public BalanceCheckRequest threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set return this; } @@ -2285,6 +2508,7 @@ public Boolean getThreeDSAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set } /** @@ -2297,6 +2521,7 @@ public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { */ public BalanceCheckRequest totalsGroup(String totalsGroup) { this.totalsGroup = totalsGroup; + isSetTotalsGroup = true; // mark as set return this; } @@ -2324,6 +2549,7 @@ public String getTotalsGroup() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTotalsGroup(String totalsGroup) { this.totalsGroup = totalsGroup; + isSetTotalsGroup = true; // mark as set } /** @@ -2334,6 +2560,7 @@ public void setTotalsGroup(String totalsGroup) { */ public BalanceCheckRequest trustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set return this; } @@ -2357,6 +2584,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 BalanceCheckRequest 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 BalanceCheckRequest object is equal to o. */ @@ -2547,6 +2795,162 @@ 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 (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + 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 BalanceCheckRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/BalanceCheckResponse.java b/src/main/java/com/adyen/model/checkout/BalanceCheckResponse.java index fd894eac9..6b69911d5 100644 --- a/src/main/java/com/adyen/model/checkout/BalanceCheckResponse.java +++ b/src/main/java/com/adyen/model/checkout/BalanceCheckResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,18 +39,33 @@ public class BalanceCheckResponse { 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_BALANCE = "balance"; private Amount balance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalance = 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_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 cancellation request. Possible values: * **Success** – Indicates that the * balance check was successful. * **NotEnoughBalance** – Commonly indicates that the card did not @@ -101,9 +118,21 @@ 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; + public static final String JSON_PROPERTY_TRANSACTION_LIMIT = "transactionLimit"; private Amount transactionLimit; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionLimit = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceCheckResponse() {} /** @@ -117,6 +146,7 @@ public BalanceCheckResponse() {} */ public BalanceCheckResponse additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -154,6 +184,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -164,6 +195,7 @@ public void setAdditionalData(Map additionalData) { */ public BalanceCheckResponse balance(Amount balance) { this.balance = balance; + isSetBalance = true; // mark as set return this; } @@ -187,6 +219,7 @@ public Amount getBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalance(Amount balance) { this.balance = balance; + isSetBalance = true; // mark as set } /** @@ -197,6 +230,7 @@ public void setBalance(Amount balance) { */ public BalanceCheckResponse fraudResult(FraudResult fraudResult) { this.fraudResult = fraudResult; + isSetFraudResult = true; // mark as set return this; } @@ -220,6 +254,7 @@ public FraudResult getFraudResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudResult(FraudResult fraudResult) { this.fraudResult = fraudResult; + isSetFraudResult = true; // mark as set } /** @@ -232,6 +267,7 @@ public void setFraudResult(FraudResult fraudResult) { */ public BalanceCheckResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -260,6 +296,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -278,6 +315,7 @@ public void setPspReference(String pspReference) { */ public BalanceCheckResponse refusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set return this; } @@ -317,6 +355,7 @@ public String getRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set } /** @@ -335,6 +374,7 @@ public void setRefusalReason(String refusalReason) { */ public BalanceCheckResponse resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -374,6 +414,7 @@ public ResultCodeEnum getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set } /** @@ -384,6 +425,7 @@ public void setResultCode(ResultCodeEnum resultCode) { */ public BalanceCheckResponse transactionLimit(Amount transactionLimit) { this.transactionLimit = transactionLimit; + isSetTransactionLimit = true; // mark as set return this; } @@ -407,6 +449,27 @@ public Amount getTransactionLimit() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionLimit(Amount transactionLimit) { this.transactionLimit = transactionLimit; + isSetTransactionLimit = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceCheckResponse 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 BalanceCheckResponse object is equal to o. */ @@ -465,6 +528,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetBalance) { + addIfNull(nulls, JSON_PROPERTY_BALANCE, this.balance); + } + if (isSetFraudResult) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_RESULT, this.fraudResult); + } + 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); + } + if (isSetTransactionLimit) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_LIMIT, this.transactionLimit); + } + + 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 BalanceCheckResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/BillDeskDetails.java b/src/main/java/com/adyen/model/checkout/BillDeskDetails.java index a07cafae7..b47769af8 100644 --- a/src/main/java/com/adyen/model/checkout/BillDeskDetails.java +++ b/src/main/java/com/adyen/model/checkout/BillDeskDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -32,12 +34,21 @@ public class BillDeskDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **billdesk** */ public enum TypeEnum { BILLDESK_ONLINE(String.valueOf("billdesk_online")), @@ -82,6 +93,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BillDeskDetails() {} /** @@ -92,6 +112,7 @@ public BillDeskDetails() {} */ public BillDeskDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -115,6 +136,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -125,6 +147,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public BillDeskDetails issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -148,6 +171,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -158,6 +182,7 @@ public void setIssuer(String issuer) { */ public BillDeskDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -182,6 +207,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -192,6 +218,7 @@ public void setSdkData(String sdkData) { */ public BillDeskDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -215,6 +242,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 BillDeskDetails 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 BillDeskDetails object is equal to o. */ @@ -260,6 +308,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + 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 BillDeskDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/BillingAddress.java b/src/main/java/com/adyen/model/checkout/BillingAddress.java index 8dfacc2a5..4a86e972a 100644 --- a/src/main/java/com/adyen/model/checkout/BillingAddress.java +++ b/src/main/java/com/adyen/model/checkout/BillingAddress.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 BillingAddress { 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 BillingAddress() {} /** @@ -55,6 +81,7 @@ public BillingAddress() {} */ public BillingAddress 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 BillingAddress 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 BillingAddress 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 BillingAddress 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 BillingAddress 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 BillingAddress 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 BillingAddress 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 BillingAddress object is equal to o. */ @@ -325,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 (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 BillingAddress given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/BlikDetails.java b/src/main/java/com/adyen/model/checkout/BlikDetails.java index e95f78c0e..432252751 100644 --- a/src/main/java/com/adyen/model/checkout/BlikDetails.java +++ b/src/main/java/com/adyen/model/checkout/BlikDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,19 +36,34 @@ public class BlikDetails { public static final String JSON_PROPERTY_BLIK_CODE = "blikCode"; private String blikCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBlikCode = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **blik** */ public enum TypeEnum { BLIK(String.valueOf("blik")); @@ -89,6 +106,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 BlikDetails() {} /** @@ -99,6 +125,7 @@ public BlikDetails() {} */ public BlikDetails blikCode(String blikCode) { this.blikCode = blikCode; + isSetBlikCode = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getBlikCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBlikCode(String blikCode) { this.blikCode = blikCode; + isSetBlikCode = true; // mark as set } /** @@ -132,6 +160,7 @@ public void setBlikCode(String blikCode) { */ public BlikDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -155,6 +184,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -169,6 +199,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public BlikDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -200,6 +231,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -210,6 +242,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public BlikDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -234,6 +267,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -246,6 +280,7 @@ public void setSdkData(String sdkData) { */ public BlikDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -273,6 +308,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -283,6 +319,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public BlikDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -306,6 +343,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 BlikDetails 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 BlikDetails object is equal to o. */ @@ -365,6 +423,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 (isSetBlikCode) { + addIfNull(nulls, JSON_PROPERTY_BLIK_CODE, this.blikCode); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 BlikDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/BrowserInfo.java b/src/main/java/com/adyen/model/checkout/BrowserInfo.java index c2d1d508c..43c4345c9 100644 --- a/src/main/java/com/adyen/model/checkout/BrowserInfo.java +++ b/src/main/java/com/adyen/model/checkout/BrowserInfo.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -448,6 +521,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/checkout/CancelOrderRequest.java b/src/main/java/com/adyen/model/checkout/CancelOrderRequest.java index b146581d3..3e76b6597 100644 --- a/src/main/java/com/adyen/model/checkout/CancelOrderRequest.java +++ b/src/main/java/com/adyen/model/checkout/CancelOrderRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 CancelOrderRequest { 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_ORDER = "order"; private EncryptedOrderData order; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrder = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CancelOrderRequest() {} /** @@ -39,6 +53,7 @@ public CancelOrderRequest() {} */ public CancelOrderRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setMerchantAccount(String merchantAccount) { */ public CancelOrderRequest order(EncryptedOrderData order) { this.order = order; + isSetOrder = true; // mark as set return this; } @@ -95,6 +112,27 @@ public EncryptedOrderData getOrder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrder(EncryptedOrderData order) { this.order = order; + isSetOrder = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CancelOrderRequest 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 CancelOrderRequest object is equal to o. */ @@ -136,6 +174,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 (isSetOrder) { + addIfNull(nulls, JSON_PROPERTY_ORDER, this.order); + } + + 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 CancelOrderRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CancelOrderResponse.java b/src/main/java/com/adyen/model/checkout/CancelOrderResponse.java index d38e65f49..0546afc9b 100644 --- a/src/main/java/com/adyen/model/checkout/CancelOrderResponse.java +++ b/src/main/java/com/adyen/model/checkout/CancelOrderResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -30,6 +32,9 @@ public class CancelOrderResponse { public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + /** * The result of the cancellation request. Possible values: * **Received** – Indicates the * cancellation has successfully been received by Adyen, and will be processed. @@ -75,6 +80,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 CancelOrderResponse() {} /** @@ -85,6 +99,7 @@ public CancelOrderResponse() {} */ public CancelOrderResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -108,6 +123,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -120,6 +136,7 @@ public void setPspReference(String pspReference) { */ public CancelOrderResponse resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -147,6 +164,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 CancelOrderResponse 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 CancelOrderResponse object is equal to o. */ @@ -188,6 +226,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 (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + 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 CancelOrderResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CardBrandDetails.java b/src/main/java/com/adyen/model/checkout/CardBrandDetails.java index 10d8876cc..0214e5667 100644 --- a/src/main/java/com/adyen/model/checkout/CardBrandDetails.java +++ b/src/main/java/com/adyen/model/checkout/CardBrandDetails.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 CardBrandDetails { public static final String JSON_PROPERTY_SUPPORTED = "supported"; private Boolean supported; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSupported = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 CardBrandDetails() {} /** @@ -36,6 +50,7 @@ public CardBrandDetails() {} */ public CardBrandDetails supported(Boolean supported) { this.supported = supported; + isSetSupported = true; // mark as set return this; } @@ -59,6 +74,7 @@ public Boolean getSupported() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSupported(Boolean supported) { this.supported = supported; + isSetSupported = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setSupported(Boolean supported) { */ public CardBrandDetails type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardBrandDetails 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 CardBrandDetails object is equal to o. */ @@ -133,6 +171,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 (isSetSupported) { + addIfNull(nulls, JSON_PROPERTY_SUPPORTED, this.supported); + } + 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 CardBrandDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CardDetails.java b/src/main/java/com/adyen/model/checkout/CardDetails.java index 7ed5d2647..96d8d0056 100644 --- a/src/main/java/com/adyen/model/checkout/CardDetails.java +++ b/src/main/java/com/adyen/model/checkout/CardDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -56,46 +58,88 @@ public class CardDetails { public static final String JSON_PROPERTY_BILLING_SEQUENCE_NUMBER = "billingSequenceNumber"; private String billingSequenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingSequenceNumber = false; + public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_CUPSECUREPLUS_SMSCODE = "cupsecureplus.smscode"; @Deprecated // deprecated private String cupsecureplusSmscode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCupsecureplusSmscode = 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_ENCRYPTED_CARD = "encryptedCard"; private String encryptedCard; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedCard = false; + public static final String JSON_PROPERTY_ENCRYPTED_CARD_NUMBER = "encryptedCardNumber"; private String encryptedCardNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedCardNumber = false; + public static final String JSON_PROPERTY_ENCRYPTED_EXPIRY_MONTH = "encryptedExpiryMonth"; private String encryptedExpiryMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedExpiryMonth = false; + public static final String JSON_PROPERTY_ENCRYPTED_EXPIRY_YEAR = "encryptedExpiryYear"; private String encryptedExpiryYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedExpiryYear = false; + public static final String JSON_PROPERTY_ENCRYPTED_PASSWORD = "encryptedPassword"; private String encryptedPassword; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedPassword = false; + public static final String JSON_PROPERTY_ENCRYPTED_SECURITY_CODE = "encryptedSecurityCode"; private String encryptedSecurityCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedSecurityCode = 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_FASTLANE_DATA = "fastlaneData"; private String fastlaneData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFastlaneData = 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**. @@ -143,44 +187,83 @@ 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_HOLDER_NAME = "holderName"; private String holderName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHolderName = false; + public static final String JSON_PROPERTY_NETWORK_PAYMENT_REFERENCE = "networkPaymentReference"; private String networkPaymentReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkPaymentReference = 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_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE = "shopperNotificationReference"; private String shopperNotificationReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperNotificationReference = false; + public static final String JSON_PROPERTY_SRC_CORRELATION_ID = "srcCorrelationId"; private String srcCorrelationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSrcCorrelationId = false; + public static final String JSON_PROPERTY_SRC_DIGITAL_CARD_ID = "srcDigitalCardId"; private String srcDigitalCardId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSrcDigitalCardId = false; + public static final String JSON_PROPERTY_SRC_SCHEME = "srcScheme"; private String srcScheme; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSrcScheme = false; + public static final String JSON_PROPERTY_SRC_TOKEN_REFERENCE = "srcTokenReference"; private String srcTokenReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSrcTokenReference = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_THREE_D_S2_SDK_VERSION = "threeDS2SdkVersion"; private String threeDS2SdkVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2SdkVersion = false; + /** * Default payment method details. Common for scheme payment methods, and for simple payment * method details. @@ -236,6 +319,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 CardDetails() {} /** @@ -249,6 +341,7 @@ public CardDetails() {} */ public CardDetails billingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set return this; } @@ -278,6 +371,7 @@ public String getBillingSequenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set } /** @@ -288,6 +382,7 @@ public void setBillingSequenceNumber(String billingSequenceNumber) { */ public CardDetails brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -311,6 +406,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -321,6 +417,7 @@ public void setBrand(String brand) { */ public CardDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -344,6 +441,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -356,6 +454,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated public CardDetails cupsecureplusSmscode(String cupsecureplusSmscode) { this.cupsecureplusSmscode = cupsecureplusSmscode; + isSetCupsecureplusSmscode = true; // mark as set return this; } @@ -383,6 +482,7 @@ public String getCupsecureplusSmscode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCupsecureplusSmscode(String cupsecureplusSmscode) { this.cupsecureplusSmscode = cupsecureplusSmscode; + isSetCupsecureplusSmscode = true; // mark as set } /** @@ -395,6 +495,7 @@ public void setCupsecureplusSmscode(String cupsecureplusSmscode) { */ public CardDetails cvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set return this; } @@ -422,6 +523,7 @@ public String getCvc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set } /** @@ -434,6 +536,7 @@ public void setCvc(String cvc) { */ public CardDetails encryptedCard(String encryptedCard) { this.encryptedCard = encryptedCard; + isSetEncryptedCard = true; // mark as set return this; } @@ -461,6 +564,7 @@ public String getEncryptedCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedCard(String encryptedCard) { this.encryptedCard = encryptedCard; + isSetEncryptedCard = true; // mark as set } /** @@ -471,6 +575,7 @@ public void setEncryptedCard(String encryptedCard) { */ public CardDetails encryptedCardNumber(String encryptedCardNumber) { this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set return this; } @@ -494,6 +599,7 @@ public String getEncryptedCardNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedCardNumber(String encryptedCardNumber) { this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set } /** @@ -504,6 +610,7 @@ public void setEncryptedCardNumber(String encryptedCardNumber) { */ public CardDetails encryptedExpiryMonth(String encryptedExpiryMonth) { this.encryptedExpiryMonth = encryptedExpiryMonth; + isSetEncryptedExpiryMonth = true; // mark as set return this; } @@ -527,6 +634,7 @@ public String getEncryptedExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedExpiryMonth(String encryptedExpiryMonth) { this.encryptedExpiryMonth = encryptedExpiryMonth; + isSetEncryptedExpiryMonth = true; // mark as set } /** @@ -537,6 +645,7 @@ public void setEncryptedExpiryMonth(String encryptedExpiryMonth) { */ public CardDetails encryptedExpiryYear(String encryptedExpiryYear) { this.encryptedExpiryYear = encryptedExpiryYear; + isSetEncryptedExpiryYear = true; // mark as set return this; } @@ -560,6 +669,7 @@ public String getEncryptedExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedExpiryYear(String encryptedExpiryYear) { this.encryptedExpiryYear = encryptedExpiryYear; + isSetEncryptedExpiryYear = true; // mark as set } /** @@ -572,6 +682,7 @@ public void setEncryptedExpiryYear(String encryptedExpiryYear) { */ public CardDetails encryptedPassword(String encryptedPassword) { this.encryptedPassword = encryptedPassword; + isSetEncryptedPassword = true; // mark as set return this; } @@ -599,6 +710,7 @@ public String getEncryptedPassword() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedPassword(String encryptedPassword) { this.encryptedPassword = encryptedPassword; + isSetEncryptedPassword = true; // mark as set } /** @@ -609,6 +721,7 @@ public void setEncryptedPassword(String encryptedPassword) { */ public CardDetails encryptedSecurityCode(String encryptedSecurityCode) { this.encryptedSecurityCode = encryptedSecurityCode; + isSetEncryptedSecurityCode = true; // mark as set return this; } @@ -632,6 +745,7 @@ public String getEncryptedSecurityCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedSecurityCode(String encryptedSecurityCode) { this.encryptedSecurityCode = encryptedSecurityCode; + isSetEncryptedSecurityCode = true; // mark as set } /** @@ -644,6 +758,7 @@ public void setEncryptedSecurityCode(String encryptedSecurityCode) { */ public CardDetails expiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set return this; } @@ -671,6 +786,7 @@ public String getExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set } /** @@ -683,6 +799,7 @@ public void setExpiryMonth(String expiryMonth) { */ public CardDetails expiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set return this; } @@ -710,6 +827,7 @@ public String getExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set } /** @@ -720,6 +838,7 @@ public void setExpiryYear(String expiryYear) { */ public CardDetails fastlaneData(String fastlaneData) { this.fastlaneData = fastlaneData; + isSetFastlaneData = true; // mark as set return this; } @@ -743,6 +862,7 @@ public String getFastlaneData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFastlaneData(String fastlaneData) { this.fastlaneData = fastlaneData; + isSetFastlaneData = true; // mark as set } /** @@ -756,6 +876,7 @@ public void setFastlaneData(String fastlaneData) { */ public CardDetails fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -785,6 +906,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -795,6 +917,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public CardDetails holderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set return this; } @@ -818,6 +941,7 @@ public String getHolderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHolderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set } /** @@ -832,6 +956,7 @@ public void setHolderName(String holderName) { */ public CardDetails networkPaymentReference(String networkPaymentReference) { this.networkPaymentReference = networkPaymentReference; + isSetNetworkPaymentReference = true; // mark as set return this; } @@ -863,6 +988,7 @@ public String getNetworkPaymentReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkPaymentReference(String networkPaymentReference) { this.networkPaymentReference = networkPaymentReference; + isSetNetworkPaymentReference = true; // mark as set } /** @@ -875,6 +1001,7 @@ public void setNetworkPaymentReference(String networkPaymentReference) { */ public CardDetails number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -902,6 +1029,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -916,6 +1044,7 @@ public void setNumber(String number) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public CardDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -947,6 +1076,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -957,6 +1087,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public CardDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -981,6 +1112,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -994,6 +1126,7 @@ public void setSdkData(String sdkData) { */ public CardDetails shopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set return this; } @@ -1023,6 +1156,7 @@ public String getShopperNotificationReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set } /** @@ -1033,6 +1167,7 @@ public void setShopperNotificationReference(String shopperNotificationReference) */ public CardDetails srcCorrelationId(String srcCorrelationId) { this.srcCorrelationId = srcCorrelationId; + isSetSrcCorrelationId = true; // mark as set return this; } @@ -1056,6 +1191,7 @@ public String getSrcCorrelationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSrcCorrelationId(String srcCorrelationId) { this.srcCorrelationId = srcCorrelationId; + isSetSrcCorrelationId = true; // mark as set } /** @@ -1066,6 +1202,7 @@ public void setSrcCorrelationId(String srcCorrelationId) { */ public CardDetails srcDigitalCardId(String srcDigitalCardId) { this.srcDigitalCardId = srcDigitalCardId; + isSetSrcDigitalCardId = true; // mark as set return this; } @@ -1089,6 +1226,7 @@ public String getSrcDigitalCardId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSrcDigitalCardId(String srcDigitalCardId) { this.srcDigitalCardId = srcDigitalCardId; + isSetSrcDigitalCardId = true; // mark as set } /** @@ -1099,6 +1237,7 @@ public void setSrcDigitalCardId(String srcDigitalCardId) { */ public CardDetails srcScheme(String srcScheme) { this.srcScheme = srcScheme; + isSetSrcScheme = true; // mark as set return this; } @@ -1122,6 +1261,7 @@ public String getSrcScheme() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSrcScheme(String srcScheme) { this.srcScheme = srcScheme; + isSetSrcScheme = true; // mark as set } /** @@ -1132,6 +1272,7 @@ public void setSrcScheme(String srcScheme) { */ public CardDetails srcTokenReference(String srcTokenReference) { this.srcTokenReference = srcTokenReference; + isSetSrcTokenReference = true; // mark as set return this; } @@ -1155,6 +1296,7 @@ public String getSrcTokenReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSrcTokenReference(String srcTokenReference) { this.srcTokenReference = srcTokenReference; + isSetSrcTokenReference = true; // mark as set } /** @@ -1167,6 +1309,7 @@ public void setSrcTokenReference(String srcTokenReference) { */ public CardDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -1194,6 +1337,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -1205,6 +1349,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public CardDetails threeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set return this; } @@ -1230,6 +1375,7 @@ public String getThreeDS2SdkVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set } /** @@ -1242,6 +1388,7 @@ public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { */ public CardDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1269,6 +1416,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 CardDetails 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 CardDetails object is equal to o. */ @@ -1411,6 +1579,112 @@ 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 (isSetBillingSequenceNumber) { + addIfNull(nulls, JSON_PROPERTY_BILLING_SEQUENCE_NUMBER, this.billingSequenceNumber); + } + if (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetCupsecureplusSmscode) { + addIfNull(nulls, JSON_PROPERTY_CUPSECUREPLUS_SMSCODE, this.cupsecureplusSmscode); + } + if (isSetCvc) { + addIfNull(nulls, JSON_PROPERTY_CVC, this.cvc); + } + if (isSetEncryptedCard) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_CARD, this.encryptedCard); + } + if (isSetEncryptedCardNumber) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_CARD_NUMBER, this.encryptedCardNumber); + } + if (isSetEncryptedExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_EXPIRY_MONTH, this.encryptedExpiryMonth); + } + if (isSetEncryptedExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_EXPIRY_YEAR, this.encryptedExpiryYear); + } + if (isSetEncryptedPassword) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_PASSWORD, this.encryptedPassword); + } + if (isSetEncryptedSecurityCode) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_SECURITY_CODE, this.encryptedSecurityCode); + } + if (isSetExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_MONTH, this.expiryMonth); + } + if (isSetExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_YEAR, this.expiryYear); + } + if (isSetFastlaneData) { + addIfNull(nulls, JSON_PROPERTY_FASTLANE_DATA, this.fastlaneData); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetHolderName) { + addIfNull(nulls, JSON_PROPERTY_HOLDER_NAME, this.holderName); + } + if (isSetNetworkPaymentReference) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_PAYMENT_REFERENCE, this.networkPaymentReference); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperNotificationReference) { + addIfNull( + nulls, JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE, this.shopperNotificationReference); + } + if (isSetSrcCorrelationId) { + addIfNull(nulls, JSON_PROPERTY_SRC_CORRELATION_ID, this.srcCorrelationId); + } + if (isSetSrcDigitalCardId) { + addIfNull(nulls, JSON_PROPERTY_SRC_DIGITAL_CARD_ID, this.srcDigitalCardId); + } + if (isSetSrcScheme) { + addIfNull(nulls, JSON_PROPERTY_SRC_SCHEME, this.srcScheme); + } + if (isSetSrcTokenReference) { + addIfNull(nulls, JSON_PROPERTY_SRC_TOKEN_REFERENCE, this.srcTokenReference); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetThreeDS2SdkVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_SDK_VERSION, this.threeDS2SdkVersion); + } + 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 CardDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CardDetailsRequest.java b/src/main/java/com/adyen/model/checkout/CardDetailsRequest.java index 1019c69f2..4d8d014d1 100644 --- a/src/main/java/com/adyen/model/checkout/CardDetailsRequest.java +++ b/src/main/java/com/adyen/model/checkout/CardDetailsRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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; @@ -31,18 +33,39 @@ public class CardDetailsRequest { public static final String JSON_PROPERTY_CARD_NUMBER = "cardNumber"; private String cardNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardNumber = 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_ENCRYPTED_CARD_NUMBER = "encryptedCardNumber"; private String encryptedCardNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedCardNumber = 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_SUPPORTED_BRANDS = "supportedBrands"; private List supportedBrands; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSupportedBrands = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardDetailsRequest() {} /** @@ -60,6 +83,7 @@ public CardDetailsRequest() {} */ public CardDetailsRequest cardNumber(String cardNumber) { this.cardNumber = cardNumber; + isSetCardNumber = true; // mark as set return this; } @@ -97,6 +121,7 @@ public String getCardNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardNumber(String cardNumber) { this.cardNumber = cardNumber; + isSetCardNumber = true; // mark as set } /** @@ -109,6 +134,7 @@ public void setCardNumber(String cardNumber) { */ public CardDetailsRequest countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -136,6 +162,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -146,6 +173,7 @@ public void setCountryCode(String countryCode) { */ public CardDetailsRequest encryptedCardNumber(String encryptedCardNumber) { this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set return this; } @@ -169,6 +197,7 @@ public String getEncryptedCardNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedCardNumber(String encryptedCardNumber) { this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set } /** @@ -180,6 +209,7 @@ public void setEncryptedCardNumber(String encryptedCardNumber) { */ public CardDetailsRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -205,6 +235,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -225,6 +256,7 @@ public void setMerchantAccount(String merchantAccount) { */ public CardDetailsRequest supportedBrands(List supportedBrands) { this.supportedBrands = supportedBrands; + isSetSupportedBrands = true; // mark as set return this; } @@ -276,6 +308,27 @@ public List getSupportedBrands() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSupportedBrands(List supportedBrands) { this.supportedBrands = supportedBrands; + isSetSupportedBrands = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardDetailsRequest 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 CardDetailsRequest object is equal to o. */ @@ -326,6 +379,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 (isSetCardNumber) { + addIfNull(nulls, JSON_PROPERTY_CARD_NUMBER, this.cardNumber); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetEncryptedCardNumber) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_CARD_NUMBER, this.encryptedCardNumber); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetSupportedBrands) { + addIfNull(nulls, JSON_PROPERTY_SUPPORTED_BRANDS, this.supportedBrands); + } + + 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 CardDetailsRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CardDetailsResponse.java b/src/main/java/com/adyen/model/checkout/CardDetailsResponse.java index 5575fa6af..68f407bff 100644 --- a/src/main/java/com/adyen/model/checkout/CardDetailsResponse.java +++ b/src/main/java/com/adyen/model/checkout/CardDetailsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,15 +32,33 @@ public class CardDetailsResponse { public static final String JSON_PROPERTY_BRANDS = "brands"; private List brands; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrands = 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_IS_CARD_COMMERCIAL = "isCardCommercial"; private Boolean isCardCommercial; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIsCardCommercial = false; + public static final String JSON_PROPERTY_ISSUING_COUNTRY_CODE = "issuingCountryCode"; private String issuingCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuingCountryCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardDetailsResponse() {} /** @@ -49,6 +69,7 @@ public CardDetailsResponse() {} */ public CardDetailsResponse brands(List brands) { this.brands = brands; + isSetBrands = true; // mark as set return this; } @@ -80,6 +101,7 @@ public List getBrands() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrands(List brands) { this.brands = brands; + isSetBrands = true; // mark as set } /** @@ -91,6 +113,7 @@ public void setBrands(List brands) { */ public CardDetailsResponse fundingSource(String fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -116,6 +139,7 @@ public String getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(String fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -128,6 +152,7 @@ public void setFundingSource(String fundingSource) { */ public CardDetailsResponse isCardCommercial(Boolean isCardCommercial) { this.isCardCommercial = isCardCommercial; + isSetIsCardCommercial = true; // mark as set return this; } @@ -155,6 +180,7 @@ public Boolean getIsCardCommercial() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIsCardCommercial(Boolean isCardCommercial) { this.isCardCommercial = isCardCommercial; + isSetIsCardCommercial = true; // mark as set } /** @@ -165,6 +191,7 @@ public void setIsCardCommercial(Boolean isCardCommercial) { */ public CardDetailsResponse issuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set return this; } @@ -189,6 +216,27 @@ public String getIssuingCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardDetailsResponse 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 CardDetailsResponse object is equal to o. */ @@ -234,6 +282,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 (isSetBrands) { + addIfNull(nulls, JSON_PROPERTY_BRANDS, this.brands); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetIsCardCommercial) { + addIfNull(nulls, JSON_PROPERTY_IS_CARD_COMMERCIAL, this.isCardCommercial); + } + if (isSetIssuingCountryCode) { + addIfNull(nulls, JSON_PROPERTY_ISSUING_COUNTRY_CODE, this.issuingCountryCode); + } + + 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 CardDetailsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CardDonations.java b/src/main/java/com/adyen/model/checkout/CardDonations.java index 3682b6618..5ee80e97c 100644 --- a/src/main/java/com/adyen/model/checkout/CardDonations.java +++ b/src/main/java/com/adyen/model/checkout/CardDonations.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -56,46 +58,88 @@ public class CardDonations { public static final String JSON_PROPERTY_BILLING_SEQUENCE_NUMBER = "billingSequenceNumber"; private String billingSequenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingSequenceNumber = false; + public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_CUPSECUREPLUS_SMSCODE = "cupsecureplus.smscode"; @Deprecated // deprecated private String cupsecureplusSmscode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCupsecureplusSmscode = 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_ENCRYPTED_CARD = "encryptedCard"; private String encryptedCard; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedCard = false; + public static final String JSON_PROPERTY_ENCRYPTED_CARD_NUMBER = "encryptedCardNumber"; private String encryptedCardNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedCardNumber = false; + public static final String JSON_PROPERTY_ENCRYPTED_EXPIRY_MONTH = "encryptedExpiryMonth"; private String encryptedExpiryMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedExpiryMonth = false; + public static final String JSON_PROPERTY_ENCRYPTED_EXPIRY_YEAR = "encryptedExpiryYear"; private String encryptedExpiryYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedExpiryYear = false; + public static final String JSON_PROPERTY_ENCRYPTED_PASSWORD = "encryptedPassword"; private String encryptedPassword; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedPassword = false; + public static final String JSON_PROPERTY_ENCRYPTED_SECURITY_CODE = "encryptedSecurityCode"; private String encryptedSecurityCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedSecurityCode = 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_FASTLANE_DATA = "fastlaneData"; private String fastlaneData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFastlaneData = 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**. @@ -143,44 +187,83 @@ 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_HOLDER_NAME = "holderName"; private String holderName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHolderName = false; + public static final String JSON_PROPERTY_NETWORK_PAYMENT_REFERENCE = "networkPaymentReference"; private String networkPaymentReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkPaymentReference = 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_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE = "shopperNotificationReference"; private String shopperNotificationReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperNotificationReference = false; + public static final String JSON_PROPERTY_SRC_CORRELATION_ID = "srcCorrelationId"; private String srcCorrelationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSrcCorrelationId = false; + public static final String JSON_PROPERTY_SRC_DIGITAL_CARD_ID = "srcDigitalCardId"; private String srcDigitalCardId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSrcDigitalCardId = false; + public static final String JSON_PROPERTY_SRC_SCHEME = "srcScheme"; private String srcScheme; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSrcScheme = false; + public static final String JSON_PROPERTY_SRC_TOKEN_REFERENCE = "srcTokenReference"; private String srcTokenReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSrcTokenReference = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_THREE_D_S2_SDK_VERSION = "threeDS2SdkVersion"; private String threeDS2SdkVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2SdkVersion = false; + /** * Default payment method details. Common for scheme payment methods, and for simple payment * method details. @@ -236,6 +319,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 CardDonations() {} /** @@ -249,6 +341,7 @@ public CardDonations() {} */ public CardDonations billingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set return this; } @@ -278,6 +371,7 @@ public String getBillingSequenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set } /** @@ -288,6 +382,7 @@ public void setBillingSequenceNumber(String billingSequenceNumber) { */ public CardDonations brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -311,6 +406,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -321,6 +417,7 @@ public void setBrand(String brand) { */ public CardDonations checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -344,6 +441,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -356,6 +454,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated public CardDonations cupsecureplusSmscode(String cupsecureplusSmscode) { this.cupsecureplusSmscode = cupsecureplusSmscode; + isSetCupsecureplusSmscode = true; // mark as set return this; } @@ -383,6 +482,7 @@ public String getCupsecureplusSmscode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCupsecureplusSmscode(String cupsecureplusSmscode) { this.cupsecureplusSmscode = cupsecureplusSmscode; + isSetCupsecureplusSmscode = true; // mark as set } /** @@ -395,6 +495,7 @@ public void setCupsecureplusSmscode(String cupsecureplusSmscode) { */ public CardDonations cvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set return this; } @@ -422,6 +523,7 @@ public String getCvc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set } /** @@ -434,6 +536,7 @@ public void setCvc(String cvc) { */ public CardDonations encryptedCard(String encryptedCard) { this.encryptedCard = encryptedCard; + isSetEncryptedCard = true; // mark as set return this; } @@ -461,6 +564,7 @@ public String getEncryptedCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedCard(String encryptedCard) { this.encryptedCard = encryptedCard; + isSetEncryptedCard = true; // mark as set } /** @@ -471,6 +575,7 @@ public void setEncryptedCard(String encryptedCard) { */ public CardDonations encryptedCardNumber(String encryptedCardNumber) { this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set return this; } @@ -494,6 +599,7 @@ public String getEncryptedCardNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedCardNumber(String encryptedCardNumber) { this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set } /** @@ -504,6 +610,7 @@ public void setEncryptedCardNumber(String encryptedCardNumber) { */ public CardDonations encryptedExpiryMonth(String encryptedExpiryMonth) { this.encryptedExpiryMonth = encryptedExpiryMonth; + isSetEncryptedExpiryMonth = true; // mark as set return this; } @@ -527,6 +634,7 @@ public String getEncryptedExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedExpiryMonth(String encryptedExpiryMonth) { this.encryptedExpiryMonth = encryptedExpiryMonth; + isSetEncryptedExpiryMonth = true; // mark as set } /** @@ -537,6 +645,7 @@ public void setEncryptedExpiryMonth(String encryptedExpiryMonth) { */ public CardDonations encryptedExpiryYear(String encryptedExpiryYear) { this.encryptedExpiryYear = encryptedExpiryYear; + isSetEncryptedExpiryYear = true; // mark as set return this; } @@ -560,6 +669,7 @@ public String getEncryptedExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedExpiryYear(String encryptedExpiryYear) { this.encryptedExpiryYear = encryptedExpiryYear; + isSetEncryptedExpiryYear = true; // mark as set } /** @@ -572,6 +682,7 @@ public void setEncryptedExpiryYear(String encryptedExpiryYear) { */ public CardDonations encryptedPassword(String encryptedPassword) { this.encryptedPassword = encryptedPassword; + isSetEncryptedPassword = true; // mark as set return this; } @@ -599,6 +710,7 @@ public String getEncryptedPassword() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedPassword(String encryptedPassword) { this.encryptedPassword = encryptedPassword; + isSetEncryptedPassword = true; // mark as set } /** @@ -609,6 +721,7 @@ public void setEncryptedPassword(String encryptedPassword) { */ public CardDonations encryptedSecurityCode(String encryptedSecurityCode) { this.encryptedSecurityCode = encryptedSecurityCode; + isSetEncryptedSecurityCode = true; // mark as set return this; } @@ -632,6 +745,7 @@ public String getEncryptedSecurityCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedSecurityCode(String encryptedSecurityCode) { this.encryptedSecurityCode = encryptedSecurityCode; + isSetEncryptedSecurityCode = true; // mark as set } /** @@ -644,6 +758,7 @@ public void setEncryptedSecurityCode(String encryptedSecurityCode) { */ public CardDonations expiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set return this; } @@ -671,6 +786,7 @@ public String getExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set } /** @@ -683,6 +799,7 @@ public void setExpiryMonth(String expiryMonth) { */ public CardDonations expiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set return this; } @@ -710,6 +827,7 @@ public String getExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set } /** @@ -720,6 +838,7 @@ public void setExpiryYear(String expiryYear) { */ public CardDonations fastlaneData(String fastlaneData) { this.fastlaneData = fastlaneData; + isSetFastlaneData = true; // mark as set return this; } @@ -743,6 +862,7 @@ public String getFastlaneData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFastlaneData(String fastlaneData) { this.fastlaneData = fastlaneData; + isSetFastlaneData = true; // mark as set } /** @@ -756,6 +876,7 @@ public void setFastlaneData(String fastlaneData) { */ public CardDonations fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -785,6 +906,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -795,6 +917,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public CardDonations holderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set return this; } @@ -818,6 +941,7 @@ public String getHolderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHolderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set } /** @@ -832,6 +956,7 @@ public void setHolderName(String holderName) { */ public CardDonations networkPaymentReference(String networkPaymentReference) { this.networkPaymentReference = networkPaymentReference; + isSetNetworkPaymentReference = true; // mark as set return this; } @@ -863,6 +988,7 @@ public String getNetworkPaymentReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkPaymentReference(String networkPaymentReference) { this.networkPaymentReference = networkPaymentReference; + isSetNetworkPaymentReference = true; // mark as set } /** @@ -875,6 +1001,7 @@ public void setNetworkPaymentReference(String networkPaymentReference) { */ public CardDonations number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -902,6 +1029,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -916,6 +1044,7 @@ public void setNumber(String number) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public CardDonations recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -947,6 +1076,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -957,6 +1087,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public CardDonations sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -981,6 +1112,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -994,6 +1126,7 @@ public void setSdkData(String sdkData) { */ public CardDonations shopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set return this; } @@ -1023,6 +1156,7 @@ public String getShopperNotificationReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set } /** @@ -1033,6 +1167,7 @@ public void setShopperNotificationReference(String shopperNotificationReference) */ public CardDonations srcCorrelationId(String srcCorrelationId) { this.srcCorrelationId = srcCorrelationId; + isSetSrcCorrelationId = true; // mark as set return this; } @@ -1056,6 +1191,7 @@ public String getSrcCorrelationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSrcCorrelationId(String srcCorrelationId) { this.srcCorrelationId = srcCorrelationId; + isSetSrcCorrelationId = true; // mark as set } /** @@ -1066,6 +1202,7 @@ public void setSrcCorrelationId(String srcCorrelationId) { */ public CardDonations srcDigitalCardId(String srcDigitalCardId) { this.srcDigitalCardId = srcDigitalCardId; + isSetSrcDigitalCardId = true; // mark as set return this; } @@ -1089,6 +1226,7 @@ public String getSrcDigitalCardId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSrcDigitalCardId(String srcDigitalCardId) { this.srcDigitalCardId = srcDigitalCardId; + isSetSrcDigitalCardId = true; // mark as set } /** @@ -1099,6 +1237,7 @@ public void setSrcDigitalCardId(String srcDigitalCardId) { */ public CardDonations srcScheme(String srcScheme) { this.srcScheme = srcScheme; + isSetSrcScheme = true; // mark as set return this; } @@ -1122,6 +1261,7 @@ public String getSrcScheme() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSrcScheme(String srcScheme) { this.srcScheme = srcScheme; + isSetSrcScheme = true; // mark as set } /** @@ -1132,6 +1272,7 @@ public void setSrcScheme(String srcScheme) { */ public CardDonations srcTokenReference(String srcTokenReference) { this.srcTokenReference = srcTokenReference; + isSetSrcTokenReference = true; // mark as set return this; } @@ -1155,6 +1296,7 @@ public String getSrcTokenReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSrcTokenReference(String srcTokenReference) { this.srcTokenReference = srcTokenReference; + isSetSrcTokenReference = true; // mark as set } /** @@ -1167,6 +1309,7 @@ public void setSrcTokenReference(String srcTokenReference) { */ public CardDonations storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -1194,6 +1337,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -1205,6 +1349,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public CardDonations threeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set return this; } @@ -1230,6 +1375,7 @@ public String getThreeDS2SdkVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set } /** @@ -1242,6 +1388,7 @@ public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { */ public CardDonations type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1269,6 +1416,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 CardDonations 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 CardDonations object is equal to o. */ @@ -1411,6 +1579,112 @@ 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 (isSetBillingSequenceNumber) { + addIfNull(nulls, JSON_PROPERTY_BILLING_SEQUENCE_NUMBER, this.billingSequenceNumber); + } + if (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetCupsecureplusSmscode) { + addIfNull(nulls, JSON_PROPERTY_CUPSECUREPLUS_SMSCODE, this.cupsecureplusSmscode); + } + if (isSetCvc) { + addIfNull(nulls, JSON_PROPERTY_CVC, this.cvc); + } + if (isSetEncryptedCard) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_CARD, this.encryptedCard); + } + if (isSetEncryptedCardNumber) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_CARD_NUMBER, this.encryptedCardNumber); + } + if (isSetEncryptedExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_EXPIRY_MONTH, this.encryptedExpiryMonth); + } + if (isSetEncryptedExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_EXPIRY_YEAR, this.encryptedExpiryYear); + } + if (isSetEncryptedPassword) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_PASSWORD, this.encryptedPassword); + } + if (isSetEncryptedSecurityCode) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_SECURITY_CODE, this.encryptedSecurityCode); + } + if (isSetExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_MONTH, this.expiryMonth); + } + if (isSetExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_YEAR, this.expiryYear); + } + if (isSetFastlaneData) { + addIfNull(nulls, JSON_PROPERTY_FASTLANE_DATA, this.fastlaneData); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetHolderName) { + addIfNull(nulls, JSON_PROPERTY_HOLDER_NAME, this.holderName); + } + if (isSetNetworkPaymentReference) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_PAYMENT_REFERENCE, this.networkPaymentReference); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperNotificationReference) { + addIfNull( + nulls, JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE, this.shopperNotificationReference); + } + if (isSetSrcCorrelationId) { + addIfNull(nulls, JSON_PROPERTY_SRC_CORRELATION_ID, this.srcCorrelationId); + } + if (isSetSrcDigitalCardId) { + addIfNull(nulls, JSON_PROPERTY_SRC_DIGITAL_CARD_ID, this.srcDigitalCardId); + } + if (isSetSrcScheme) { + addIfNull(nulls, JSON_PROPERTY_SRC_SCHEME, this.srcScheme); + } + if (isSetSrcTokenReference) { + addIfNull(nulls, JSON_PROPERTY_SRC_TOKEN_REFERENCE, this.srcTokenReference); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetThreeDS2SdkVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_SDK_VERSION, this.threeDS2SdkVersion); + } + 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 CardDonations given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CashAppDetails.java b/src/main/java/com/adyen/model/checkout/CashAppDetails.java index c1ab53394..f0827d6bb 100644 --- a/src/main/java/com/adyen/model/checkout/CashAppDetails.java +++ b/src/main/java/com/adyen/model/checkout/CashAppDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -39,34 +41,64 @@ public class CashAppDetails { public static final String JSON_PROPERTY_CASHTAG = "cashtag"; private String cashtag; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCashtag = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_CUSTOMER_ID = "customerId"; private String customerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCustomerId = false; + public static final String JSON_PROPERTY_GRANT_ID = "grantId"; private String grantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrantId = false; + public static final String JSON_PROPERTY_ON_FILE_GRANT_ID = "onFileGrantId"; private String onFileGrantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOnFileGrantId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_REQUEST_ID = "requestId"; private String requestId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestId = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_SUBTYPE = "subtype"; private String subtype; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubtype = false; + /** cashapp */ public enum TypeEnum { CASHAPP(String.valueOf("cashapp")); @@ -109,6 +141,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 CashAppDetails() {} /** @@ -119,6 +160,7 @@ public CashAppDetails() {} */ public CashAppDetails cashtag(String cashtag) { this.cashtag = cashtag; + isSetCashtag = true; // mark as set return this; } @@ -142,6 +184,7 @@ public String getCashtag() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCashtag(String cashtag) { this.cashtag = cashtag; + isSetCashtag = true; // mark as set } /** @@ -152,6 +195,7 @@ public void setCashtag(String cashtag) { */ public CashAppDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -175,6 +219,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -185,6 +230,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public CashAppDetails customerId(String customerId) { this.customerId = customerId; + isSetCustomerId = true; // mark as set return this; } @@ -208,6 +254,7 @@ public String getCustomerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCustomerId(String customerId) { this.customerId = customerId; + isSetCustomerId = true; // mark as set } /** @@ -218,6 +265,7 @@ public void setCustomerId(String customerId) { */ public CashAppDetails grantId(String grantId) { this.grantId = grantId; + isSetGrantId = true; // mark as set return this; } @@ -241,6 +289,7 @@ public String getGrantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGrantId(String grantId) { this.grantId = grantId; + isSetGrantId = true; // mark as set } /** @@ -251,6 +300,7 @@ public void setGrantId(String grantId) { */ public CashAppDetails onFileGrantId(String onFileGrantId) { this.onFileGrantId = onFileGrantId; + isSetOnFileGrantId = true; // mark as set return this; } @@ -274,6 +324,7 @@ public String getOnFileGrantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOnFileGrantId(String onFileGrantId) { this.onFileGrantId = onFileGrantId; + isSetOnFileGrantId = true; // mark as set } /** @@ -288,6 +339,7 @@ public void setOnFileGrantId(String onFileGrantId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public CashAppDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -319,6 +371,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -329,6 +382,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public CashAppDetails requestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set return this; } @@ -352,6 +406,7 @@ public String getRequestId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set } /** @@ -362,6 +417,7 @@ public void setRequestId(String requestId) { */ public CashAppDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -386,6 +442,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -398,6 +455,7 @@ public void setSdkData(String sdkData) { */ public CashAppDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -425,6 +483,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -435,6 +494,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public CashAppDetails subtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set return this; } @@ -458,6 +518,7 @@ public String getSubtype() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set } /** @@ -468,6 +529,7 @@ public void setSubtype(String subtype) { */ public CashAppDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -491,6 +553,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 CashAppDetails 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 CashAppDetails object is equal to o. */ @@ -565,6 +648,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 (isSetCashtag) { + addIfNull(nulls, JSON_PROPERTY_CASHTAG, this.cashtag); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetCustomerId) { + addIfNull(nulls, JSON_PROPERTY_CUSTOMER_ID, this.customerId); + } + if (isSetGrantId) { + addIfNull(nulls, JSON_PROPERTY_GRANT_ID, this.grantId); + } + if (isSetOnFileGrantId) { + addIfNull(nulls, JSON_PROPERTY_ON_FILE_GRANT_ID, this.onFileGrantId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetRequestId) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_ID, this.requestId); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetSubtype) { + addIfNull(nulls, JSON_PROPERTY_SUBTYPE, this.subtype); + } + 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 CashAppDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CellulantDetails.java b/src/main/java/com/adyen/model/checkout/CellulantDetails.java index 2857742df..256b1df4b 100644 --- a/src/main/java/com/adyen/model/checkout/CellulantDetails.java +++ b/src/main/java/com/adyen/model/checkout/CellulantDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -32,12 +34,21 @@ public class CellulantDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **Cellulant** */ public enum TypeEnum { CELLULANT(String.valueOf("cellulant")); @@ -80,6 +91,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 CellulantDetails() {} /** @@ -90,6 +110,7 @@ public CellulantDetails() {} */ public CellulantDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -113,6 +134,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -123,6 +145,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public CellulantDetails issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -146,6 +169,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -156,6 +180,7 @@ public void setIssuer(String issuer) { */ public CellulantDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -180,6 +205,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -190,6 +216,7 @@ public void setSdkData(String sdkData) { */ public CellulantDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -213,6 +240,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 CellulantDetails 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 CellulantDetails object is equal to o. */ @@ -258,6 +306,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + 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 CellulantDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutAwaitAction.java b/src/main/java/com/adyen/model/checkout/CheckoutAwaitAction.java index 7844abc1d..2abd34f70 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutAwaitAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutAwaitAction.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -32,9 +34,15 @@ public class CheckoutAwaitAction { public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData"; private String paymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_TYPE = "paymentMethodType"; private String paymentMethodType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodType = false; + /** **await** */ public enum TypeEnum { AWAIT(String.valueOf("await")); @@ -77,9 +85,21 @@ 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; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutAwaitAction() {} /** @@ -90,6 +110,7 @@ public CheckoutAwaitAction() {} */ public CheckoutAwaitAction paymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set return this; } @@ -113,6 +134,7 @@ public String getPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set } /** @@ -123,6 +145,7 @@ public void setPaymentData(String paymentData) { */ public CheckoutAwaitAction paymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set return this; } @@ -146,6 +169,7 @@ public String getPaymentMethodType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set } /** @@ -156,6 +180,7 @@ public void setPaymentMethodType(String paymentMethodType) { */ public CheckoutAwaitAction type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -179,6 +204,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -189,6 +215,7 @@ public void setType(TypeEnum type) { */ public CheckoutAwaitAction url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -212,6 +239,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutAwaitAction 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 CheckoutAwaitAction object is equal to o. */ @@ -257,6 +305,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 (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + if (isSetPaymentMethodType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_TYPE, this.paymentMethodType); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + 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 CheckoutAwaitAction given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutBankAccount.java b/src/main/java/com/adyen/model/checkout/CheckoutBankAccount.java index 35ecb5bde..6c8cef2f2 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutBankAccount.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutBankAccount.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -89,33 +91,69 @@ 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_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 CheckoutBankAccount() {} /** @@ -126,6 +164,7 @@ public CheckoutBankAccount() {} */ public CheckoutBankAccount accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -149,6 +188,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -159,6 +199,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public CheckoutBankAccount bankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set return this; } @@ -182,6 +223,7 @@ public String getBankAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set } /** @@ -192,6 +234,7 @@ public void setBankAccountNumber(String bankAccountNumber) { */ public CheckoutBankAccount bankCity(String bankCity) { this.bankCity = bankCity; + isSetBankCity = true; // mark as set return this; } @@ -215,6 +258,7 @@ public String getBankCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCity(String bankCity) { this.bankCity = bankCity; + isSetBankCity = true; // mark as set } /** @@ -226,6 +270,7 @@ public void setBankCity(String bankCity) { */ public CheckoutBankAccount bankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set return this; } @@ -251,6 +296,7 @@ public String getBankLocationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set } /** @@ -261,6 +307,7 @@ public void setBankLocationId(String bankLocationId) { */ public CheckoutBankAccount bankName(String bankName) { this.bankName = bankName; + isSetBankName = true; // mark as set return this; } @@ -284,6 +331,7 @@ public String getBankName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankName(String bankName) { this.bankName = bankName; + isSetBankName = true; // mark as set } /** @@ -296,6 +344,7 @@ public void setBankName(String bankName) { */ public CheckoutBankAccount bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -323,6 +372,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -335,6 +385,7 @@ public void setBic(String bic) { */ public CheckoutBankAccount countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -362,6 +413,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -374,6 +426,7 @@ public void setCountryCode(String countryCode) { */ public CheckoutBankAccount iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -401,6 +454,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -427,6 +481,7 @@ public void setIban(String iban) { */ public CheckoutBankAccount ownerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set return this; } @@ -482,6 +537,7 @@ public String getOwnerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwnerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set } /** @@ -492,6 +548,7 @@ public void setOwnerName(String ownerName) { */ public CheckoutBankAccount taxId(String taxId) { this.taxId = taxId; + isSetTaxId = true; // mark as set return this; } @@ -515,6 +572,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 CheckoutBankAccount 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 CheckoutBankAccount object is equal to o. */ @@ -582,6 +660,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 (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + 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 CheckoutBankAccount given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutBankTransferAction.java b/src/main/java/com/adyen/model/checkout/CheckoutBankTransferAction.java index 4cf158477..ccd371d70 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutBankTransferAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutBankTransferAction.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,42 +45,81 @@ public class CheckoutBankTransferAction { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + public static final String JSON_PROPERTY_BENEFICIARY = "beneficiary"; private String beneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBeneficiary = 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_BRANCH_CODE = "branchCode"; private String branchCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBranchCode = false; + public static final String JSON_PROPERTY_DOWNLOAD_URL = "downloadUrl"; private String downloadUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDownloadUrl = 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_PAYMENT_METHOD_TYPE = "paymentMethodType"; private String paymentMethodType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodType = 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_ROUTING_NUMBER = "routingNumber"; private String routingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRoutingNumber = 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_SORT_CODE = "sortCode"; private String sortCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSortCode = false; + public static final String JSON_PROPERTY_TOTAL_AMOUNT = "totalAmount"; private Amount totalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalAmount = false; + /** The type of the action. */ public enum TypeEnum { BANKTRANSFER(String.valueOf("bankTransfer")); @@ -121,9 +162,21 @@ 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; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutBankTransferAction() {} /** @@ -134,6 +187,7 @@ public CheckoutBankTransferAction() {} */ public CheckoutBankTransferAction accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -157,6 +211,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -167,6 +222,7 @@ public void setAccountNumber(String accountNumber) { */ public CheckoutBankTransferAction bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -190,6 +246,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -200,6 +257,7 @@ public void setBankCode(String bankCode) { */ public CheckoutBankTransferAction beneficiary(String beneficiary) { this.beneficiary = beneficiary; + isSetBeneficiary = true; // mark as set return this; } @@ -223,6 +281,7 @@ public String getBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBeneficiary(String beneficiary) { this.beneficiary = beneficiary; + isSetBeneficiary = true; // mark as set } /** @@ -233,6 +292,7 @@ public void setBeneficiary(String beneficiary) { */ public CheckoutBankTransferAction bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -256,6 +316,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -266,6 +327,7 @@ public void setBic(String bic) { */ public CheckoutBankTransferAction branchCode(String branchCode) { this.branchCode = branchCode; + isSetBranchCode = true; // mark as set return this; } @@ -289,6 +351,7 @@ public String getBranchCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBranchCode(String branchCode) { this.branchCode = branchCode; + isSetBranchCode = true; // mark as set } /** @@ -299,6 +362,7 @@ public void setBranchCode(String branchCode) { */ public CheckoutBankTransferAction downloadUrl(String downloadUrl) { this.downloadUrl = downloadUrl; + isSetDownloadUrl = true; // mark as set return this; } @@ -322,6 +386,7 @@ public String getDownloadUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDownloadUrl(String downloadUrl) { this.downloadUrl = downloadUrl; + isSetDownloadUrl = true; // mark as set } /** @@ -332,6 +397,7 @@ public void setDownloadUrl(String downloadUrl) { */ public CheckoutBankTransferAction iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -355,6 +421,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -365,6 +432,7 @@ public void setIban(String iban) { */ public CheckoutBankTransferAction paymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set return this; } @@ -388,6 +456,7 @@ public String getPaymentMethodType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set } /** @@ -398,6 +467,7 @@ public void setPaymentMethodType(String paymentMethodType) { */ public CheckoutBankTransferAction reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -421,6 +491,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -431,6 +502,7 @@ public void setReference(String reference) { */ public CheckoutBankTransferAction routingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set return this; } @@ -454,6 +526,7 @@ public String getRoutingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRoutingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set } /** @@ -464,6 +537,7 @@ public void setRoutingNumber(String routingNumber) { */ public CheckoutBankTransferAction shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -487,6 +561,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -497,6 +572,7 @@ public void setShopperEmail(String shopperEmail) { */ public CheckoutBankTransferAction sortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set return this; } @@ -520,6 +596,7 @@ public String getSortCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set } /** @@ -530,6 +607,7 @@ public void setSortCode(String sortCode) { */ public CheckoutBankTransferAction totalAmount(Amount totalAmount) { this.totalAmount = totalAmount; + isSetTotalAmount = true; // mark as set return this; } @@ -553,6 +631,7 @@ public Amount getTotalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTotalAmount(Amount totalAmount) { this.totalAmount = totalAmount; + isSetTotalAmount = true; // mark as set } /** @@ -563,6 +642,7 @@ public void setTotalAmount(Amount totalAmount) { */ public CheckoutBankTransferAction type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -586,6 +666,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -596,6 +677,7 @@ public void setType(TypeEnum type) { */ public CheckoutBankTransferAction url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -619,6 +701,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutBankTransferAction 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 CheckoutBankTransferAction object is equal to o. */ @@ -701,6 +804,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_BENEFICIARY, this.beneficiary); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + if (isSetBranchCode) { + addIfNull(nulls, JSON_PROPERTY_BRANCH_CODE, this.branchCode); + } + if (isSetDownloadUrl) { + addIfNull(nulls, JSON_PROPERTY_DOWNLOAD_URL, this.downloadUrl); + } + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetPaymentMethodType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_TYPE, this.paymentMethodType); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetRoutingNumber) { + addIfNull(nulls, JSON_PROPERTY_ROUTING_NUMBER, this.routingNumber); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetSortCode) { + addIfNull(nulls, JSON_PROPERTY_SORT_CODE, this.sortCode); + } + if (isSetTotalAmount) { + addIfNull(nulls, JSON_PROPERTY_TOTAL_AMOUNT, this.totalAmount); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + 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 CheckoutBankTransferAction given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutDelegatedAuthenticationAction.java b/src/main/java/com/adyen/model/checkout/CheckoutDelegatedAuthenticationAction.java index 3ac65b281..0b3a2d538 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutDelegatedAuthenticationAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutDelegatedAuthenticationAction.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 CheckoutDelegatedAuthenticationAction { public static final String JSON_PROPERTY_AUTHORISATION_TOKEN = "authorisationToken"; private String authorisationToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorisationToken = false; + public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData"; private String paymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_TYPE = "paymentMethodType"; private String paymentMethodType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodType = false; + public static final String JSON_PROPERTY_TOKEN = "token"; private String token; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetToken = false; + /** **delegatedAuthentication** */ public enum TypeEnum { DELEGATEDAUTHENTICATION(String.valueOf("delegatedAuthentication")); @@ -85,9 +99,21 @@ 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; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutDelegatedAuthenticationAction() {} /** @@ -99,6 +125,7 @@ public CheckoutDelegatedAuthenticationAction() {} */ public CheckoutDelegatedAuthenticationAction authorisationToken(String authorisationToken) { this.authorisationToken = authorisationToken; + isSetAuthorisationToken = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getAuthorisationToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisationToken(String authorisationToken) { this.authorisationToken = authorisationToken; + isSetAuthorisationToken = true; // mark as set } /** @@ -133,6 +161,7 @@ public void setAuthorisationToken(String authorisationToken) { */ public CheckoutDelegatedAuthenticationAction paymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set return this; } @@ -156,6 +185,7 @@ public String getPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set } /** @@ -167,6 +197,7 @@ public void setPaymentData(String paymentData) { */ public CheckoutDelegatedAuthenticationAction paymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set return this; } @@ -190,6 +221,7 @@ public String getPaymentMethodType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set } /** @@ -201,6 +233,7 @@ public void setPaymentMethodType(String paymentMethodType) { */ public CheckoutDelegatedAuthenticationAction token(String token) { this.token = token; + isSetToken = true; // mark as set return this; } @@ -224,6 +257,7 @@ public String getToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setToken(String token) { this.token = token; + isSetToken = true; // mark as set } /** @@ -235,6 +269,7 @@ public void setToken(String token) { */ public CheckoutDelegatedAuthenticationAction type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -258,6 +293,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -269,6 +305,7 @@ public void setType(TypeEnum type) { */ public CheckoutDelegatedAuthenticationAction url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -292,6 +329,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutDelegatedAuthenticationAction 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 CheckoutDelegatedAuthenticationAction object is equal to o. */ @@ -344,6 +402,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 (isSetAuthorisationToken) { + addIfNull(nulls, JSON_PROPERTY_AUTHORISATION_TOKEN, this.authorisationToken); + } + if (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + if (isSetPaymentMethodType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_TYPE, this.paymentMethodType); + } + if (isSetToken) { + addIfNull(nulls, JSON_PROPERTY_TOKEN, this.token); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + 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 CheckoutDelegatedAuthenticationAction given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutNativeRedirectAction.java b/src/main/java/com/adyen/model/checkout/CheckoutNativeRedirectAction.java index 5d4a6b3c1..84ed415f3 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutNativeRedirectAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutNativeRedirectAction.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -36,15 +38,27 @@ public class CheckoutNativeRedirectAction { public static final String JSON_PROPERTY_DATA = "data"; private Map data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_METHOD = "method"; private String method; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMethod = false; + public static final String JSON_PROPERTY_NATIVE_REDIRECT_DATA = "nativeRedirectData"; private String nativeRedirectData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNativeRedirectData = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_TYPE = "paymentMethodType"; private String paymentMethodType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodType = false; + /** **nativeRedirect** */ public enum TypeEnum { NATIVEREDIRECT(String.valueOf("nativeRedirect")); @@ -87,9 +101,21 @@ 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; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutNativeRedirectAction() {} /** @@ -101,6 +127,7 @@ public CheckoutNativeRedirectAction() {} */ public CheckoutNativeRedirectAction data(Map data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -134,6 +161,7 @@ public Map getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(Map data) { this.data = data; + isSetData = true; // mark as set } /** @@ -144,6 +172,7 @@ public void setData(Map data) { */ public CheckoutNativeRedirectAction method(String method) { this.method = method; + isSetMethod = true; // mark as set return this; } @@ -167,6 +196,7 @@ public String getMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMethod(String method) { this.method = method; + isSetMethod = true; // mark as set } /** @@ -179,6 +209,7 @@ public void setMethod(String method) { */ public CheckoutNativeRedirectAction nativeRedirectData(String nativeRedirectData) { this.nativeRedirectData = nativeRedirectData; + isSetNativeRedirectData = true; // mark as set return this; } @@ -206,6 +237,7 @@ public String getNativeRedirectData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNativeRedirectData(String nativeRedirectData) { this.nativeRedirectData = nativeRedirectData; + isSetNativeRedirectData = true; // mark as set } /** @@ -216,6 +248,7 @@ public void setNativeRedirectData(String nativeRedirectData) { */ public CheckoutNativeRedirectAction paymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set return this; } @@ -239,6 +272,7 @@ public String getPaymentMethodType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set } /** @@ -249,6 +283,7 @@ public void setPaymentMethodType(String paymentMethodType) { */ public CheckoutNativeRedirectAction type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -272,6 +307,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -282,6 +318,7 @@ public void setType(TypeEnum type) { */ public CheckoutNativeRedirectAction url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -305,6 +342,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutNativeRedirectAction 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 CheckoutNativeRedirectAction object is equal to o. */ @@ -354,6 +412,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 (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetMethod) { + addIfNull(nulls, JSON_PROPERTY_METHOD, this.method); + } + if (isSetNativeRedirectData) { + addIfNull(nulls, JSON_PROPERTY_NATIVE_REDIRECT_DATA, this.nativeRedirectData); + } + if (isSetPaymentMethodType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_TYPE, this.paymentMethodType); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + 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 CheckoutNativeRedirectAction given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutOrderResponse.java b/src/main/java/com/adyen/model/checkout/CheckoutOrderResponse.java index 8d75c9cf3..f98931044 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutOrderResponse.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutOrderResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 CheckoutOrderResponse { 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_EXPIRES_AT = "expiresAt"; private String expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + public static final String JSON_PROPERTY_ORDER_DATA = "orderData"; private String orderData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrderData = 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; + public static final String JSON_PROPERTY_REMAINING_AMOUNT = "remainingAmount"; private Amount remainingAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemainingAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutOrderResponse() {} /** @@ -55,6 +81,7 @@ public CheckoutOrderResponse() {} */ public CheckoutOrderResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -78,6 +105,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -88,6 +116,7 @@ public void setAmount(Amount amount) { */ public CheckoutOrderResponse expiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -111,6 +140,7 @@ public String getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -121,6 +151,7 @@ public void setExpiresAt(String expiresAt) { */ public CheckoutOrderResponse orderData(String orderData) { this.orderData = orderData; + isSetOrderData = true; // mark as set return this; } @@ -144,6 +175,7 @@ public String getOrderData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrderData(String orderData) { this.orderData = orderData; + isSetOrderData = true; // mark as set } /** @@ -154,6 +186,7 @@ public void setOrderData(String orderData) { */ public CheckoutOrderResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -177,6 +210,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -187,6 +221,7 @@ public void setPspReference(String pspReference) { */ public CheckoutOrderResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -210,6 +245,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -220,6 +256,7 @@ public void setReference(String reference) { */ public CheckoutOrderResponse remainingAmount(Amount remainingAmount) { this.remainingAmount = remainingAmount; + isSetRemainingAmount = true; // mark as set return this; } @@ -243,6 +280,27 @@ public Amount getRemainingAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemainingAmount(Amount remainingAmount) { this.remainingAmount = remainingAmount; + isSetRemainingAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutOrderResponse 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 CheckoutOrderResponse object is equal to o. */ @@ -292,6 +350,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 (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetOrderData) { + addIfNull(nulls, JSON_PROPERTY_ORDER_DATA, this.orderData); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetRemainingAmount) { + addIfNull(nulls, JSON_PROPERTY_REMAINING_AMOUNT, this.remainingAmount); + } + + 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 CheckoutOrderResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutQrCodeAction.java b/src/main/java/com/adyen/model/checkout/CheckoutQrCodeAction.java index fe798f762..a3b06bc7c 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutQrCodeAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutQrCodeAction.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 CheckoutQrCodeAction { public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private String expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData"; private String paymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_TYPE = "paymentMethodType"; private String paymentMethodType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodType = false; + public static final String JSON_PROPERTY_QR_CODE_DATA = "qrCodeData"; private String qrCodeData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetQrCodeData = false; + /** **qrCode** */ public enum TypeEnum { QRCODE(String.valueOf("qrCode")); @@ -85,9 +99,21 @@ 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; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutQrCodeAction() {} /** @@ -98,6 +124,7 @@ public CheckoutQrCodeAction() {} */ public CheckoutQrCodeAction expiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -121,6 +148,7 @@ public String getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -131,6 +159,7 @@ public void setExpiresAt(String expiresAt) { */ public CheckoutQrCodeAction paymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set return this; } @@ -154,6 +183,7 @@ public String getPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set } /** @@ -164,6 +194,7 @@ public void setPaymentData(String paymentData) { */ public CheckoutQrCodeAction paymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set return this; } @@ -187,6 +218,7 @@ public String getPaymentMethodType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set } /** @@ -197,6 +229,7 @@ public void setPaymentMethodType(String paymentMethodType) { */ public CheckoutQrCodeAction qrCodeData(String qrCodeData) { this.qrCodeData = qrCodeData; + isSetQrCodeData = true; // mark as set return this; } @@ -220,6 +253,7 @@ public String getQrCodeData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setQrCodeData(String qrCodeData) { this.qrCodeData = qrCodeData; + isSetQrCodeData = true; // mark as set } /** @@ -230,6 +264,7 @@ public void setQrCodeData(String qrCodeData) { */ public CheckoutQrCodeAction type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -253,6 +288,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -263,6 +299,7 @@ public void setType(TypeEnum type) { */ public CheckoutQrCodeAction url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -286,6 +323,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutQrCodeAction 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 CheckoutQrCodeAction object is equal to o. */ @@ -335,6 +393,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 (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + if (isSetPaymentMethodType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_TYPE, this.paymentMethodType); + } + if (isSetQrCodeData) { + addIfNull(nulls, JSON_PROPERTY_QR_CODE_DATA, this.qrCodeData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + 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 CheckoutQrCodeAction given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutRedirectAction.java b/src/main/java/com/adyen/model/checkout/CheckoutRedirectAction.java index 20acd4339..47ff54d70 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutRedirectAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutRedirectAction.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,12 +37,21 @@ public class CheckoutRedirectAction { public static final String JSON_PROPERTY_DATA = "data"; private Map data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_METHOD = "method"; private String method; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMethod = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_TYPE = "paymentMethodType"; private String paymentMethodType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodType = false; + /** **redirect** */ public enum TypeEnum { REDIRECT(String.valueOf("redirect")); @@ -83,9 +94,21 @@ 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; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutRedirectAction() {} /** @@ -97,6 +120,7 @@ public CheckoutRedirectAction() {} */ public CheckoutRedirectAction data(Map data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -130,6 +154,7 @@ public Map getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(Map data) { this.data = data; + isSetData = true; // mark as set } /** @@ -140,6 +165,7 @@ public void setData(Map data) { */ public CheckoutRedirectAction method(String method) { this.method = method; + isSetMethod = true; // mark as set return this; } @@ -163,6 +189,7 @@ public String getMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMethod(String method) { this.method = method; + isSetMethod = true; // mark as set } /** @@ -173,6 +200,7 @@ public void setMethod(String method) { */ public CheckoutRedirectAction paymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set return this; } @@ -196,6 +224,7 @@ public String getPaymentMethodType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set } /** @@ -206,6 +235,7 @@ public void setPaymentMethodType(String paymentMethodType) { */ public CheckoutRedirectAction type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -229,6 +259,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -239,6 +270,7 @@ public void setType(TypeEnum type) { */ public CheckoutRedirectAction url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -262,6 +294,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutRedirectAction 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 CheckoutRedirectAction object is equal to o. */ @@ -309,6 +362,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 (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetMethod) { + addIfNull(nulls, JSON_PROPERTY_METHOD, this.method); + } + if (isSetPaymentMethodType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_TYPE, this.paymentMethodType); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + 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 CheckoutRedirectAction given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutSDKAction.java b/src/main/java/com/adyen/model/checkout/CheckoutSDKAction.java index 77dd438e3..3a10f6270 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutSDKAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutSDKAction.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,12 +37,21 @@ public class CheckoutSDKAction { public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData"; private String paymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_TYPE = "paymentMethodType"; private String paymentMethodType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodType = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private Map sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** The type of the action. */ public enum TypeEnum { SDK(String.valueOf("sdk")), @@ -85,9 +96,21 @@ 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; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutSDKAction() {} /** @@ -98,6 +121,7 @@ public CheckoutSDKAction() {} */ public CheckoutSDKAction paymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set return this; } @@ -121,6 +145,7 @@ public String getPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set } /** @@ -131,6 +156,7 @@ public void setPaymentData(String paymentData) { */ public CheckoutSDKAction paymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set return this; } @@ -154,6 +180,7 @@ public String getPaymentMethodType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set } /** @@ -164,6 +191,7 @@ public void setPaymentMethodType(String paymentMethodType) { */ public CheckoutSDKAction sdkData(Map sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -195,6 +223,7 @@ public Map getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(Map sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -205,6 +234,7 @@ public void setSdkData(Map sdkData) { */ public CheckoutSDKAction type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -228,6 +258,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -238,6 +269,7 @@ public void setType(TypeEnum type) { */ public CheckoutSDKAction url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -261,6 +293,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutSDKAction 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 CheckoutSDKAction object is equal to o. */ @@ -308,6 +361,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 (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + if (isSetPaymentMethodType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_TYPE, this.paymentMethodType); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + 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 CheckoutSDKAction given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutSessionInstallmentOption.java b/src/main/java/com/adyen/model/checkout/CheckoutSessionInstallmentOption.java index 7dba3c069..7e5e3c669 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutSessionInstallmentOption.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutSessionInstallmentOption.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -90,12 +92,27 @@ public static PlansEnum fromValue(String value) { public static final String JSON_PROPERTY_PLANS = "plans"; private List plans; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlans = false; + public static final String JSON_PROPERTY_PRESELECTED_VALUE = "preselectedValue"; private Integer preselectedValue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPreselectedValue = false; + public static final String JSON_PROPERTY_VALUES = "values"; private List values; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValues = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutSessionInstallmentOption() {} /** @@ -113,6 +130,7 @@ public CheckoutSessionInstallmentOption() {} */ public CheckoutSessionInstallmentOption plans(List plans) { this.plans = plans; + isSetPlans = true; // mark as set return this; } @@ -156,6 +174,7 @@ public List getPlans() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlans(List plans) { this.plans = plans; + isSetPlans = true; // mark as set } /** @@ -167,6 +186,7 @@ public void setPlans(List plans) { */ public CheckoutSessionInstallmentOption preselectedValue(Integer preselectedValue) { this.preselectedValue = preselectedValue; + isSetPreselectedValue = true; // mark as set return this; } @@ -190,6 +210,7 @@ public Integer getPreselectedValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPreselectedValue(Integer preselectedValue) { this.preselectedValue = preselectedValue; + isSetPreselectedValue = true; // mark as set } /** @@ -203,6 +224,7 @@ public void setPreselectedValue(Integer preselectedValue) { */ public CheckoutSessionInstallmentOption values(List values) { this.values = values; + isSetValues = true; // mark as set return this; } @@ -238,6 +260,27 @@ public List getValues() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValues(List values) { this.values = values; + isSetValues = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutSessionInstallmentOption 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 CheckoutSessionInstallmentOption object is equal to o. */ @@ -282,6 +325,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 (isSetPlans) { + addIfNull(nulls, JSON_PROPERTY_PLANS, this.plans); + } + if (isSetPreselectedValue) { + addIfNull(nulls, JSON_PROPERTY_PRESELECTED_VALUE, this.preselectedValue); + } + if (isSetValues) { + addIfNull(nulls, JSON_PROPERTY_VALUES, this.values); + } + + 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 CheckoutSessionInstallmentOption given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutSessionThreeDS2RequestData.java b/src/main/java/com/adyen/model/checkout/CheckoutSessionThreeDS2RequestData.java index f8bf8c289..da866e593 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutSessionThreeDS2RequestData.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutSessionThreeDS2RequestData.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -32,9 +34,15 @@ public class CheckoutSessionThreeDS2RequestData { 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_MOBILE_PHONE = "mobilePhone"; private Phone mobilePhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMobilePhone = false; + /** * Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No * preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor @@ -94,9 +102,21 @@ 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_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 CheckoutSessionThreeDS2RequestData() {} /** @@ -108,6 +128,7 @@ public CheckoutSessionThreeDS2RequestData() {} */ public CheckoutSessionThreeDS2RequestData homePhone(Phone homePhone) { this.homePhone = homePhone; + isSetHomePhone = true; // mark as set return this; } @@ -131,6 +152,7 @@ public Phone getHomePhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHomePhone(Phone homePhone) { this.homePhone = homePhone; + isSetHomePhone = true; // mark as set } /** @@ -142,6 +164,7 @@ public void setHomePhone(Phone homePhone) { */ public CheckoutSessionThreeDS2RequestData mobilePhone(Phone mobilePhone) { this.mobilePhone = mobilePhone; + isSetMobilePhone = true; // mark as set return this; } @@ -165,6 +188,7 @@ public Phone getMobilePhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMobilePhone(Phone mobilePhone) { this.mobilePhone = mobilePhone; + isSetMobilePhone = true; // mark as set } /** @@ -184,6 +208,7 @@ public void setMobilePhone(Phone mobilePhone) { public CheckoutSessionThreeDS2RequestData threeDSRequestorChallengeInd( ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd) { this.threeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + isSetThreeDSRequestorChallengeInd = true; // mark as set return this; } @@ -222,6 +247,7 @@ public ThreeDSRequestorChallengeIndEnum getThreeDSRequestorChallengeInd() { public void setThreeDSRequestorChallengeInd( ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd) { this.threeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + isSetThreeDSRequestorChallengeInd = true; // mark as set } /** @@ -233,6 +259,7 @@ public void setThreeDSRequestorChallengeInd( */ public CheckoutSessionThreeDS2RequestData workPhone(Phone workPhone) { this.workPhone = workPhone; + isSetWorkPhone = true; // mark as set return this; } @@ -256,6 +283,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 CheckoutSessionThreeDS2RequestData 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 CheckoutSessionThreeDS2RequestData object is equal to o. */ @@ -306,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 (isSetHomePhone) { + addIfNull(nulls, JSON_PROPERTY_HOME_PHONE, this.homePhone); + } + if (isSetMobilePhone) { + addIfNull(nulls, JSON_PROPERTY_MOBILE_PHONE, this.mobilePhone); + } + if (isSetThreeDSRequestorChallengeInd) { + addIfNull( + nulls, + JSON_PROPERTY_THREE_D_S_REQUESTOR_CHALLENGE_IND, + this.threeDSRequestorChallengeInd); + } + 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 CheckoutSessionThreeDS2RequestData given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutThreeDS2Action.java b/src/main/java/com/adyen/model/checkout/CheckoutThreeDS2Action.java index 088f45254..2557465e8 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutThreeDS2Action.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutThreeDS2Action.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,18 +37,33 @@ public class CheckoutThreeDS2Action { public static final String JSON_PROPERTY_AUTHORISATION_TOKEN = "authorisationToken"; private String authorisationToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorisationToken = false; + public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData"; private String paymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_TYPE = "paymentMethodType"; private String paymentMethodType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodType = false; + public static final String JSON_PROPERTY_SUBTYPE = "subtype"; private String subtype; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubtype = false; + public static final String JSON_PROPERTY_TOKEN = "token"; private String token; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetToken = false; + /** **threeDS2** */ public enum TypeEnum { THREEDS2(String.valueOf("threeDS2")); @@ -89,9 +106,21 @@ 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; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutThreeDS2Action() {} /** @@ -102,6 +131,7 @@ public CheckoutThreeDS2Action() {} */ public CheckoutThreeDS2Action authorisationToken(String authorisationToken) { this.authorisationToken = authorisationToken; + isSetAuthorisationToken = true; // mark as set return this; } @@ -125,6 +155,7 @@ public String getAuthorisationToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisationToken(String authorisationToken) { this.authorisationToken = authorisationToken; + isSetAuthorisationToken = true; // mark as set } /** @@ -135,6 +166,7 @@ public void setAuthorisationToken(String authorisationToken) { */ public CheckoutThreeDS2Action paymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set return this; } @@ -158,6 +190,7 @@ public String getPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set } /** @@ -168,6 +201,7 @@ public void setPaymentData(String paymentData) { */ public CheckoutThreeDS2Action paymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set return this; } @@ -191,6 +225,7 @@ public String getPaymentMethodType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set } /** @@ -201,6 +236,7 @@ public void setPaymentMethodType(String paymentMethodType) { */ public CheckoutThreeDS2Action subtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set return this; } @@ -224,6 +260,7 @@ public String getSubtype() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set } /** @@ -234,6 +271,7 @@ public void setSubtype(String subtype) { */ public CheckoutThreeDS2Action token(String token) { this.token = token; + isSetToken = true; // mark as set return this; } @@ -257,6 +295,7 @@ public String getToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setToken(String token) { this.token = token; + isSetToken = true; // mark as set } /** @@ -267,6 +306,7 @@ public void setToken(String token) { */ public CheckoutThreeDS2Action type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -290,6 +330,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -300,6 +341,7 @@ public void setType(TypeEnum type) { */ public CheckoutThreeDS2Action url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -323,6 +365,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutThreeDS2Action 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 CheckoutThreeDS2Action object is equal to o. */ @@ -375,6 +438,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAuthorisationToken) { + addIfNull(nulls, JSON_PROPERTY_AUTHORISATION_TOKEN, this.authorisationToken); + } + if (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + if (isSetPaymentMethodType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_TYPE, this.paymentMethodType); + } + if (isSetSubtype) { + addIfNull(nulls, JSON_PROPERTY_SUBTYPE, this.subtype); + } + if (isSetToken) { + addIfNull(nulls, JSON_PROPERTY_TOKEN, this.token); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + 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 CheckoutThreeDS2Action given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutVoucherAction.java b/src/main/java/com/adyen/model/checkout/CheckoutVoucherAction.java index 8dc61f06c..104e395ab 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutVoucherAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutVoucherAction.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -49,61 +51,118 @@ public class CheckoutVoucherAction { public static final String JSON_PROPERTY_ALTERNATIVE_REFERENCE = "alternativeReference"; private String alternativeReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAlternativeReference = false; + public static final String JSON_PROPERTY_COLLECTION_INSTITUTION_NUMBER = "collectionInstitutionNumber"; private String collectionInstitutionNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCollectionInstitutionNumber = false; + public static final String JSON_PROPERTY_DOWNLOAD_URL = "downloadUrl"; private String downloadUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDownloadUrl = false; + public static final String JSON_PROPERTY_ENTITY = "entity"; private String entity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntity = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private String expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + public static final String JSON_PROPERTY_INITIAL_AMOUNT = "initialAmount"; private Amount initialAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInitialAmount = false; + public static final String JSON_PROPERTY_INSTRUCTIONS_URL = "instructionsUrl"; private String instructionsUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstructionsUrl = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_MASKED_TELEPHONE_NUMBER = "maskedTelephoneNumber"; private String maskedTelephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaskedTelephoneNumber = 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_MERCHANT_REFERENCE = "merchantReference"; private String merchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantReference = false; + public static final String JSON_PROPERTY_PASS_CREATION_TOKEN = "passCreationToken"; private String passCreationToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPassCreationToken = false; + public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData"; private String paymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_TYPE = "paymentMethodType"; private String paymentMethodType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodType = 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_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 String shopperName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperName = false; + public static final String JSON_PROPERTY_SURCHARGE = "surcharge"; private Amount surcharge; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSurcharge = false; + public static final String JSON_PROPERTY_TOTAL_AMOUNT = "totalAmount"; private Amount totalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalAmount = false; + /** **voucher** */ public enum TypeEnum { VOUCHER(String.valueOf("voucher")); @@ -146,9 +205,21 @@ 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; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutVoucherAction() {} /** @@ -159,6 +230,7 @@ public CheckoutVoucherAction() {} */ public CheckoutVoucherAction alternativeReference(String alternativeReference) { this.alternativeReference = alternativeReference; + isSetAlternativeReference = true; // mark as set return this; } @@ -182,6 +254,7 @@ public String getAlternativeReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAlternativeReference(String alternativeReference) { this.alternativeReference = alternativeReference; + isSetAlternativeReference = true; // mark as set } /** @@ -193,6 +266,7 @@ public void setAlternativeReference(String alternativeReference) { */ public CheckoutVoucherAction collectionInstitutionNumber(String collectionInstitutionNumber) { this.collectionInstitutionNumber = collectionInstitutionNumber; + isSetCollectionInstitutionNumber = true; // mark as set return this; } @@ -218,6 +292,7 @@ public String getCollectionInstitutionNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCollectionInstitutionNumber(String collectionInstitutionNumber) { this.collectionInstitutionNumber = collectionInstitutionNumber; + isSetCollectionInstitutionNumber = true; // mark as set } /** @@ -228,6 +303,7 @@ public void setCollectionInstitutionNumber(String collectionInstitutionNumber) { */ public CheckoutVoucherAction downloadUrl(String downloadUrl) { this.downloadUrl = downloadUrl; + isSetDownloadUrl = true; // mark as set return this; } @@ -251,6 +327,7 @@ public String getDownloadUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDownloadUrl(String downloadUrl) { this.downloadUrl = downloadUrl; + isSetDownloadUrl = true; // mark as set } /** @@ -261,6 +338,7 @@ public void setDownloadUrl(String downloadUrl) { */ public CheckoutVoucherAction entity(String entity) { this.entity = entity; + isSetEntity = true; // mark as set return this; } @@ -284,6 +362,7 @@ public String getEntity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntity(String entity) { this.entity = entity; + isSetEntity = true; // mark as set } /** @@ -294,6 +373,7 @@ public void setEntity(String entity) { */ public CheckoutVoucherAction expiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -317,6 +397,7 @@ public String getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -327,6 +408,7 @@ public void setExpiresAt(String expiresAt) { */ public CheckoutVoucherAction initialAmount(Amount initialAmount) { this.initialAmount = initialAmount; + isSetInitialAmount = true; // mark as set return this; } @@ -350,6 +432,7 @@ public Amount getInitialAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInitialAmount(Amount initialAmount) { this.initialAmount = initialAmount; + isSetInitialAmount = true; // mark as set } /** @@ -360,6 +443,7 @@ public void setInitialAmount(Amount initialAmount) { */ public CheckoutVoucherAction instructionsUrl(String instructionsUrl) { this.instructionsUrl = instructionsUrl; + isSetInstructionsUrl = true; // mark as set return this; } @@ -383,6 +467,7 @@ public String getInstructionsUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstructionsUrl(String instructionsUrl) { this.instructionsUrl = instructionsUrl; + isSetInstructionsUrl = true; // mark as set } /** @@ -393,6 +478,7 @@ public void setInstructionsUrl(String instructionsUrl) { */ public CheckoutVoucherAction issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -416,6 +502,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -426,6 +513,7 @@ public void setIssuer(String issuer) { */ public CheckoutVoucherAction maskedTelephoneNumber(String maskedTelephoneNumber) { this.maskedTelephoneNumber = maskedTelephoneNumber; + isSetMaskedTelephoneNumber = true; // mark as set return this; } @@ -449,6 +537,7 @@ public String getMaskedTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaskedTelephoneNumber(String maskedTelephoneNumber) { this.maskedTelephoneNumber = maskedTelephoneNumber; + isSetMaskedTelephoneNumber = true; // mark as set } /** @@ -459,6 +548,7 @@ public void setMaskedTelephoneNumber(String maskedTelephoneNumber) { */ public CheckoutVoucherAction merchantName(String merchantName) { this.merchantName = merchantName; + isSetMerchantName = true; // mark as set return this; } @@ -482,6 +572,7 @@ public String getMerchantName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantName(String merchantName) { this.merchantName = merchantName; + isSetMerchantName = true; // mark as set } /** @@ -492,6 +583,7 @@ public void setMerchantName(String merchantName) { */ public CheckoutVoucherAction merchantReference(String merchantReference) { this.merchantReference = merchantReference; + isSetMerchantReference = true; // mark as set return this; } @@ -515,6 +607,7 @@ public String getMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantReference(String merchantReference) { this.merchantReference = merchantReference; + isSetMerchantReference = true; // mark as set } /** @@ -527,6 +620,7 @@ public void setMerchantReference(String merchantReference) { */ public CheckoutVoucherAction passCreationToken(String passCreationToken) { this.passCreationToken = passCreationToken; + isSetPassCreationToken = true; // mark as set return this; } @@ -554,6 +648,7 @@ public String getPassCreationToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPassCreationToken(String passCreationToken) { this.passCreationToken = passCreationToken; + isSetPassCreationToken = true; // mark as set } /** @@ -564,6 +659,7 @@ public void setPassCreationToken(String passCreationToken) { */ public CheckoutVoucherAction paymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set return this; } @@ -587,6 +683,7 @@ public String getPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set } /** @@ -597,6 +694,7 @@ public void setPaymentData(String paymentData) { */ public CheckoutVoucherAction paymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set return this; } @@ -620,6 +718,7 @@ public String getPaymentMethodType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set } /** @@ -630,6 +729,7 @@ public void setPaymentMethodType(String paymentMethodType) { */ public CheckoutVoucherAction reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -653,6 +753,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -663,6 +764,7 @@ public void setReference(String reference) { */ public CheckoutVoucherAction shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -686,6 +788,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -696,6 +799,7 @@ public void setShopperEmail(String shopperEmail) { */ public CheckoutVoucherAction shopperName(String shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -719,6 +823,7 @@ public String getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(String shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -729,6 +834,7 @@ public void setShopperName(String shopperName) { */ public CheckoutVoucherAction surcharge(Amount surcharge) { this.surcharge = surcharge; + isSetSurcharge = true; // mark as set return this; } @@ -752,6 +858,7 @@ public Amount getSurcharge() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSurcharge(Amount surcharge) { this.surcharge = surcharge; + isSetSurcharge = true; // mark as set } /** @@ -762,6 +869,7 @@ public void setSurcharge(Amount surcharge) { */ public CheckoutVoucherAction totalAmount(Amount totalAmount) { this.totalAmount = totalAmount; + isSetTotalAmount = true; // mark as set return this; } @@ -785,6 +893,7 @@ public Amount getTotalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTotalAmount(Amount totalAmount) { this.totalAmount = totalAmount; + isSetTotalAmount = true; // mark as set } /** @@ -795,6 +904,7 @@ public void setTotalAmount(Amount totalAmount) { */ public CheckoutVoucherAction type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -818,6 +928,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -828,6 +939,7 @@ public void setType(TypeEnum type) { */ public CheckoutVoucherAction url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -851,6 +963,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutVoucherAction 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 CheckoutVoucherAction object is equal to o. */ @@ -958,6 +1091,91 @@ 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 (isSetAlternativeReference) { + addIfNull(nulls, JSON_PROPERTY_ALTERNATIVE_REFERENCE, this.alternativeReference); + } + if (isSetCollectionInstitutionNumber) { + addIfNull( + nulls, JSON_PROPERTY_COLLECTION_INSTITUTION_NUMBER, this.collectionInstitutionNumber); + } + if (isSetDownloadUrl) { + addIfNull(nulls, JSON_PROPERTY_DOWNLOAD_URL, this.downloadUrl); + } + if (isSetEntity) { + addIfNull(nulls, JSON_PROPERTY_ENTITY, this.entity); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetInitialAmount) { + addIfNull(nulls, JSON_PROPERTY_INITIAL_AMOUNT, this.initialAmount); + } + if (isSetInstructionsUrl) { + addIfNull(nulls, JSON_PROPERTY_INSTRUCTIONS_URL, this.instructionsUrl); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetMaskedTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_MASKED_TELEPHONE_NUMBER, this.maskedTelephoneNumber); + } + if (isSetMerchantName) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_NAME, this.merchantName); + } + if (isSetMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_REFERENCE, this.merchantReference); + } + if (isSetPassCreationToken) { + addIfNull(nulls, JSON_PROPERTY_PASS_CREATION_TOKEN, this.passCreationToken); + } + if (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + if (isSetPaymentMethodType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_TYPE, this.paymentMethodType); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperName) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_NAME, this.shopperName); + } + if (isSetSurcharge) { + addIfNull(nulls, JSON_PROPERTY_SURCHARGE, this.surcharge); + } + if (isSetTotalAmount) { + addIfNull(nulls, JSON_PROPERTY_TOTAL_AMOUNT, this.totalAmount); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + 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 CheckoutVoucherAction given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CommonField.java b/src/main/java/com/adyen/model/checkout/CommonField.java index 711a5d058..063684e7c 100644 --- a/src/main/java/com/adyen/model/checkout/CommonField.java +++ b/src/main/java/com/adyen/model/checkout/CommonField.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -133,6 +171,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/checkout/Company.java b/src/main/java/com/adyen/model/checkout/Company.java index a8338d9b9..041e2e371 100644 --- a/src/main/java/com/adyen/model/checkout/Company.java +++ b/src/main/java/com/adyen/model/checkout/Company.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 Company { public static final String JSON_PROPERTY_HOMEPAGE = "homepage"; private String homepage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHomepage = 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_REGISTRATION_NUMBER = "registrationNumber"; private String registrationNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRegistrationNumber = false; + public static final String JSON_PROPERTY_REGISTRY_LOCATION = "registryLocation"; private String registryLocation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRegistryLocation = 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; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 Company() {} /** @@ -55,6 +81,7 @@ public Company() {} */ public Company homepage(String homepage) { this.homepage = homepage; + isSetHomepage = true; // mark as set return this; } @@ -78,6 +105,7 @@ public String getHomepage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHomepage(String homepage) { this.homepage = homepage; + isSetHomepage = true; // mark as set } /** @@ -88,6 +116,7 @@ public void setHomepage(String homepage) { */ public Company name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -111,6 +140,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -121,6 +151,7 @@ public void setName(String name) { */ public Company registrationNumber(String registrationNumber) { this.registrationNumber = registrationNumber; + isSetRegistrationNumber = true; // mark as set return this; } @@ -144,6 +175,7 @@ public String getRegistrationNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRegistrationNumber(String registrationNumber) { this.registrationNumber = registrationNumber; + isSetRegistrationNumber = true; // mark as set } /** @@ -154,6 +186,7 @@ public void setRegistrationNumber(String registrationNumber) { */ public Company registryLocation(String registryLocation) { this.registryLocation = registryLocation; + isSetRegistryLocation = true; // mark as set return this; } @@ -177,6 +210,7 @@ public String getRegistryLocation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRegistryLocation(String registryLocation) { this.registryLocation = registryLocation; + isSetRegistryLocation = true; // mark as set } /** @@ -187,6 +221,7 @@ public void setRegistryLocation(String registryLocation) { */ public Company taxId(String taxId) { this.taxId = taxId; + isSetTaxId = true; // mark as set return this; } @@ -210,6 +245,7 @@ public String getTaxId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxId(String taxId) { this.taxId = taxId; + isSetTaxId = true; // mark as set } /** @@ -220,6 +256,7 @@ public void setTaxId(String taxId) { */ public Company type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -243,6 +280,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Company 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 Company object is equal to o. */ @@ -292,6 +350,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 (isSetHomepage) { + addIfNull(nulls, JSON_PROPERTY_HOMEPAGE, this.homepage); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetRegistrationNumber) { + addIfNull(nulls, JSON_PROPERTY_REGISTRATION_NUMBER, this.registrationNumber); + } + if (isSetRegistryLocation) { + addIfNull(nulls, JSON_PROPERTY_REGISTRY_LOCATION, this.registryLocation); + } + if (isSetTaxId) { + addIfNull(nulls, JSON_PROPERTY_TAX_ID, this.taxId); + } + 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 Company given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java index ed55b878b..2131c5f4f 100644 --- a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,33 +97,63 @@ public class CreateCheckoutSessionRequest { 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_ALLOWED_PAYMENT_METHODS = "allowedPaymentMethods"; private List allowedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedPaymentMethods = 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_AUTHENTICATION_DATA = "authenticationData"; private AuthenticationData authenticationData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationData = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private BillingAddress billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_BLOCKED_PAYMENT_METHODS = "blockedPaymentMethods"; private List blockedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBlockedPaymentMethods = 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; + /** * The platform where a payment transaction takes place. This field is optional for filtering out * payment methods that are only available on specific platforms. If this value is not set, then @@ -173,60 +205,117 @@ public static ChannelEnum fromValue(String value) { public static final String JSON_PROPERTY_CHANNEL = "channel"; private ChannelEnum channel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChannel = false; + public static final String JSON_PROPERTY_COMPANY = "company"; private Company company; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCompany = 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_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_DELIVER_AT = "deliverAt"; private OffsetDateTime deliverAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliverAt = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private DeliveryAddress deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_ENABLE_ONE_CLICK = "enableOneClick"; private Boolean enableOneClick; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnableOneClick = false; + public static final String JSON_PROPERTY_ENABLE_PAY_OUT = "enablePayOut"; private Boolean enablePayOut; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnablePayOut = false; + public static final String JSON_PROPERTY_ENABLE_RECURRING = "enableRecurring"; private Boolean enableRecurring; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnableRecurring = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private OffsetDateTime expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + public static final String JSON_PROPERTY_FUND_ORIGIN = "fundOrigin"; private FundOrigin fundOrigin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundOrigin = false; + public static final String JSON_PROPERTY_FUND_RECIPIENT = "fundRecipient"; private FundRecipient fundRecipient; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundRecipient = false; + public static final String JSON_PROPERTY_INSTALLMENT_OPTIONS = "installmentOptions"; private Map installmentOptions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentOptions = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = 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_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + /** * Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in * or Components integration * **hosted**: Hosted Checkout integration @@ -274,18 +363,33 @@ public static ModeEnum fromValue(String value) { public static final String JSON_PROPERTY_MODE = "mode"; private ModeEnum mode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMode = 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_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_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; + /** * Defines a recurring payment type. Required when creating a token to store payment details. * Allowed values: * `Subscription` – A transaction for a fixed or variable amount, @@ -343,27 +447,51 @@ 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_REDIRECT_FROM_ISSUER_METHOD = "redirectFromIssuerMethod"; private String redirectFromIssuerMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectFromIssuerMethod = false; + public static final String JSON_PROPERTY_REDIRECT_TO_ISSUER_METHOD = "redirectToIssuerMethod"; private String redirectToIssuerMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectToIssuerMethod = 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_RETURN_URL = "returnUrl"; private String returnUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReturnUrl = false; + public static final String JSON_PROPERTY_RISK_DATA = "riskData"; private RiskData riskData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskData = 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 @@ -424,37 +552,70 @@ 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 ShopperName 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_SHOW_INSTALLMENT_AMOUNT = "showInstallmentAmount"; private Boolean showInstallmentAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShowInstallmentAmount = false; + public static final String JSON_PROPERTY_SHOW_REMOVE_PAYMENT_METHOD_BUTTON = "showRemovePaymentMethodButton"; private Boolean showRemovePaymentMethodButton; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShowRemovePaymentMethodButton = 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_SPLIT_CARD_FUNDING_SOURCES = "splitCardFundingSources"; private Boolean splitCardFundingSources; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplitCardFundingSources = 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; + /** * Specifies how payment methods should be filtered based on the 'store' parameter: - * 'exclusive': Only payment methods belonging to the specified 'store' are @@ -506,9 +667,15 @@ public static StoreFiltrationModeEnum fromValue(String value) { public static final String JSON_PROPERTY_STORE_FILTRATION_MODE = "storeFiltrationMode"; private StoreFiltrationModeEnum storeFiltrationMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoreFiltrationMode = false; + public static final String JSON_PROPERTY_STORE_PAYMENT_METHOD = "storePaymentMethod"; private Boolean storePaymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStorePaymentMethod = false; + /** * Indicates if the details of the payment method will be stored for the shopper. Possible values: * * **disabled** – No details will be stored (default). * **askForConsent** – If the @@ -561,24 +728,48 @@ public static StorePaymentMethodModeEnum fromValue(String value) { public static final String JSON_PROPERTY_STORE_PAYMENT_METHOD_MODE = "storePaymentMethodMode"; private StorePaymentMethodModeEnum storePaymentMethodMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStorePaymentMethodMode = 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_THEME_ID = "themeId"; private String themeId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThemeId = false; + public static final String JSON_PROPERTY_THREE_D_S2_REQUEST_DATA = "threeDS2RequestData"; private CheckoutSessionThreeDS2RequestData 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"; @Deprecated // deprecated since Adyen Checkout API v69: Use // `authenticationData.authenticationOnly` instead. private Boolean threeDSAuthenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSAuthenticationOnly = 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 CreateCheckoutSessionRequest() {} /** @@ -589,6 +780,7 @@ public CreateCheckoutSessionRequest() {} */ public CreateCheckoutSessionRequest accountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set return this; } @@ -612,6 +804,7 @@ public AccountInfo getAccountInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set } /** @@ -622,6 +815,7 @@ public void setAccountInfo(AccountInfo accountInfo) { */ public CreateCheckoutSessionRequest additionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set return this; } @@ -645,6 +839,7 @@ public Amount getAdditionalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set } /** @@ -659,6 +854,7 @@ public void setAdditionalAmount(Amount additionalAmount) { */ public CreateCheckoutSessionRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -698,6 +894,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -713,6 +910,7 @@ public void setAdditionalData(Map additionalData) { */ public CreateCheckoutSessionRequest allowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set return this; } @@ -755,6 +953,7 @@ public List getAllowedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set } /** @@ -765,6 +964,7 @@ public void setAllowedPaymentMethods(List allowedPaymentMethods) { */ public CreateCheckoutSessionRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -788,6 +988,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -798,6 +999,7 @@ public void setAmount(Amount amount) { */ public CreateCheckoutSessionRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -821,6 +1023,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -831,6 +1034,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public CreateCheckoutSessionRequest authenticationData(AuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set return this; } @@ -854,6 +1058,7 @@ public AuthenticationData getAuthenticationData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationData(AuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set } /** @@ -864,6 +1069,7 @@ public void setAuthenticationData(AuthenticationData authenticationData) { */ public CreateCheckoutSessionRequest billingAddress(BillingAddress billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -887,6 +1093,7 @@ public BillingAddress getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(BillingAddress billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -902,6 +1109,7 @@ public void setBillingAddress(BillingAddress billingAddress) { */ public CreateCheckoutSessionRequest blockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set return this; } @@ -944,6 +1152,7 @@ public List getBlockedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBlockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set } /** @@ -955,6 +1164,7 @@ public void setBlockedPaymentMethods(List blockedPaymentMethods) { */ public CreateCheckoutSessionRequest captureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set return this; } @@ -980,6 +1190,7 @@ public Integer getCaptureDelayHours() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set } /** @@ -996,6 +1207,7 @@ public void setCaptureDelayHours(Integer captureDelayHours) { */ public CreateCheckoutSessionRequest channel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set return this; } @@ -1031,6 +1243,7 @@ public ChannelEnum getChannel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChannel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set } /** @@ -1041,6 +1254,7 @@ public void setChannel(ChannelEnum channel) { */ public CreateCheckoutSessionRequest company(Company company) { this.company = company; + isSetCompany = true; // mark as set return this; } @@ -1064,6 +1278,7 @@ public Company getCompany() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCompany(Company company) { this.company = company; + isSetCompany = true; // mark as set } /** @@ -1074,6 +1289,7 @@ public void setCompany(Company company) { */ public CreateCheckoutSessionRequest countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -1097,6 +1313,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -1109,6 +1326,7 @@ public void setCountryCode(String countryCode) { */ public CreateCheckoutSessionRequest dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -1136,6 +1354,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -1150,6 +1369,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public CreateCheckoutSessionRequest deliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set return this; } @@ -1181,6 +1401,7 @@ public OffsetDateTime getDeliverAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set } /** @@ -1191,6 +1412,7 @@ public void setDeliverAt(OffsetDateTime deliverAt) { */ public CreateCheckoutSessionRequest deliveryAddress(DeliveryAddress deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -1214,6 +1436,7 @@ public DeliveryAddress getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(DeliveryAddress deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -1228,6 +1451,7 @@ public void setDeliveryAddress(DeliveryAddress deliveryAddress) { */ public CreateCheckoutSessionRequest enableOneClick(Boolean enableOneClick) { this.enableOneClick = enableOneClick; + isSetEnableOneClick = true; // mark as set return this; } @@ -1259,6 +1483,7 @@ public Boolean getEnableOneClick() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnableOneClick(Boolean enableOneClick) { this.enableOneClick = enableOneClick; + isSetEnableOneClick = true; // mark as set } /** @@ -1271,6 +1496,7 @@ public void setEnableOneClick(Boolean enableOneClick) { */ public CreateCheckoutSessionRequest enablePayOut(Boolean enablePayOut) { this.enablePayOut = enablePayOut; + isSetEnablePayOut = true; // mark as set return this; } @@ -1298,6 +1524,7 @@ public Boolean getEnablePayOut() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnablePayOut(Boolean enablePayOut) { this.enablePayOut = enablePayOut; + isSetEnablePayOut = true; // mark as set } /** @@ -1314,6 +1541,7 @@ public void setEnablePayOut(Boolean enablePayOut) { */ public CreateCheckoutSessionRequest enableRecurring(Boolean enableRecurring) { this.enableRecurring = enableRecurring; + isSetEnableRecurring = true; // mark as set return this; } @@ -1349,6 +1577,7 @@ public Boolean getEnableRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnableRecurring(Boolean enableRecurring) { this.enableRecurring = enableRecurring; + isSetEnableRecurring = true; // mark as set } /** @@ -1365,6 +1594,7 @@ public void setEnableRecurring(Boolean enableRecurring) { */ public CreateCheckoutSessionRequest expiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -1400,6 +1630,7 @@ public OffsetDateTime getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -1410,6 +1641,7 @@ public void setExpiresAt(OffsetDateTime expiresAt) { */ public CreateCheckoutSessionRequest fundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set return this; } @@ -1433,6 +1665,7 @@ public FundOrigin getFundOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set } /** @@ -1443,6 +1676,7 @@ public void setFundOrigin(FundOrigin fundOrigin) { */ public CreateCheckoutSessionRequest fundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set return this; } @@ -1466,6 +1700,7 @@ public FundRecipient getFundRecipient() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set } /** @@ -1483,6 +1718,7 @@ public void setFundRecipient(FundRecipient fundRecipient) { public CreateCheckoutSessionRequest installmentOptions( Map installmentOptions) { this.installmentOptions = installmentOptions; + isSetInstallmentOptions = true; // mark as set return this; } @@ -1528,6 +1764,7 @@ public Map getInstallmentOptions() { public void setInstallmentOptions( Map installmentOptions) { this.installmentOptions = installmentOptions; + isSetInstallmentOptions = true; // mark as set } /** @@ -1542,6 +1779,7 @@ public void setInstallmentOptions( */ public CreateCheckoutSessionRequest lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -1581,6 +1819,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -1591,6 +1830,7 @@ public void setLineItems(List lineItems) { */ public CreateCheckoutSessionRequest mandate(Mandate mandate) { this.mandate = mandate; + isSetMandate = true; // mark as set return this; } @@ -1614,6 +1854,7 @@ public Mandate getMandate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMandate(Mandate mandate) { this.mandate = mandate; + isSetMandate = true; // mark as set } /** @@ -1628,6 +1869,7 @@ public void setMandate(Mandate mandate) { */ public CreateCheckoutSessionRequest mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -1659,6 +1901,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -1670,6 +1913,7 @@ public void setMcc(String mcc) { */ public CreateCheckoutSessionRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -1695,6 +1939,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -1719,6 +1964,7 @@ public void setMerchantAccount(String merchantAccount) { */ public CreateCheckoutSessionRequest merchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set return this; } @@ -1771,6 +2017,7 @@ public String getMerchantOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set } /** @@ -1785,6 +2032,7 @@ public void setMerchantOrderReference(String merchantOrderReference) { */ public CreateCheckoutSessionRequest metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -1824,6 +2072,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -1836,6 +2085,7 @@ public void setMetadata(Map metadata) { */ public CreateCheckoutSessionRequest mode(ModeEnum mode) { this.mode = mode; + isSetMode = true; // mark as set return this; } @@ -1863,6 +2113,7 @@ public ModeEnum getMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMode(ModeEnum mode) { this.mode = mode; + isSetMode = true; // mark as set } /** @@ -1873,6 +2124,7 @@ public void setMode(ModeEnum mode) { */ public CreateCheckoutSessionRequest mpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set return this; } @@ -1896,6 +2148,7 @@ public ThreeDSecureData getMpiData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set } /** @@ -1907,6 +2160,7 @@ public void setMpiData(ThreeDSecureData mpiData) { public CreateCheckoutSessionRequest platformChargebackLogic( PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -1930,6 +2184,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -1941,6 +2196,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public CreateCheckoutSessionRequest recurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set return this; } @@ -1966,6 +2222,7 @@ public String getRecurringExpiry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set } /** @@ -1976,6 +2233,7 @@ public void setRecurringExpiry(String recurringExpiry) { */ public CreateCheckoutSessionRequest recurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set return this; } @@ -1999,6 +2257,7 @@ public String getRecurringFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set } /** @@ -2026,6 +2285,7 @@ public void setRecurringFrequency(String recurringFrequency) { public CreateCheckoutSessionRequest recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -2081,6 +2341,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -2092,6 +2353,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public CreateCheckoutSessionRequest redirectFromIssuerMethod(String redirectFromIssuerMethod) { this.redirectFromIssuerMethod = redirectFromIssuerMethod; + isSetRedirectFromIssuerMethod = true; // mark as set return this; } @@ -2117,6 +2379,7 @@ public String getRedirectFromIssuerMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectFromIssuerMethod(String redirectFromIssuerMethod) { this.redirectFromIssuerMethod = redirectFromIssuerMethod; + isSetRedirectFromIssuerMethod = true; // mark as set } /** @@ -2128,6 +2391,7 @@ public void setRedirectFromIssuerMethod(String redirectFromIssuerMethod) { */ public CreateCheckoutSessionRequest redirectToIssuerMethod(String redirectToIssuerMethod) { this.redirectToIssuerMethod = redirectToIssuerMethod; + isSetRedirectToIssuerMethod = true; // mark as set return this; } @@ -2153,6 +2417,7 @@ public String getRedirectToIssuerMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectToIssuerMethod(String redirectToIssuerMethod) { this.redirectToIssuerMethod = redirectToIssuerMethod; + isSetRedirectToIssuerMethod = true; // mark as set } /** @@ -2163,6 +2428,7 @@ public void setRedirectToIssuerMethod(String redirectToIssuerMethod) { */ public CreateCheckoutSessionRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -2186,6 +2452,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -2223,6 +2490,7 @@ public void setReference(String reference) { */ public CreateCheckoutSessionRequest returnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set return this; } @@ -2300,6 +2568,7 @@ public String getReturnUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set } /** @@ -2310,6 +2579,7 @@ public void setReturnUrl(String returnUrl) { */ public CreateCheckoutSessionRequest riskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set return this; } @@ -2333,6 +2603,7 @@ public RiskData getRiskData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set } /** @@ -2343,6 +2614,7 @@ public void setRiskData(RiskData riskData) { */ public CreateCheckoutSessionRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -2366,6 +2638,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -2389,6 +2662,7 @@ public void setShopperEmail(String shopperEmail) { */ public CreateCheckoutSessionRequest shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -2438,6 +2712,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -2470,6 +2745,7 @@ public void setShopperIP(String shopperIP) { public CreateCheckoutSessionRequest shopperInteraction( ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -2535,6 +2811,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -2547,6 +2824,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public CreateCheckoutSessionRequest shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -2574,6 +2852,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -2584,6 +2863,7 @@ public void setShopperLocale(String shopperLocale) { */ public CreateCheckoutSessionRequest shopperName(ShopperName shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -2607,6 +2887,7 @@ public ShopperName getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(ShopperName shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -2622,6 +2903,7 @@ public void setShopperName(ShopperName shopperName) { */ public CreateCheckoutSessionRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -2655,6 +2937,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -2670,6 +2953,7 @@ public void setShopperReference(String shopperReference) { */ public CreateCheckoutSessionRequest shopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set return this; } @@ -2703,6 +2987,7 @@ public String getShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set } /** @@ -2713,6 +2998,7 @@ public void setShopperStatement(String shopperStatement) { */ public CreateCheckoutSessionRequest showInstallmentAmount(Boolean showInstallmentAmount) { this.showInstallmentAmount = showInstallmentAmount; + isSetShowInstallmentAmount = true; // mark as set return this; } @@ -2736,6 +3022,7 @@ public Boolean getShowInstallmentAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShowInstallmentAmount(Boolean showInstallmentAmount) { this.showInstallmentAmount = showInstallmentAmount; + isSetShowInstallmentAmount = true; // mark as set } /** @@ -2748,6 +3035,7 @@ public void setShowInstallmentAmount(Boolean showInstallmentAmount) { public CreateCheckoutSessionRequest showRemovePaymentMethodButton( Boolean showRemovePaymentMethodButton) { this.showRemovePaymentMethodButton = showRemovePaymentMethodButton; + isSetShowRemovePaymentMethodButton = true; // mark as set return this; } @@ -2773,6 +3061,7 @@ public Boolean getShowRemovePaymentMethodButton() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShowRemovePaymentMethodButton(Boolean showRemovePaymentMethodButton) { this.showRemovePaymentMethodButton = showRemovePaymentMethodButton; + isSetShowRemovePaymentMethodButton = true; // mark as set } /** @@ -2783,6 +3072,7 @@ public void setShowRemovePaymentMethodButton(Boolean showRemovePaymentMethodButt */ public CreateCheckoutSessionRequest socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -2806,6 +3096,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -2818,6 +3109,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public CreateCheckoutSessionRequest splitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set return this; } @@ -2845,6 +3137,7 @@ public Boolean getSplitCardFundingSources() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set } /** @@ -2863,6 +3156,7 @@ public void setSplitCardFundingSources(Boolean splitCardFundingSources) { */ public CreateCheckoutSessionRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -2910,6 +3204,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -2933,6 +3228,7 @@ public void setSplits(List splits) { */ public CreateCheckoutSessionRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -2982,6 +3278,7 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set } /** @@ -2999,6 +3296,7 @@ public void setStore(String store) { public CreateCheckoutSessionRequest storeFiltrationMode( StoreFiltrationModeEnum storeFiltrationMode) { this.storeFiltrationMode = storeFiltrationMode; + isSetStoreFiltrationMode = true; // mark as set return this; } @@ -3034,6 +3332,7 @@ public StoreFiltrationModeEnum getStoreFiltrationMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoreFiltrationMode(StoreFiltrationModeEnum storeFiltrationMode) { this.storeFiltrationMode = storeFiltrationMode; + isSetStoreFiltrationMode = true; // mark as set } /** @@ -3048,6 +3347,7 @@ public void setStoreFiltrationMode(StoreFiltrationModeEnum storeFiltrationMode) */ public CreateCheckoutSessionRequest storePaymentMethod(Boolean storePaymentMethod) { this.storePaymentMethod = storePaymentMethod; + isSetStorePaymentMethod = true; // mark as set return this; } @@ -3079,6 +3379,7 @@ public Boolean getStorePaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStorePaymentMethod(Boolean storePaymentMethod) { this.storePaymentMethod = storePaymentMethod; + isSetStorePaymentMethod = true; // mark as set } /** @@ -3099,6 +3400,7 @@ public void setStorePaymentMethod(Boolean storePaymentMethod) { public CreateCheckoutSessionRequest storePaymentMethodMode( StorePaymentMethodModeEnum storePaymentMethodMode) { this.storePaymentMethodMode = storePaymentMethodMode; + isSetStorePaymentMethodMode = true; // mark as set return this; } @@ -3140,6 +3442,7 @@ public StorePaymentMethodModeEnum getStorePaymentMethodMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStorePaymentMethodMode(StorePaymentMethodModeEnum storePaymentMethodMode) { this.storePaymentMethodMode = storePaymentMethodMode; + isSetStorePaymentMethodMode = true; // mark as set } /** @@ -3158,6 +3461,7 @@ public void setStorePaymentMethodMode(StorePaymentMethodModeEnum storePaymentMet */ public CreateCheckoutSessionRequest telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -3197,6 +3501,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -3211,6 +3516,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public CreateCheckoutSessionRequest themeId(String themeId) { this.themeId = themeId; + isSetThemeId = true; // mark as set return this; } @@ -3242,6 +3548,7 @@ public String getThemeId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThemeId(String themeId) { this.themeId = themeId; + isSetThemeId = true; // mark as set } /** @@ -3253,6 +3560,7 @@ public void setThemeId(String themeId) { public CreateCheckoutSessionRequest threeDS2RequestData( CheckoutSessionThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set return this; } @@ -3276,6 +3584,7 @@ public CheckoutSessionThreeDS2RequestData getThreeDS2RequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2RequestData(CheckoutSessionThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set } /** @@ -3296,6 +3605,7 @@ public void setThreeDS2RequestData(CheckoutSessionThreeDS2RequestData threeDS2Re // `authenticationData.authenticationOnly` instead. public CreateCheckoutSessionRequest threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set return this; } @@ -3339,6 +3649,7 @@ public Boolean getThreeDSAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set } /** @@ -3349,6 +3660,7 @@ public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { */ public CreateCheckoutSessionRequest trustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set return this; } @@ -3372,6 +3684,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 CreateCheckoutSessionRequest 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 CreateCheckoutSessionRequest object is equal to o. */ @@ -3638,6 +3971,213 @@ 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 (isSetAllowedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_PAYMENT_METHODS, this.allowedPaymentMethods); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetAuthenticationData) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_DATA, this.authenticationData); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetBlockedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_BLOCKED_PAYMENT_METHODS, this.blockedPaymentMethods); + } + if (isSetCaptureDelayHours) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_DELAY_HOURS, this.captureDelayHours); + } + if (isSetChannel) { + addIfNull(nulls, JSON_PROPERTY_CHANNEL, this.channel); + } + if (isSetCompany) { + addIfNull(nulls, JSON_PROPERTY_COMPANY, this.company); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetDeliverAt) { + addIfNull(nulls, JSON_PROPERTY_DELIVER_AT, this.deliverAt); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetEnableOneClick) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_ONE_CLICK, this.enableOneClick); + } + if (isSetEnablePayOut) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_PAY_OUT, this.enablePayOut); + } + if (isSetEnableRecurring) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_RECURRING, this.enableRecurring); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetFundOrigin) { + addIfNull(nulls, JSON_PROPERTY_FUND_ORIGIN, this.fundOrigin); + } + if (isSetFundRecipient) { + addIfNull(nulls, JSON_PROPERTY_FUND_RECIPIENT, this.fundRecipient); + } + if (isSetInstallmentOptions) { + addIfNull(nulls, JSON_PROPERTY_INSTALLMENT_OPTIONS, this.installmentOptions); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + 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 (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMode) { + addIfNull(nulls, JSON_PROPERTY_MODE, this.mode); + } + if (isSetMpiData) { + addIfNull(nulls, JSON_PROPERTY_MPI_DATA, this.mpiData); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetRecurringExpiry) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_EXPIRY, this.recurringExpiry); + } + if (isSetRecurringFrequency) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_FREQUENCY, this.recurringFrequency); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetRedirectFromIssuerMethod) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_FROM_ISSUER_METHOD, this.redirectFromIssuerMethod); + } + if (isSetRedirectToIssuerMethod) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_TO_ISSUER_METHOD, this.redirectToIssuerMethod); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReturnUrl) { + addIfNull(nulls, JSON_PROPERTY_RETURN_URL, this.returnUrl); + } + if (isSetRiskData) { + addIfNull(nulls, JSON_PROPERTY_RISK_DATA, this.riskData); + } + 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 (isSetShowInstallmentAmount) { + addIfNull(nulls, JSON_PROPERTY_SHOW_INSTALLMENT_AMOUNT, this.showInstallmentAmount); + } + if (isSetShowRemovePaymentMethodButton) { + addIfNull( + nulls, + JSON_PROPERTY_SHOW_REMOVE_PAYMENT_METHOD_BUTTON, + this.showRemovePaymentMethodButton); + } + if (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + if (isSetSplitCardFundingSources) { + addIfNull(nulls, JSON_PROPERTY_SPLIT_CARD_FUNDING_SOURCES, this.splitCardFundingSources); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + if (isSetStoreFiltrationMode) { + addIfNull(nulls, JSON_PROPERTY_STORE_FILTRATION_MODE, this.storeFiltrationMode); + } + if (isSetStorePaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_STORE_PAYMENT_METHOD, this.storePaymentMethod); + } + if (isSetStorePaymentMethodMode) { + addIfNull(nulls, JSON_PROPERTY_STORE_PAYMENT_METHOD_MODE, this.storePaymentMethodMode); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetThemeId) { + addIfNull(nulls, JSON_PROPERTY_THEME_ID, this.themeId); + } + 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 (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 CreateCheckoutSessionRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java index 7ac817353..357c747bd 100644 --- a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java +++ b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -97,33 +99,63 @@ public class CreateCheckoutSessionResponse { 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_ALLOWED_PAYMENT_METHODS = "allowedPaymentMethods"; private List allowedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedPaymentMethods = 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_AUTHENTICATION_DATA = "authenticationData"; private AuthenticationData authenticationData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationData = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private BillingAddress billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_BLOCKED_PAYMENT_METHODS = "blockedPaymentMethods"; private List blockedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBlockedPaymentMethods = 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; + /** * The platform where a payment transaction takes place. This field is optional for filtering out * payment methods that are only available on specific platforms. If this value is not set, then @@ -175,63 +207,123 @@ public static ChannelEnum fromValue(String value) { public static final String JSON_PROPERTY_CHANNEL = "channel"; private ChannelEnum channel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChannel = false; + public static final String JSON_PROPERTY_COMPANY = "company"; private Company company; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCompany = 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_DATE_OF_BIRTH = "dateOfBirth"; private OffsetDateTime dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + public static final String JSON_PROPERTY_DELIVER_AT = "deliverAt"; private OffsetDateTime deliverAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliverAt = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private DeliveryAddress deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_ENABLE_ONE_CLICK = "enableOneClick"; private Boolean enableOneClick; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnableOneClick = false; + public static final String JSON_PROPERTY_ENABLE_PAY_OUT = "enablePayOut"; private Boolean enablePayOut; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnablePayOut = false; + public static final String JSON_PROPERTY_ENABLE_RECURRING = "enableRecurring"; private Boolean enableRecurring; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnableRecurring = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private OffsetDateTime expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + public static final String JSON_PROPERTY_FUND_ORIGIN = "fundOrigin"; private FundOrigin fundOrigin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundOrigin = false; + public static final String JSON_PROPERTY_FUND_RECIPIENT = "fundRecipient"; private FundRecipient fundRecipient; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundRecipient = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_INSTALLMENT_OPTIONS = "installmentOptions"; private Map installmentOptions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentOptions = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = 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_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + /** * Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in * or Components integration * **hosted**: Hosted Checkout integration @@ -279,18 +371,33 @@ public static ModeEnum fromValue(String value) { public static final String JSON_PROPERTY_MODE = "mode"; private ModeEnum mode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMode = 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_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_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; + /** * Defines a recurring payment type. Required when creating a token to store payment details. * Allowed values: * `Subscription` – A transaction for a fixed or variable amount, @@ -348,30 +455,57 @@ 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_REDIRECT_FROM_ISSUER_METHOD = "redirectFromIssuerMethod"; private String redirectFromIssuerMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectFromIssuerMethod = false; + public static final String JSON_PROPERTY_REDIRECT_TO_ISSUER_METHOD = "redirectToIssuerMethod"; private String redirectToIssuerMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectToIssuerMethod = 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_RETURN_URL = "returnUrl"; private String returnUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReturnUrl = false; + public static final String JSON_PROPERTY_RISK_DATA = "riskData"; private RiskData riskData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskData = false; + public static final String JSON_PROPERTY_SESSION_DATA = "sessionData"; private String sessionData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSessionData = 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 @@ -432,37 +566,70 @@ 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 ShopperName 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_SHOW_INSTALLMENT_AMOUNT = "showInstallmentAmount"; private Boolean showInstallmentAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShowInstallmentAmount = false; + public static final String JSON_PROPERTY_SHOW_REMOVE_PAYMENT_METHOD_BUTTON = "showRemovePaymentMethodButton"; private Boolean showRemovePaymentMethodButton; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShowRemovePaymentMethodButton = 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_SPLIT_CARD_FUNDING_SOURCES = "splitCardFundingSources"; private Boolean splitCardFundingSources; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplitCardFundingSources = 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; + /** * Specifies how payment methods should be filtered based on the 'store' parameter: - * 'exclusive': Only payment methods belonging to the specified 'store' are @@ -514,9 +681,15 @@ public static StoreFiltrationModeEnum fromValue(String value) { public static final String JSON_PROPERTY_STORE_FILTRATION_MODE = "storeFiltrationMode"; private StoreFiltrationModeEnum storeFiltrationMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoreFiltrationMode = false; + public static final String JSON_PROPERTY_STORE_PAYMENT_METHOD = "storePaymentMethod"; private Boolean storePaymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStorePaymentMethod = false; + /** * Indicates if the details of the payment method will be stored for the shopper. Possible values: * * **disabled** – No details will be stored (default). * **askForConsent** – If the @@ -569,27 +742,54 @@ public static StorePaymentMethodModeEnum fromValue(String value) { public static final String JSON_PROPERTY_STORE_PAYMENT_METHOD_MODE = "storePaymentMethodMode"; private StorePaymentMethodModeEnum storePaymentMethodMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStorePaymentMethodMode = 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_THEME_ID = "themeId"; private String themeId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThemeId = false; + public static final String JSON_PROPERTY_THREE_D_S2_REQUEST_DATA = "threeDS2RequestData"; private CheckoutSessionThreeDS2RequestData 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"; @Deprecated // deprecated since Adyen Checkout API v69: Use // `authenticationData.authenticationOnly` instead. private Boolean threeDSAuthenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSAuthenticationOnly = 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; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CreateCheckoutSessionResponse() {} @JsonCreator @@ -607,6 +807,7 @@ public CreateCheckoutSessionResponse(@JsonProperty(JSON_PROPERTY_ID) String id) */ public CreateCheckoutSessionResponse accountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set return this; } @@ -630,6 +831,7 @@ public AccountInfo getAccountInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set } /** @@ -641,6 +843,7 @@ public void setAccountInfo(AccountInfo accountInfo) { */ public CreateCheckoutSessionResponse additionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set return this; } @@ -664,6 +867,7 @@ public Amount getAdditionalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set } /** @@ -679,6 +883,7 @@ public void setAdditionalAmount(Amount additionalAmount) { */ public CreateCheckoutSessionResponse additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -719,6 +924,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -735,6 +941,7 @@ public void setAdditionalData(Map additionalData) { */ public CreateCheckoutSessionResponse allowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set return this; } @@ -777,6 +984,7 @@ public List getAllowedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set } /** @@ -788,6 +996,7 @@ public void setAllowedPaymentMethods(List allowedPaymentMethods) { */ public CreateCheckoutSessionResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -811,6 +1020,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -822,6 +1032,7 @@ public void setAmount(Amount amount) { */ public CreateCheckoutSessionResponse applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -845,6 +1056,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -856,6 +1068,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public CreateCheckoutSessionResponse authenticationData(AuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set return this; } @@ -879,6 +1092,7 @@ public AuthenticationData getAuthenticationData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationData(AuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set } /** @@ -890,6 +1104,7 @@ public void setAuthenticationData(AuthenticationData authenticationData) { */ public CreateCheckoutSessionResponse billingAddress(BillingAddress billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -913,6 +1128,7 @@ public BillingAddress getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(BillingAddress billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -929,6 +1145,7 @@ public void setBillingAddress(BillingAddress billingAddress) { */ public CreateCheckoutSessionResponse blockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set return this; } @@ -971,6 +1188,7 @@ public List getBlockedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBlockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set } /** @@ -983,6 +1201,7 @@ public void setBlockedPaymentMethods(List blockedPaymentMethods) { */ public CreateCheckoutSessionResponse captureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set return this; } @@ -1008,6 +1227,7 @@ public Integer getCaptureDelayHours() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set } /** @@ -1025,6 +1245,7 @@ public void setCaptureDelayHours(Integer captureDelayHours) { */ public CreateCheckoutSessionResponse channel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set return this; } @@ -1060,6 +1281,7 @@ public ChannelEnum getChannel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChannel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set } /** @@ -1071,6 +1293,7 @@ public void setChannel(ChannelEnum channel) { */ public CreateCheckoutSessionResponse company(Company company) { this.company = company; + isSetCompany = true; // mark as set return this; } @@ -1094,6 +1317,7 @@ public Company getCompany() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCompany(Company company) { this.company = company; + isSetCompany = true; // mark as set } /** @@ -1105,6 +1329,7 @@ public void setCompany(Company company) { */ public CreateCheckoutSessionResponse countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -1128,6 +1353,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -1141,6 +1367,7 @@ public void setCountryCode(String countryCode) { */ public CreateCheckoutSessionResponse dateOfBirth(OffsetDateTime dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -1168,6 +1395,7 @@ public OffsetDateTime getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(OffsetDateTime dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -1183,6 +1411,7 @@ public void setDateOfBirth(OffsetDateTime dateOfBirth) { */ public CreateCheckoutSessionResponse deliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set return this; } @@ -1214,6 +1443,7 @@ public OffsetDateTime getDeliverAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set } /** @@ -1225,6 +1455,7 @@ public void setDeliverAt(OffsetDateTime deliverAt) { */ public CreateCheckoutSessionResponse deliveryAddress(DeliveryAddress deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -1248,6 +1479,7 @@ public DeliveryAddress getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(DeliveryAddress deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -1263,6 +1495,7 @@ public void setDeliveryAddress(DeliveryAddress deliveryAddress) { */ public CreateCheckoutSessionResponse enableOneClick(Boolean enableOneClick) { this.enableOneClick = enableOneClick; + isSetEnableOneClick = true; // mark as set return this; } @@ -1294,6 +1527,7 @@ public Boolean getEnableOneClick() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnableOneClick(Boolean enableOneClick) { this.enableOneClick = enableOneClick; + isSetEnableOneClick = true; // mark as set } /** @@ -1307,6 +1541,7 @@ public void setEnableOneClick(Boolean enableOneClick) { */ public CreateCheckoutSessionResponse enablePayOut(Boolean enablePayOut) { this.enablePayOut = enablePayOut; + isSetEnablePayOut = true; // mark as set return this; } @@ -1334,6 +1569,7 @@ public Boolean getEnablePayOut() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnablePayOut(Boolean enablePayOut) { this.enablePayOut = enablePayOut; + isSetEnablePayOut = true; // mark as set } /** @@ -1351,6 +1587,7 @@ public void setEnablePayOut(Boolean enablePayOut) { */ public CreateCheckoutSessionResponse enableRecurring(Boolean enableRecurring) { this.enableRecurring = enableRecurring; + isSetEnableRecurring = true; // mark as set return this; } @@ -1386,6 +1623,7 @@ public Boolean getEnableRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnableRecurring(Boolean enableRecurring) { this.enableRecurring = enableRecurring; + isSetEnableRecurring = true; // mark as set } /** @@ -1403,6 +1641,7 @@ public void setEnableRecurring(Boolean enableRecurring) { */ public CreateCheckoutSessionResponse expiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -1438,6 +1677,7 @@ public OffsetDateTime getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -1449,6 +1689,7 @@ public void setExpiresAt(OffsetDateTime expiresAt) { */ public CreateCheckoutSessionResponse fundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set return this; } @@ -1472,6 +1713,7 @@ public FundOrigin getFundOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set } /** @@ -1483,6 +1725,7 @@ public void setFundOrigin(FundOrigin fundOrigin) { */ public CreateCheckoutSessionResponse fundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set return this; } @@ -1506,6 +1749,7 @@ public FundRecipient getFundRecipient() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set } /** @@ -1535,6 +1779,7 @@ public String getId() { public CreateCheckoutSessionResponse installmentOptions( Map installmentOptions) { this.installmentOptions = installmentOptions; + isSetInstallmentOptions = true; // mark as set return this; } @@ -1580,6 +1825,7 @@ public Map getInstallmentOptions() { public void setInstallmentOptions( Map installmentOptions) { this.installmentOptions = installmentOptions; + isSetInstallmentOptions = true; // mark as set } /** @@ -1595,6 +1841,7 @@ public void setInstallmentOptions( */ public CreateCheckoutSessionResponse lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -1634,6 +1881,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -1645,6 +1893,7 @@ public void setLineItems(List lineItems) { */ public CreateCheckoutSessionResponse mandate(Mandate mandate) { this.mandate = mandate; + isSetMandate = true; // mark as set return this; } @@ -1668,6 +1917,7 @@ public Mandate getMandate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMandate(Mandate mandate) { this.mandate = mandate; + isSetMandate = true; // mark as set } /** @@ -1683,6 +1933,7 @@ public void setMandate(Mandate mandate) { */ public CreateCheckoutSessionResponse mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -1714,6 +1965,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -1726,6 +1978,7 @@ public void setMcc(String mcc) { */ public CreateCheckoutSessionResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -1751,6 +2004,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -1776,6 +2030,7 @@ public void setMerchantAccount(String merchantAccount) { */ public CreateCheckoutSessionResponse merchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set return this; } @@ -1828,6 +2083,7 @@ public String getMerchantOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set } /** @@ -1843,6 +2099,7 @@ public void setMerchantOrderReference(String merchantOrderReference) { */ public CreateCheckoutSessionResponse metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -1882,6 +2139,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -1895,6 +2153,7 @@ public void setMetadata(Map metadata) { */ public CreateCheckoutSessionResponse mode(ModeEnum mode) { this.mode = mode; + isSetMode = true; // mark as set return this; } @@ -1922,6 +2181,7 @@ public ModeEnum getMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMode(ModeEnum mode) { this.mode = mode; + isSetMode = true; // mark as set } /** @@ -1933,6 +2193,7 @@ public void setMode(ModeEnum mode) { */ public CreateCheckoutSessionResponse mpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set return this; } @@ -1956,6 +2217,7 @@ public ThreeDSecureData getMpiData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set } /** @@ -1968,6 +2230,7 @@ public void setMpiData(ThreeDSecureData mpiData) { public CreateCheckoutSessionResponse platformChargebackLogic( PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -1991,6 +2254,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -2003,6 +2267,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public CreateCheckoutSessionResponse recurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set return this; } @@ -2028,6 +2293,7 @@ public String getRecurringExpiry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set } /** @@ -2039,6 +2305,7 @@ public void setRecurringExpiry(String recurringExpiry) { */ public CreateCheckoutSessionResponse recurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set return this; } @@ -2062,6 +2329,7 @@ public String getRecurringFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set } /** @@ -2090,6 +2358,7 @@ public void setRecurringFrequency(String recurringFrequency) { public CreateCheckoutSessionResponse recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -2145,6 +2414,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -2157,6 +2427,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public CreateCheckoutSessionResponse redirectFromIssuerMethod(String redirectFromIssuerMethod) { this.redirectFromIssuerMethod = redirectFromIssuerMethod; + isSetRedirectFromIssuerMethod = true; // mark as set return this; } @@ -2182,6 +2453,7 @@ public String getRedirectFromIssuerMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectFromIssuerMethod(String redirectFromIssuerMethod) { this.redirectFromIssuerMethod = redirectFromIssuerMethod; + isSetRedirectFromIssuerMethod = true; // mark as set } /** @@ -2194,6 +2466,7 @@ public void setRedirectFromIssuerMethod(String redirectFromIssuerMethod) { */ public CreateCheckoutSessionResponse redirectToIssuerMethod(String redirectToIssuerMethod) { this.redirectToIssuerMethod = redirectToIssuerMethod; + isSetRedirectToIssuerMethod = true; // mark as set return this; } @@ -2219,6 +2492,7 @@ public String getRedirectToIssuerMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectToIssuerMethod(String redirectToIssuerMethod) { this.redirectToIssuerMethod = redirectToIssuerMethod; + isSetRedirectToIssuerMethod = true; // mark as set } /** @@ -2230,6 +2504,7 @@ public void setRedirectToIssuerMethod(String redirectToIssuerMethod) { */ public CreateCheckoutSessionResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -2253,6 +2528,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -2291,6 +2567,7 @@ public void setReference(String reference) { */ public CreateCheckoutSessionResponse returnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set return this; } @@ -2368,6 +2645,7 @@ public String getReturnUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set } /** @@ -2379,6 +2657,7 @@ public void setReturnUrl(String returnUrl) { */ public CreateCheckoutSessionResponse riskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set return this; } @@ -2402,6 +2681,7 @@ public RiskData getRiskData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set } /** @@ -2413,6 +2693,7 @@ public void setRiskData(RiskData riskData) { */ public CreateCheckoutSessionResponse sessionData(String sessionData) { this.sessionData = sessionData; + isSetSessionData = true; // mark as set return this; } @@ -2436,6 +2717,7 @@ public String getSessionData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSessionData(String sessionData) { this.sessionData = sessionData; + isSetSessionData = true; // mark as set } /** @@ -2447,6 +2729,7 @@ public void setSessionData(String sessionData) { */ public CreateCheckoutSessionResponse shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -2470,6 +2753,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -2494,6 +2778,7 @@ public void setShopperEmail(String shopperEmail) { */ public CreateCheckoutSessionResponse shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -2543,6 +2828,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -2576,6 +2862,7 @@ public void setShopperIP(String shopperIP) { public CreateCheckoutSessionResponse shopperInteraction( ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -2641,6 +2928,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -2654,6 +2942,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public CreateCheckoutSessionResponse shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -2681,6 +2970,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -2692,6 +2982,7 @@ public void setShopperLocale(String shopperLocale) { */ public CreateCheckoutSessionResponse shopperName(ShopperName shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -2715,6 +3006,7 @@ public ShopperName getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(ShopperName shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -2731,6 +3023,7 @@ public void setShopperName(ShopperName shopperName) { */ public CreateCheckoutSessionResponse shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -2764,6 +3057,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -2780,6 +3074,7 @@ public void setShopperReference(String shopperReference) { */ public CreateCheckoutSessionResponse shopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set return this; } @@ -2813,6 +3108,7 @@ public String getShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set } /** @@ -2824,6 +3120,7 @@ public void setShopperStatement(String shopperStatement) { */ public CreateCheckoutSessionResponse showInstallmentAmount(Boolean showInstallmentAmount) { this.showInstallmentAmount = showInstallmentAmount; + isSetShowInstallmentAmount = true; // mark as set return this; } @@ -2847,6 +3144,7 @@ public Boolean getShowInstallmentAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShowInstallmentAmount(Boolean showInstallmentAmount) { this.showInstallmentAmount = showInstallmentAmount; + isSetShowInstallmentAmount = true; // mark as set } /** @@ -2860,6 +3158,7 @@ public void setShowInstallmentAmount(Boolean showInstallmentAmount) { public CreateCheckoutSessionResponse showRemovePaymentMethodButton( Boolean showRemovePaymentMethodButton) { this.showRemovePaymentMethodButton = showRemovePaymentMethodButton; + isSetShowRemovePaymentMethodButton = true; // mark as set return this; } @@ -2885,6 +3184,7 @@ public Boolean getShowRemovePaymentMethodButton() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShowRemovePaymentMethodButton(Boolean showRemovePaymentMethodButton) { this.showRemovePaymentMethodButton = showRemovePaymentMethodButton; + isSetShowRemovePaymentMethodButton = true; // mark as set } /** @@ -2896,6 +3196,7 @@ public void setShowRemovePaymentMethodButton(Boolean showRemovePaymentMethodButt */ public CreateCheckoutSessionResponse socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -2919,6 +3220,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -2932,6 +3234,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public CreateCheckoutSessionResponse splitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set return this; } @@ -2959,6 +3262,7 @@ public Boolean getSplitCardFundingSources() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set } /** @@ -2978,6 +3282,7 @@ public void setSplitCardFundingSources(Boolean splitCardFundingSources) { */ public CreateCheckoutSessionResponse splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -3025,6 +3330,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -3049,6 +3355,7 @@ public void setSplits(List splits) { */ public CreateCheckoutSessionResponse store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -3098,6 +3405,7 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set } /** @@ -3116,6 +3424,7 @@ public void setStore(String store) { public CreateCheckoutSessionResponse storeFiltrationMode( StoreFiltrationModeEnum storeFiltrationMode) { this.storeFiltrationMode = storeFiltrationMode; + isSetStoreFiltrationMode = true; // mark as set return this; } @@ -3151,6 +3460,7 @@ public StoreFiltrationModeEnum getStoreFiltrationMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoreFiltrationMode(StoreFiltrationModeEnum storeFiltrationMode) { this.storeFiltrationMode = storeFiltrationMode; + isSetStoreFiltrationMode = true; // mark as set } /** @@ -3166,6 +3476,7 @@ public void setStoreFiltrationMode(StoreFiltrationModeEnum storeFiltrationMode) */ public CreateCheckoutSessionResponse storePaymentMethod(Boolean storePaymentMethod) { this.storePaymentMethod = storePaymentMethod; + isSetStorePaymentMethod = true; // mark as set return this; } @@ -3197,6 +3508,7 @@ public Boolean getStorePaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStorePaymentMethod(Boolean storePaymentMethod) { this.storePaymentMethod = storePaymentMethod; + isSetStorePaymentMethod = true; // mark as set } /** @@ -3218,6 +3530,7 @@ public void setStorePaymentMethod(Boolean storePaymentMethod) { public CreateCheckoutSessionResponse storePaymentMethodMode( StorePaymentMethodModeEnum storePaymentMethodMode) { this.storePaymentMethodMode = storePaymentMethodMode; + isSetStorePaymentMethodMode = true; // mark as set return this; } @@ -3259,6 +3572,7 @@ public StorePaymentMethodModeEnum getStorePaymentMethodMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStorePaymentMethodMode(StorePaymentMethodModeEnum storePaymentMethodMode) { this.storePaymentMethodMode = storePaymentMethodMode; + isSetStorePaymentMethodMode = true; // mark as set } /** @@ -3278,6 +3592,7 @@ public void setStorePaymentMethodMode(StorePaymentMethodModeEnum storePaymentMet */ public CreateCheckoutSessionResponse telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -3317,6 +3632,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -3332,6 +3648,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public CreateCheckoutSessionResponse themeId(String themeId) { this.themeId = themeId; + isSetThemeId = true; // mark as set return this; } @@ -3363,6 +3680,7 @@ public String getThemeId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThemeId(String themeId) { this.themeId = themeId; + isSetThemeId = true; // mark as set } /** @@ -3375,6 +3693,7 @@ public void setThemeId(String themeId) { public CreateCheckoutSessionResponse threeDS2RequestData( CheckoutSessionThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set return this; } @@ -3398,6 +3717,7 @@ public CheckoutSessionThreeDS2RequestData getThreeDS2RequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2RequestData(CheckoutSessionThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set } /** @@ -3420,6 +3740,7 @@ public void setThreeDS2RequestData(CheckoutSessionThreeDS2RequestData threeDS2Re public CreateCheckoutSessionResponse threeDSAuthenticationOnly( Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set return this; } @@ -3463,6 +3784,7 @@ public Boolean getThreeDSAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set } /** @@ -3474,6 +3796,7 @@ public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { */ public CreateCheckoutSessionResponse trustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set return this; } @@ -3497,6 +3820,7 @@ public Boolean getTrustedShopper() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set } /** @@ -3510,6 +3834,7 @@ public void setTrustedShopper(Boolean trustedShopper) { */ public CreateCheckoutSessionResponse url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -3537,6 +3862,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CreateCheckoutSessionResponse 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 CreateCheckoutSessionResponse object is equal to o. */ @@ -3812,6 +4158,222 @@ 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 (isSetAllowedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_PAYMENT_METHODS, this.allowedPaymentMethods); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetAuthenticationData) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_DATA, this.authenticationData); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetBlockedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_BLOCKED_PAYMENT_METHODS, this.blockedPaymentMethods); + } + if (isSetCaptureDelayHours) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_DELAY_HOURS, this.captureDelayHours); + } + if (isSetChannel) { + addIfNull(nulls, JSON_PROPERTY_CHANNEL, this.channel); + } + if (isSetCompany) { + addIfNull(nulls, JSON_PROPERTY_COMPANY, this.company); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetDeliverAt) { + addIfNull(nulls, JSON_PROPERTY_DELIVER_AT, this.deliverAt); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetEnableOneClick) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_ONE_CLICK, this.enableOneClick); + } + if (isSetEnablePayOut) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_PAY_OUT, this.enablePayOut); + } + if (isSetEnableRecurring) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_RECURRING, this.enableRecurring); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetFundOrigin) { + addIfNull(nulls, JSON_PROPERTY_FUND_ORIGIN, this.fundOrigin); + } + if (isSetFundRecipient) { + addIfNull(nulls, JSON_PROPERTY_FUND_RECIPIENT, this.fundRecipient); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetInstallmentOptions) { + addIfNull(nulls, JSON_PROPERTY_INSTALLMENT_OPTIONS, this.installmentOptions); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + 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 (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMode) { + addIfNull(nulls, JSON_PROPERTY_MODE, this.mode); + } + if (isSetMpiData) { + addIfNull(nulls, JSON_PROPERTY_MPI_DATA, this.mpiData); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetRecurringExpiry) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_EXPIRY, this.recurringExpiry); + } + if (isSetRecurringFrequency) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_FREQUENCY, this.recurringFrequency); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetRedirectFromIssuerMethod) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_FROM_ISSUER_METHOD, this.redirectFromIssuerMethod); + } + if (isSetRedirectToIssuerMethod) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_TO_ISSUER_METHOD, this.redirectToIssuerMethod); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReturnUrl) { + addIfNull(nulls, JSON_PROPERTY_RETURN_URL, this.returnUrl); + } + if (isSetRiskData) { + addIfNull(nulls, JSON_PROPERTY_RISK_DATA, this.riskData); + } + if (isSetSessionData) { + addIfNull(nulls, JSON_PROPERTY_SESSION_DATA, this.sessionData); + } + 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 (isSetShowInstallmentAmount) { + addIfNull(nulls, JSON_PROPERTY_SHOW_INSTALLMENT_AMOUNT, this.showInstallmentAmount); + } + if (isSetShowRemovePaymentMethodButton) { + addIfNull( + nulls, + JSON_PROPERTY_SHOW_REMOVE_PAYMENT_METHOD_BUTTON, + this.showRemovePaymentMethodButton); + } + if (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + if (isSetSplitCardFundingSources) { + addIfNull(nulls, JSON_PROPERTY_SPLIT_CARD_FUNDING_SOURCES, this.splitCardFundingSources); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + if (isSetStoreFiltrationMode) { + addIfNull(nulls, JSON_PROPERTY_STORE_FILTRATION_MODE, this.storeFiltrationMode); + } + if (isSetStorePaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_STORE_PAYMENT_METHOD, this.storePaymentMethod); + } + if (isSetStorePaymentMethodMode) { + addIfNull(nulls, JSON_PROPERTY_STORE_PAYMENT_METHOD_MODE, this.storePaymentMethodMode); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetThemeId) { + addIfNull(nulls, JSON_PROPERTY_THEME_ID, this.themeId); + } + 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 (isSetTrustedShopper) { + addIfNull(nulls, JSON_PROPERTY_TRUSTED_SHOPPER, this.trustedShopper); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + 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 CreateCheckoutSessionResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CreateOrderRequest.java b/src/main/java/com/adyen/model/checkout/CreateOrderRequest.java index 71280b5a6..3d676945b 100644 --- a/src/main/java/com/adyen/model/checkout/CreateOrderRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreateOrderRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 CreateOrderRequest { 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_EXPIRES_AT = "expiresAt"; private String expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = 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_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 CreateOrderRequest() {} /** @@ -47,6 +67,7 @@ public CreateOrderRequest() {} */ public CreateOrderRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -70,6 +91,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -84,6 +106,7 @@ public void setAmount(Amount amount) { */ public CreateOrderRequest expiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -115,6 +138,7 @@ public String getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -126,6 +150,7 @@ public void setExpiresAt(String expiresAt) { */ public CreateOrderRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -151,6 +176,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -161,6 +187,7 @@ public void setMerchantAccount(String merchantAccount) { */ public CreateOrderRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -184,6 +211,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 CreateOrderRequest 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 CreateOrderRequest object is equal to o. */ @@ -229,6 +277,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + 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 CreateOrderRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CreateOrderResponse.java b/src/main/java/com/adyen/model/checkout/CreateOrderResponse.java index b83dc21ea..51c2aa9d4 100644 --- a/src/main/java/com/adyen/model/checkout/CreateOrderResponse.java +++ b/src/main/java/com/adyen/model/checkout/CreateOrderResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -40,30 +42,57 @@ public class CreateOrderResponse { 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_EXPIRES_AT = "expiresAt"; private String expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = 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_ORDER_DATA = "orderData"; private String orderData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrderData = 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; + public static final String JSON_PROPERTY_REFUSAL_REASON = "refusalReason"; private String refusalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRefusalReason = false; + public static final String JSON_PROPERTY_REMAINING_AMOUNT = "remainingAmount"; private Amount remainingAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemainingAmount = false; + /** The result of the order creation request. The value is always **Success**. */ public enum ResultCodeEnum { SUCCESS(String.valueOf("Success")); @@ -106,6 +135,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 CreateOrderResponse() {} /** @@ -119,6 +157,7 @@ public CreateOrderResponse() {} */ public CreateOrderResponse additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -156,6 +195,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -166,6 +206,7 @@ public void setAdditionalData(Map additionalData) { */ public CreateOrderResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -189,6 +230,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -199,6 +241,7 @@ public void setAmount(Amount amount) { */ public CreateOrderResponse expiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -222,6 +265,7 @@ public String getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -232,6 +276,7 @@ public void setExpiresAt(String expiresAt) { */ public CreateOrderResponse fraudResult(FraudResult fraudResult) { this.fraudResult = fraudResult; + isSetFraudResult = true; // mark as set return this; } @@ -255,6 +300,7 @@ public FraudResult getFraudResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudResult(FraudResult fraudResult) { this.fraudResult = fraudResult; + isSetFraudResult = true; // mark as set } /** @@ -266,6 +312,7 @@ public void setFraudResult(FraudResult fraudResult) { */ public CreateOrderResponse orderData(String orderData) { this.orderData = orderData; + isSetOrderData = true; // mark as set return this; } @@ -291,6 +338,7 @@ public String getOrderData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrderData(String orderData) { this.orderData = orderData; + isSetOrderData = true; // mark as set } /** @@ -303,6 +351,7 @@ public void setOrderData(String orderData) { */ public CreateOrderResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -331,6 +380,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -341,6 +391,7 @@ public void setPspReference(String pspReference) { */ public CreateOrderResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -364,6 +415,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -382,6 +434,7 @@ public void setReference(String reference) { */ public CreateOrderResponse refusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set return this; } @@ -421,6 +474,7 @@ public String getRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set } /** @@ -431,6 +485,7 @@ public void setRefusalReason(String refusalReason) { */ public CreateOrderResponse remainingAmount(Amount remainingAmount) { this.remainingAmount = remainingAmount; + isSetRemainingAmount = true; // mark as set return this; } @@ -454,6 +509,7 @@ public Amount getRemainingAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemainingAmount(Amount remainingAmount) { this.remainingAmount = remainingAmount; + isSetRemainingAmount = true; // mark as set } /** @@ -464,6 +520,7 @@ public void setRemainingAmount(Amount remainingAmount) { */ public CreateOrderResponse resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -487,6 +544,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 CreateOrderResponse 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 CreateOrderResponse object is equal to o. */ @@ -554,6 +632,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetFraudResult) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_RESULT, this.fraudResult); + } + if (isSetOrderData) { + addIfNull(nulls, JSON_PROPERTY_ORDER_DATA, this.orderData); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetRefusalReason) { + addIfNull(nulls, JSON_PROPERTY_REFUSAL_REASON, this.refusalReason); + } + if (isSetRemainingAmount) { + addIfNull(nulls, JSON_PROPERTY_REMAINING_AMOUNT, this.remainingAmount); + } + 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 CreateOrderResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DefaultErrorResponseEntity.java b/src/main/java/com/adyen/model/checkout/DefaultErrorResponseEntity.java index ff692da56..8eb6a4fd1 100644 --- a/src/main/java/com/adyen/model/checkout/DefaultErrorResponseEntity.java +++ b/src/main/java/com/adyen/model/checkout/DefaultErrorResponseEntity.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,27 +36,57 @@ public class DefaultErrorResponseEntity { public static final String JSON_PROPERTY_DETAIL = "detail"; private String detail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetail = 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_INSTANCE = "instance"; private String instance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstance = false; + public static final String JSON_PROPERTY_INVALID_FIELDS = "invalidFields"; private List invalidFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInvalidFields = false; + public static final String JSON_PROPERTY_REQUEST_ID = "requestId"; private String requestId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestId = false; + public static final String JSON_PROPERTY_STATUS = "status"; private Integer status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TITLE = "title"; private String title; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTitle = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 DefaultErrorResponseEntity() {} /** @@ -65,6 +97,7 @@ public DefaultErrorResponseEntity() {} */ public DefaultErrorResponseEntity detail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set return this; } @@ -88,6 +121,7 @@ public String getDetail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set } /** @@ -98,6 +132,7 @@ public void setDetail(String detail) { */ public DefaultErrorResponseEntity errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -121,6 +156,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -131,6 +167,7 @@ public void setErrorCode(String errorCode) { */ public DefaultErrorResponseEntity instance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set return this; } @@ -154,6 +191,7 @@ public String getInstance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set } /** @@ -164,6 +202,7 @@ public void setInstance(String instance) { */ public DefaultErrorResponseEntity invalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set return this; } @@ -195,6 +234,7 @@ public List getInvalidFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInvalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set } /** @@ -205,6 +245,7 @@ public void setInvalidFields(List invalidFields) { */ public DefaultErrorResponseEntity requestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set return this; } @@ -228,6 +269,7 @@ public String getRequestId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set } /** @@ -238,6 +280,7 @@ public void setRequestId(String requestId) { */ public DefaultErrorResponseEntity status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -261,6 +304,7 @@ public Integer getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(Integer status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -271,6 +315,7 @@ public void setStatus(Integer status) { */ public DefaultErrorResponseEntity title(String title) { this.title = title; + isSetTitle = true; // mark as set return this; } @@ -294,6 +339,7 @@ public String getTitle() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTitle(String title) { this.title = title; + isSetTitle = true; // mark as set } /** @@ -306,6 +352,7 @@ public void setTitle(String title) { */ public DefaultErrorResponseEntity type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -333,6 +380,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DefaultErrorResponseEntity 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 DefaultErrorResponseEntity object is equal to o. */ @@ -386,6 +454,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 (isSetDetail) { + addIfNull(nulls, JSON_PROPERTY_DETAIL, this.detail); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetInstance) { + addIfNull(nulls, JSON_PROPERTY_INSTANCE, this.instance); + } + if (isSetInvalidFields) { + addIfNull(nulls, JSON_PROPERTY_INVALID_FIELDS, this.invalidFields); + } + if (isSetRequestId) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_ID, this.requestId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTitle) { + addIfNull(nulls, JSON_PROPERTY_TITLE, this.title); + } + 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 DefaultErrorResponseEntity given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DeliveryAddress.java b/src/main/java/com/adyen/model/checkout/DeliveryAddress.java index 8be597897..4e0de50f8 100644 --- a/src/main/java/com/adyen/model/checkout/DeliveryAddress.java +++ b/src/main/java/com/adyen/model/checkout/DeliveryAddress.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 DeliveryAddress { 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_FIRST_NAME = "firstName"; private String firstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirstName = 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_LAST_NAME = "lastName"; private String lastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastName = 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 DeliveryAddress() {} /** @@ -63,6 +95,7 @@ public DeliveryAddress() {} */ public DeliveryAddress city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -86,6 +119,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -100,6 +134,7 @@ public void setCity(String city) { */ public DeliveryAddress country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -131,6 +166,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -141,6 +177,7 @@ public void setCountry(String country) { */ public DeliveryAddress firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -164,6 +201,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -174,6 +212,7 @@ public void setFirstName(String firstName) { */ public DeliveryAddress houseNumberOrName(String houseNumberOrName) { this.houseNumberOrName = houseNumberOrName; + isSetHouseNumberOrName = true; // mark as set return this; } @@ -197,6 +236,7 @@ public String getHouseNumberOrName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHouseNumberOrName(String houseNumberOrName) { this.houseNumberOrName = houseNumberOrName; + isSetHouseNumberOrName = true; // mark as set } /** @@ -207,6 +247,7 @@ public void setHouseNumberOrName(String houseNumberOrName) { */ public DeliveryAddress lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -230,6 +271,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -242,6 +284,7 @@ public void setLastName(String lastName) { */ public DeliveryAddress postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -269,6 +312,7 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set } /** @@ -281,6 +325,7 @@ public void setPostalCode(String postalCode) { */ public DeliveryAddress stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set return this; } @@ -308,6 +353,7 @@ public String getStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set } /** @@ -321,6 +367,7 @@ public void setStateOrProvince(String stateOrProvince) { */ public DeliveryAddress street(String street) { this.street = street; + isSetStreet = true; // mark as set return this; } @@ -350,6 +397,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 DeliveryAddress 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 DeliveryAddress object is equal to o. */ @@ -404,6 +472,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 (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetHouseNumberOrName) { + addIfNull(nulls, JSON_PROPERTY_HOUSE_NUMBER_OR_NAME, this.houseNumberOrName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + 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 DeliveryAddress given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DeliveryMethod.java b/src/main/java/com/adyen/model/checkout/DeliveryMethod.java index a07d214ab..2ed935eef 100644 --- a/src/main/java/com/adyen/model/checkout/DeliveryMethod.java +++ b/src/main/java/com/adyen/model/checkout/DeliveryMethod.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 DeliveryMethod { 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_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SELECTED = "selected"; private Boolean selected; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSelected = false; + /** The type of the delivery method. */ public enum TypeEnum { SHIPPING(String.valueOf("Shipping")); @@ -84,6 +98,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 DeliveryMethod() {} /** @@ -94,6 +117,7 @@ public DeliveryMethod() {} */ public DeliveryMethod amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -117,6 +141,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -127,6 +152,7 @@ public void setAmount(Amount amount) { */ public DeliveryMethod description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -150,6 +176,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -160,6 +187,7 @@ public void setDescription(String description) { */ public DeliveryMethod reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -183,6 +211,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -195,6 +224,7 @@ public void setReference(String reference) { */ public DeliveryMethod selected(Boolean selected) { this.selected = selected; + isSetSelected = true; // mark as set return this; } @@ -222,6 +252,7 @@ public Boolean getSelected() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelected(Boolean selected) { this.selected = selected; + isSetSelected = true; // mark as set } /** @@ -232,6 +263,7 @@ public void setSelected(Boolean selected) { */ public DeliveryMethod type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -255,6 +287,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 DeliveryMethod 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 DeliveryMethod object is equal to o. */ @@ -302,6 +355,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 (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 (isSetSelected) { + addIfNull(nulls, JSON_PROPERTY_SELECTED, this.selected); + } + 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 DeliveryMethod given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DetailsRequestAuthenticationData.java b/src/main/java/com/adyen/model/checkout/DetailsRequestAuthenticationData.java index e584b917e..36b5644ae 100644 --- a/src/main/java/com/adyen/model/checkout/DetailsRequestAuthenticationData.java +++ b/src/main/java/com/adyen/model/checkout/DetailsRequestAuthenticationData.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 DetailsRequestAuthenticationData { public static final String JSON_PROPERTY_AUTHENTICATION_ONLY = "authenticationOnly"; private Boolean authenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationOnly = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DetailsRequestAuthenticationData() {} /** @@ -40,6 +51,7 @@ public DetailsRequestAuthenticationData() {} */ public DetailsRequestAuthenticationData authenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; + isSetAuthenticationOnly = true; // mark as set return this; } @@ -75,6 +87,27 @@ public Boolean getAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; + isSetAuthenticationOnly = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DetailsRequestAuthenticationData 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 DetailsRequestAuthenticationData object is equal to o. */ @@ -116,6 +149,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 (isSetAuthenticationOnly) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_ONLY, this.authenticationOnly); + } + + 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 DetailsRequestAuthenticationData given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DeviceRenderOptions.java b/src/main/java/com/adyen/model/checkout/DeviceRenderOptions.java index 929db88d5..ecc2bee61 100644 --- a/src/main/java/com/adyen/model/checkout/DeviceRenderOptions.java +++ b/src/main/java/com/adyen/model/checkout/DeviceRenderOptions.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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. */ @@ -246,6 +284,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/checkout/DokuDetails.java b/src/main/java/com/adyen/model/checkout/DokuDetails.java index 1df8f345b..fd822b5e8 100644 --- a/src/main/java/com/adyen/model/checkout/DokuDetails.java +++ b/src/main/java/com/adyen/model/checkout/DokuDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 DokuDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + 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; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = 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; + /** **doku** */ public enum TypeEnum { DOKU_MANDIRI_VA(String.valueOf("doku_mandiri_va")), @@ -108,6 +125,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 DokuDetails() {} /** @@ -118,6 +144,7 @@ public DokuDetails() {} */ public DokuDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -141,6 +168,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -151,6 +179,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public DokuDetails firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -174,6 +203,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -184,6 +214,7 @@ public void setFirstName(String firstName) { */ public DokuDetails lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -207,6 +238,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -217,6 +249,7 @@ public void setLastName(String lastName) { */ public DokuDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -241,6 +274,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -251,6 +285,7 @@ public void setSdkData(String sdkData) { */ public DokuDetails shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -274,6 +309,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -284,6 +320,7 @@ public void setShopperEmail(String shopperEmail) { */ public DokuDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -307,6 +344,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 DokuDetails 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 DokuDetails object is equal to o. */ @@ -356,6 +414,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + 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 DokuDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Donation.java b/src/main/java/com/adyen/model/checkout/Donation.java index 750c3a67a..c1437e2e2 100644 --- a/src/main/java/com/adyen/model/checkout/Donation.java +++ b/src/main/java/com/adyen/model/checkout/Donation.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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; @@ -31,18 +33,39 @@ public class Donation { 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_DONATION_TYPE = "donationType"; private String donationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationType = false; + public static final String JSON_PROPERTY_MAX_ROUNDUP_AMOUNT = "maxRoundupAmount"; private Long maxRoundupAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaxRoundupAmount = 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_VALUES = "values"; private List values; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValues = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Donation() {} /** @@ -55,6 +78,7 @@ public Donation() {} */ public Donation currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -82,6 +106,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -99,6 +124,7 @@ public void setCurrency(String currency) { */ public Donation donationType(String donationType) { this.donationType = donationType; + isSetDonationType = true; // mark as set return this; } @@ -136,6 +162,7 @@ public String getDonationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationType(String donationType) { this.donationType = donationType; + isSetDonationType = true; // mark as set } /** @@ -148,6 +175,7 @@ public void setDonationType(String donationType) { */ public Donation maxRoundupAmount(Long maxRoundupAmount) { this.maxRoundupAmount = maxRoundupAmount; + isSetMaxRoundupAmount = true; // mark as set return this; } @@ -175,6 +203,7 @@ public Long getMaxRoundupAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaxRoundupAmount(Long maxRoundupAmount) { this.maxRoundupAmount = maxRoundupAmount; + isSetMaxRoundupAmount = true; // mark as set } /** @@ -192,6 +221,7 @@ public void setMaxRoundupAmount(Long maxRoundupAmount) { */ public Donation type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -229,6 +259,7 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set } /** @@ -243,6 +274,7 @@ public void setType(String type) { */ public Donation values(List values) { this.values = values; + isSetValues = true; // mark as set return this; } @@ -282,6 +314,27 @@ public List getValues() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValues(List values) { this.values = values; + isSetValues = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Donation 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 Donation object is equal to o. */ @@ -329,6 +382,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 (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetDonationType) { + addIfNull(nulls, JSON_PROPERTY_DONATION_TYPE, this.donationType); + } + if (isSetMaxRoundupAmount) { + addIfNull(nulls, JSON_PROPERTY_MAX_ROUNDUP_AMOUNT, this.maxRoundupAmount); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetValues) { + addIfNull(nulls, JSON_PROPERTY_VALUES, this.values); + } + + 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 Donation given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DonationCampaign.java b/src/main/java/com/adyen/model/checkout/DonationCampaign.java index 3d9f37a04..313ded4dc 100644 --- a/src/main/java/com/adyen/model/checkout/DonationCampaign.java +++ b/src/main/java/com/adyen/model/checkout/DonationCampaign.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,36 +37,75 @@ public class DonationCampaign { public static final String JSON_PROPERTY_AMOUNTS = "amounts"; private Amounts amounts; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmounts = false; + public static final String JSON_PROPERTY_BANNER_URL = "bannerUrl"; private String bannerUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBannerUrl = false; + public static final String JSON_PROPERTY_CAMPAIGN_NAME = "campaignName"; private String campaignName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCampaignName = false; + public static final String JSON_PROPERTY_CAUSE_NAME = "causeName"; private String causeName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCauseName = false; + public static final String JSON_PROPERTY_DONATION = "donation"; private Donation donation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonation = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_LOGO_URL = "logoUrl"; private String logoUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLogoUrl = false; + public static final String JSON_PROPERTY_NONPROFIT_DESCRIPTION = "nonprofitDescription"; private String nonprofitDescription; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNonprofitDescription = false; + public static final String JSON_PROPERTY_NONPROFIT_NAME = "nonprofitName"; private String nonprofitName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNonprofitName = false; + public static final String JSON_PROPERTY_NONPROFIT_URL = "nonprofitUrl"; private String nonprofitUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNonprofitUrl = false; + public static final String JSON_PROPERTY_TERMS_AND_CONDITIONS_URL = "termsAndConditionsUrl"; private String termsAndConditionsUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTermsAndConditionsUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DonationCampaign() {} /** @@ -75,6 +116,7 @@ public DonationCampaign() {} */ public DonationCampaign amounts(Amounts amounts) { this.amounts = amounts; + isSetAmounts = true; // mark as set return this; } @@ -98,6 +140,7 @@ public Amounts getAmounts() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmounts(Amounts amounts) { this.amounts = amounts; + isSetAmounts = true; // mark as set } /** @@ -108,6 +151,7 @@ public void setAmounts(Amounts amounts) { */ public DonationCampaign bannerUrl(String bannerUrl) { this.bannerUrl = bannerUrl; + isSetBannerUrl = true; // mark as set return this; } @@ -131,6 +175,7 @@ public String getBannerUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBannerUrl(String bannerUrl) { this.bannerUrl = bannerUrl; + isSetBannerUrl = true; // mark as set } /** @@ -141,6 +186,7 @@ public void setBannerUrl(String bannerUrl) { */ public DonationCampaign campaignName(String campaignName) { this.campaignName = campaignName; + isSetCampaignName = true; // mark as set return this; } @@ -164,6 +210,7 @@ public String getCampaignName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCampaignName(String campaignName) { this.campaignName = campaignName; + isSetCampaignName = true; // mark as set } /** @@ -174,6 +221,7 @@ public void setCampaignName(String campaignName) { */ public DonationCampaign causeName(String causeName) { this.causeName = causeName; + isSetCauseName = true; // mark as set return this; } @@ -197,6 +245,7 @@ public String getCauseName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCauseName(String causeName) { this.causeName = causeName; + isSetCauseName = true; // mark as set } /** @@ -207,6 +256,7 @@ public void setCauseName(String causeName) { */ public DonationCampaign donation(Donation donation) { this.donation = donation; + isSetDonation = true; // mark as set return this; } @@ -230,6 +280,7 @@ public Donation getDonation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonation(Donation donation) { this.donation = donation; + isSetDonation = true; // mark as set } /** @@ -240,6 +291,7 @@ public void setDonation(Donation donation) { */ public DonationCampaign id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -263,6 +315,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -273,6 +326,7 @@ public void setId(String id) { */ public DonationCampaign logoUrl(String logoUrl) { this.logoUrl = logoUrl; + isSetLogoUrl = true; // mark as set return this; } @@ -296,6 +350,7 @@ public String getLogoUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLogoUrl(String logoUrl) { this.logoUrl = logoUrl; + isSetLogoUrl = true; // mark as set } /** @@ -306,6 +361,7 @@ public void setLogoUrl(String logoUrl) { */ public DonationCampaign nonprofitDescription(String nonprofitDescription) { this.nonprofitDescription = nonprofitDescription; + isSetNonprofitDescription = true; // mark as set return this; } @@ -329,6 +385,7 @@ public String getNonprofitDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNonprofitDescription(String nonprofitDescription) { this.nonprofitDescription = nonprofitDescription; + isSetNonprofitDescription = true; // mark as set } /** @@ -339,6 +396,7 @@ public void setNonprofitDescription(String nonprofitDescription) { */ public DonationCampaign nonprofitName(String nonprofitName) { this.nonprofitName = nonprofitName; + isSetNonprofitName = true; // mark as set return this; } @@ -362,6 +420,7 @@ public String getNonprofitName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNonprofitName(String nonprofitName) { this.nonprofitName = nonprofitName; + isSetNonprofitName = true; // mark as set } /** @@ -372,6 +431,7 @@ public void setNonprofitName(String nonprofitName) { */ public DonationCampaign nonprofitUrl(String nonprofitUrl) { this.nonprofitUrl = nonprofitUrl; + isSetNonprofitUrl = true; // mark as set return this; } @@ -395,6 +455,7 @@ public String getNonprofitUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNonprofitUrl(String nonprofitUrl) { this.nonprofitUrl = nonprofitUrl; + isSetNonprofitUrl = true; // mark as set } /** @@ -406,6 +467,7 @@ public void setNonprofitUrl(String nonprofitUrl) { */ public DonationCampaign termsAndConditionsUrl(String termsAndConditionsUrl) { this.termsAndConditionsUrl = termsAndConditionsUrl; + isSetTermsAndConditionsUrl = true; // mark as set return this; } @@ -431,6 +493,27 @@ public String getTermsAndConditionsUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTermsAndConditionsUrl(String termsAndConditionsUrl) { this.termsAndConditionsUrl = termsAndConditionsUrl; + isSetTermsAndConditionsUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DonationCampaign 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 DonationCampaign object is equal to o. */ @@ -505,6 +588,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 (isSetAmounts) { + addIfNull(nulls, JSON_PROPERTY_AMOUNTS, this.amounts); + } + if (isSetBannerUrl) { + addIfNull(nulls, JSON_PROPERTY_BANNER_URL, this.bannerUrl); + } + if (isSetCampaignName) { + addIfNull(nulls, JSON_PROPERTY_CAMPAIGN_NAME, this.campaignName); + } + if (isSetCauseName) { + addIfNull(nulls, JSON_PROPERTY_CAUSE_NAME, this.causeName); + } + if (isSetDonation) { + addIfNull(nulls, JSON_PROPERTY_DONATION, this.donation); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLogoUrl) { + addIfNull(nulls, JSON_PROPERTY_LOGO_URL, this.logoUrl); + } + if (isSetNonprofitDescription) { + addIfNull(nulls, JSON_PROPERTY_NONPROFIT_DESCRIPTION, this.nonprofitDescription); + } + if (isSetNonprofitName) { + addIfNull(nulls, JSON_PROPERTY_NONPROFIT_NAME, this.nonprofitName); + } + if (isSetNonprofitUrl) { + addIfNull(nulls, JSON_PROPERTY_NONPROFIT_URL, this.nonprofitUrl); + } + if (isSetTermsAndConditionsUrl) { + addIfNull(nulls, JSON_PROPERTY_TERMS_AND_CONDITIONS_URL, this.termsAndConditionsUrl); + } + + 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 DonationCampaign given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DonationCampaignsRequest.java b/src/main/java/com/adyen/model/checkout/DonationCampaignsRequest.java index 001265b8d..56bea8ec1 100644 --- a/src/main/java/com/adyen/model/checkout/DonationCampaignsRequest.java +++ b/src/main/java/com/adyen/model/checkout/DonationCampaignsRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 DonationCampaignsRequest { 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_LOCALE = "locale"; private String locale; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLocale = 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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DonationCampaignsRequest() {} /** @@ -45,6 +62,7 @@ public DonationCampaignsRequest() {} */ public DonationCampaignsRequest currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -72,6 +90,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -82,6 +101,7 @@ public void setCurrency(String currency) { */ public DonationCampaignsRequest locale(String locale) { this.locale = locale; + isSetLocale = true; // mark as set return this; } @@ -105,6 +125,7 @@ public String getLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLocale(String locale) { this.locale = locale; + isSetLocale = true; // mark as set } /** @@ -115,6 +136,7 @@ public void setLocale(String locale) { */ public DonationCampaignsRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -138,6 +160,27 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DonationCampaignsRequest 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 DonationCampaignsRequest object is equal to o. */ @@ -181,6 +224,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 (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetLocale) { + addIfNull(nulls, JSON_PROPERTY_LOCALE, this.locale); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + + 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 DonationCampaignsRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DonationCampaignsResponse.java b/src/main/java/com/adyen/model/checkout/DonationCampaignsResponse.java index 0bb1ff92c..d092a7963 100644 --- a/src/main/java/com/adyen/model/checkout/DonationCampaignsResponse.java +++ b/src/main/java/com/adyen/model/checkout/DonationCampaignsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,6 +27,15 @@ public class DonationCampaignsResponse { public static final String JSON_PROPERTY_DONATION_CAMPAIGNS = "donationCampaigns"; private List donationCampaigns; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationCampaigns = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DonationCampaignsResponse() {} /** @@ -35,6 +46,7 @@ public DonationCampaignsResponse() {} */ public DonationCampaignsResponse donationCampaigns(List donationCampaigns) { this.donationCampaigns = donationCampaigns; + isSetDonationCampaigns = true; // mark as set return this; } @@ -67,6 +79,27 @@ public List getDonationCampaigns() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationCampaigns(List donationCampaigns) { this.donationCampaigns = donationCampaigns; + isSetDonationCampaigns = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DonationCampaignsResponse 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 DonationCampaignsResponse object is equal to o. */ @@ -106,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDonationCampaigns) { + addIfNull(nulls, JSON_PROPERTY_DONATION_CAMPAIGNS, this.donationCampaigns); + } + + 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 DonationCampaignsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DonationPaymentRequest.java b/src/main/java/com/adyen/model/checkout/DonationPaymentRequest.java index f07b2d810..6530f6cd0 100644 --- a/src/main/java/com/adyen/model/checkout/DonationPaymentRequest.java +++ b/src/main/java/com/adyen/model/checkout/DonationPaymentRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,24 +77,45 @@ public class DonationPaymentRequest { 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_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_AUTHENTICATION_DATA = "authenticationData"; private AuthenticationData authenticationData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationData = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private BillingAddress 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; + /** * The platform where a payment transaction takes place. This field is optional for filtering out * payment methods that are only available on specific platforms. If this value is not set, then @@ -144,62 +167,119 @@ public static ChannelEnum fromValue(String value) { public static final String JSON_PROPERTY_CHANNEL = "channel"; private ChannelEnum channel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChannel = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_CONVERSION_ID = "conversionId"; @Deprecated // deprecated since Adyen Checkout API v68: Use `checkoutAttemptId` instead private String conversionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConversionId = 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_DATE_OF_BIRTH = "dateOfBirth"; private OffsetDateTime dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + public static final String JSON_PROPERTY_DELIVER_AT = "deliverAt"; private OffsetDateTime deliverAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliverAt = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private DeliveryAddress deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = 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_DONATION_ACCOUNT = "donationAccount"; private String donationAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationAccount = false; + public static final String JSON_PROPERTY_DONATION_CAMPAIGN_ID = "donationCampaignId"; private String donationCampaignId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationCampaignId = false; + public static final String JSON_PROPERTY_DONATION_ORIGINAL_PSP_REFERENCE = "donationOriginalPspReference"; private String donationOriginalPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationOriginalPspReference = false; + public static final String JSON_PROPERTY_DONATION_TOKEN = "donationToken"; private String donationToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationToken = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = 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_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_ORIGIN = "origin"; private String origin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrigin = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private DonationPaymentMethod paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = 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 @@ -257,27 +337,51 @@ 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_REDIRECT_FROM_ISSUER_METHOD = "redirectFromIssuerMethod"; private String redirectFromIssuerMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectFromIssuerMethod = false; + public static final String JSON_PROPERTY_REDIRECT_TO_ISSUER_METHOD = "redirectToIssuerMethod"; private String redirectToIssuerMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectToIssuerMethod = 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_RETURN_URL = "returnUrl"; private String returnUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReturnUrl = false; + public static final String JSON_PROPERTY_SESSION_VALIDITY = "sessionValidity"; private String sessionValidity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSessionValidity = 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 @@ -338,30 +442,60 @@ 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 ShopperName 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_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_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 ThreeDS2RequestFields 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"; @Deprecated // deprecated since Adyen Checkout API v69: Use // `authenticationData.authenticationOnly` instead. private Boolean threeDSAuthenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSAuthenticationOnly = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DonationPaymentRequest() {} /** @@ -372,6 +506,7 @@ public DonationPaymentRequest() {} */ public DonationPaymentRequest accountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set return this; } @@ -395,6 +530,7 @@ public AccountInfo getAccountInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set } /** @@ -409,6 +545,7 @@ public void setAccountInfo(AccountInfo accountInfo) { */ public DonationPaymentRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -448,6 +585,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -458,6 +596,7 @@ public void setAdditionalData(Map additionalData) { */ public DonationPaymentRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -481,6 +620,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -491,6 +631,7 @@ public void setAmount(Amount amount) { */ public DonationPaymentRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -514,6 +655,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -524,6 +666,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public DonationPaymentRequest authenticationData(AuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set return this; } @@ -547,6 +690,7 @@ public AuthenticationData getAuthenticationData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationData(AuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set } /** @@ -557,6 +701,7 @@ public void setAuthenticationData(AuthenticationData authenticationData) { */ public DonationPaymentRequest billingAddress(BillingAddress billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -580,6 +725,7 @@ public BillingAddress getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(BillingAddress billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -590,6 +736,7 @@ public void setBillingAddress(BillingAddress billingAddress) { */ public DonationPaymentRequest browserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set return this; } @@ -613,6 +760,7 @@ public BrowserInfo getBrowserInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrowserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set } /** @@ -629,6 +777,7 @@ public void setBrowserInfo(BrowserInfo browserInfo) { */ public DonationPaymentRequest channel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set return this; } @@ -664,6 +813,7 @@ public ChannelEnum getChannel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChannel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set } /** @@ -676,6 +826,7 @@ public void setChannel(ChannelEnum channel) { */ public DonationPaymentRequest checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -703,6 +854,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -717,6 +869,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v68: Use `checkoutAttemptId` instead public DonationPaymentRequest conversionId(String conversionId) { this.conversionId = conversionId; + isSetConversionId = true; // mark as set return this; } @@ -748,6 +901,7 @@ public String getConversionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConversionId(String conversionId) { this.conversionId = conversionId; + isSetConversionId = true; // mark as set } /** @@ -760,6 +914,7 @@ public void setConversionId(String conversionId) { */ public DonationPaymentRequest countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -787,6 +942,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -799,6 +955,7 @@ public void setCountryCode(String countryCode) { */ public DonationPaymentRequest dateOfBirth(OffsetDateTime dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -826,6 +983,7 @@ public OffsetDateTime getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(OffsetDateTime dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -840,6 +998,7 @@ public void setDateOfBirth(OffsetDateTime dateOfBirth) { */ public DonationPaymentRequest deliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set return this; } @@ -871,6 +1030,7 @@ public OffsetDateTime getDeliverAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set } /** @@ -881,6 +1041,7 @@ public void setDeliverAt(OffsetDateTime deliverAt) { */ public DonationPaymentRequest deliveryAddress(DeliveryAddress deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -904,6 +1065,7 @@ public DeliveryAddress getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(DeliveryAddress deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -917,6 +1079,7 @@ public void setDeliveryAddress(DeliveryAddress deliveryAddress) { */ public DonationPaymentRequest deviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set return this; } @@ -946,6 +1109,7 @@ public String getDeviceFingerprint() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set } /** @@ -956,6 +1120,7 @@ public void setDeviceFingerprint(String deviceFingerprint) { */ public DonationPaymentRequest donationAccount(String donationAccount) { this.donationAccount = donationAccount; + isSetDonationAccount = true; // mark as set return this; } @@ -979,6 +1144,7 @@ public String getDonationAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationAccount(String donationAccount) { this.donationAccount = donationAccount; + isSetDonationAccount = true; // mark as set } /** @@ -990,6 +1156,7 @@ public void setDonationAccount(String donationAccount) { */ public DonationPaymentRequest donationCampaignId(String donationCampaignId) { this.donationCampaignId = donationCampaignId; + isSetDonationCampaignId = true; // mark as set return this; } @@ -1015,6 +1182,7 @@ public String getDonationCampaignId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationCampaignId(String donationCampaignId) { this.donationCampaignId = donationCampaignId; + isSetDonationCampaignId = true; // mark as set } /** @@ -1027,6 +1195,7 @@ public void setDonationCampaignId(String donationCampaignId) { */ public DonationPaymentRequest donationOriginalPspReference(String donationOriginalPspReference) { this.donationOriginalPspReference = donationOriginalPspReference; + isSetDonationOriginalPspReference = true; // mark as set return this; } @@ -1054,6 +1223,7 @@ public String getDonationOriginalPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationOriginalPspReference(String donationOriginalPspReference) { this.donationOriginalPspReference = donationOriginalPspReference; + isSetDonationOriginalPspReference = true; // mark as set } /** @@ -1064,6 +1234,7 @@ public void setDonationOriginalPspReference(String donationOriginalPspReference) */ public DonationPaymentRequest donationToken(String donationToken) { this.donationToken = donationToken; + isSetDonationToken = true; // mark as set return this; } @@ -1087,6 +1258,7 @@ public String getDonationToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationToken(String donationToken) { this.donationToken = donationToken; + isSetDonationToken = true; // mark as set } /** @@ -1101,6 +1273,7 @@ public void setDonationToken(String donationToken) { */ public DonationPaymentRequest lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -1140,6 +1313,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -1151,6 +1325,7 @@ public void setLineItems(List lineItems) { */ public DonationPaymentRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -1176,6 +1351,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -1186,6 +1362,7 @@ public void setMerchantAccount(String merchantAccount) { */ public DonationPaymentRequest merchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator) { this.merchantRiskIndicator = merchantRiskIndicator; + isSetMerchantRiskIndicator = true; // mark as set return this; } @@ -1209,6 +1386,7 @@ public MerchantRiskIndicator getMerchantRiskIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator) { this.merchantRiskIndicator = merchantRiskIndicator; + isSetMerchantRiskIndicator = true; // mark as set } /** @@ -1225,6 +1403,7 @@ public void setMerchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator */ public DonationPaymentRequest metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -1268,6 +1447,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -1278,6 +1458,7 @@ public void setMetadata(Map metadata) { */ public DonationPaymentRequest mpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set return this; } @@ -1301,6 +1482,7 @@ public ThreeDSecureData getMpiData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set } /** @@ -1315,6 +1497,7 @@ public void setMpiData(ThreeDSecureData mpiData) { */ public DonationPaymentRequest origin(String origin) { this.origin = origin; + isSetOrigin = true; // mark as set return this; } @@ -1346,6 +1529,7 @@ public String getOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrigin(String origin) { this.origin = origin; + isSetOrigin = true; // mark as set } /** @@ -1356,6 +1540,7 @@ public void setOrigin(String origin) { */ public DonationPaymentRequest paymentMethod(DonationPaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -1379,6 +1564,7 @@ public DonationPaymentMethod getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(DonationPaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -1407,6 +1593,7 @@ public void setPaymentMethod(DonationPaymentMethod paymentMethod) { public DonationPaymentRequest recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -1464,6 +1651,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -1475,6 +1663,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public DonationPaymentRequest redirectFromIssuerMethod(String redirectFromIssuerMethod) { this.redirectFromIssuerMethod = redirectFromIssuerMethod; + isSetRedirectFromIssuerMethod = true; // mark as set return this; } @@ -1500,6 +1689,7 @@ public String getRedirectFromIssuerMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectFromIssuerMethod(String redirectFromIssuerMethod) { this.redirectFromIssuerMethod = redirectFromIssuerMethod; + isSetRedirectFromIssuerMethod = true; // mark as set } /** @@ -1511,6 +1701,7 @@ public void setRedirectFromIssuerMethod(String redirectFromIssuerMethod) { */ public DonationPaymentRequest redirectToIssuerMethod(String redirectToIssuerMethod) { this.redirectToIssuerMethod = redirectToIssuerMethod; + isSetRedirectToIssuerMethod = true; // mark as set return this; } @@ -1536,6 +1727,7 @@ public String getRedirectToIssuerMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectToIssuerMethod(String redirectToIssuerMethod) { this.redirectToIssuerMethod = redirectToIssuerMethod; + isSetRedirectToIssuerMethod = true; // mark as set } /** @@ -1552,6 +1744,7 @@ public void setRedirectToIssuerMethod(String redirectToIssuerMethod) { */ public DonationPaymentRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -1587,6 +1780,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -1624,6 +1818,7 @@ public void setReference(String reference) { */ public DonationPaymentRequest returnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set return this; } @@ -1701,6 +1896,7 @@ public String getReturnUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set } /** @@ -1714,6 +1910,7 @@ public void setReturnUrl(String returnUrl) { */ public DonationPaymentRequest sessionValidity(String sessionValidity) { this.sessionValidity = sessionValidity; + isSetSessionValidity = true; // mark as set return this; } @@ -1743,6 +1940,7 @@ public String getSessionValidity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSessionValidity(String sessionValidity) { this.sessionValidity = sessionValidity; + isSetSessionValidity = true; // mark as set } /** @@ -1757,6 +1955,7 @@ public void setSessionValidity(String sessionValidity) { */ public DonationPaymentRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -1788,6 +1987,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -1811,6 +2011,7 @@ public void setShopperEmail(String shopperEmail) { */ public DonationPaymentRequest shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -1860,6 +2061,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -1891,6 +2093,7 @@ public void setShopperIP(String shopperIP) { */ public DonationPaymentRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -1956,6 +2159,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -1968,6 +2172,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public DonationPaymentRequest shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -1995,6 +2200,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -2005,6 +2211,7 @@ public void setShopperLocale(String shopperLocale) { */ public DonationPaymentRequest shopperName(ShopperName shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -2028,6 +2235,7 @@ public ShopperName getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(ShopperName shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -2043,6 +2251,7 @@ public void setShopperName(ShopperName shopperName) { */ public DonationPaymentRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -2076,6 +2285,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -2086,6 +2296,7 @@ public void setShopperReference(String shopperReference) { */ public DonationPaymentRequest socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -2109,6 +2320,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -2127,6 +2339,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public DonationPaymentRequest telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -2166,6 +2379,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -2176,6 +2390,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public DonationPaymentRequest threeDS2RequestData(ThreeDS2RequestFields threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set return this; } @@ -2199,6 +2414,7 @@ public ThreeDS2RequestFields getThreeDS2RequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2RequestData(ThreeDS2RequestFields threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set } /** @@ -2219,6 +2435,7 @@ public void setThreeDS2RequestData(ThreeDS2RequestFields threeDS2RequestData) { // `authenticationData.authenticationOnly` instead. public DonationPaymentRequest threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set return this; } @@ -2262,6 +2479,27 @@ public Boolean getThreeDSAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DonationPaymentRequest 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 DonationPaymentRequest object is equal to o. */ @@ -2446,6 +2684,154 @@ 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 (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 (isSetAuthenticationData) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_DATA, this.authenticationData); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetBrowserInfo) { + addIfNull(nulls, JSON_PROPERTY_BROWSER_INFO, this.browserInfo); + } + if (isSetChannel) { + addIfNull(nulls, JSON_PROPERTY_CHANNEL, this.channel); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetConversionId) { + addIfNull(nulls, JSON_PROPERTY_CONVERSION_ID, this.conversionId); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetDeliverAt) { + addIfNull(nulls, JSON_PROPERTY_DELIVER_AT, this.deliverAt); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetDeviceFingerprint) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_FINGERPRINT, this.deviceFingerprint); + } + if (isSetDonationAccount) { + addIfNull(nulls, JSON_PROPERTY_DONATION_ACCOUNT, this.donationAccount); + } + if (isSetDonationCampaignId) { + addIfNull(nulls, JSON_PROPERTY_DONATION_CAMPAIGN_ID, this.donationCampaignId); + } + if (isSetDonationOriginalPspReference) { + addIfNull( + nulls, JSON_PROPERTY_DONATION_ORIGINAL_PSP_REFERENCE, this.donationOriginalPspReference); + } + if (isSetDonationToken) { + addIfNull(nulls, JSON_PROPERTY_DONATION_TOKEN, this.donationToken); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + 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 (isSetOrigin) { + addIfNull(nulls, JSON_PROPERTY_ORIGIN, this.origin); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetRedirectFromIssuerMethod) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_FROM_ISSUER_METHOD, this.redirectFromIssuerMethod); + } + if (isSetRedirectToIssuerMethod) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_TO_ISSUER_METHOD, this.redirectToIssuerMethod); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReturnUrl) { + addIfNull(nulls, JSON_PROPERTY_RETURN_URL, this.returnUrl); + } + if (isSetSessionValidity) { + addIfNull(nulls, JSON_PROPERTY_SESSION_VALIDITY, this.sessionValidity); + } + 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 (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + 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); + } + + 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 DonationPaymentRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DonationPaymentResponse.java b/src/main/java/com/adyen/model/checkout/DonationPaymentResponse.java index 880346c4f..65ce2ca2e 100644 --- a/src/main/java/com/adyen/model/checkout/DonationPaymentResponse.java +++ b/src/main/java/com/adyen/model/checkout/DonationPaymentResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,21 +37,39 @@ public class DonationPaymentResponse { 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_DONATION_ACCOUNT = "donationAccount"; private String donationAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationAccount = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_PAYMENT = "payment"; private PaymentResponse payment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayment = 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 donation transaction. Possible values: * **completed** * **pending** * * **refused** @@ -99,6 +119,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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DonationPaymentResponse() {} /** @@ -109,6 +138,7 @@ public DonationPaymentResponse() {} */ public DonationPaymentResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -132,6 +162,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -146,6 +177,7 @@ public void setAmount(Amount amount) { */ public DonationPaymentResponse donationAccount(String donationAccount) { this.donationAccount = donationAccount; + isSetDonationAccount = true; // mark as set return this; } @@ -177,6 +209,7 @@ public String getDonationAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationAccount(String donationAccount) { this.donationAccount = donationAccount; + isSetDonationAccount = true; // mark as set } /** @@ -187,6 +220,7 @@ public void setDonationAccount(String donationAccount) { */ public DonationPaymentResponse id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -210,6 +244,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -221,6 +256,7 @@ public void setId(String id) { */ public DonationPaymentResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -246,6 +282,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -256,6 +293,7 @@ public void setMerchantAccount(String merchantAccount) { */ public DonationPaymentResponse payment(PaymentResponse payment) { this.payment = payment; + isSetPayment = true; // mark as set return this; } @@ -279,6 +317,7 @@ public PaymentResponse getPayment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayment(PaymentResponse payment) { this.payment = payment; + isSetPayment = true; // mark as set } /** @@ -295,6 +334,7 @@ public void setPayment(PaymentResponse payment) { */ public DonationPaymentResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -330,6 +370,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -342,6 +383,7 @@ public void setReference(String reference) { */ public DonationPaymentResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -369,6 +411,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DonationPaymentResponse 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 DonationPaymentResponse object is equal to o. */ @@ -420,6 +483,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetDonationAccount) { + addIfNull(nulls, JSON_PROPERTY_DONATION_ACCOUNT, this.donationAccount); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPayment) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT, this.payment); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + 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 DonationPaymentResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DragonpayDetails.java b/src/main/java/com/adyen/model/checkout/DragonpayDetails.java index b03bc32fc..9554ca10d 100644 --- a/src/main/java/com/adyen/model/checkout/DragonpayDetails.java +++ b/src/main/java/com/adyen/model/checkout/DragonpayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 DragonpayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = 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; + /** **dragonpay** */ public enum TypeEnum { DRAGONPAY_EBANKING(String.valueOf("dragonpay_ebanking")), @@ -90,6 +104,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 DragonpayDetails() {} /** @@ -100,6 +123,7 @@ public DragonpayDetails() {} */ public DragonpayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -123,6 +147,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -135,6 +160,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public DragonpayDetails issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -162,6 +188,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -172,6 +199,7 @@ public void setIssuer(String issuer) { */ public DragonpayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -196,6 +224,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -206,6 +235,7 @@ public void setSdkData(String sdkData) { */ public DragonpayDetails shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -229,6 +259,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -239,6 +270,7 @@ public void setShopperEmail(String shopperEmail) { */ public DragonpayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -262,6 +294,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 DragonpayDetails 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 DragonpayDetails object is equal to o. */ @@ -309,6 +362,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + 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 DragonpayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/EBankingFinlandDetails.java b/src/main/java/com/adyen/model/checkout/EBankingFinlandDetails.java index e239df293..789ebad15 100644 --- a/src/main/java/com/adyen/model/checkout/EBankingFinlandDetails.java +++ b/src/main/java/com/adyen/model/checkout/EBankingFinlandDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -32,12 +34,21 @@ public class EBankingFinlandDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **ebanking_FI** */ public enum TypeEnum { EBANKING_FI(String.valueOf("ebanking_FI")); @@ -80,6 +91,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 EBankingFinlandDetails() {} /** @@ -90,6 +110,7 @@ public EBankingFinlandDetails() {} */ public EBankingFinlandDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -113,6 +134,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -123,6 +145,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public EBankingFinlandDetails issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -146,6 +169,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -156,6 +180,7 @@ public void setIssuer(String issuer) { */ public EBankingFinlandDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -180,6 +205,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -190,6 +216,7 @@ public void setSdkData(String sdkData) { */ public EBankingFinlandDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -213,6 +240,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 EBankingFinlandDetails 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 EBankingFinlandDetails object is equal to o. */ @@ -258,6 +306,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + 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 EBankingFinlandDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/EcontextVoucherDetails.java b/src/main/java/com/adyen/model/checkout/EcontextVoucherDetails.java index eb8856400..f7f069116 100644 --- a/src/main/java/com/adyen/model/checkout/EcontextVoucherDetails.java +++ b/src/main/java/com/adyen/model/checkout/EcontextVoucherDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,21 +37,39 @@ public class EcontextVoucherDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + 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; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = 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_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + /** **econtextvoucher** */ public enum TypeEnum { ECONTEXT_SEVEN_ELEVEN(String.valueOf("econtext_seven_eleven")), @@ -100,6 +120,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 EcontextVoucherDetails() {} /** @@ -110,6 +139,7 @@ public EcontextVoucherDetails() {} */ public EcontextVoucherDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -133,6 +163,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -143,6 +174,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public EcontextVoucherDetails firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -166,6 +198,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -176,6 +209,7 @@ public void setFirstName(String firstName) { */ public EcontextVoucherDetails lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -199,6 +233,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -209,6 +244,7 @@ public void setLastName(String lastName) { */ public EcontextVoucherDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -233,6 +269,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -243,6 +280,7 @@ public void setSdkData(String sdkData) { */ public EcontextVoucherDetails shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -266,6 +304,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -280,6 +319,7 @@ public void setShopperEmail(String shopperEmail) { */ public EcontextVoucherDetails telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -311,6 +351,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -321,6 +362,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public EcontextVoucherDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -344,6 +386,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 EcontextVoucherDetails 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 EcontextVoucherDetails object is equal to o. */ @@ -396,6 +459,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + 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 EcontextVoucherDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/EftDetails.java b/src/main/java/com/adyen/model/checkout/EftDetails.java index 388ec456b..0006d6cb9 100644 --- a/src/main/java/com/adyen/model/checkout/EftDetails.java +++ b/src/main/java/com/adyen/model/checkout/EftDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,28 +39,52 @@ public class EftDetails { 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_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = 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_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = 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_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **eft** */ public enum TypeEnum { EFT_DIRECTDEBIT_CA(String.valueOf("eft_directdebit_CA")); @@ -101,6 +127,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 EftDetails() {} /** @@ -111,6 +146,7 @@ public EftDetails() {} */ public EftDetails bankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set return this; } @@ -134,6 +170,7 @@ public String getBankAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set } /** @@ -144,6 +181,7 @@ public void setBankAccountNumber(String bankAccountNumber) { */ public EftDetails bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -167,6 +205,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -177,6 +216,7 @@ public void setBankCode(String bankCode) { */ public EftDetails bankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set return this; } @@ -200,6 +240,7 @@ public String getBankLocationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set } /** @@ -210,6 +251,7 @@ public void setBankLocationId(String bankLocationId) { */ public EftDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -233,6 +275,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -259,6 +302,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public EftDetails ownerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set return this; } @@ -314,6 +358,7 @@ public String getOwnerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwnerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set } /** @@ -328,6 +373,7 @@ public void setOwnerName(String ownerName) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public EftDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -359,6 +405,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -369,6 +416,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public EftDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -393,6 +441,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -405,6 +454,7 @@ public void setSdkData(String sdkData) { */ public EftDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -432,6 +482,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -442,6 +493,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public EftDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -465,6 +517,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 EftDetails 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 EftDetails object is equal to o. */ @@ -533,6 +606,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 (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetBankLocationId) { + addIfNull(nulls, JSON_PROPERTY_BANK_LOCATION_ID, this.bankLocationId); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetOwnerName) { + addIfNull(nulls, JSON_PROPERTY_OWNER_NAME, this.ownerName); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 EftDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/EncryptedOrderData.java b/src/main/java/com/adyen/model/checkout/EncryptedOrderData.java index 391ea7057..edd284daa 100644 --- a/src/main/java/com/adyen/model/checkout/EncryptedOrderData.java +++ b/src/main/java/com/adyen/model/checkout/EncryptedOrderData.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 EncryptedOrderData { public static final String JSON_PROPERTY_ORDER_DATA = "orderData"; private String orderData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrderData = 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 EncryptedOrderData() {} /** @@ -39,6 +53,7 @@ public EncryptedOrderData() {} */ public EncryptedOrderData orderData(String orderData) { this.orderData = orderData; + isSetOrderData = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getOrderData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrderData(String orderData) { this.orderData = orderData; + isSetOrderData = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setOrderData(String orderData) { */ public EncryptedOrderData pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -95,6 +112,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 EncryptedOrderData 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 EncryptedOrderData object is equal to o. */ @@ -136,6 +174,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 (isSetOrderData) { + addIfNull(nulls, JSON_PROPERTY_ORDER_DATA, this.orderData); + } + 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 EncryptedOrderData given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/EnhancedSchemeData.java b/src/main/java/com/adyen/model/checkout/EnhancedSchemeData.java index fa7ca197c..75d2b630a 100644 --- a/src/main/java/com/adyen/model/checkout/EnhancedSchemeData.java +++ b/src/main/java/com/adyen/model/checkout/EnhancedSchemeData.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 EnhancedSchemeData { public static final String JSON_PROPERTY_AIRLINE = "airline"; private Airline airline; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirline = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public EnhancedSchemeData() {} /** @@ -33,6 +44,7 @@ public EnhancedSchemeData() {} */ public EnhancedSchemeData airline(Airline airline) { this.airline = airline; + isSetAirline = true; // mark as set return this; } @@ -56,6 +68,27 @@ public Airline getAirline() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirline(Airline airline) { this.airline = airline; + isSetAirline = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public EnhancedSchemeData 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 EnhancedSchemeData object is equal to o. */ @@ -95,6 +128,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 (isSetAirline) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE, this.airline); + } + + 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 EnhancedSchemeData given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ExternalPlatform.java b/src/main/java/com/adyen/model/checkout/ExternalPlatform.java index 065b8e302..e6f6734ec 100644 --- a/src/main/java/com/adyen/model/checkout/ExternalPlatform.java +++ b/src/main/java/com/adyen/model/checkout/ExternalPlatform.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -175,6 +218,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/checkout/FastlaneDetails.java b/src/main/java/com/adyen/model/checkout/FastlaneDetails.java index 032b9261e..9751c0169 100644 --- a/src/main/java/com/adyen/model/checkout/FastlaneDetails.java +++ b/src/main/java/com/adyen/model/checkout/FastlaneDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,19 +36,34 @@ public class FastlaneDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_FASTLANE_DATA = "fastlaneData"; private String fastlaneData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFastlaneData = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **fastlane** */ public enum TypeEnum { FASTLANE(String.valueOf("fastlane")); @@ -89,6 +106,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 FastlaneDetails() {} /** @@ -99,6 +125,7 @@ public FastlaneDetails() {} */ public FastlaneDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -132,6 +160,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public FastlaneDetails fastlaneData(String fastlaneData) { this.fastlaneData = fastlaneData; + isSetFastlaneData = true; // mark as set return this; } @@ -155,6 +184,7 @@ public String getFastlaneData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFastlaneData(String fastlaneData) { this.fastlaneData = fastlaneData; + isSetFastlaneData = true; // mark as set } /** @@ -169,6 +199,7 @@ public void setFastlaneData(String fastlaneData) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public FastlaneDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -200,6 +231,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -210,6 +242,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public FastlaneDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -234,6 +267,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -246,6 +280,7 @@ public void setSdkData(String sdkData) { */ public FastlaneDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -273,6 +308,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -283,6 +319,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public FastlaneDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -306,6 +343,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 FastlaneDetails 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 FastlaneDetails object is equal to o. */ @@ -365,6 +423,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFastlaneData) { + addIfNull(nulls, JSON_PROPERTY_FASTLANE_DATA, this.fastlaneData); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 FastlaneDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ForexQuote.java b/src/main/java/com/adyen/model/checkout/ForexQuote.java index 79fb4567a..38fc85692 100644 --- a/src/main/java/com/adyen/model/checkout/ForexQuote.java +++ b/src/main/java/com/adyen/model/checkout/ForexQuote.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -539,6 +627,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/checkout/FraudCheckResult.java b/src/main/java/com/adyen/model/checkout/FraudCheckResult.java index 03fde128b..86a324fd8 100644 --- a/src/main/java/com/adyen/model/checkout/FraudCheckResult.java +++ b/src/main/java/com/adyen/model/checkout/FraudCheckResult.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -175,6 +218,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/checkout/FraudResult.java b/src/main/java/com/adyen/model/checkout/FraudResult.java index 31cdaa0eb..3ad205bff 100644 --- a/src/main/java/com/adyen/model/checkout/FraudResult.java +++ b/src/main/java/com/adyen/model/checkout/FraudResult.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -143,6 +181,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/checkout/FundOrigin.java b/src/main/java/com/adyen/model/checkout/FundOrigin.java index a1355a9b5..e5cfa5b09 100644 --- a/src/main/java/com/adyen/model/checkout/FundOrigin.java +++ b/src/main/java/com/adyen/model/checkout/FundOrigin.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 FundOrigin { 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_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; + public static final String JSON_PROPERTY_WALLET_IDENTIFIER = "walletIdentifier"; private String walletIdentifier; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWalletIdentifier = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public FundOrigin() {} /** @@ -51,6 +74,7 @@ public FundOrigin() {} */ public FundOrigin billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -74,6 +98,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setBillingAddress(Address billingAddress) { */ public FundOrigin shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setShopperEmail(String shopperEmail) { */ public FundOrigin shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -140,6 +168,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setShopperName(Name shopperName) { */ public FundOrigin telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -173,6 +203,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -183,6 +214,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public FundOrigin walletIdentifier(String walletIdentifier) { this.walletIdentifier = walletIdentifier; + isSetWalletIdentifier = true; // mark as set return this; } @@ -206,6 +238,27 @@ public String getWalletIdentifier() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWalletIdentifier(String walletIdentifier) { this.walletIdentifier = walletIdentifier; + isSetWalletIdentifier = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FundOrigin 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 FundOrigin object is equal to o. */ @@ -254,6 +307,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 (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + 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); + } + if (isSetWalletIdentifier) { + addIfNull(nulls, JSON_PROPERTY_WALLET_IDENTIFIER, this.walletIdentifier); + } + + 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 FundOrigin given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/FundRecipient.java b/src/main/java/com/adyen/model/checkout/FundRecipient.java index 37e1d3aae..1cfbbb643 100644 --- a/src/main/java/com/adyen/model/checkout/FundRecipient.java +++ b/src/main/java/com/adyen/model/checkout/FundRecipient.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -40,36 +42,69 @@ public class FundRecipient { 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_BILLING_ADDRESS = "billingAddress"; private Address billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private CardDetails paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = 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_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = 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_IDENTIFIER = "walletIdentifier"; private String walletIdentifier; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWalletIdentifier = false; + public static final String JSON_PROPERTY_WALLET_OWNER_TAX_ID = "walletOwnerTaxId"; private String walletOwnerTaxId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWalletOwnerTaxId = false; + /** The purpose of a digital wallet transaction. */ public enum WalletPurposeEnum { IDENTIFIEDBOLETO(String.valueOf("identifiedBoleto")), @@ -120,6 +155,15 @@ public static WalletPurposeEnum fromValue(String value) { public static final String JSON_PROPERTY_WALLET_PURPOSE = "walletPurpose"; private WalletPurposeEnum 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 FundRecipient() {} /** @@ -130,6 +174,7 @@ public FundRecipient() {} */ public FundRecipient IBAN(String IBAN) { this.IBAN = IBAN; + isSetIBAN = true; // mark as set return this; } @@ -153,6 +198,7 @@ public String getIBAN() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIBAN(String IBAN) { this.IBAN = IBAN; + isSetIBAN = true; // mark as set } /** @@ -163,6 +209,7 @@ public void setIBAN(String IBAN) { */ public FundRecipient billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -186,6 +233,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -196,6 +244,7 @@ public void setBillingAddress(Address billingAddress) { */ public FundRecipient paymentMethod(CardDetails paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -219,6 +268,7 @@ public CardDetails getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(CardDetails paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -229,6 +279,7 @@ public void setPaymentMethod(CardDetails paymentMethod) { */ public FundRecipient shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -252,6 +303,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -262,6 +314,7 @@ public void setShopperEmail(String shopperEmail) { */ public FundRecipient shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -285,6 +338,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -301,6 +355,7 @@ public void setShopperName(Name shopperName) { */ public FundRecipient shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -336,6 +391,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -348,6 +404,7 @@ public void setShopperReference(String shopperReference) { */ public FundRecipient storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -375,6 +432,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -385,6 +443,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public FundRecipient subMerchant(SubMerchant subMerchant) { this.subMerchant = subMerchant; + isSetSubMerchant = true; // mark as set return this; } @@ -408,6 +467,7 @@ public SubMerchant getSubMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchant(SubMerchant subMerchant) { this.subMerchant = subMerchant; + isSetSubMerchant = true; // mark as set } /** @@ -418,6 +478,7 @@ public void setSubMerchant(SubMerchant subMerchant) { */ public FundRecipient telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -441,6 +502,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -453,6 +515,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public FundRecipient walletIdentifier(String walletIdentifier) { this.walletIdentifier = walletIdentifier; + isSetWalletIdentifier = true; // mark as set return this; } @@ -480,6 +543,7 @@ public String getWalletIdentifier() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWalletIdentifier(String walletIdentifier) { this.walletIdentifier = walletIdentifier; + isSetWalletIdentifier = true; // mark as set } /** @@ -490,6 +554,7 @@ public void setWalletIdentifier(String walletIdentifier) { */ public FundRecipient walletOwnerTaxId(String walletOwnerTaxId) { this.walletOwnerTaxId = walletOwnerTaxId; + isSetWalletOwnerTaxId = true; // mark as set return this; } @@ -513,6 +578,7 @@ public String getWalletOwnerTaxId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWalletOwnerTaxId(String walletOwnerTaxId) { this.walletOwnerTaxId = walletOwnerTaxId; + isSetWalletOwnerTaxId = true; // mark as set } /** @@ -523,6 +589,7 @@ public void setWalletOwnerTaxId(String walletOwnerTaxId) { */ public FundRecipient walletPurpose(WalletPurposeEnum walletPurpose) { this.walletPurpose = walletPurpose; + isSetWalletPurpose = true; // mark as set return this; } @@ -546,6 +613,27 @@ public WalletPurposeEnum getWalletPurpose() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWalletPurpose(WalletPurposeEnum walletPurpose) { this.walletPurpose = walletPurpose; + isSetWalletPurpose = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FundRecipient 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 FundRecipient object is equal to o. */ @@ -621,6 +709,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 (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + 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 (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetSubMerchant) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT, this.subMerchant); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetWalletIdentifier) { + addIfNull(nulls, JSON_PROPERTY_WALLET_IDENTIFIER, this.walletIdentifier); + } + if (isSetWalletOwnerTaxId) { + addIfNull(nulls, JSON_PROPERTY_WALLET_OWNER_TAX_ID, this.walletOwnerTaxId); + } + 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 FundRecipient given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/GenericIssuerPaymentMethodDetails.java b/src/main/java/com/adyen/model/checkout/GenericIssuerPaymentMethodDetails.java index fac91915d..43c2de549 100644 --- a/src/main/java/com/adyen/model/checkout/GenericIssuerPaymentMethodDetails.java +++ b/src/main/java/com/adyen/model/checkout/GenericIssuerPaymentMethodDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,19 +36,34 @@ public class GenericIssuerPaymentMethodDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **genericissuer** */ public enum TypeEnum { ONLINEBANKING_PL(String.valueOf("onlineBanking_PL")), @@ -97,6 +114,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 GenericIssuerPaymentMethodDetails() {} /** @@ -108,6 +134,7 @@ public GenericIssuerPaymentMethodDetails() {} */ public GenericIssuerPaymentMethodDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -131,6 +158,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -142,6 +170,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public GenericIssuerPaymentMethodDetails issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -165,6 +194,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -181,6 +211,7 @@ public void setIssuer(String issuer) { public GenericIssuerPaymentMethodDetails recurringDetailReference( String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -212,6 +243,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -223,6 +255,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public GenericIssuerPaymentMethodDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -247,6 +280,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -260,6 +294,7 @@ public void setSdkData(String sdkData) { */ public GenericIssuerPaymentMethodDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -287,6 +322,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -298,6 +334,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public GenericIssuerPaymentMethodDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -321,6 +358,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 GenericIssuerPaymentMethodDetails 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 GenericIssuerPaymentMethodDetails object is equal to o. */ @@ -380,6 +438,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 GenericIssuerPaymentMethodDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/GooglePayDetails.java b/src/main/java/com/adyen/model/checkout/GooglePayDetails.java index deb73e02a..df2499e46 100644 --- a/src/main/java/com/adyen/model/checkout/GooglePayDetails.java +++ b/src/main/java/com/adyen/model/checkout/GooglePayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 GooglePayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = 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**. @@ -84,25 +89,46 @@ 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_GOOGLE_PAY_CARD_NETWORK = "googlePayCardNetwork"; private String googlePayCardNetwork; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGooglePayCardNetwork = false; + public static final String JSON_PROPERTY_GOOGLE_PAY_TOKEN = "googlePayToken"; private String googlePayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGooglePayToken = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_THREE_D_S2_SDK_VERSION = "threeDS2SdkVersion"; private String threeDS2SdkVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2SdkVersion = false; + /** **googlepay**, **paywithgoogle** */ public enum TypeEnum { GOOGLEPAY(String.valueOf("googlepay")); @@ -145,6 +171,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 GooglePayDetails() {} /** @@ -155,6 +190,7 @@ public GooglePayDetails() {} */ public GooglePayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -178,6 +214,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -191,6 +228,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public GooglePayDetails fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -220,6 +258,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -230,6 +269,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public GooglePayDetails googlePayCardNetwork(String googlePayCardNetwork) { this.googlePayCardNetwork = googlePayCardNetwork; + isSetGooglePayCardNetwork = true; // mark as set return this; } @@ -253,6 +293,7 @@ public String getGooglePayCardNetwork() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGooglePayCardNetwork(String googlePayCardNetwork) { this.googlePayCardNetwork = googlePayCardNetwork; + isSetGooglePayCardNetwork = true; // mark as set } /** @@ -267,6 +308,7 @@ public void setGooglePayCardNetwork(String googlePayCardNetwork) { */ public GooglePayDetails googlePayToken(String googlePayToken) { this.googlePayToken = googlePayToken; + isSetGooglePayToken = true; // mark as set return this; } @@ -298,6 +340,7 @@ public String getGooglePayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGooglePayToken(String googlePayToken) { this.googlePayToken = googlePayToken; + isSetGooglePayToken = true; // mark as set } /** @@ -312,6 +355,7 @@ public void setGooglePayToken(String googlePayToken) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public GooglePayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -343,6 +387,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -353,6 +398,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public GooglePayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -377,6 +423,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -389,6 +436,7 @@ public void setSdkData(String sdkData) { */ public GooglePayDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -416,6 +464,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -427,6 +476,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public GooglePayDetails threeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set return this; } @@ -452,6 +502,7 @@ public String getThreeDS2SdkVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set } /** @@ -462,6 +513,7 @@ public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { */ public GooglePayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -485,6 +537,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 GooglePayDetails 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 GooglePayDetails object is equal to o. */ @@ -555,6 +628,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetGooglePayCardNetwork) { + addIfNull(nulls, JSON_PROPERTY_GOOGLE_PAY_CARD_NETWORK, this.googlePayCardNetwork); + } + if (isSetGooglePayToken) { + addIfNull(nulls, JSON_PROPERTY_GOOGLE_PAY_TOKEN, this.googlePayToken); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetThreeDS2SdkVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_SDK_VERSION, this.threeDS2SdkVersion); + } + 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 GooglePayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/GooglePayDonations.java b/src/main/java/com/adyen/model/checkout/GooglePayDonations.java index 825b39743..c72d83268 100644 --- a/src/main/java/com/adyen/model/checkout/GooglePayDonations.java +++ b/src/main/java/com/adyen/model/checkout/GooglePayDonations.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 GooglePayDonations { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = 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**. @@ -84,25 +89,46 @@ 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_GOOGLE_PAY_CARD_NETWORK = "googlePayCardNetwork"; private String googlePayCardNetwork; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGooglePayCardNetwork = false; + public static final String JSON_PROPERTY_GOOGLE_PAY_TOKEN = "googlePayToken"; private String googlePayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGooglePayToken = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_THREE_D_S2_SDK_VERSION = "threeDS2SdkVersion"; private String threeDS2SdkVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2SdkVersion = false; + /** **googlepay**, **paywithgoogle** */ public enum TypeEnum { GOOGLEPAY(String.valueOf("googlepay")); @@ -145,6 +171,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 GooglePayDonations() {} /** @@ -155,6 +190,7 @@ public GooglePayDonations() {} */ public GooglePayDonations checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -178,6 +214,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -191,6 +228,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public GooglePayDonations fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -220,6 +258,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -230,6 +269,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public GooglePayDonations googlePayCardNetwork(String googlePayCardNetwork) { this.googlePayCardNetwork = googlePayCardNetwork; + isSetGooglePayCardNetwork = true; // mark as set return this; } @@ -253,6 +293,7 @@ public String getGooglePayCardNetwork() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGooglePayCardNetwork(String googlePayCardNetwork) { this.googlePayCardNetwork = googlePayCardNetwork; + isSetGooglePayCardNetwork = true; // mark as set } /** @@ -267,6 +308,7 @@ public void setGooglePayCardNetwork(String googlePayCardNetwork) { */ public GooglePayDonations googlePayToken(String googlePayToken) { this.googlePayToken = googlePayToken; + isSetGooglePayToken = true; // mark as set return this; } @@ -298,6 +340,7 @@ public String getGooglePayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGooglePayToken(String googlePayToken) { this.googlePayToken = googlePayToken; + isSetGooglePayToken = true; // mark as set } /** @@ -312,6 +355,7 @@ public void setGooglePayToken(String googlePayToken) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public GooglePayDonations recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -343,6 +387,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -353,6 +398,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public GooglePayDonations sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -377,6 +423,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -389,6 +436,7 @@ public void setSdkData(String sdkData) { */ public GooglePayDonations storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -416,6 +464,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -427,6 +476,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public GooglePayDonations threeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set return this; } @@ -452,6 +502,7 @@ public String getThreeDS2SdkVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set } /** @@ -462,6 +513,7 @@ public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { */ public GooglePayDonations type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -485,6 +537,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 GooglePayDonations 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 GooglePayDonations object is equal to o. */ @@ -556,6 +629,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetGooglePayCardNetwork) { + addIfNull(nulls, JSON_PROPERTY_GOOGLE_PAY_CARD_NETWORK, this.googlePayCardNetwork); + } + if (isSetGooglePayToken) { + addIfNull(nulls, JSON_PROPERTY_GOOGLE_PAY_TOKEN, this.googlePayToken); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetThreeDS2SdkVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_SDK_VERSION, this.threeDS2SdkVersion); + } + 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 GooglePayDonations given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/IdealDetails.java b/src/main/java/com/adyen/model/checkout/IdealDetails.java index 02327e6fe..c30081483 100644 --- a/src/main/java/com/adyen/model/checkout/IdealDetails.java +++ b/src/main/java/com/adyen/model/checkout/IdealDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,19 +36,34 @@ public class IdealDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **ideal** */ public enum TypeEnum { IDEAL(String.valueOf("ideal")); @@ -89,6 +106,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 IdealDetails() {} /** @@ -99,6 +125,7 @@ public IdealDetails() {} */ public IdealDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -134,6 +162,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public IdealDetails issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -161,6 +190,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -175,6 +205,7 @@ public void setIssuer(String issuer) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public IdealDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -206,6 +237,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -216,6 +248,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public IdealDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -240,6 +273,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -252,6 +286,7 @@ public void setSdkData(String sdkData) { */ public IdealDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -279,6 +314,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -289,6 +325,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public IdealDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -312,6 +349,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 IdealDetails 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 IdealDetails object is equal to o. */ @@ -366,6 +424,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 IdealDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/IdealDonations.java b/src/main/java/com/adyen/model/checkout/IdealDonations.java index 9db35edf2..50cbb043c 100644 --- a/src/main/java/com/adyen/model/checkout/IdealDonations.java +++ b/src/main/java/com/adyen/model/checkout/IdealDonations.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,19 +36,34 @@ public class IdealDonations { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **ideal** */ public enum TypeEnum { IDEAL(String.valueOf("ideal")); @@ -89,6 +106,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 IdealDonations() {} /** @@ -99,6 +125,7 @@ public IdealDonations() {} */ public IdealDonations checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -134,6 +162,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public IdealDonations issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -161,6 +190,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -175,6 +205,7 @@ public void setIssuer(String issuer) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public IdealDonations recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -206,6 +237,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -216,6 +248,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public IdealDonations sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -240,6 +273,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -252,6 +286,7 @@ public void setSdkData(String sdkData) { */ public IdealDonations storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -279,6 +314,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -289,6 +325,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public IdealDonations type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -312,6 +349,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 IdealDonations 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 IdealDonations object is equal to o. */ @@ -366,6 +424,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 IdealDonations given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/InputDetail.java b/src/main/java/com/adyen/model/checkout/InputDetail.java index efb11c939..e406299b4 100644 --- a/src/main/java/com/adyen/model/checkout/InputDetail.java +++ b/src/main/java/com/adyen/model/checkout/InputDetail.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,31 +39,64 @@ public class InputDetail { public static final String JSON_PROPERTY_CONFIGURATION = "configuration"; private Map configuration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConfiguration = false; + public static final String JSON_PROPERTY_DETAILS = "details"; private List details; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetails = false; + public static final String JSON_PROPERTY_INPUT_DETAILS = "inputDetails"; @Deprecated // deprecated private List inputDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInputDetails = false; + public static final String JSON_PROPERTY_ITEM_SEARCH_URL = "itemSearchUrl"; private String itemSearchUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetItemSearchUrl = false; + public static final String JSON_PROPERTY_ITEMS = "items"; private List items; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetItems = false; + public static final String JSON_PROPERTY_KEY = "key"; private String key; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetKey = false; + public static final String JSON_PROPERTY_OPTIONAL = "optional"; private Boolean optional; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOptional = 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_VALUE = "value"; private String 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 InputDetail() {} /** @@ -72,6 +107,7 @@ public InputDetail() {} */ public InputDetail configuration(Map configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set return this; } @@ -103,6 +139,7 @@ public Map getConfiguration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConfiguration(Map configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set } /** @@ -113,6 +150,7 @@ public void setConfiguration(Map configuration) { */ public InputDetail details(List details) { this.details = details; + isSetDetails = true; // mark as set return this; } @@ -144,6 +182,7 @@ public List getDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetails(List details) { this.details = details; + isSetDetails = true; // mark as set } /** @@ -156,6 +195,7 @@ public void setDetails(List details) { @Deprecated // deprecated public InputDetail inputDetails(List inputDetails) { this.inputDetails = inputDetails; + isSetInputDetails = true; // mark as set return this; } @@ -191,6 +231,7 @@ public List getInputDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInputDetails(List inputDetails) { this.inputDetails = inputDetails; + isSetInputDetails = true; // mark as set } /** @@ -201,6 +242,7 @@ public void setInputDetails(List inputDetails) { */ public InputDetail itemSearchUrl(String itemSearchUrl) { this.itemSearchUrl = itemSearchUrl; + isSetItemSearchUrl = true; // mark as set return this; } @@ -224,6 +266,7 @@ public String getItemSearchUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setItemSearchUrl(String itemSearchUrl) { this.itemSearchUrl = itemSearchUrl; + isSetItemSearchUrl = true; // mark as set } /** @@ -234,6 +277,7 @@ public void setItemSearchUrl(String itemSearchUrl) { */ public InputDetail items(List items) { this.items = items; + isSetItems = true; // mark as set return this; } @@ -265,6 +309,7 @@ public List getItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setItems(List items) { this.items = items; + isSetItems = true; // mark as set } /** @@ -275,6 +320,7 @@ public void setItems(List items) { */ public InputDetail key(String key) { this.key = key; + isSetKey = true; // mark as set return this; } @@ -298,6 +344,7 @@ public String getKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setKey(String key) { this.key = key; + isSetKey = true; // mark as set } /** @@ -308,6 +355,7 @@ public void setKey(String key) { */ public InputDetail optional(Boolean optional) { this.optional = optional; + isSetOptional = true; // mark as set return this; } @@ -331,6 +379,7 @@ public Boolean getOptional() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOptional(Boolean optional) { this.optional = optional; + isSetOptional = true; // mark as set } /** @@ -341,6 +390,7 @@ public void setOptional(Boolean optional) { */ public InputDetail type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -364,6 +414,7 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set } /** @@ -374,6 +425,7 @@ public void setType(String type) { */ public InputDetail value(String value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -397,6 +449,27 @@ public String getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(String value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InputDetail 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 InputDetail object is equal to o. */ @@ -453,6 +526,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 (isSetConfiguration) { + addIfNull(nulls, JSON_PROPERTY_CONFIGURATION, this.configuration); + } + if (isSetDetails) { + addIfNull(nulls, JSON_PROPERTY_DETAILS, this.details); + } + if (isSetInputDetails) { + addIfNull(nulls, JSON_PROPERTY_INPUT_DETAILS, this.inputDetails); + } + if (isSetItemSearchUrl) { + addIfNull(nulls, JSON_PROPERTY_ITEM_SEARCH_URL, this.itemSearchUrl); + } + if (isSetItems) { + addIfNull(nulls, JSON_PROPERTY_ITEMS, this.items); + } + if (isSetKey) { + addIfNull(nulls, JSON_PROPERTY_KEY, this.key); + } + if (isSetOptional) { + addIfNull(nulls, JSON_PROPERTY_OPTIONAL, this.optional); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + 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 InputDetail given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/InstallmentOption.java b/src/main/java/com/adyen/model/checkout/InstallmentOption.java index 93ecc477e..f5d22d818 100644 --- a/src/main/java/com/adyen/model/checkout/InstallmentOption.java +++ b/src/main/java/com/adyen/model/checkout/InstallmentOption.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 InstallmentOption { public static final String JSON_PROPERTY_MAX_VALUE = "maxValue"; private Integer maxValue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaxValue = false; + /** Gets or Sets plans */ public enum PlansEnum { BONUS(String.valueOf("bonus")), @@ -94,12 +99,27 @@ public static PlansEnum fromValue(String value) { public static final String JSON_PROPERTY_PLANS = "plans"; private List plans; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlans = false; + public static final String JSON_PROPERTY_PRESELECTED_VALUE = "preselectedValue"; private Integer preselectedValue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPreselectedValue = false; + public static final String JSON_PROPERTY_VALUES = "values"; private List values; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValues = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public InstallmentOption() {} /** @@ -110,6 +130,7 @@ public InstallmentOption() {} */ public InstallmentOption maxValue(Integer maxValue) { this.maxValue = maxValue; + isSetMaxValue = true; // mark as set return this; } @@ -133,6 +154,7 @@ public Integer getMaxValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaxValue(Integer maxValue) { this.maxValue = maxValue; + isSetMaxValue = true; // mark as set } /** @@ -145,6 +167,7 @@ public void setMaxValue(Integer maxValue) { */ public InstallmentOption plans(List plans) { this.plans = plans; + isSetPlans = true; // mark as set return this; } @@ -180,6 +203,7 @@ public List getPlans() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlans(List plans) { this.plans = plans; + isSetPlans = true; // mark as set } /** @@ -190,6 +214,7 @@ public void setPlans(List plans) { */ public InstallmentOption preselectedValue(Integer preselectedValue) { this.preselectedValue = preselectedValue; + isSetPreselectedValue = true; // mark as set return this; } @@ -213,6 +238,7 @@ public Integer getPreselectedValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPreselectedValue(Integer preselectedValue) { this.preselectedValue = preselectedValue; + isSetPreselectedValue = true; // mark as set } /** @@ -225,6 +251,7 @@ public void setPreselectedValue(Integer preselectedValue) { */ public InstallmentOption values(List values) { this.values = values; + isSetValues = true; // mark as set return this; } @@ -260,6 +287,27 @@ public List getValues() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValues(List values) { this.values = values; + isSetValues = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InstallmentOption 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 InstallmentOption object is equal to o. */ @@ -305,6 +353,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 (isSetMaxValue) { + addIfNull(nulls, JSON_PROPERTY_MAX_VALUE, this.maxValue); + } + if (isSetPlans) { + addIfNull(nulls, JSON_PROPERTY_PLANS, this.plans); + } + if (isSetPreselectedValue) { + addIfNull(nulls, JSON_PROPERTY_PRESELECTED_VALUE, this.preselectedValue); + } + if (isSetValues) { + addIfNull(nulls, JSON_PROPERTY_VALUES, this.values); + } + + 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 InstallmentOption given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Installments.java b/src/main/java/com/adyen/model/checkout/Installments.java index aadb2e868..5bdcb574f 100644 --- a/src/main/java/com/adyen/model/checkout/Installments.java +++ b/src/main/java/com/adyen/model/checkout/Installments.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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. */ @@ -296,6 +339,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/checkout/InvalidField.java b/src/main/java/com/adyen/model/checkout/InvalidField.java index 715211f87..4e5309138 100644 --- a/src/main/java/com/adyen/model/checkout/InvalidField.java +++ b/src/main/java/com/adyen/model/checkout/InvalidField.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 InvalidField { 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_VALUE = "value"; private String value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public InvalidField() {} /** @@ -43,6 +60,7 @@ public InvalidField() {} */ public InvalidField name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setName(String name) { */ public InvalidField value(String value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(String value) { this.value = value; + isSetValue = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setValue(String value) { */ public InvalidField message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InvalidField 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 InvalidField object is equal to o. */ @@ -175,6 +218,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 (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + + 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 InvalidField given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Item.java b/src/main/java/com/adyen/model/checkout/Item.java index 49ba2aae0..214aa7c5a 100644 --- a/src/main/java/com/adyen/model/checkout/Item.java +++ b/src/main/java/com/adyen/model/checkout/Item.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 Item { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_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 Item() {} /** @@ -36,6 +50,7 @@ public Item() {} */ public Item id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setId(String id) { */ public Item name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -92,6 +109,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 Item 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 Item object is equal to o. */ @@ -132,6 +170,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + 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 Item given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/KlarnaDetails.java b/src/main/java/com/adyen/model/checkout/KlarnaDetails.java index 8ce91db46..3d47071c1 100644 --- a/src/main/java/com/adyen/model/checkout/KlarnaDetails.java +++ b/src/main/java/com/adyen/model/checkout/KlarnaDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,28 +39,52 @@ public class KlarnaDetails { public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private String billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private String deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_PERSONAL_DETAILS = "personalDetails"; private String personalDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPersonalDetails = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_SUBTYPE = "subtype"; private String subtype; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubtype = false; + /** **klarna** */ public enum TypeEnum { KLARNA(String.valueOf("klarna")), @@ -113,6 +139,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 KlarnaDetails() {} /** @@ -123,6 +158,7 @@ public KlarnaDetails() {} */ public KlarnaDetails billingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -146,6 +182,7 @@ public String getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -156,6 +193,7 @@ public void setBillingAddress(String billingAddress) { */ public KlarnaDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -179,6 +217,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -189,6 +228,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public KlarnaDetails deliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -212,6 +252,7 @@ public String getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -222,6 +263,7 @@ public void setDeliveryAddress(String deliveryAddress) { */ public KlarnaDetails personalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set return this; } @@ -245,6 +287,7 @@ public String getPersonalDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPersonalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set } /** @@ -259,6 +302,7 @@ public void setPersonalDetails(String personalDetails) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public KlarnaDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -290,6 +334,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -300,6 +345,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public KlarnaDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -324,6 +370,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -336,6 +383,7 @@ public void setSdkData(String sdkData) { */ public KlarnaDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -363,6 +411,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -373,6 +422,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public KlarnaDetails subtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set return this; } @@ -396,6 +446,7 @@ public String getSubtype() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set } /** @@ -406,6 +457,7 @@ public void setSubtype(String subtype) { */ public KlarnaDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -429,6 +481,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 KlarnaDetails 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 KlarnaDetails object is equal to o. */ @@ -497,6 +570,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 (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetPersonalDetails) { + addIfNull(nulls, JSON_PROPERTY_PERSONAL_DETAILS, this.personalDetails); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetSubtype) { + addIfNull(nulls, JSON_PROPERTY_SUBTYPE, this.subtype); + } + 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 KlarnaDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Leg.java b/src/main/java/com/adyen/model/checkout/Leg.java index ded1d82ab..1b1c5bc5b 100644 --- a/src/main/java/com/adyen/model/checkout/Leg.java +++ b/src/main/java/com/adyen/model/checkout/Leg.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,30 +36,63 @@ public class Leg { public static final String JSON_PROPERTY_CARRIER_CODE = "carrierCode"; private String carrierCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarrierCode = false; + public static final String JSON_PROPERTY_CLASS_OF_TRAVEL = "classOfTravel"; private String classOfTravel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClassOfTravel = false; + public static final String JSON_PROPERTY_DATE_OF_TRAVEL = "dateOfTravel"; private OffsetDateTime dateOfTravel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfTravel = false; + public static final String JSON_PROPERTY_DEPARTURE_AIRPORT_CODE = "departureAirportCode"; private String departureAirportCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDepartureAirportCode = false; + public static final String JSON_PROPERTY_DEPARTURE_TAX = "departureTax"; private Long departureTax; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDepartureTax = false; + public static final String JSON_PROPERTY_DESTINATION_AIRPORT_CODE = "destinationAirportCode"; private String destinationAirportCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDestinationAirportCode = false; + public static final String JSON_PROPERTY_FARE_BASIS_CODE = "fareBasisCode"; private String fareBasisCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFareBasisCode = false; + public static final String JSON_PROPERTY_FLIGHT_NUMBER = "flightNumber"; private String flightNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFlightNumber = false; + public static final String JSON_PROPERTY_STOP_OVER_CODE = "stopOverCode"; private String stopOverCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStopOverCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Leg() {} /** @@ -74,6 +109,7 @@ public Leg() {} */ public Leg carrierCode(String carrierCode) { this.carrierCode = carrierCode; + isSetCarrierCode = true; // mark as set return this; } @@ -109,6 +145,7 @@ public String getCarrierCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarrierCode(String carrierCode) { this.carrierCode = carrierCode; + isSetCarrierCode = true; // mark as set } /** @@ -124,6 +161,7 @@ public void setCarrierCode(String carrierCode) { */ public Leg classOfTravel(String classOfTravel) { this.classOfTravel = classOfTravel; + isSetClassOfTravel = true; // mark as set return this; } @@ -157,6 +195,7 @@ public String getClassOfTravel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClassOfTravel(String classOfTravel) { this.classOfTravel = classOfTravel; + isSetClassOfTravel = true; // mark as set } /** @@ -169,6 +208,7 @@ public void setClassOfTravel(String classOfTravel) { */ public Leg dateOfTravel(OffsetDateTime dateOfTravel) { this.dateOfTravel = dateOfTravel; + isSetDateOfTravel = true; // mark as set return this; } @@ -196,6 +236,7 @@ public OffsetDateTime getDateOfTravel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfTravel(OffsetDateTime dateOfTravel) { this.dateOfTravel = dateOfTravel; + isSetDateOfTravel = true; // mark as set } /** @@ -213,6 +254,7 @@ public void setDateOfTravel(OffsetDateTime dateOfTravel) { */ public Leg departureAirportCode(String departureAirportCode) { this.departureAirportCode = departureAirportCode; + isSetDepartureAirportCode = true; // mark as set return this; } @@ -250,6 +292,7 @@ public String getDepartureAirportCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDepartureAirportCode(String departureAirportCode) { this.departureAirportCode = departureAirportCode; + isSetDepartureAirportCode = true; // mark as set } /** @@ -264,6 +307,7 @@ public void setDepartureAirportCode(String departureAirportCode) { */ public Leg departureTax(Long departureTax) { this.departureTax = departureTax; + isSetDepartureTax = true; // mark as set return this; } @@ -295,6 +339,7 @@ public Long getDepartureTax() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDepartureTax(Long departureTax) { this.departureTax = departureTax; + isSetDepartureTax = true; // mark as set } /** @@ -312,6 +357,7 @@ public void setDepartureTax(Long departureTax) { */ public Leg destinationAirportCode(String destinationAirportCode) { this.destinationAirportCode = destinationAirportCode; + isSetDestinationAirportCode = true; // mark as set return this; } @@ -349,6 +395,7 @@ public String getDestinationAirportCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDestinationAirportCode(String destinationAirportCode) { this.destinationAirportCode = destinationAirportCode; + isSetDestinationAirportCode = true; // mark as set } /** @@ -363,6 +410,7 @@ public void setDestinationAirportCode(String destinationAirportCode) { */ public Leg fareBasisCode(String fareBasisCode) { this.fareBasisCode = fareBasisCode; + isSetFareBasisCode = true; // mark as set return this; } @@ -394,6 +442,7 @@ public String getFareBasisCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFareBasisCode(String fareBasisCode) { this.fareBasisCode = fareBasisCode; + isSetFareBasisCode = true; // mark as set } /** @@ -406,6 +455,7 @@ public void setFareBasisCode(String fareBasisCode) { */ public Leg flightNumber(String flightNumber) { this.flightNumber = flightNumber; + isSetFlightNumber = true; // mark as set return this; } @@ -433,6 +483,7 @@ public String getFlightNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFlightNumber(String flightNumber) { this.flightNumber = flightNumber; + isSetFlightNumber = true; // mark as set } /** @@ -447,6 +498,7 @@ public void setFlightNumber(String flightNumber) { */ public Leg stopOverCode(String stopOverCode) { this.stopOverCode = stopOverCode; + isSetStopOverCode = true; // mark as set return this; } @@ -478,6 +530,27 @@ public String getStopOverCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStopOverCode(String stopOverCode) { this.stopOverCode = stopOverCode; + isSetStopOverCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Leg 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 Leg object is equal to o. */ @@ -546,6 +619,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 (isSetCarrierCode) { + addIfNull(nulls, JSON_PROPERTY_CARRIER_CODE, this.carrierCode); + } + if (isSetClassOfTravel) { + addIfNull(nulls, JSON_PROPERTY_CLASS_OF_TRAVEL, this.classOfTravel); + } + if (isSetDateOfTravel) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_TRAVEL, this.dateOfTravel); + } + if (isSetDepartureAirportCode) { + addIfNull(nulls, JSON_PROPERTY_DEPARTURE_AIRPORT_CODE, this.departureAirportCode); + } + if (isSetDepartureTax) { + addIfNull(nulls, JSON_PROPERTY_DEPARTURE_TAX, this.departureTax); + } + if (isSetDestinationAirportCode) { + addIfNull(nulls, JSON_PROPERTY_DESTINATION_AIRPORT_CODE, this.destinationAirportCode); + } + if (isSetFareBasisCode) { + addIfNull(nulls, JSON_PROPERTY_FARE_BASIS_CODE, this.fareBasisCode); + } + if (isSetFlightNumber) { + addIfNull(nulls, JSON_PROPERTY_FLIGHT_NUMBER, this.flightNumber); + } + if (isSetStopOverCode) { + addIfNull(nulls, JSON_PROPERTY_STOP_OVER_CODE, this.stopOverCode); + } + + 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 Leg given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/LineItem.java b/src/main/java/com/adyen/model/checkout/LineItem.java index 69b792684..188394cde 100644 --- a/src/main/java/com/adyen/model/checkout/LineItem.java +++ b/src/main/java/com/adyen/model/checkout/LineItem.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,57 +44,117 @@ public class LineItem { public static final String JSON_PROPERTY_AMOUNT_EXCLUDING_TAX = "amountExcludingTax"; private Long amountExcludingTax; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountExcludingTax = false; + public static final String JSON_PROPERTY_AMOUNT_INCLUDING_TAX = "amountIncludingTax"; private Long amountIncludingTax; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountIncludingTax = false; + public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_COLOR = "color"; private String color; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetColor = 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_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_IMAGE_URL = "imageUrl"; private String imageUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetImageUrl = false; + public static final String JSON_PROPERTY_ITEM_CATEGORY = "itemCategory"; private String itemCategory; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetItemCategory = false; + public static final String JSON_PROPERTY_MANUFACTURER = "manufacturer"; private String manufacturer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetManufacturer = false; + public static final String JSON_PROPERTY_MARKETPLACE_SELLER_ID = "marketplaceSellerId"; private String marketplaceSellerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMarketplaceSellerId = false; + public static final String JSON_PROPERTY_PRODUCT_URL = "productUrl"; private String productUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProductUrl = false; + public static final String JSON_PROPERTY_QUANTITY = "quantity"; private Long quantity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetQuantity = false; + public static final String JSON_PROPERTY_RECEIVER_EMAIL = "receiverEmail"; private String receiverEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReceiverEmail = false; + public static final String JSON_PROPERTY_SIZE = "size"; private String size; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSize = false; + public static final String JSON_PROPERTY_SKU = "sku"; private String sku; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSku = false; + public static final String JSON_PROPERTY_TAX_AMOUNT = "taxAmount"; private Long taxAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxAmount = false; + public static final String JSON_PROPERTY_TAX_PERCENTAGE = "taxPercentage"; private Long taxPercentage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxPercentage = false; + public static final String JSON_PROPERTY_UPC = "upc"; private String upc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUpc = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public LineItem() {} /** @@ -103,6 +165,7 @@ public LineItem() {} */ public LineItem amountExcludingTax(Long amountExcludingTax) { this.amountExcludingTax = amountExcludingTax; + isSetAmountExcludingTax = true; // mark as set return this; } @@ -126,6 +189,7 @@ public Long getAmountExcludingTax() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountExcludingTax(Long amountExcludingTax) { this.amountExcludingTax = amountExcludingTax; + isSetAmountExcludingTax = true; // mark as set } /** @@ -136,6 +200,7 @@ public void setAmountExcludingTax(Long amountExcludingTax) { */ public LineItem amountIncludingTax(Long amountIncludingTax) { this.amountIncludingTax = amountIncludingTax; + isSetAmountIncludingTax = true; // mark as set return this; } @@ -159,6 +224,7 @@ public Long getAmountIncludingTax() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountIncludingTax(Long amountIncludingTax) { this.amountIncludingTax = amountIncludingTax; + isSetAmountIncludingTax = true; // mark as set } /** @@ -169,6 +235,7 @@ public void setAmountIncludingTax(Long amountIncludingTax) { */ public LineItem brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -192,6 +259,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -202,6 +270,7 @@ public void setBrand(String brand) { */ public LineItem color(String color) { this.color = color; + isSetColor = true; // mark as set return this; } @@ -225,6 +294,7 @@ public String getColor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setColor(String color) { this.color = color; + isSetColor = true; // mark as set } /** @@ -235,6 +305,7 @@ public void setColor(String color) { */ public LineItem description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -258,6 +329,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -268,6 +340,7 @@ public void setDescription(String description) { */ public LineItem id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -291,6 +364,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -301,6 +375,7 @@ public void setId(String id) { */ public LineItem imageUrl(String imageUrl) { this.imageUrl = imageUrl; + isSetImageUrl = true; // mark as set return this; } @@ -324,6 +399,7 @@ public String getImageUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setImageUrl(String imageUrl) { this.imageUrl = imageUrl; + isSetImageUrl = true; // mark as set } /** @@ -334,6 +410,7 @@ public void setImageUrl(String imageUrl) { */ public LineItem itemCategory(String itemCategory) { this.itemCategory = itemCategory; + isSetItemCategory = true; // mark as set return this; } @@ -357,6 +434,7 @@ public String getItemCategory() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setItemCategory(String itemCategory) { this.itemCategory = itemCategory; + isSetItemCategory = true; // mark as set } /** @@ -367,6 +445,7 @@ public void setItemCategory(String itemCategory) { */ public LineItem manufacturer(String manufacturer) { this.manufacturer = manufacturer; + isSetManufacturer = true; // mark as set return this; } @@ -390,6 +469,7 @@ public String getManufacturer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setManufacturer(String manufacturer) { this.manufacturer = manufacturer; + isSetManufacturer = true; // mark as set } /** @@ -400,6 +480,7 @@ public void setManufacturer(String manufacturer) { */ public LineItem marketplaceSellerId(String marketplaceSellerId) { this.marketplaceSellerId = marketplaceSellerId; + isSetMarketplaceSellerId = true; // mark as set return this; } @@ -423,6 +504,7 @@ public String getMarketplaceSellerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMarketplaceSellerId(String marketplaceSellerId) { this.marketplaceSellerId = marketplaceSellerId; + isSetMarketplaceSellerId = true; // mark as set } /** @@ -433,6 +515,7 @@ public void setMarketplaceSellerId(String marketplaceSellerId) { */ public LineItem productUrl(String productUrl) { this.productUrl = productUrl; + isSetProductUrl = true; // mark as set return this; } @@ -456,6 +539,7 @@ public String getProductUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProductUrl(String productUrl) { this.productUrl = productUrl; + isSetProductUrl = true; // mark as set } /** @@ -466,6 +550,7 @@ public void setProductUrl(String productUrl) { */ public LineItem quantity(Long quantity) { this.quantity = quantity; + isSetQuantity = true; // mark as set return this; } @@ -489,6 +574,7 @@ public Long getQuantity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setQuantity(Long quantity) { this.quantity = quantity; + isSetQuantity = true; // mark as set } /** @@ -500,6 +586,7 @@ public void setQuantity(Long quantity) { */ public LineItem receiverEmail(String receiverEmail) { this.receiverEmail = receiverEmail; + isSetReceiverEmail = true; // mark as set return this; } @@ -525,6 +612,7 @@ public String getReceiverEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReceiverEmail(String receiverEmail) { this.receiverEmail = receiverEmail; + isSetReceiverEmail = true; // mark as set } /** @@ -535,6 +623,7 @@ public void setReceiverEmail(String receiverEmail) { */ public LineItem size(String size) { this.size = size; + isSetSize = true; // mark as set return this; } @@ -558,6 +647,7 @@ public String getSize() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSize(String size) { this.size = size; + isSetSize = true; // mark as set } /** @@ -568,6 +658,7 @@ public void setSize(String size) { */ public LineItem sku(String sku) { this.sku = sku; + isSetSku = true; // mark as set return this; } @@ -591,6 +682,7 @@ public String getSku() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSku(String sku) { this.sku = sku; + isSetSku = true; // mark as set } /** @@ -601,6 +693,7 @@ public void setSku(String sku) { */ public LineItem taxAmount(Long taxAmount) { this.taxAmount = taxAmount; + isSetTaxAmount = true; // mark as set return this; } @@ -624,6 +717,7 @@ public Long getTaxAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxAmount(Long taxAmount) { this.taxAmount = taxAmount; + isSetTaxAmount = true; // mark as set } /** @@ -634,6 +728,7 @@ public void setTaxAmount(Long taxAmount) { */ public LineItem taxPercentage(Long taxPercentage) { this.taxPercentage = taxPercentage; + isSetTaxPercentage = true; // mark as set return this; } @@ -657,6 +752,7 @@ public Long getTaxPercentage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxPercentage(Long taxPercentage) { this.taxPercentage = taxPercentage; + isSetTaxPercentage = true; // mark as set } /** @@ -667,6 +763,7 @@ public void setTaxPercentage(Long taxPercentage) { */ public LineItem upc(String upc) { this.upc = upc; + isSetUpc = true; // mark as set return this; } @@ -690,6 +787,27 @@ public String getUpc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUpc(String upc) { this.upc = upc; + isSetUpc = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LineItem 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 LineItem object is equal to o. */ @@ -783,6 +901,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 (isSetAmountExcludingTax) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_EXCLUDING_TAX, this.amountExcludingTax); + } + if (isSetAmountIncludingTax) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_INCLUDING_TAX, this.amountIncludingTax); + } + if (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetColor) { + addIfNull(nulls, JSON_PROPERTY_COLOR, this.color); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetImageUrl) { + addIfNull(nulls, JSON_PROPERTY_IMAGE_URL, this.imageUrl); + } + if (isSetItemCategory) { + addIfNull(nulls, JSON_PROPERTY_ITEM_CATEGORY, this.itemCategory); + } + if (isSetManufacturer) { + addIfNull(nulls, JSON_PROPERTY_MANUFACTURER, this.manufacturer); + } + if (isSetMarketplaceSellerId) { + addIfNull(nulls, JSON_PROPERTY_MARKETPLACE_SELLER_ID, this.marketplaceSellerId); + } + if (isSetProductUrl) { + addIfNull(nulls, JSON_PROPERTY_PRODUCT_URL, this.productUrl); + } + if (isSetQuantity) { + addIfNull(nulls, JSON_PROPERTY_QUANTITY, this.quantity); + } + if (isSetReceiverEmail) { + addIfNull(nulls, JSON_PROPERTY_RECEIVER_EMAIL, this.receiverEmail); + } + if (isSetSize) { + addIfNull(nulls, JSON_PROPERTY_SIZE, this.size); + } + if (isSetSku) { + addIfNull(nulls, JSON_PROPERTY_SKU, this.sku); + } + if (isSetTaxAmount) { + addIfNull(nulls, JSON_PROPERTY_TAX_AMOUNT, this.taxAmount); + } + if (isSetTaxPercentage) { + addIfNull(nulls, JSON_PROPERTY_TAX_PERCENTAGE, this.taxPercentage); + } + if (isSetUpc) { + addIfNull(nulls, JSON_PROPERTY_UPC, this.upc); + } + + 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 LineItem given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ListStoredPaymentMethodsResponse.java b/src/main/java/com/adyen/model/checkout/ListStoredPaymentMethodsResponse.java index 1ef85f60a..ec4989b6c 100644 --- a/src/main/java/com/adyen/model/checkout/ListStoredPaymentMethodsResponse.java +++ b/src/main/java/com/adyen/model/checkout/ListStoredPaymentMethodsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,12 +31,27 @@ public class ListStoredPaymentMethodsResponse { 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_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHODS = "storedPaymentMethods"; private List storedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethods = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ListStoredPaymentMethodsResponse() {} /** @@ -46,6 +63,7 @@ public ListStoredPaymentMethodsResponse() {} */ public ListStoredPaymentMethodsResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -69,6 +87,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -84,6 +103,7 @@ public void setMerchantAccount(String merchantAccount) { */ public ListStoredPaymentMethodsResponse shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -115,6 +135,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -127,6 +148,7 @@ public void setShopperReference(String shopperReference) { public ListStoredPaymentMethodsResponse storedPaymentMethods( List storedPaymentMethods) { this.storedPaymentMethods = storedPaymentMethods; + isSetStoredPaymentMethods = true; // mark as set return this; } @@ -159,6 +181,27 @@ public List getStoredPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethods(List storedPaymentMethods) { this.storedPaymentMethods = storedPaymentMethods; + isSetStoredPaymentMethods = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ListStoredPaymentMethodsResponse 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 ListStoredPaymentMethodsResponse object is equal to o. */ @@ -206,6 +249,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 (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetStoredPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHODS, this.storedPaymentMethods); + } + + 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 ListStoredPaymentMethodsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Mandate.java b/src/main/java/com/adyen/model/checkout/Mandate.java index c632e63e0..1487e3e99 100644 --- a/src/main/java/com/adyen/model/checkout/Mandate.java +++ b/src/main/java/com/adyen/model/checkout/Mandate.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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: **adhoc**, **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. */ @@ -623,6 +696,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/checkout/MasterpassDetails.java b/src/main/java/com/adyen/model/checkout/MasterpassDetails.java index 43f4d35e1..37e8efe16 100644 --- a/src/main/java/com/adyen/model/checkout/MasterpassDetails.java +++ b/src/main/java/com/adyen/model/checkout/MasterpassDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 MasterpassDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = 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**. @@ -80,12 +85,21 @@ 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_MASTERPASS_TRANSACTION_ID = "masterpassTransactionId"; private String masterpassTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMasterpassTransactionId = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **masterpass** */ public enum TypeEnum { MASTERPASS(String.valueOf("masterpass")); @@ -128,6 +142,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 MasterpassDetails() {} /** @@ -138,6 +161,7 @@ public MasterpassDetails() {} */ public MasterpassDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -161,6 +185,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -174,6 +199,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public MasterpassDetails fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -203,6 +229,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -213,6 +240,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public MasterpassDetails masterpassTransactionId(String masterpassTransactionId) { this.masterpassTransactionId = masterpassTransactionId; + isSetMasterpassTransactionId = true; // mark as set return this; } @@ -236,6 +264,7 @@ public String getMasterpassTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMasterpassTransactionId(String masterpassTransactionId) { this.masterpassTransactionId = masterpassTransactionId; + isSetMasterpassTransactionId = true; // mark as set } /** @@ -246,6 +275,7 @@ public void setMasterpassTransactionId(String masterpassTransactionId) { */ public MasterpassDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -270,6 +300,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -280,6 +311,7 @@ public void setSdkData(String sdkData) { */ public MasterpassDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -303,6 +335,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 MasterpassDetails 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 MasterpassDetails object is equal to o. */ @@ -352,6 +405,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetMasterpassTransactionId) { + addIfNull(nulls, JSON_PROPERTY_MASTERPASS_TRANSACTION_ID, this.masterpassTransactionId); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + 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 MasterpassDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/MbwayDetails.java b/src/main/java/com/adyen/model/checkout/MbwayDetails.java index 93fde7b67..cb579bd84 100644 --- a/src/main/java/com/adyen/model/checkout/MbwayDetails.java +++ b/src/main/java/com/adyen/model/checkout/MbwayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 MbwayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = 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_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + /** **mbway** */ public enum TypeEnum { MBWAY(String.valueOf("mbway")); @@ -84,6 +98,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 MbwayDetails() {} /** @@ -94,6 +117,7 @@ public MbwayDetails() {} */ public MbwayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -117,6 +141,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -127,6 +152,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public MbwayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -151,6 +177,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -159,6 +186,7 @@ public void setSdkData(String sdkData) { */ public MbwayDetails shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -178,6 +206,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -186,6 +215,7 @@ public void setShopperEmail(String shopperEmail) { */ public MbwayDetails telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -205,6 +235,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -215,6 +246,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public MbwayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -238,6 +270,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 MbwayDetails 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 MbwayDetails object is equal to o. */ @@ -285,6 +338,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + 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 MbwayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/MerchantDevice.java b/src/main/java/com/adyen/model/checkout/MerchantDevice.java index 6e6841e2d..68e95dbb6 100644 --- a/src/main/java/com/adyen/model/checkout/MerchantDevice.java +++ b/src/main/java/com/adyen/model/checkout/MerchantDevice.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -175,6 +218,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/checkout/MerchantRiskIndicator.java b/src/main/java/com/adyen/model/checkout/MerchantRiskIndicator.java index b6486931a..7e488987d 100644 --- a/src/main/java/com/adyen/model/checkout/MerchantRiskIndicator.java +++ b/src/main/java/com/adyen/model/checkout/MerchantRiskIndicator.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 Checkout 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 Checkout 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. */ @@ -812,6 +910,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/checkout/MobilePayDetails.java b/src/main/java/com/adyen/model/checkout/MobilePayDetails.java index fbd744f13..6b0f76f8f 100644 --- a/src/main/java/com/adyen/model/checkout/MobilePayDetails.java +++ b/src/main/java/com/adyen/model/checkout/MobilePayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,9 +33,15 @@ public class MobilePayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **mobilepay** */ public enum TypeEnum { MOBILEPAY(String.valueOf("mobilepay")); @@ -76,6 +84,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 MobilePayDetails() {} /** @@ -86,6 +103,7 @@ public MobilePayDetails() {} */ public MobilePayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -119,6 +138,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public MobilePayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -143,6 +163,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -153,6 +174,7 @@ public void setSdkData(String sdkData) { */ public MobilePayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -176,6 +198,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 MobilePayDetails 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 MobilePayDetails object is equal to o. */ @@ -219,6 +262,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + 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 MobilePayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/MolPayDetails.java b/src/main/java/com/adyen/model/checkout/MolPayDetails.java index 510f3157b..8816bf318 100644 --- a/src/main/java/com/adyen/model/checkout/MolPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/MolPayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -32,12 +34,21 @@ public class MolPayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **molpay** */ public enum TypeEnum { MOLPAY_EBANKING_FPX_MY(String.valueOf("molpay_ebanking_fpx_MY")), @@ -82,6 +93,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MolPayDetails() {} /** @@ -92,6 +112,7 @@ public MolPayDetails() {} */ public MolPayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -115,6 +136,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -126,6 +148,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public MolPayDetails issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -151,6 +174,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -161,6 +185,7 @@ public void setIssuer(String issuer) { */ public MolPayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -185,6 +210,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -195,6 +221,7 @@ public void setSdkData(String sdkData) { */ public MolPayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -218,6 +245,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 MolPayDetails 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 MolPayDetails object is equal to o. */ @@ -263,6 +311,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + 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 MolPayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Name.java b/src/main/java/com/adyen/model/checkout/Name.java index 4c60fa238..14d660d94 100644 --- a/src/main/java/com/adyen/model/checkout/Name.java +++ b/src/main/java/com/adyen/model/checkout/Name.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -133,6 +171,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/checkout/OpenInvoiceDetails.java b/src/main/java/com/adyen/model/checkout/OpenInvoiceDetails.java index b022c35dc..a6832bcf6 100644 --- a/src/main/java/com/adyen/model/checkout/OpenInvoiceDetails.java +++ b/src/main/java/com/adyen/model/checkout/OpenInvoiceDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -36,25 +38,46 @@ public class OpenInvoiceDetails { public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private String billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private String deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_PERSONAL_DETAILS = "personalDetails"; private String personalDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPersonalDetails = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **openinvoice** */ public enum TypeEnum { OPENINVOICE(String.valueOf("openinvoice")), @@ -101,6 +124,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 OpenInvoiceDetails() {} /** @@ -111,6 +143,7 @@ public OpenInvoiceDetails() {} */ public OpenInvoiceDetails billingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -134,6 +167,7 @@ public String getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -144,6 +178,7 @@ public void setBillingAddress(String billingAddress) { */ public OpenInvoiceDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -167,6 +202,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -177,6 +213,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public OpenInvoiceDetails deliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -200,6 +237,7 @@ public String getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -210,6 +248,7 @@ public void setDeliveryAddress(String deliveryAddress) { */ public OpenInvoiceDetails personalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set return this; } @@ -233,6 +272,7 @@ public String getPersonalDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPersonalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set } /** @@ -247,6 +287,7 @@ public void setPersonalDetails(String personalDetails) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public OpenInvoiceDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -278,6 +319,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -288,6 +330,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public OpenInvoiceDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -312,6 +355,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -324,6 +368,7 @@ public void setSdkData(String sdkData) { */ public OpenInvoiceDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -351,6 +396,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -361,6 +407,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public OpenInvoiceDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -384,6 +431,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 OpenInvoiceDetails 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 OpenInvoiceDetails object is equal to o. */ @@ -450,6 +518,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 (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetPersonalDetails) { + addIfNull(nulls, JSON_PROPERTY_PERSONAL_DETAILS, this.personalDetails); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 OpenInvoiceDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Passenger.java b/src/main/java/com/adyen/model/checkout/Passenger.java index ebc966312..23d2b102b 100644 --- a/src/main/java/com/adyen/model/checkout/Passenger.java +++ b/src/main/java/com/adyen/model/checkout/Passenger.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,18 +32,39 @@ public class Passenger { 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_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; + public static final String JSON_PROPERTY_PHONE_NUMBER = "phoneNumber"; private String phoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneNumber = false; + public static final String JSON_PROPERTY_TRAVELLER_TYPE = "travellerType"; private String travellerType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTravellerType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Passenger() {} /** @@ -54,6 +77,7 @@ public Passenger() {} */ public Passenger dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -81,6 +105,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -93,6 +118,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public Passenger firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -120,6 +146,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -132,6 +159,7 @@ public void setFirstName(String firstName) { */ public Passenger lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -159,6 +187,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -173,6 +202,7 @@ public void setLastName(String lastName) { */ public Passenger phoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set return this; } @@ -204,6 +234,7 @@ public String getPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set } /** @@ -216,6 +247,7 @@ public void setPhoneNumber(String phoneNumber) { */ public Passenger travellerType(String travellerType) { this.travellerType = travellerType; + isSetTravellerType = true; // mark as set return this; } @@ -243,6 +275,27 @@ public String getTravellerType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTravellerType(String travellerType) { this.travellerType = travellerType; + isSetTravellerType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Passenger 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 Passenger object is equal to o. */ @@ -290,6 +343,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 (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetPhoneNumber) { + addIfNull(nulls, JSON_PROPERTY_PHONE_NUMBER, this.phoneNumber); + } + if (isSetTravellerType) { + addIfNull(nulls, JSON_PROPERTY_TRAVELLER_TYPE, this.travellerType); + } + + 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 Passenger given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PayByBankAISDirectDebitDetails.java b/src/main/java/com/adyen/model/checkout/PayByBankAISDirectDebitDetails.java index 2bff1e433..19de9610e 100644 --- a/src/main/java/com/adyen/model/checkout/PayByBankAISDirectDebitDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayByBankAISDirectDebitDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,16 +35,28 @@ public class PayByBankAISDirectDebitDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **paybybank_AIS_DD** */ public enum TypeEnum { PAYBYBANK_AIS_DD(String.valueOf("paybybank_AIS_DD")); @@ -85,6 +99,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 PayByBankAISDirectDebitDetails() {} /** @@ -96,6 +119,7 @@ public PayByBankAISDirectDebitDetails() {} */ public PayByBankAISDirectDebitDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -119,6 +143,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -134,6 +159,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public PayByBankAISDirectDebitDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -165,6 +191,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -176,6 +203,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public PayByBankAISDirectDebitDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -200,6 +228,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -213,6 +242,7 @@ public void setSdkData(String sdkData) { */ public PayByBankAISDirectDebitDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -240,6 +270,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -251,6 +282,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public PayByBankAISDirectDebitDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -274,6 +306,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 PayByBankAISDirectDebitDetails 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 PayByBankAISDirectDebitDetails object is equal to o. */ @@ -329,6 +382,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 PayByBankAISDirectDebitDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PayByBankDetails.java b/src/main/java/com/adyen/model/checkout/PayByBankDetails.java index fb3cb443c..e03906e89 100644 --- a/src/main/java/com/adyen/model/checkout/PayByBankDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayByBankDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -32,12 +34,21 @@ public class PayByBankDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **paybybank** */ public enum TypeEnum { PAYBYBANK(String.valueOf("paybybank")); @@ -80,6 +91,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 PayByBankDetails() {} /** @@ -90,6 +110,7 @@ public PayByBankDetails() {} */ public PayByBankDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -113,6 +134,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -123,6 +145,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public PayByBankDetails issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -146,6 +169,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -156,6 +180,7 @@ public void setIssuer(String issuer) { */ public PayByBankDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -180,6 +205,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -190,6 +216,7 @@ public void setSdkData(String sdkData) { */ public PayByBankDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -213,6 +240,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 PayByBankDetails 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 PayByBankDetails object is equal to o. */ @@ -258,6 +306,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + 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 PayByBankDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PayPalDetails.java b/src/main/java/com/adyen/model/checkout/PayPalDetails.java index 559905097..981fd5b49 100644 --- a/src/main/java/com/adyen/model/checkout/PayPalDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayPalDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,28 +40,52 @@ public class PayPalDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ORDER_I_D = "orderID"; private String orderID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrderID = false; + public static final String JSON_PROPERTY_PAYEE_PREFERRED = "payeePreferred"; private String payeePreferred; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayeePreferred = false; + public static final String JSON_PROPERTY_PAYER_I_D = "payerID"; private String payerID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayerID = false; + public static final String JSON_PROPERTY_PAYER_SELECTED = "payerSelected"; private String payerSelected; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayerSelected = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** The type of flow to initiate. */ public enum SubtypeEnum { EXPRESS(String.valueOf("express")), @@ -106,6 +132,9 @@ public static SubtypeEnum fromValue(String value) { public static final String JSON_PROPERTY_SUBTYPE = "subtype"; private SubtypeEnum subtype; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubtype = false; + /** **paypal** */ public enum TypeEnum { PAYPAL(String.valueOf("paypal")); @@ -148,6 +177,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 PayPalDetails() {} /** @@ -158,6 +196,7 @@ public PayPalDetails() {} */ public PayPalDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -181,6 +220,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -191,6 +231,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public PayPalDetails orderID(String orderID) { this.orderID = orderID; + isSetOrderID = true; // mark as set return this; } @@ -214,6 +255,7 @@ public String getOrderID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrderID(String orderID) { this.orderID = orderID; + isSetOrderID = true; // mark as set } /** @@ -224,6 +266,7 @@ public void setOrderID(String orderID) { */ public PayPalDetails payeePreferred(String payeePreferred) { this.payeePreferred = payeePreferred; + isSetPayeePreferred = true; // mark as set return this; } @@ -247,6 +290,7 @@ public String getPayeePreferred() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayeePreferred(String payeePreferred) { this.payeePreferred = payeePreferred; + isSetPayeePreferred = true; // mark as set } /** @@ -257,6 +301,7 @@ public void setPayeePreferred(String payeePreferred) { */ public PayPalDetails payerID(String payerID) { this.payerID = payerID; + isSetPayerID = true; // mark as set return this; } @@ -280,6 +325,7 @@ public String getPayerID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayerID(String payerID) { this.payerID = payerID; + isSetPayerID = true; // mark as set } /** @@ -290,6 +336,7 @@ public void setPayerID(String payerID) { */ public PayPalDetails payerSelected(String payerSelected) { this.payerSelected = payerSelected; + isSetPayerSelected = true; // mark as set return this; } @@ -313,6 +360,7 @@ public String getPayerSelected() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayerSelected(String payerSelected) { this.payerSelected = payerSelected; + isSetPayerSelected = true; // mark as set } /** @@ -327,6 +375,7 @@ public void setPayerSelected(String payerSelected) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public PayPalDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -358,6 +407,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -368,6 +418,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public PayPalDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -392,6 +443,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -404,6 +456,7 @@ public void setSdkData(String sdkData) { */ public PayPalDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -431,6 +484,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -441,6 +495,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public PayPalDetails subtype(SubtypeEnum subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set return this; } @@ -464,6 +519,7 @@ public SubtypeEnum getSubtype() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubtype(SubtypeEnum subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set } /** @@ -474,6 +530,7 @@ public void setSubtype(SubtypeEnum subtype) { */ public PayPalDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -497,6 +554,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 PayPalDetails 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 PayPalDetails object is equal to o. */ @@ -568,6 +646,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetOrderID) { + addIfNull(nulls, JSON_PROPERTY_ORDER_I_D, this.orderID); + } + if (isSetPayeePreferred) { + addIfNull(nulls, JSON_PROPERTY_PAYEE_PREFERRED, this.payeePreferred); + } + if (isSetPayerID) { + addIfNull(nulls, JSON_PROPERTY_PAYER_I_D, this.payerID); + } + if (isSetPayerSelected) { + addIfNull(nulls, JSON_PROPERTY_PAYER_SELECTED, this.payerSelected); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetSubtype) { + addIfNull(nulls, JSON_PROPERTY_SUBTYPE, this.subtype); + } + 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 PayPalDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PayPayDetails.java b/src/main/java/com/adyen/model/checkout/PayPayDetails.java index 5b6ba6a49..3a02b4bb6 100644 --- a/src/main/java/com/adyen/model/checkout/PayPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayPayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,16 +35,28 @@ public class PayPayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **paypay** */ public enum TypeEnum { PAYPAY(String.valueOf("paypay")); @@ -85,6 +99,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 PayPayDetails() {} /** @@ -95,6 +118,7 @@ public PayPayDetails() {} */ public PayPayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -118,6 +142,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -132,6 +157,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public PayPayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -163,6 +189,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -173,6 +200,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public PayPayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -197,6 +225,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -209,6 +238,7 @@ public void setSdkData(String sdkData) { */ public PayPayDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -236,6 +266,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -246,6 +277,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public PayPayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -269,6 +301,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 PayPayDetails 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 PayPayDetails object is equal to o. */ @@ -321,6 +374,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 PayPayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PayToDetails.java b/src/main/java/com/adyen/model/checkout/PayToDetails.java index 92a6be26c..9db8df397 100644 --- a/src/main/java/com/adyen/model/checkout/PayToDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayToDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,19 +36,34 @@ public class PayToDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SHOPPER_ACCOUNT_IDENTIFIER = "shopperAccountIdentifier"; private String shopperAccountIdentifier; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperAccountIdentifier = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **payto** */ public enum TypeEnum { PAYTO(String.valueOf("payto")); @@ -89,6 +106,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 PayToDetails() {} /** @@ -99,6 +125,7 @@ public PayToDetails() {} */ public PayToDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -136,6 +164,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public PayToDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -167,6 +196,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -177,6 +207,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public PayToDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -201,6 +232,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -212,6 +244,7 @@ public void setSdkData(String sdkData) { */ public PayToDetails shopperAccountIdentifier(String shopperAccountIdentifier) { this.shopperAccountIdentifier = shopperAccountIdentifier; + isSetShopperAccountIdentifier = true; // mark as set return this; } @@ -237,6 +270,7 @@ public String getShopperAccountIdentifier() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperAccountIdentifier(String shopperAccountIdentifier) { this.shopperAccountIdentifier = shopperAccountIdentifier; + isSetShopperAccountIdentifier = true; // mark as set } /** @@ -249,6 +283,7 @@ public void setShopperAccountIdentifier(String shopperAccountIdentifier) { */ public PayToDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -276,6 +311,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -286,6 +322,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public PayToDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -309,6 +346,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 PayToDetails 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 PayToDetails object is equal to o. */ @@ -370,6 +428,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperAccountIdentifier) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_ACCOUNT_IDENTIFIER, this.shopperAccountIdentifier); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 PayToDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PayToPaymentMethod.java b/src/main/java/com/adyen/model/checkout/PayToPaymentMethod.java index c062dfc60..5d2f0d269 100644 --- a/src/main/java/com/adyen/model/checkout/PayToPaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/PayToPaymentMethod.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -36,6 +38,15 @@ public class PayToPaymentMethod extends ShopperIdPaymentMethod { public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PayToPaymentMethod() {} /** @@ -46,6 +57,7 @@ public PayToPaymentMethod() {} */ public PayToPaymentMethod shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -69,6 +81,27 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PayToPaymentMethod 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 PayToPaymentMethod object is equal to o. */ @@ -117,6 +150,30 @@ private String toIndentedString(Object o) { JSON.registerDiscriminator(PayToPaymentMethod.class, "type", mappings); } + /** 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 (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + + 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 PayToPaymentMethod given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PayUUpiDetails.java b/src/main/java/com/adyen/model/checkout/PayUUpiDetails.java index 178fe2a76..f01ad561e 100644 --- a/src/main/java/com/adyen/model/checkout/PayUUpiDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayUUpiDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,20 +37,35 @@ public class PayUUpiDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE = "shopperNotificationReference"; private String shopperNotificationReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperNotificationReference = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **payu_IN_upi** */ public enum TypeEnum { PAYU_IN_UPI(String.valueOf("payu_IN_upi")); @@ -91,9 +108,21 @@ 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; + public static final String JSON_PROPERTY_VIRTUAL_PAYMENT_ADDRESS = "virtualPaymentAddress"; private String virtualPaymentAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVirtualPaymentAddress = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PayUUpiDetails() {} /** @@ -104,6 +133,7 @@ public PayUUpiDetails() {} */ public PayUUpiDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -127,6 +157,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -141,6 +172,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public PayUUpiDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -172,6 +204,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -182,6 +215,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public PayUUpiDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -206,6 +240,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -218,6 +253,7 @@ public void setSdkData(String sdkData) { */ public PayUUpiDetails shopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set return this; } @@ -245,6 +281,7 @@ public String getShopperNotificationReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set } /** @@ -257,6 +294,7 @@ public void setShopperNotificationReference(String shopperNotificationReference) */ public PayUUpiDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -284,6 +322,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -294,6 +333,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public PayUUpiDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -317,6 +357,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -327,6 +368,7 @@ public void setType(TypeEnum type) { */ public PayUUpiDetails virtualPaymentAddress(String virtualPaymentAddress) { this.virtualPaymentAddress = virtualPaymentAddress; + isSetVirtualPaymentAddress = true; // mark as set return this; } @@ -350,6 +392,27 @@ public String getVirtualPaymentAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVirtualPaymentAddress(String virtualPaymentAddress) { this.virtualPaymentAddress = virtualPaymentAddress; + isSetVirtualPaymentAddress = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PayUUpiDetails 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 PayUUpiDetails object is equal to o. */ @@ -417,6 +480,49 @@ 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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperNotificationReference) { + addIfNull( + nulls, JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE, this.shopperNotificationReference); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetVirtualPaymentAddress) { + addIfNull(nulls, JSON_PROPERTY_VIRTUAL_PAYMENT_ADDRESS, this.virtualPaymentAddress); + } + + 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 PayUUpiDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PayWithGoogleDetails.java b/src/main/java/com/adyen/model/checkout/PayWithGoogleDetails.java index 4f9b2dee9..7b3c97397 100644 --- a/src/main/java/com/adyen/model/checkout/PayWithGoogleDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayWithGoogleDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -36,6 +38,9 @@ public class PayWithGoogleDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = 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**. @@ -83,22 +88,40 @@ 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_GOOGLE_PAY_TOKEN = "googlePayToken"; private String googlePayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGooglePayToken = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_THREE_D_S2_SDK_VERSION = "threeDS2SdkVersion"; private String threeDS2SdkVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2SdkVersion = false; + /** **paywithgoogle** */ public enum TypeEnum { PAYWITHGOOGLE(String.valueOf("paywithgoogle")); @@ -141,6 +164,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 PayWithGoogleDetails() {} /** @@ -151,6 +183,7 @@ public PayWithGoogleDetails() {} */ public PayWithGoogleDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -174,6 +207,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -187,6 +221,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public PayWithGoogleDetails fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -216,6 +251,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -230,6 +266,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public PayWithGoogleDetails googlePayToken(String googlePayToken) { this.googlePayToken = googlePayToken; + isSetGooglePayToken = true; // mark as set return this; } @@ -261,6 +298,7 @@ public String getGooglePayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGooglePayToken(String googlePayToken) { this.googlePayToken = googlePayToken; + isSetGooglePayToken = true; // mark as set } /** @@ -275,6 +313,7 @@ public void setGooglePayToken(String googlePayToken) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public PayWithGoogleDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -306,6 +345,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -316,6 +356,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public PayWithGoogleDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -340,6 +381,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -352,6 +394,7 @@ public void setSdkData(String sdkData) { */ public PayWithGoogleDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -379,6 +422,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -390,6 +434,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public PayWithGoogleDetails threeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set return this; } @@ -415,6 +460,7 @@ public String getThreeDS2SdkVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set } /** @@ -425,6 +471,7 @@ public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { */ public PayWithGoogleDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -448,6 +495,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 PayWithGoogleDetails 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 PayWithGoogleDetails object is equal to o. */ @@ -514,6 +582,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetGooglePayToken) { + addIfNull(nulls, JSON_PROPERTY_GOOGLE_PAY_TOKEN, this.googlePayToken); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetThreeDS2SdkVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_SDK_VERSION, this.threeDS2SdkVersion); + } + 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 PayWithGoogleDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PayWithGoogleDonations.java b/src/main/java/com/adyen/model/checkout/PayWithGoogleDonations.java index 465a84035..bb0d39884 100644 --- a/src/main/java/com/adyen/model/checkout/PayWithGoogleDonations.java +++ b/src/main/java/com/adyen/model/checkout/PayWithGoogleDonations.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -36,6 +38,9 @@ public class PayWithGoogleDonations { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = 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**. @@ -83,22 +88,40 @@ 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_GOOGLE_PAY_TOKEN = "googlePayToken"; private String googlePayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGooglePayToken = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_THREE_D_S2_SDK_VERSION = "threeDS2SdkVersion"; private String threeDS2SdkVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2SdkVersion = false; + /** **paywithgoogle** */ public enum TypeEnum { PAYWITHGOOGLE(String.valueOf("paywithgoogle")); @@ -141,6 +164,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 PayWithGoogleDonations() {} /** @@ -151,6 +183,7 @@ public PayWithGoogleDonations() {} */ public PayWithGoogleDonations checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -174,6 +207,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -187,6 +221,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public PayWithGoogleDonations fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -216,6 +251,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -230,6 +266,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public PayWithGoogleDonations googlePayToken(String googlePayToken) { this.googlePayToken = googlePayToken; + isSetGooglePayToken = true; // mark as set return this; } @@ -261,6 +298,7 @@ public String getGooglePayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGooglePayToken(String googlePayToken) { this.googlePayToken = googlePayToken; + isSetGooglePayToken = true; // mark as set } /** @@ -275,6 +313,7 @@ public void setGooglePayToken(String googlePayToken) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public PayWithGoogleDonations recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -306,6 +345,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -316,6 +356,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public PayWithGoogleDonations sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -340,6 +381,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -352,6 +394,7 @@ public void setSdkData(String sdkData) { */ public PayWithGoogleDonations storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -379,6 +422,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -390,6 +434,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public PayWithGoogleDonations threeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set return this; } @@ -415,6 +460,7 @@ public String getThreeDS2SdkVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set } /** @@ -425,6 +471,7 @@ public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { */ public PayWithGoogleDonations type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -448,6 +495,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 PayWithGoogleDonations 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 PayWithGoogleDonations object is equal to o. */ @@ -514,6 +582,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetGooglePayToken) { + addIfNull(nulls, JSON_PROPERTY_GOOGLE_PAY_TOKEN, this.googlePayToken); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetThreeDS2SdkVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_SDK_VERSION, this.threeDS2SdkVersion); + } + 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 PayWithGoogleDonations given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Payment.java b/src/main/java/com/adyen/model/checkout/Payment.java index a304cdf30..c84e46c37 100644 --- a/src/main/java/com/adyen/model/checkout/Payment.java +++ b/src/main/java/com/adyen/model/checkout/Payment.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -32,12 +34,21 @@ public class Payment { 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_PAYMENT_METHOD = "paymentMethod"; private ResponsePaymentMethod paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = 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; + /** * The result of the payment. For more information, see [Result * codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * @@ -85,6 +96,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 Payment() {} /** @@ -95,6 +115,7 @@ public Payment() {} */ public Payment amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -118,6 +139,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -128,6 +150,7 @@ public void setAmount(Amount amount) { */ public Payment paymentMethod(ResponsePaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -151,6 +174,7 @@ public ResponsePaymentMethod getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(ResponsePaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -164,6 +188,7 @@ public void setPaymentMethod(ResponsePaymentMethod paymentMethod) { */ public Payment pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -193,6 +218,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -209,6 +235,7 @@ public void setPspReference(String pspReference) { */ public Payment resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -244,6 +271,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 Payment 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 Payment object is equal to o. */ @@ -289,6 +337,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + 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 Payment given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateRequest.java b/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateRequest.java index 008fc7854..488c7753e 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,12 +40,21 @@ public class PaymentAmountUpdateRequest { 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_ENHANCED_SCHEME_DATA = "enhancedSchemeData"; private EnhancedSchemeData enhancedSchemeData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeData = false; + /** * The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * * **installment** @@ -93,18 +104,39 @@ 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_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = 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_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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentAmountUpdateRequest() {} /** @@ -115,6 +147,7 @@ public PaymentAmountUpdateRequest() {} */ public PaymentAmountUpdateRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -138,6 +171,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -148,6 +182,7 @@ public void setAmount(Amount amount) { */ public PaymentAmountUpdateRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -171,6 +206,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -181,6 +217,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentAmountUpdateRequest enhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set return this; } @@ -204,6 +241,7 @@ public EnhancedSchemeData getEnhancedSchemeData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set } /** @@ -216,6 +254,7 @@ public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { */ public PaymentAmountUpdateRequest industryUsage(IndustryUsageEnum industryUsage) { this.industryUsage = industryUsage; + isSetIndustryUsage = true; // mark as set return this; } @@ -243,6 +282,7 @@ public IndustryUsageEnum getIndustryUsage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIndustryUsage(IndustryUsageEnum industryUsage) { this.industryUsage = industryUsage; + isSetIndustryUsage = true; // mark as set } /** @@ -259,6 +299,7 @@ public void setIndustryUsage(IndustryUsageEnum industryUsage) { */ public PaymentAmountUpdateRequest lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -302,6 +343,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -312,6 +354,7 @@ public void setLineItems(List lineItems) { */ public PaymentAmountUpdateRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -335,6 +378,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -345,6 +389,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentAmountUpdateRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -368,6 +413,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -384,6 +430,7 @@ public void setReference(String reference) { */ public PaymentAmountUpdateRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -427,6 +474,27 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentAmountUpdateRequest 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 PaymentAmountUpdateRequest object is equal to o. */ @@ -488,6 +556,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetEnhancedSchemeData) { + addIfNull(nulls, JSON_PROPERTY_ENHANCED_SCHEME_DATA, this.enhancedSchemeData); + } + if (isSetIndustryUsage) { + addIfNull(nulls, JSON_PROPERTY_INDUSTRY_USAGE, this.industryUsage); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + + 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 PaymentAmountUpdateRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateResponse.java b/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateResponse.java index 74d2ea74d..92c159bcb 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -39,6 +41,9 @@ public class PaymentAmountUpdateResponse { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + /** * The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * * **installment** @@ -88,24 +93,45 @@ 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_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = 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_PAYMENT_PSP_REFERENCE = "paymentPspReference"; private String paymentPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentPspReference = 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; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + /** The status of your request. This will always have the value **received**. */ public enum StatusEnum { RECEIVED(String.valueOf("received")); @@ -148,6 +174,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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentAmountUpdateResponse() {} /** @@ -158,6 +193,7 @@ public PaymentAmountUpdateResponse() {} */ public PaymentAmountUpdateResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -181,6 +217,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -193,6 +230,7 @@ public void setAmount(Amount amount) { */ public PaymentAmountUpdateResponse industryUsage(IndustryUsageEnum industryUsage) { this.industryUsage = industryUsage; + isSetIndustryUsage = true; // mark as set return this; } @@ -220,6 +258,7 @@ public IndustryUsageEnum getIndustryUsage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIndustryUsage(IndustryUsageEnum industryUsage) { this.industryUsage = industryUsage; + isSetIndustryUsage = true; // mark as set } /** @@ -236,6 +275,7 @@ public void setIndustryUsage(IndustryUsageEnum industryUsage) { */ public PaymentAmountUpdateResponse lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -279,6 +319,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -289,6 +330,7 @@ public void setLineItems(List lineItems) { */ public PaymentAmountUpdateResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -312,6 +354,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -326,6 +369,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentAmountUpdateResponse paymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set return this; } @@ -357,6 +401,7 @@ public String getPaymentPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set } /** @@ -368,6 +413,7 @@ public void setPaymentPspReference(String paymentPspReference) { */ public PaymentAmountUpdateResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -393,6 +439,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -403,6 +450,7 @@ public void setPspReference(String pspReference) { */ public PaymentAmountUpdateResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -426,6 +474,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -442,6 +491,7 @@ public void setReference(String reference) { */ public PaymentAmountUpdateResponse splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -485,6 +535,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -495,6 +546,7 @@ public void setSplits(List splits) { */ public PaymentAmountUpdateResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -518,6 +570,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentAmountUpdateResponse 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 PaymentAmountUpdateResponse object is equal to o. */ @@ -584,6 +657,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 (isSetIndustryUsage) { + addIfNull(nulls, JSON_PROPERTY_INDUSTRY_USAGE, this.industryUsage); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentPspReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_PSP_REFERENCE, this.paymentPspReference); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + 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 PaymentAmountUpdateResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentCancelRequest.java b/src/main/java/com/adyen/model/checkout/PaymentCancelRequest.java index cbc66d8f2..a54d70c6c 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentCancelRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentCancelRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 PaymentCancelRequest { 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_ENHANCED_SCHEME_DATA = "enhancedSchemeData"; private EnhancedSchemeData enhancedSchemeData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeData = 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_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 PaymentCancelRequest() {} /** @@ -47,6 +67,7 @@ public PaymentCancelRequest() {} */ public PaymentCancelRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -70,6 +91,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentCancelRequest enhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set return this; } @@ -103,6 +126,7 @@ public EnhancedSchemeData getEnhancedSchemeData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { */ public PaymentCancelRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentCancelRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -169,6 +196,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 PaymentCancelRequest 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 PaymentCancelRequest object is equal to o. */ @@ -214,6 +262,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetEnhancedSchemeData) { + addIfNull(nulls, JSON_PROPERTY_ENHANCED_SCHEME_DATA, this.enhancedSchemeData); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + 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 PaymentCancelRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentCancelResponse.java b/src/main/java/com/adyen/model/checkout/PaymentCancelResponse.java index 87cf7cf9b..7d6579cd5 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentCancelResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentCancelResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 PaymentCancelResponse { 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_PAYMENT_PSP_REFERENCE = "paymentPspReference"; private String paymentPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentPspReference = 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 your request. This will always have the value **received**. */ public enum StatusEnum { RECEIVED(String.valueOf("received")); @@ -84,6 +98,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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentCancelResponse() {} /** @@ -94,6 +117,7 @@ public PaymentCancelResponse() {} */ public PaymentCancelResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -117,6 +141,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -131,6 +156,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentCancelResponse paymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set return this; } @@ -162,6 +188,7 @@ public String getPaymentPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set } /** @@ -172,6 +199,7 @@ public void setPaymentPspReference(String paymentPspReference) { */ public PaymentCancelResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -195,6 +223,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -205,6 +234,7 @@ public void setPspReference(String pspReference) { */ public PaymentCancelResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -228,6 +258,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -238,6 +269,7 @@ public void setReference(String reference) { */ public PaymentCancelResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -261,6 +293,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentCancelResponse 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 PaymentCancelResponse object is equal to o. */ @@ -310,6 +363,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 (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentPspReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_PSP_REFERENCE, this.paymentPspReference); + } + 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); + } + + 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 PaymentCancelResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentCaptureRequest.java b/src/main/java/com/adyen/model/checkout/PaymentCaptureRequest.java index 83a700282..bac17ec0a 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentCaptureRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentCaptureRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,30 +37,63 @@ public class PaymentCaptureRequest { 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_ENHANCED_SCHEME_DATA = "enhancedSchemeData"; private EnhancedSchemeData enhancedSchemeData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeData = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = 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_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_SUB_MERCHANTS = "subMerchants"; private List subMerchants; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchants = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentCaptureRequest() {} /** @@ -69,6 +104,7 @@ public PaymentCaptureRequest() {} */ public PaymentCaptureRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -92,6 +128,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -102,6 +139,7 @@ public void setAmount(Amount amount) { */ public PaymentCaptureRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -125,6 +163,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -135,6 +174,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentCaptureRequest enhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set return this; } @@ -158,6 +198,7 @@ public EnhancedSchemeData getEnhancedSchemeData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set } /** @@ -174,6 +215,7 @@ public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { */ public PaymentCaptureRequest lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -217,6 +259,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -227,6 +270,7 @@ public void setLineItems(List lineItems) { */ public PaymentCaptureRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -250,6 +294,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -261,6 +306,7 @@ public void setMerchantAccount(String merchantAccount) { public PaymentCaptureRequest platformChargebackLogic( PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -284,6 +330,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -294,6 +341,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public PaymentCaptureRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -317,6 +365,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -333,6 +382,7 @@ public void setReference(String reference) { */ public PaymentCaptureRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -376,6 +426,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -386,6 +437,7 @@ public void setSplits(List splits) { */ public PaymentCaptureRequest subMerchants(List subMerchants) { this.subMerchants = subMerchants; + isSetSubMerchants = true; // mark as set return this; } @@ -417,6 +469,27 @@ public List getSubMerchants() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchants(List subMerchants) { this.subMerchants = subMerchants; + isSetSubMerchants = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentCaptureRequest 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 PaymentCaptureRequest object is equal to o. */ @@ -484,6 +557,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 (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetEnhancedSchemeData) { + addIfNull(nulls, JSON_PROPERTY_ENHANCED_SCHEME_DATA, this.enhancedSchemeData); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + 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 (isSetSubMerchants) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANTS, this.subMerchants); + } + + 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 PaymentCaptureRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentCaptureResponse.java b/src/main/java/com/adyen/model/checkout/PaymentCaptureResponse.java index c3c9b78e0..965c2129d 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentCaptureResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentCaptureResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -40,27 +42,51 @@ public class PaymentCaptureResponse { 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_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = 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_PAYMENT_PSP_REFERENCE = "paymentPspReference"; private String paymentPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentPspReference = 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_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; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + /** The status of your request. This will always have the value **received**. */ public enum StatusEnum { RECEIVED(String.valueOf("received")); @@ -103,9 +129,21 @@ 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_SUB_MERCHANTS = "subMerchants"; private List subMerchants; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchants = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentCaptureResponse() {} /** @@ -116,6 +154,7 @@ public PaymentCaptureResponse() {} */ public PaymentCaptureResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -139,6 +178,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -155,6 +195,7 @@ public void setAmount(Amount amount) { */ public PaymentCaptureResponse lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -198,6 +239,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -208,6 +250,7 @@ public void setLineItems(List lineItems) { */ public PaymentCaptureResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -231,6 +274,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -245,6 +289,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentCaptureResponse paymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set return this; } @@ -276,6 +321,7 @@ public String getPaymentPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set } /** @@ -287,6 +333,7 @@ public void setPaymentPspReference(String paymentPspReference) { public PaymentCaptureResponse platformChargebackLogic( PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -310,6 +357,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -320,6 +368,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public PaymentCaptureResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -343,6 +392,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -353,6 +403,7 @@ public void setPspReference(String pspReference) { */ public PaymentCaptureResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -376,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 } /** @@ -392,6 +444,7 @@ public void setReference(String reference) { */ public PaymentCaptureResponse splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -435,6 +488,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -445,6 +499,7 @@ public void setSplits(List splits) { */ public PaymentCaptureResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -468,6 +523,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -478,6 +534,7 @@ public void setStatus(StatusEnum status) { */ public PaymentCaptureResponse subMerchants(List subMerchants) { this.subMerchants = subMerchants; + isSetSubMerchants = true; // mark as set return this; } @@ -509,6 +566,27 @@ public List getSubMerchants() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchants(List subMerchants) { this.subMerchants = subMerchants; + isSetSubMerchants = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentCaptureResponse 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 PaymentCaptureResponse object is equal to o. */ @@ -581,6 +659,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentPspReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_PSP_REFERENCE, this.paymentPspReference); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetSubMerchants) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANTS, this.subMerchants); + } + + 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 PaymentCaptureResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentCompletionDetails.java b/src/main/java/com/adyen/model/checkout/PaymentCompletionDetails.java index 678235869..ade830807 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentCompletionDetails.java +++ b/src/main/java/com/adyen/model/checkout/PaymentCompletionDetails.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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; @@ -44,63 +46,129 @@ public class PaymentCompletionDetails { public static final String JSON_PROPERTY_M_D = "MD"; private String MD; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMD = false; + public static final String JSON_PROPERTY_PA_REQ = "PaReq"; private String paReq; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaReq = false; + public static final String JSON_PROPERTY_PA_RES = "PaRes"; private String paRes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaRes = false; + public static final String JSON_PROPERTY_AUTHORIZATION_TOKEN = "authorization_token"; private String authorizationToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorizationToken = false; + public static final String JSON_PROPERTY_BILLING_TOKEN = "billingToken"; private String billingToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingToken = false; + public static final String JSON_PROPERTY_CUPSECUREPLUS_SMSCODE = "cupsecureplus.smscode"; private String cupsecureplusSmscode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCupsecureplusSmscode = false; + public static final String JSON_PROPERTY_FACILITATOR_ACCESS_TOKEN = "facilitatorAccessToken"; private String facilitatorAccessToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFacilitatorAccessToken = false; + public static final String JSON_PROPERTY_ONE_TIME_PASSCODE = "oneTimePasscode"; private String oneTimePasscode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOneTimePasscode = false; + public static final String JSON_PROPERTY_ORDER_I_D = "orderID"; private String orderID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrderID = false; + public static final String JSON_PROPERTY_PAYER_I_D = "payerID"; private String payerID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayerID = false; + public static final String JSON_PROPERTY_PAYLOAD = "payload"; private String payload; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayload = false; + public static final String JSON_PROPERTY_PAYMENT_I_D = "paymentID"; private String paymentID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentID = false; + public static final String JSON_PROPERTY_PAYMENT_STATUS = "paymentStatus"; private String paymentStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentStatus = false; + public static final String JSON_PROPERTY_REDIRECT_RESULT = "redirectResult"; private String redirectResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectResult = false; + public static final String JSON_PROPERTY_RESULT_CODE = "resultCode"; private String resultCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResultCode = false; + public static final String JSON_PROPERTY_RETURN_URL_QUERY_STRING = "returnUrlQueryString"; private String returnUrlQueryString; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReturnUrlQueryString = false; + public static final String JSON_PROPERTY_THREE_D_S_RESULT = "threeDSResult"; private String threeDSResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSResult = false; + public static final String JSON_PROPERTY_THREEDS2_CHALLENGE_RESULT = "threeds2.challengeResult"; private String threeds2ChallengeResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeds2ChallengeResult = false; + public static final String JSON_PROPERTY_THREEDS2_FINGERPRINT = "threeds2.fingerprint"; private String threeds2Fingerprint; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeds2Fingerprint = false; + public static final String JSON_PROPERTY_VAULT_TOKEN = "vaultToken"; private String vaultToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVaultToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentCompletionDetails() {} /** @@ -111,6 +179,7 @@ public PaymentCompletionDetails() {} */ public PaymentCompletionDetails MD(String MD) { this.MD = MD; + isSetMD = true; // mark as set return this; } @@ -134,6 +203,7 @@ public String getMD() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMD(String MD) { this.MD = MD; + isSetMD = true; // mark as set } /** @@ -144,6 +214,7 @@ public void setMD(String MD) { */ public PaymentCompletionDetails paReq(String paReq) { this.paReq = paReq; + isSetPaReq = true; // mark as set return this; } @@ -167,6 +238,7 @@ public String getPaReq() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaReq(String paReq) { this.paReq = paReq; + isSetPaReq = true; // mark as set } /** @@ -177,6 +249,7 @@ public void setPaReq(String paReq) { */ public PaymentCompletionDetails paRes(String paRes) { this.paRes = paRes; + isSetPaRes = true; // mark as set return this; } @@ -200,6 +273,7 @@ public String getPaRes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaRes(String paRes) { this.paRes = paRes; + isSetPaRes = true; // mark as set } /** @@ -210,6 +284,7 @@ public void setPaRes(String paRes) { */ public PaymentCompletionDetails authorizationToken(String authorizationToken) { this.authorizationToken = authorizationToken; + isSetAuthorizationToken = true; // mark as set return this; } @@ -233,6 +308,7 @@ public String getAuthorizationToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorizationToken(String authorizationToken) { this.authorizationToken = authorizationToken; + isSetAuthorizationToken = true; // mark as set } /** @@ -243,6 +319,7 @@ public void setAuthorizationToken(String authorizationToken) { */ public PaymentCompletionDetails billingToken(String billingToken) { this.billingToken = billingToken; + isSetBillingToken = true; // mark as set return this; } @@ -266,6 +343,7 @@ public String getBillingToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingToken(String billingToken) { this.billingToken = billingToken; + isSetBillingToken = true; // mark as set } /** @@ -276,6 +354,7 @@ public void setBillingToken(String billingToken) { */ public PaymentCompletionDetails cupsecureplusSmscode(String cupsecureplusSmscode) { this.cupsecureplusSmscode = cupsecureplusSmscode; + isSetCupsecureplusSmscode = true; // mark as set return this; } @@ -299,6 +378,7 @@ public String getCupsecureplusSmscode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCupsecureplusSmscode(String cupsecureplusSmscode) { this.cupsecureplusSmscode = cupsecureplusSmscode; + isSetCupsecureplusSmscode = true; // mark as set } /** @@ -309,6 +389,7 @@ public void setCupsecureplusSmscode(String cupsecureplusSmscode) { */ public PaymentCompletionDetails facilitatorAccessToken(String facilitatorAccessToken) { this.facilitatorAccessToken = facilitatorAccessToken; + isSetFacilitatorAccessToken = true; // mark as set return this; } @@ -332,6 +413,7 @@ public String getFacilitatorAccessToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFacilitatorAccessToken(String facilitatorAccessToken) { this.facilitatorAccessToken = facilitatorAccessToken; + isSetFacilitatorAccessToken = true; // mark as set } /** @@ -343,6 +425,7 @@ public void setFacilitatorAccessToken(String facilitatorAccessToken) { */ public PaymentCompletionDetails oneTimePasscode(String oneTimePasscode) { this.oneTimePasscode = oneTimePasscode; + isSetOneTimePasscode = true; // mark as set return this; } @@ -368,6 +451,7 @@ public String getOneTimePasscode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOneTimePasscode(String oneTimePasscode) { this.oneTimePasscode = oneTimePasscode; + isSetOneTimePasscode = true; // mark as set } /** @@ -378,6 +462,7 @@ public void setOneTimePasscode(String oneTimePasscode) { */ public PaymentCompletionDetails orderID(String orderID) { this.orderID = orderID; + isSetOrderID = true; // mark as set return this; } @@ -401,6 +486,7 @@ public String getOrderID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrderID(String orderID) { this.orderID = orderID; + isSetOrderID = true; // mark as set } /** @@ -411,6 +497,7 @@ public void setOrderID(String orderID) { */ public PaymentCompletionDetails payerID(String payerID) { this.payerID = payerID; + isSetPayerID = true; // mark as set return this; } @@ -434,6 +521,7 @@ public String getPayerID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayerID(String payerID) { this.payerID = payerID; + isSetPayerID = true; // mark as set } /** @@ -444,6 +532,7 @@ public void setPayerID(String payerID) { */ public PaymentCompletionDetails payload(String payload) { this.payload = payload; + isSetPayload = true; // mark as set return this; } @@ -467,6 +556,7 @@ public String getPayload() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayload(String payload) { this.payload = payload; + isSetPayload = true; // mark as set } /** @@ -477,6 +567,7 @@ public void setPayload(String payload) { */ public PaymentCompletionDetails paymentID(String paymentID) { this.paymentID = paymentID; + isSetPaymentID = true; // mark as set return this; } @@ -500,6 +591,7 @@ public String getPaymentID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentID(String paymentID) { this.paymentID = paymentID; + isSetPaymentID = true; // mark as set } /** @@ -513,6 +605,7 @@ public void setPaymentID(String paymentID) { */ public PaymentCompletionDetails paymentStatus(String paymentStatus) { this.paymentStatus = paymentStatus; + isSetPaymentStatus = true; // mark as set return this; } @@ -542,6 +635,7 @@ public String getPaymentStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentStatus(String paymentStatus) { this.paymentStatus = paymentStatus; + isSetPaymentStatus = true; // mark as set } /** @@ -552,6 +646,7 @@ public void setPaymentStatus(String paymentStatus) { */ public PaymentCompletionDetails redirectResult(String redirectResult) { this.redirectResult = redirectResult; + isSetRedirectResult = true; // mark as set return this; } @@ -575,6 +670,7 @@ public String getRedirectResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectResult(String redirectResult) { this.redirectResult = redirectResult; + isSetRedirectResult = true; // mark as set } /** @@ -585,6 +681,7 @@ public void setRedirectResult(String redirectResult) { */ public PaymentCompletionDetails resultCode(String resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -608,6 +705,7 @@ public String getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(String resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set } /** @@ -619,6 +717,7 @@ public void setResultCode(String resultCode) { */ public PaymentCompletionDetails returnUrlQueryString(String returnUrlQueryString) { this.returnUrlQueryString = returnUrlQueryString; + isSetReturnUrlQueryString = true; // mark as set return this; } @@ -644,6 +743,7 @@ public String getReturnUrlQueryString() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReturnUrlQueryString(String returnUrlQueryString) { this.returnUrlQueryString = returnUrlQueryString; + isSetReturnUrlQueryString = true; // mark as set } /** @@ -657,6 +757,7 @@ public void setReturnUrlQueryString(String returnUrlQueryString) { */ public PaymentCompletionDetails threeDSResult(String threeDSResult) { this.threeDSResult = threeDSResult; + isSetThreeDSResult = true; // mark as set return this; } @@ -686,6 +787,7 @@ public String getThreeDSResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSResult(String threeDSResult) { this.threeDSResult = threeDSResult; + isSetThreeDSResult = true; // mark as set } /** @@ -698,6 +800,7 @@ public void setThreeDSResult(String threeDSResult) { */ public PaymentCompletionDetails threeds2ChallengeResult(String threeds2ChallengeResult) { this.threeds2ChallengeResult = threeds2ChallengeResult; + isSetThreeds2ChallengeResult = true; // mark as set return this; } @@ -725,6 +828,7 @@ public String getThreeds2ChallengeResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeds2ChallengeResult(String threeds2ChallengeResult) { this.threeds2ChallengeResult = threeds2ChallengeResult; + isSetThreeds2ChallengeResult = true; // mark as set } /** @@ -737,6 +841,7 @@ public void setThreeds2ChallengeResult(String threeds2ChallengeResult) { */ public PaymentCompletionDetails threeds2Fingerprint(String threeds2Fingerprint) { this.threeds2Fingerprint = threeds2Fingerprint; + isSetThreeds2Fingerprint = true; // mark as set return this; } @@ -764,6 +869,7 @@ public String getThreeds2Fingerprint() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeds2Fingerprint(String threeds2Fingerprint) { this.threeds2Fingerprint = threeds2Fingerprint; + isSetThreeds2Fingerprint = true; // mark as set } /** @@ -774,6 +880,7 @@ public void setThreeds2Fingerprint(String threeds2Fingerprint) { */ public PaymentCompletionDetails vaultToken(String vaultToken) { this.vaultToken = vaultToken; + isSetVaultToken = true; // mark as set return this; } @@ -797,6 +904,27 @@ public String getVaultToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVaultToken(String vaultToken) { this.vaultToken = vaultToken; + isSetVaultToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentCompletionDetails 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 PaymentCompletionDetails object is equal to o. */ @@ -906,6 +1034,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 (isSetMD) { + addIfNull(nulls, JSON_PROPERTY_M_D, this.MD); + } + if (isSetPaReq) { + addIfNull(nulls, JSON_PROPERTY_PA_REQ, this.paReq); + } + if (isSetPaRes) { + addIfNull(nulls, JSON_PROPERTY_PA_RES, this.paRes); + } + if (isSetAuthorizationToken) { + addIfNull(nulls, JSON_PROPERTY_AUTHORIZATION_TOKEN, this.authorizationToken); + } + if (isSetBillingToken) { + addIfNull(nulls, JSON_PROPERTY_BILLING_TOKEN, this.billingToken); + } + if (isSetCupsecureplusSmscode) { + addIfNull(nulls, JSON_PROPERTY_CUPSECUREPLUS_SMSCODE, this.cupsecureplusSmscode); + } + if (isSetFacilitatorAccessToken) { + addIfNull(nulls, JSON_PROPERTY_FACILITATOR_ACCESS_TOKEN, this.facilitatorAccessToken); + } + if (isSetOneTimePasscode) { + addIfNull(nulls, JSON_PROPERTY_ONE_TIME_PASSCODE, this.oneTimePasscode); + } + if (isSetOrderID) { + addIfNull(nulls, JSON_PROPERTY_ORDER_I_D, this.orderID); + } + if (isSetPayerID) { + addIfNull(nulls, JSON_PROPERTY_PAYER_I_D, this.payerID); + } + if (isSetPayload) { + addIfNull(nulls, JSON_PROPERTY_PAYLOAD, this.payload); + } + if (isSetPaymentID) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_I_D, this.paymentID); + } + if (isSetPaymentStatus) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_STATUS, this.paymentStatus); + } + if (isSetRedirectResult) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_RESULT, this.redirectResult); + } + if (isSetResultCode) { + addIfNull(nulls, JSON_PROPERTY_RESULT_CODE, this.resultCode); + } + if (isSetReturnUrlQueryString) { + addIfNull(nulls, JSON_PROPERTY_RETURN_URL_QUERY_STRING, this.returnUrlQueryString); + } + if (isSetThreeDSResult) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_RESULT, this.threeDSResult); + } + if (isSetThreeds2ChallengeResult) { + addIfNull(nulls, JSON_PROPERTY_THREEDS2_CHALLENGE_RESULT, this.threeds2ChallengeResult); + } + if (isSetThreeds2Fingerprint) { + addIfNull(nulls, JSON_PROPERTY_THREEDS2_FINGERPRINT, this.threeds2Fingerprint); + } + if (isSetVaultToken) { + addIfNull(nulls, JSON_PROPERTY_VAULT_TOKEN, this.vaultToken); + } + + 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 PaymentCompletionDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentDetails.java b/src/main/java/com/adyen/model/checkout/PaymentDetails.java index e4cfaf322..a15e3ce1d 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDetails.java +++ b/src/main/java/com/adyen/model/checkout/PaymentDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,9 +33,15 @@ public class PaymentDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** The payment method type. */ public enum TypeEnum { ALIPAY(String.valueOf("alipay")), @@ -156,14 +164,10 @@ public enum TypeEnum { KCP_NAVERPAY(String.valueOf("kcp_naverpay")), - ONLINEBANKING_IN(String.valueOf("onlinebanking_IN")), - FAWRY(String.valueOf("fawry")), ATOME(String.valueOf("atome")), - MONEYBOOKERS(String.valueOf("moneybookers")), - NAPS(String.valueOf("naps")), NORDEA(String.valueOf("nordea")), @@ -254,6 +258,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 PaymentDetails() {} /** @@ -264,6 +277,7 @@ public PaymentDetails() {} */ public PaymentDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -287,6 +301,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -297,6 +312,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public PaymentDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -321,6 +337,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -331,6 +348,7 @@ public void setSdkData(String sdkData) { */ public PaymentDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -354,6 +372,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 PaymentDetails 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 PaymentDetails object is equal to o. */ @@ -397,6 +436,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + 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 PaymentDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentDetailsRequest.java b/src/main/java/com/adyen/model/checkout/PaymentDetailsRequest.java index bd3f4651b..b43cc5bf7 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDetailsRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentDetailsRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,18 +30,36 @@ public class PaymentDetailsRequest { public static final String JSON_PROPERTY_AUTHENTICATION_DATA = "authenticationData"; private DetailsRequestAuthenticationData authenticationData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationData = false; + public static final String JSON_PROPERTY_DETAILS = "details"; private PaymentCompletionDetails details; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetails = false; + public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData"; private String paymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = false; + public static final String JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY = "threeDSAuthenticationOnly"; @Deprecated // deprecated since Adyen Checkout API v69: Use // `authenticationData.authenticationOnly` instead. private Boolean threeDSAuthenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSAuthenticationOnly = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentDetailsRequest() {} /** @@ -51,6 +71,7 @@ public PaymentDetailsRequest() {} public PaymentDetailsRequest authenticationData( DetailsRequestAuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set return this; } @@ -74,6 +95,7 @@ public DetailsRequestAuthenticationData getAuthenticationData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationData(DetailsRequestAuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set } /** @@ -84,6 +106,7 @@ public void setAuthenticationData(DetailsRequestAuthenticationData authenticatio */ public PaymentDetailsRequest details(PaymentCompletionDetails details) { this.details = details; + isSetDetails = true; // mark as set return this; } @@ -107,6 +130,7 @@ public PaymentCompletionDetails getDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetails(PaymentCompletionDetails details) { this.details = details; + isSetDetails = true; // mark as set } /** @@ -128,6 +152,7 @@ public void setDetails(PaymentCompletionDetails details) { */ public PaymentDetailsRequest paymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set return this; } @@ -173,6 +198,7 @@ public String getPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set } /** @@ -190,6 +216,7 @@ public void setPaymentData(String paymentData) { // `authenticationData.authenticationOnly` instead. public PaymentDetailsRequest threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set return this; } @@ -227,6 +254,27 @@ public Boolean getThreeDSAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentDetailsRequest 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 PaymentDetailsRequest object is equal to o. */ @@ -275,6 +323,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 (isSetAuthenticationData) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_DATA, this.authenticationData); + } + if (isSetDetails) { + addIfNull(nulls, JSON_PROPERTY_DETAILS, this.details); + } + if (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + if (isSetThreeDSAuthenticationOnly) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY, this.threeDSAuthenticationOnly); + } + + 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 PaymentDetailsRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentDetailsResponse.java b/src/main/java/com/adyen/model/checkout/PaymentDetailsResponse.java index fd037500c..5ac654cf3 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDetailsResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentDetailsResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -47,39 +49,75 @@ public class PaymentDetailsResponse { public static final String JSON_PROPERTY_ACTION = "action"; private PaymentDetailsResponseAction action; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAction = 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_DONATION_TOKEN = "donationToken"; private String donationToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationToken = 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_MERCHANT_REFERENCE = "merchantReference"; private String merchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantReference = false; + public static final String JSON_PROPERTY_ORDER = "order"; private CheckoutOrderResponse order; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrder = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private ResponsePaymentMethod paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + public static final String JSON_PROPERTY_PAYMENT_VALIDATIONS = "paymentValidations"; private PaymentValidationsResponse paymentValidations; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentValidations = 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; + public static final String JSON_PROPERTY_REFUSAL_REASON_CODE = "refusalReasonCode"; private String refusalReasonCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRefusalReasonCode = false; + /** * The result of the payment. For more information, see [Result * codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * @@ -176,18 +214,39 @@ 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; + 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_THREE_D_S2_RESPONSE_DATA = "threeDS2ResponseData"; private ThreeDS2ResponseData threeDS2ResponseData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2ResponseData = 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_S_PAYMENT_DATA = "threeDSPaymentData"; private String threeDSPaymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSPaymentData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentDetailsResponse() {} /** @@ -198,6 +257,7 @@ public PaymentDetailsResponse() {} */ public PaymentDetailsResponse action(PaymentDetailsResponseAction action) { this.action = action; + isSetAction = true; // mark as set return this; } @@ -221,6 +281,7 @@ public PaymentDetailsResponseAction getAction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAction(PaymentDetailsResponseAction action) { this.action = action; + isSetAction = true; // mark as set } /** @@ -234,6 +295,7 @@ public void setAction(PaymentDetailsResponseAction action) { */ public PaymentDetailsResponse additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -271,6 +333,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -281,6 +344,7 @@ public void setAdditionalData(Map additionalData) { */ public PaymentDetailsResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -304,6 +368,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -314,6 +379,7 @@ public void setAmount(Amount amount) { */ public PaymentDetailsResponse donationToken(String donationToken) { this.donationToken = donationToken; + isSetDonationToken = true; // mark as set return this; } @@ -337,6 +403,7 @@ public String getDonationToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationToken(String donationToken) { this.donationToken = donationToken; + isSetDonationToken = true; // mark as set } /** @@ -347,6 +414,7 @@ public void setDonationToken(String donationToken) { */ public PaymentDetailsResponse fraudResult(FraudResult fraudResult) { this.fraudResult = fraudResult; + isSetFraudResult = true; // mark as set return this; } @@ -370,6 +438,7 @@ public FraudResult getFraudResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudResult(FraudResult fraudResult) { this.fraudResult = fraudResult; + isSetFraudResult = true; // mark as set } /** @@ -380,6 +449,7 @@ public void setFraudResult(FraudResult fraudResult) { */ public PaymentDetailsResponse merchantReference(String merchantReference) { this.merchantReference = merchantReference; + isSetMerchantReference = true; // mark as set return this; } @@ -403,6 +473,7 @@ public String getMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantReference(String merchantReference) { this.merchantReference = merchantReference; + isSetMerchantReference = true; // mark as set } /** @@ -413,6 +484,7 @@ public void setMerchantReference(String merchantReference) { */ public PaymentDetailsResponse order(CheckoutOrderResponse order) { this.order = order; + isSetOrder = true; // mark as set return this; } @@ -436,6 +508,7 @@ public CheckoutOrderResponse getOrder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrder(CheckoutOrderResponse order) { this.order = order; + isSetOrder = true; // mark as set } /** @@ -446,6 +519,7 @@ public void setOrder(CheckoutOrderResponse order) { */ public PaymentDetailsResponse paymentMethod(ResponsePaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -469,6 +543,7 @@ public ResponsePaymentMethod getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(ResponsePaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -479,6 +554,7 @@ public void setPaymentMethod(ResponsePaymentMethod paymentMethod) { */ public PaymentDetailsResponse paymentValidations(PaymentValidationsResponse paymentValidations) { this.paymentValidations = paymentValidations; + isSetPaymentValidations = true; // mark as set return this; } @@ -502,6 +578,7 @@ public PaymentValidationsResponse getPaymentValidations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentValidations(PaymentValidationsResponse paymentValidations) { this.paymentValidations = paymentValidations; + isSetPaymentValidations = true; // mark as set } /** @@ -515,6 +592,7 @@ public void setPaymentValidations(PaymentValidationsResponse paymentValidations) */ public PaymentDetailsResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -544,6 +622,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -562,6 +641,7 @@ public void setPspReference(String pspReference) { */ public PaymentDetailsResponse refusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set return this; } @@ -601,6 +681,7 @@ public String getRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set } /** @@ -614,6 +695,7 @@ public void setRefusalReason(String refusalReason) { */ public PaymentDetailsResponse refusalReasonCode(String refusalReasonCode) { this.refusalReasonCode = refusalReasonCode; + isSetRefusalReasonCode = true; // mark as set return this; } @@ -643,6 +725,7 @@ public String getRefusalReasonCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReasonCode(String refusalReasonCode) { this.refusalReasonCode = refusalReasonCode; + isSetRefusalReasonCode = true; // mark as set } /** @@ -706,6 +789,7 @@ public void setRefusalReasonCode(String refusalReasonCode) { */ public PaymentDetailsResponse resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -835,6 +919,7 @@ public ResultCodeEnum getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set } /** @@ -845,6 +930,7 @@ public void setResultCode(ResultCodeEnum resultCode) { */ public PaymentDetailsResponse shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -868,6 +954,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -878,6 +965,7 @@ public void setShopperLocale(String shopperLocale) { */ public PaymentDetailsResponse threeDS2ResponseData(ThreeDS2ResponseData threeDS2ResponseData) { this.threeDS2ResponseData = threeDS2ResponseData; + isSetThreeDS2ResponseData = true; // mark as set return this; } @@ -901,6 +989,7 @@ public ThreeDS2ResponseData getThreeDS2ResponseData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2ResponseData(ThreeDS2ResponseData threeDS2ResponseData) { this.threeDS2ResponseData = threeDS2ResponseData; + isSetThreeDS2ResponseData = true; // mark as set } /** @@ -911,6 +1000,7 @@ public void setThreeDS2ResponseData(ThreeDS2ResponseData threeDS2ResponseData) { */ public PaymentDetailsResponse threeDS2Result(ThreeDS2Result threeDS2Result) { this.threeDS2Result = threeDS2Result; + isSetThreeDS2Result = true; // mark as set return this; } @@ -934,6 +1024,7 @@ public ThreeDS2Result getThreeDS2Result() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2Result(ThreeDS2Result threeDS2Result) { this.threeDS2Result = threeDS2Result; + isSetThreeDS2Result = true; // mark as set } /** @@ -946,6 +1037,7 @@ public void setThreeDS2Result(ThreeDS2Result threeDS2Result) { */ public PaymentDetailsResponse threeDSPaymentData(String threeDSPaymentData) { this.threeDSPaymentData = threeDSPaymentData; + isSetThreeDSPaymentData = true; // mark as set return this; } @@ -973,6 +1065,27 @@ public String getThreeDSPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSPaymentData(String threeDSPaymentData) { this.threeDSPaymentData = threeDSPaymentData; + isSetThreeDSPaymentData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentDetailsResponse 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 PaymentDetailsResponse object is equal to o. */ @@ -1063,6 +1176,78 @@ 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 (isSetAction) { + addIfNull(nulls, JSON_PROPERTY_ACTION, this.action); + } + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetDonationToken) { + addIfNull(nulls, JSON_PROPERTY_DONATION_TOKEN, this.donationToken); + } + if (isSetFraudResult) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_RESULT, this.fraudResult); + } + if (isSetMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_REFERENCE, this.merchantReference); + } + if (isSetOrder) { + addIfNull(nulls, JSON_PROPERTY_ORDER, this.order); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetPaymentValidations) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_VALIDATIONS, this.paymentValidations); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetRefusalReason) { + addIfNull(nulls, JSON_PROPERTY_REFUSAL_REASON, this.refusalReason); + } + if (isSetRefusalReasonCode) { + addIfNull(nulls, JSON_PROPERTY_REFUSAL_REASON_CODE, this.refusalReasonCode); + } + if (isSetResultCode) { + addIfNull(nulls, JSON_PROPERTY_RESULT_CODE, this.resultCode); + } + if (isSetShopperLocale) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_LOCALE, this.shopperLocale); + } + if (isSetThreeDS2ResponseData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_RESPONSE_DATA, this.threeDS2ResponseData); + } + if (isSetThreeDS2Result) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_RESULT, this.threeDS2Result); + } + if (isSetThreeDSPaymentData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_PAYMENT_DATA, this.threeDSPaymentData); + } + + 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 PaymentDetailsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentLinkRequest.java b/src/main/java/com/adyen/model/checkout/PaymentLinkRequest.java index 5d035c14d..54e5ec359 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentLinkRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentLinkRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -76,69 +78,135 @@ public class PaymentLinkRequest { public static final String JSON_PROPERTY_ALLOWED_PAYMENT_METHODS = "allowedPaymentMethods"; private List allowedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedPaymentMethods = 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_BLOCKED_PAYMENT_METHODS = "blockedPaymentMethods"; private List blockedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBlockedPaymentMethods = 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_COUNTRY_CODE = "countryCode"; private String countryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryCode = 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_DELIVER_AT = "deliverAt"; private OffsetDateTime deliverAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliverAt = 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_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private OffsetDateTime expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + public static final String JSON_PROPERTY_FUND_ORIGIN = "fundOrigin"; private FundOrigin fundOrigin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundOrigin = false; + public static final String JSON_PROPERTY_FUND_RECIPIENT = "fundRecipient"; private FundRecipient fundRecipient; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundRecipient = false; + public static final String JSON_PROPERTY_INSTALLMENT_OPTIONS = "installmentOptions"; private Map installmentOptions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentOptions = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = false; + public static final String JSON_PROPERTY_MANUAL_CAPTURE = "manualCapture"; private Boolean manualCapture; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetManualCapture = 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_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = 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; + /** * Defines a recurring payment type. Required when `storePaymentMethodMode` is set to * **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a @@ -196,9 +264,15 @@ 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; + /** Gets or Sets requiredShopperFields */ public enum RequiredShopperFieldsEnum { BILLINGADDRESS(String.valueOf("billingAddress")), @@ -249,46 +323,88 @@ public static RequiredShopperFieldsEnum fromValue(String value) { public static final String JSON_PROPERTY_REQUIRED_SHOPPER_FIELDS = "requiredShopperFields"; private List requiredShopperFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequiredShopperFields = false; + public static final String JSON_PROPERTY_RETURN_URL = "returnUrl"; private String returnUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReturnUrl = false; + public static final String JSON_PROPERTY_REUSABLE = "reusable"; private Boolean reusable; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReusable = false; + public static final String JSON_PROPERTY_RISK_DATA = "riskData"; private RiskData riskData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskData = 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_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_SHOW_REMOVE_PAYMENT_METHOD_BUTTON = "showRemovePaymentMethodButton"; private Boolean showRemovePaymentMethodButton; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShowRemovePaymentMethodButton = 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_SPLIT_CARD_FUNDING_SOURCES = "splitCardFundingSources"; private Boolean splitCardFundingSources; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplitCardFundingSources = 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; + /** * Indicates if the details of the payment method will be stored for the shopper. Possible values: * * **disabled** – No details will be stored (default). * **askForConsent** – If the @@ -343,15 +459,33 @@ public static StorePaymentMethodModeEnum fromValue(String value) { public static final String JSON_PROPERTY_STORE_PAYMENT_METHOD_MODE = "storePaymentMethodMode"; private StorePaymentMethodModeEnum storePaymentMethodMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStorePaymentMethodMode = 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_THEME_ID = "themeId"; private String themeId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThemeId = false; + public static final String JSON_PROPERTY_THREE_D_S2_REQUEST_DATA = "threeDS2RequestData"; private CheckoutSessionThreeDS2RequestData threeDS2RequestData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2RequestData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentLinkRequest() {} /** @@ -367,6 +501,7 @@ public PaymentLinkRequest() {} */ public PaymentLinkRequest allowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set return this; } @@ -408,6 +543,7 @@ public List getAllowedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set } /** @@ -418,6 +554,7 @@ public void setAllowedPaymentMethods(List allowedPaymentMethods) { */ public PaymentLinkRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -441,6 +578,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -451,6 +589,7 @@ public void setAmount(Amount amount) { */ public PaymentLinkRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -474,6 +613,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -484,6 +624,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentLinkRequest billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -507,6 +648,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -522,6 +664,7 @@ public void setBillingAddress(Address billingAddress) { */ public PaymentLinkRequest blockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set return this; } @@ -563,6 +706,7 @@ public List getBlockedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBlockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set } /** @@ -574,6 +718,7 @@ public void setBlockedPaymentMethods(List blockedPaymentMethods) { */ public PaymentLinkRequest captureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set return this; } @@ -599,6 +744,7 @@ public Integer getCaptureDelayHours() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set } /** @@ -609,6 +755,7 @@ public void setCaptureDelayHours(Integer captureDelayHours) { */ public PaymentLinkRequest countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -632,6 +779,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -644,6 +792,7 @@ public void setCountryCode(String countryCode) { */ public PaymentLinkRequest dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -671,6 +820,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -685,6 +835,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public PaymentLinkRequest deliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set return this; } @@ -716,6 +867,7 @@ public OffsetDateTime getDeliverAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set } /** @@ -726,6 +878,7 @@ public void setDeliverAt(OffsetDateTime deliverAt) { */ public PaymentLinkRequest deliveryAddress(Address deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -749,6 +902,7 @@ public Address getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(Address deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -760,6 +914,7 @@ public void setDeliveryAddress(Address deliveryAddress) { */ public PaymentLinkRequest description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -785,6 +940,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -802,6 +958,7 @@ public void setDescription(String description) { */ public PaymentLinkRequest expiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -839,6 +996,7 @@ public OffsetDateTime getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -849,6 +1007,7 @@ public void setExpiresAt(OffsetDateTime expiresAt) { */ public PaymentLinkRequest fundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set return this; } @@ -872,6 +1031,7 @@ public FundOrigin getFundOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set } /** @@ -882,6 +1042,7 @@ public void setFundOrigin(FundOrigin fundOrigin) { */ public PaymentLinkRequest fundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set return this; } @@ -905,6 +1066,7 @@ public FundRecipient getFundRecipient() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set } /** @@ -921,6 +1083,7 @@ public void setFundRecipient(FundRecipient fundRecipient) { */ public PaymentLinkRequest installmentOptions(Map installmentOptions) { this.installmentOptions = installmentOptions; + isSetInstallmentOptions = true; // mark as set return this; } @@ -965,6 +1128,7 @@ public Map getInstallmentOptions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallmentOptions(Map installmentOptions) { this.installmentOptions = installmentOptions; + isSetInstallmentOptions = true; // mark as set } /** @@ -979,6 +1143,7 @@ public void setInstallmentOptions(Map installmentOpti */ public PaymentLinkRequest lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -1018,6 +1183,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -1030,6 +1196,7 @@ public void setLineItems(List lineItems) { */ public PaymentLinkRequest manualCapture(Boolean manualCapture) { this.manualCapture = manualCapture; + isSetManualCapture = true; // mark as set return this; } @@ -1057,6 +1224,7 @@ public Boolean getManualCapture() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setManualCapture(Boolean manualCapture) { this.manualCapture = manualCapture; + isSetManualCapture = true; // mark as set } /** @@ -1071,6 +1239,7 @@ public void setManualCapture(Boolean manualCapture) { */ public PaymentLinkRequest mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -1102,6 +1271,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -1112,6 +1282,7 @@ public void setMcc(String mcc) { */ public PaymentLinkRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -1135,6 +1306,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -1148,6 +1320,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentLinkRequest merchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set return this; } @@ -1177,6 +1350,7 @@ public String getMerchantOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set } /** @@ -1197,6 +1371,7 @@ public void setMerchantOrderReference(String merchantOrderReference) { */ public PaymentLinkRequest metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -1248,6 +1423,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -1259,6 +1435,7 @@ public void setMetadata(Map metadata) { public PaymentLinkRequest platformChargebackLogic( PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -1282,6 +1459,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -1309,6 +1487,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac public PaymentLinkRequest recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -1364,6 +1543,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -1376,6 +1556,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public PaymentLinkRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -1403,6 +1584,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -1426,6 +1608,7 @@ public void setReference(String reference) { public PaymentLinkRequest requiredShopperFields( List requiredShopperFields) { this.requiredShopperFields = requiredShopperFields; + isSetRequiredShopperFields = true; // mark as set return this; } @@ -1482,6 +1665,7 @@ public List getRequiredShopperFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequiredShopperFields(List requiredShopperFields) { this.requiredShopperFields = requiredShopperFields; + isSetRequiredShopperFields = true; // mark as set } /** @@ -1496,6 +1680,7 @@ public void setRequiredShopperFields(List requiredSho */ public PaymentLinkRequest returnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set return this; } @@ -1527,6 +1712,7 @@ public String getReturnUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set } /** @@ -1540,6 +1726,7 @@ public void setReturnUrl(String returnUrl) { */ public PaymentLinkRequest reusable(Boolean reusable) { this.reusable = reusable; + isSetReusable = true; // mark as set return this; } @@ -1569,6 +1756,7 @@ public Boolean getReusable() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReusable(Boolean reusable) { this.reusable = reusable; + isSetReusable = true; // mark as set } /** @@ -1579,6 +1767,7 @@ public void setReusable(Boolean reusable) { */ public PaymentLinkRequest riskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set return this; } @@ -1602,6 +1791,7 @@ public RiskData getRiskData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set } /** @@ -1612,6 +1802,7 @@ public void setRiskData(RiskData riskData) { */ public PaymentLinkRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -1635,6 +1826,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -1651,6 +1843,7 @@ public void setShopperEmail(String shopperEmail) { */ public PaymentLinkRequest shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -1686,6 +1879,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -1696,6 +1890,7 @@ public void setShopperLocale(String shopperLocale) { */ public PaymentLinkRequest shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -1719,6 +1914,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -1734,6 +1930,7 @@ public void setShopperName(Name shopperName) { */ public PaymentLinkRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -1767,6 +1964,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -1782,6 +1980,7 @@ public void setShopperReference(String shopperReference) { */ public PaymentLinkRequest shopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set return this; } @@ -1815,6 +2014,7 @@ public String getShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set } /** @@ -1826,6 +2026,7 @@ public void setShopperStatement(String shopperStatement) { */ public PaymentLinkRequest showRemovePaymentMethodButton(Boolean showRemovePaymentMethodButton) { this.showRemovePaymentMethodButton = showRemovePaymentMethodButton; + isSetShowRemovePaymentMethodButton = true; // mark as set return this; } @@ -1851,6 +2052,7 @@ public Boolean getShowRemovePaymentMethodButton() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShowRemovePaymentMethodButton(Boolean showRemovePaymentMethodButton) { this.showRemovePaymentMethodButton = showRemovePaymentMethodButton; + isSetShowRemovePaymentMethodButton = true; // mark as set } /** @@ -1861,6 +2063,7 @@ public void setShowRemovePaymentMethodButton(Boolean showRemovePaymentMethodButt */ public PaymentLinkRequest socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -1884,6 +2087,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -1896,6 +2100,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public PaymentLinkRequest splitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set return this; } @@ -1923,6 +2128,7 @@ public Boolean getSplitCardFundingSources() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set } /** @@ -1941,6 +2147,7 @@ public void setSplitCardFundingSources(Boolean splitCardFundingSources) { */ public PaymentLinkRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -1988,6 +2195,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -1998,6 +2206,7 @@ public void setSplits(List splits) { */ public PaymentLinkRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -2021,6 +2230,7 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set } /** @@ -2044,6 +2254,7 @@ public void setStore(String store) { public PaymentLinkRequest storePaymentMethodMode( StorePaymentMethodModeEnum storePaymentMethodMode) { this.storePaymentMethodMode = storePaymentMethodMode; + isSetStorePaymentMethodMode = true; // mark as set return this; } @@ -2091,6 +2302,7 @@ public StorePaymentMethodModeEnum getStorePaymentMethodMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStorePaymentMethodMode(StorePaymentMethodModeEnum storePaymentMethodMode) { this.storePaymentMethodMode = storePaymentMethodMode; + isSetStorePaymentMethodMode = true; // mark as set } /** @@ -2109,6 +2321,7 @@ public void setStorePaymentMethodMode(StorePaymentMethodModeEnum storePaymentMet */ public PaymentLinkRequest telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -2148,6 +2361,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -2163,6 +2377,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public PaymentLinkRequest themeId(String themeId) { this.themeId = themeId; + isSetThemeId = true; // mark as set return this; } @@ -2196,6 +2411,7 @@ public String getThemeId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThemeId(String themeId) { this.themeId = themeId; + isSetThemeId = true; // mark as set } /** @@ -2207,6 +2423,7 @@ public void setThemeId(String themeId) { public PaymentLinkRequest threeDS2RequestData( CheckoutSessionThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set return this; } @@ -2230,6 +2447,27 @@ public CheckoutSessionThreeDS2RequestData getThreeDS2RequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2RequestData(CheckoutSessionThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentLinkRequest 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 PaymentLinkRequest object is equal to o. */ @@ -2417,6 +2655,156 @@ 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 (isSetAllowedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_PAYMENT_METHODS, this.allowedPaymentMethods); + } + 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 (isSetBlockedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_BLOCKED_PAYMENT_METHODS, this.blockedPaymentMethods); + } + if (isSetCaptureDelayHours) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_DELAY_HOURS, this.captureDelayHours); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetDeliverAt) { + addIfNull(nulls, JSON_PROPERTY_DELIVER_AT, this.deliverAt); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetFundOrigin) { + addIfNull(nulls, JSON_PROPERTY_FUND_ORIGIN, this.fundOrigin); + } + if (isSetFundRecipient) { + addIfNull(nulls, JSON_PROPERTY_FUND_RECIPIENT, this.fundRecipient); + } + if (isSetInstallmentOptions) { + addIfNull(nulls, JSON_PROPERTY_INSTALLMENT_OPTIONS, this.installmentOptions); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetManualCapture) { + addIfNull(nulls, JSON_PROPERTY_MANUAL_CAPTURE, this.manualCapture); + } + 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 (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetRequiredShopperFields) { + addIfNull(nulls, JSON_PROPERTY_REQUIRED_SHOPPER_FIELDS, this.requiredShopperFields); + } + if (isSetReturnUrl) { + addIfNull(nulls, JSON_PROPERTY_RETURN_URL, this.returnUrl); + } + if (isSetReusable) { + addIfNull(nulls, JSON_PROPERTY_REUSABLE, this.reusable); + } + if (isSetRiskData) { + addIfNull(nulls, JSON_PROPERTY_RISK_DATA, this.riskData); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + 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 (isSetShowRemovePaymentMethodButton) { + addIfNull( + nulls, + JSON_PROPERTY_SHOW_REMOVE_PAYMENT_METHOD_BUTTON, + this.showRemovePaymentMethodButton); + } + if (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + if (isSetSplitCardFundingSources) { + addIfNull(nulls, JSON_PROPERTY_SPLIT_CARD_FUNDING_SOURCES, this.splitCardFundingSources); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + if (isSetStorePaymentMethodMode) { + addIfNull(nulls, JSON_PROPERTY_STORE_PAYMENT_METHOD_MODE, this.storePaymentMethodMode); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetThemeId) { + addIfNull(nulls, JSON_PROPERTY_THEME_ID, this.themeId); + } + if (isSetThreeDS2RequestData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_REQUEST_DATA, this.threeDS2RequestData); + } + + 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 PaymentLinkRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java b/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java index c76f9f3bb..1ba0d219f 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -80,72 +82,141 @@ public class PaymentLinkResponse { public static final String JSON_PROPERTY_ALLOWED_PAYMENT_METHODS = "allowedPaymentMethods"; private List allowedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedPaymentMethods = 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_BLOCKED_PAYMENT_METHODS = "blockedPaymentMethods"; private List blockedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBlockedPaymentMethods = 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_COUNTRY_CODE = "countryCode"; private String countryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryCode = 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_DELIVER_AT = "deliverAt"; private OffsetDateTime deliverAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliverAt = 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_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private OffsetDateTime expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + public static final String JSON_PROPERTY_FUND_ORIGIN = "fundOrigin"; private FundOrigin fundOrigin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundOrigin = false; + public static final String JSON_PROPERTY_FUND_RECIPIENT = "fundRecipient"; private FundRecipient fundRecipient; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundRecipient = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_INSTALLMENT_OPTIONS = "installmentOptions"; private Map installmentOptions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentOptions = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = false; + public static final String JSON_PROPERTY_MANUAL_CAPTURE = "manualCapture"; private Boolean manualCapture; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetManualCapture = 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_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = 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; + /** * Defines a recurring payment type. Required when `storePaymentMethodMode` is set to * **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a @@ -203,9 +274,15 @@ 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; + /** Gets or Sets requiredShopperFields */ public enum RequiredShopperFieldsEnum { BILLINGADDRESS(String.valueOf("billingAddress")), @@ -256,43 +333,82 @@ public static RequiredShopperFieldsEnum fromValue(String value) { public static final String JSON_PROPERTY_REQUIRED_SHOPPER_FIELDS = "requiredShopperFields"; private List requiredShopperFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequiredShopperFields = false; + public static final String JSON_PROPERTY_RETURN_URL = "returnUrl"; private String returnUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReturnUrl = false; + public static final String JSON_PROPERTY_REUSABLE = "reusable"; private Boolean reusable; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReusable = false; + public static final String JSON_PROPERTY_RISK_DATA = "riskData"; private RiskData riskData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskData = 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_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_SHOW_REMOVE_PAYMENT_METHOD_BUTTON = "showRemovePaymentMethodButton"; private Boolean showRemovePaymentMethodButton; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShowRemovePaymentMethodButton = 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_SPLIT_CARD_FUNDING_SOURCES = "splitCardFundingSources"; private Boolean splitCardFundingSources; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplitCardFundingSources = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + /** * Status of the payment link. Possible values: * **active**: The link can be used to make * payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no @@ -349,9 +465,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_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + /** * Indicates if the details of the payment method will be stored for the shopper. Possible values: * * **disabled** – No details will be stored (default). * **askForConsent** – If the @@ -406,21 +528,45 @@ public static StorePaymentMethodModeEnum fromValue(String value) { public static final String JSON_PROPERTY_STORE_PAYMENT_METHOD_MODE = "storePaymentMethodMode"; private StorePaymentMethodModeEnum storePaymentMethodMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStorePaymentMethodMode = 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_THEME_ID = "themeId"; private String themeId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThemeId = false; + public static final String JSON_PROPERTY_THREE_D_S2_REQUEST_DATA = "threeDS2RequestData"; private CheckoutSessionThreeDS2RequestData threeDS2RequestData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2RequestData = false; + public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt"; private OffsetDateTime updatedAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUpdatedAt = false; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentLinkResponse() {} @JsonCreator @@ -444,6 +590,7 @@ public PaymentLinkResponse( */ public PaymentLinkResponse allowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set return this; } @@ -485,6 +632,7 @@ public List getAllowedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set } /** @@ -495,6 +643,7 @@ public void setAllowedPaymentMethods(List allowedPaymentMethods) { */ public PaymentLinkResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -518,6 +667,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -528,6 +678,7 @@ public void setAmount(Amount amount) { */ public PaymentLinkResponse applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -551,6 +702,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -561,6 +713,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentLinkResponse billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -584,6 +737,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -599,6 +753,7 @@ public void setBillingAddress(Address billingAddress) { */ public PaymentLinkResponse blockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set return this; } @@ -640,6 +795,7 @@ public List getBlockedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBlockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set } /** @@ -651,6 +807,7 @@ public void setBlockedPaymentMethods(List blockedPaymentMethods) { */ public PaymentLinkResponse captureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set return this; } @@ -676,6 +833,7 @@ public Integer getCaptureDelayHours() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set } /** @@ -686,6 +844,7 @@ public void setCaptureDelayHours(Integer captureDelayHours) { */ public PaymentLinkResponse countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -709,6 +868,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -721,6 +881,7 @@ public void setCountryCode(String countryCode) { */ public PaymentLinkResponse dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -748,6 +909,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -762,6 +924,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public PaymentLinkResponse deliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set return this; } @@ -793,6 +956,7 @@ public OffsetDateTime getDeliverAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set } /** @@ -803,6 +967,7 @@ public void setDeliverAt(OffsetDateTime deliverAt) { */ public PaymentLinkResponse deliveryAddress(Address deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -826,6 +991,7 @@ public Address getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(Address deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -837,6 +1003,7 @@ public void setDeliveryAddress(Address deliveryAddress) { */ public PaymentLinkResponse description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -862,6 +1029,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -879,6 +1047,7 @@ public void setDescription(String description) { */ public PaymentLinkResponse expiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -916,6 +1085,7 @@ public OffsetDateTime getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -926,6 +1096,7 @@ public void setExpiresAt(OffsetDateTime expiresAt) { */ public PaymentLinkResponse fundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set return this; } @@ -949,6 +1120,7 @@ public FundOrigin getFundOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set } /** @@ -959,6 +1131,7 @@ public void setFundOrigin(FundOrigin fundOrigin) { */ public PaymentLinkResponse fundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set return this; } @@ -982,6 +1155,7 @@ public FundRecipient getFundRecipient() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set } /** @@ -1009,6 +1183,7 @@ public String getId() { */ public PaymentLinkResponse installmentOptions(Map installmentOptions) { this.installmentOptions = installmentOptions; + isSetInstallmentOptions = true; // mark as set return this; } @@ -1053,6 +1228,7 @@ public Map getInstallmentOptions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallmentOptions(Map installmentOptions) { this.installmentOptions = installmentOptions; + isSetInstallmentOptions = true; // mark as set } /** @@ -1067,6 +1243,7 @@ public void setInstallmentOptions(Map installmentOpti */ public PaymentLinkResponse lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -1106,6 +1283,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -1118,6 +1296,7 @@ public void setLineItems(List lineItems) { */ public PaymentLinkResponse manualCapture(Boolean manualCapture) { this.manualCapture = manualCapture; + isSetManualCapture = true; // mark as set return this; } @@ -1145,6 +1324,7 @@ public Boolean getManualCapture() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setManualCapture(Boolean manualCapture) { this.manualCapture = manualCapture; + isSetManualCapture = true; // mark as set } /** @@ -1159,6 +1339,7 @@ public void setManualCapture(Boolean manualCapture) { */ public PaymentLinkResponse mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -1190,6 +1371,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -1200,6 +1382,7 @@ public void setMcc(String mcc) { */ public PaymentLinkResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -1223,6 +1406,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -1236,6 +1420,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentLinkResponse merchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set return this; } @@ -1265,6 +1450,7 @@ public String getMerchantOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set } /** @@ -1285,6 +1471,7 @@ public void setMerchantOrderReference(String merchantOrderReference) { */ public PaymentLinkResponse metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -1336,6 +1523,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -1347,6 +1535,7 @@ public void setMetadata(Map metadata) { public PaymentLinkResponse platformChargebackLogic( PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -1370,6 +1559,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -1397,6 +1587,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac public PaymentLinkResponse recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -1452,6 +1643,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -1464,6 +1656,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public PaymentLinkResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -1491,6 +1684,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -1514,6 +1708,7 @@ public void setReference(String reference) { public PaymentLinkResponse requiredShopperFields( List requiredShopperFields) { this.requiredShopperFields = requiredShopperFields; + isSetRequiredShopperFields = true; // mark as set return this; } @@ -1570,6 +1765,7 @@ public List getRequiredShopperFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequiredShopperFields(List requiredShopperFields) { this.requiredShopperFields = requiredShopperFields; + isSetRequiredShopperFields = true; // mark as set } /** @@ -1584,6 +1780,7 @@ public void setRequiredShopperFields(List requiredSho */ public PaymentLinkResponse returnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set return this; } @@ -1615,6 +1812,7 @@ public String getReturnUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set } /** @@ -1628,6 +1826,7 @@ public void setReturnUrl(String returnUrl) { */ public PaymentLinkResponse reusable(Boolean reusable) { this.reusable = reusable; + isSetReusable = true; // mark as set return this; } @@ -1657,6 +1856,7 @@ public Boolean getReusable() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReusable(Boolean reusable) { this.reusable = reusable; + isSetReusable = true; // mark as set } /** @@ -1667,6 +1867,7 @@ public void setReusable(Boolean reusable) { */ public PaymentLinkResponse riskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set return this; } @@ -1690,6 +1891,7 @@ public RiskData getRiskData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set } /** @@ -1700,6 +1902,7 @@ public void setRiskData(RiskData riskData) { */ public PaymentLinkResponse shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -1723,6 +1926,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -1739,6 +1943,7 @@ public void setShopperEmail(String shopperEmail) { */ public PaymentLinkResponse shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -1774,6 +1979,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -1784,6 +1990,7 @@ public void setShopperLocale(String shopperLocale) { */ public PaymentLinkResponse shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -1807,6 +2014,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -1822,6 +2030,7 @@ public void setShopperName(Name shopperName) { */ public PaymentLinkResponse shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -1855,6 +2064,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -1870,6 +2080,7 @@ public void setShopperReference(String shopperReference) { */ public PaymentLinkResponse shopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set return this; } @@ -1903,6 +2114,7 @@ public String getShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set } /** @@ -1914,6 +2126,7 @@ public void setShopperStatement(String shopperStatement) { */ public PaymentLinkResponse showRemovePaymentMethodButton(Boolean showRemovePaymentMethodButton) { this.showRemovePaymentMethodButton = showRemovePaymentMethodButton; + isSetShowRemovePaymentMethodButton = true; // mark as set return this; } @@ -1939,6 +2152,7 @@ public Boolean getShowRemovePaymentMethodButton() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShowRemovePaymentMethodButton(Boolean showRemovePaymentMethodButton) { this.showRemovePaymentMethodButton = showRemovePaymentMethodButton; + isSetShowRemovePaymentMethodButton = true; // mark as set } /** @@ -1949,6 +2163,7 @@ public void setShowRemovePaymentMethodButton(Boolean showRemovePaymentMethodButt */ public PaymentLinkResponse socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -1972,6 +2187,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -1984,6 +2200,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public PaymentLinkResponse splitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set return this; } @@ -2011,6 +2228,7 @@ public Boolean getSplitCardFundingSources() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set } /** @@ -2029,6 +2247,7 @@ public void setSplitCardFundingSources(Boolean splitCardFundingSources) { */ public PaymentLinkResponse splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -2076,6 +2295,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -2094,6 +2314,7 @@ public void setSplits(List splits) { */ public PaymentLinkResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -2133,6 +2354,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -2143,6 +2365,7 @@ public void setStatus(StatusEnum status) { */ public PaymentLinkResponse store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -2166,6 +2389,7 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set } /** @@ -2189,6 +2413,7 @@ public void setStore(String store) { public PaymentLinkResponse storePaymentMethodMode( StorePaymentMethodModeEnum storePaymentMethodMode) { this.storePaymentMethodMode = storePaymentMethodMode; + isSetStorePaymentMethodMode = true; // mark as set return this; } @@ -2236,6 +2461,7 @@ public StorePaymentMethodModeEnum getStorePaymentMethodMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStorePaymentMethodMode(StorePaymentMethodModeEnum storePaymentMethodMode) { this.storePaymentMethodMode = storePaymentMethodMode; + isSetStorePaymentMethodMode = true; // mark as set } /** @@ -2254,6 +2480,7 @@ public void setStorePaymentMethodMode(StorePaymentMethodModeEnum storePaymentMet */ public PaymentLinkResponse telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -2293,6 +2520,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -2308,6 +2536,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public PaymentLinkResponse themeId(String themeId) { this.themeId = themeId; + isSetThemeId = true; // mark as set return this; } @@ -2341,6 +2570,7 @@ public String getThemeId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThemeId(String themeId) { this.themeId = themeId; + isSetThemeId = true; // mark as set } /** @@ -2352,6 +2582,7 @@ public void setThemeId(String themeId) { public PaymentLinkResponse threeDS2RequestData( CheckoutSessionThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set return this; } @@ -2375,6 +2606,7 @@ public CheckoutSessionThreeDS2RequestData getThreeDS2RequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2RequestData(CheckoutSessionThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set } /** @@ -2389,6 +2621,7 @@ public void setThreeDS2RequestData(CheckoutSessionThreeDS2RequestData threeDS2Re */ public PaymentLinkResponse updatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; + isSetUpdatedAt = true; // mark as set return this; } @@ -2420,6 +2653,7 @@ public OffsetDateTime getUpdatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUpdatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; + isSetUpdatedAt = true; // mark as set } /** @@ -2433,6 +2667,26 @@ public String getUrl() { return url; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentLinkResponse 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 PaymentLinkResponse object is equal to o. */ @Override public boolean equals(Object o) { @@ -2630,6 +2884,168 @@ 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 (isSetAllowedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_PAYMENT_METHODS, this.allowedPaymentMethods); + } + 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 (isSetBlockedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_BLOCKED_PAYMENT_METHODS, this.blockedPaymentMethods); + } + if (isSetCaptureDelayHours) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_DELAY_HOURS, this.captureDelayHours); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetDeliverAt) { + addIfNull(nulls, JSON_PROPERTY_DELIVER_AT, this.deliverAt); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetFundOrigin) { + addIfNull(nulls, JSON_PROPERTY_FUND_ORIGIN, this.fundOrigin); + } + if (isSetFundRecipient) { + addIfNull(nulls, JSON_PROPERTY_FUND_RECIPIENT, this.fundRecipient); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetInstallmentOptions) { + addIfNull(nulls, JSON_PROPERTY_INSTALLMENT_OPTIONS, this.installmentOptions); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetManualCapture) { + addIfNull(nulls, JSON_PROPERTY_MANUAL_CAPTURE, this.manualCapture); + } + 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 (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetRequiredShopperFields) { + addIfNull(nulls, JSON_PROPERTY_REQUIRED_SHOPPER_FIELDS, this.requiredShopperFields); + } + if (isSetReturnUrl) { + addIfNull(nulls, JSON_PROPERTY_RETURN_URL, this.returnUrl); + } + if (isSetReusable) { + addIfNull(nulls, JSON_PROPERTY_REUSABLE, this.reusable); + } + if (isSetRiskData) { + addIfNull(nulls, JSON_PROPERTY_RISK_DATA, this.riskData); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + 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 (isSetShowRemovePaymentMethodButton) { + addIfNull( + nulls, + JSON_PROPERTY_SHOW_REMOVE_PAYMENT_METHOD_BUTTON, + this.showRemovePaymentMethodButton); + } + if (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + if (isSetSplitCardFundingSources) { + addIfNull(nulls, JSON_PROPERTY_SPLIT_CARD_FUNDING_SOURCES, this.splitCardFundingSources); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + if (isSetStorePaymentMethodMode) { + addIfNull(nulls, JSON_PROPERTY_STORE_PAYMENT_METHOD_MODE, this.storePaymentMethodMode); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetThemeId) { + addIfNull(nulls, JSON_PROPERTY_THEME_ID, this.themeId); + } + if (isSetThreeDS2RequestData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_REQUEST_DATA, this.threeDS2RequestData); + } + if (isSetUpdatedAt) { + addIfNull(nulls, JSON_PROPERTY_UPDATED_AT, this.updatedAt); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + 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 PaymentLinkResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethod.java b/src/main/java/com/adyen/model/checkout/PaymentMethod.java index 9e7852b9e..8ab48cfd0 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethod.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,15 +45,27 @@ public class PaymentMethod { public static final String JSON_PROPERTY_APPS = "apps"; private List apps; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApps = false; + public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_BRANDS = "brands"; private List brands; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrands = false; + public static final String JSON_PROPERTY_CONFIGURATION = "configuration"; private Map configuration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConfiguration = false; + /** The funding source of the payment method. */ public enum FundingSourceEnum { CREDIT(String.valueOf("credit")), @@ -96,25 +110,52 @@ 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_GROUP = "group"; private PaymentMethodGroup group; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGroup = false; + public static final String JSON_PROPERTY_INPUT_DETAILS = "inputDetails"; @Deprecated // deprecated private List inputDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInputDetails = false; + public static final String JSON_PROPERTY_ISSUERS = "issuers"; private List issuers; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuers = 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_PROMOTED = "promoted"; private Boolean promoted; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPromoted = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 PaymentMethod() {} /** @@ -125,6 +166,7 @@ public PaymentMethod() {} */ public PaymentMethod apps(List apps) { this.apps = apps; + isSetApps = true; // mark as set return this; } @@ -156,6 +198,7 @@ public List getApps() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApps(List apps) { this.apps = apps; + isSetApps = true; // mark as set } /** @@ -166,6 +209,7 @@ public void setApps(List apps) { */ public PaymentMethod brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -189,6 +233,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -199,6 +244,7 @@ public void setBrand(String brand) { */ public PaymentMethod brands(List brands) { this.brands = brands; + isSetBrands = true; // mark as set return this; } @@ -230,6 +276,7 @@ public List getBrands() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrands(List brands) { this.brands = brands; + isSetBrands = true; // mark as set } /** @@ -240,6 +287,7 @@ public void setBrands(List brands) { */ public PaymentMethod configuration(Map configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set return this; } @@ -271,6 +319,7 @@ public Map getConfiguration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConfiguration(Map configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set } /** @@ -281,6 +330,7 @@ public void setConfiguration(Map configuration) { */ public PaymentMethod fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -304,6 +354,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -314,6 +365,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public PaymentMethod group(PaymentMethodGroup group) { this.group = group; + isSetGroup = true; // mark as set return this; } @@ -337,6 +389,7 @@ public PaymentMethodGroup getGroup() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGroup(PaymentMethodGroup group) { this.group = group; + isSetGroup = true; // mark as set } /** @@ -350,6 +403,7 @@ public void setGroup(PaymentMethodGroup group) { @Deprecated // deprecated public PaymentMethod inputDetails(List inputDetails) { this.inputDetails = inputDetails; + isSetInputDetails = true; // mark as set return this; } @@ -387,6 +441,7 @@ public List getInputDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInputDetails(List inputDetails) { this.inputDetails = inputDetails; + isSetInputDetails = true; // mark as set } /** @@ -397,6 +452,7 @@ public void setInputDetails(List inputDetails) { */ public PaymentMethod issuers(List issuers) { this.issuers = issuers; + isSetIssuers = true; // mark as set return this; } @@ -428,6 +484,7 @@ public List getIssuers() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuers(List issuers) { this.issuers = issuers; + isSetIssuers = true; // mark as set } /** @@ -438,6 +495,7 @@ public void setIssuers(List issuers) { */ public PaymentMethod name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -461,6 +519,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -471,6 +530,7 @@ public void setName(String name) { */ public PaymentMethod promoted(Boolean promoted) { this.promoted = promoted; + isSetPromoted = true; // mark as set return this; } @@ -494,6 +554,7 @@ public Boolean getPromoted() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPromoted(Boolean promoted) { this.promoted = promoted; + isSetPromoted = true; // mark as set } /** @@ -504,6 +565,7 @@ public void setPromoted(Boolean promoted) { */ public PaymentMethod type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -527,6 +589,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentMethod 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 PaymentMethod object is equal to o. */ @@ -597,6 +680,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 (isSetApps) { + addIfNull(nulls, JSON_PROPERTY_APPS, this.apps); + } + if (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetBrands) { + addIfNull(nulls, JSON_PROPERTY_BRANDS, this.brands); + } + if (isSetConfiguration) { + addIfNull(nulls, JSON_PROPERTY_CONFIGURATION, this.configuration); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetGroup) { + addIfNull(nulls, JSON_PROPERTY_GROUP, this.group); + } + if (isSetInputDetails) { + addIfNull(nulls, JSON_PROPERTY_INPUT_DETAILS, this.inputDetails); + } + if (isSetIssuers) { + addIfNull(nulls, JSON_PROPERTY_ISSUERS, this.issuers); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPromoted) { + addIfNull(nulls, JSON_PROPERTY_PROMOTED, this.promoted); + } + 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 PaymentMethod given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethodGroup.java b/src/main/java/com/adyen/model/checkout/PaymentMethodGroup.java index 5ea4bfeed..4e13a9428 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethodGroup.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethodGroup.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 PaymentMethodGroup { 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_PAYMENT_METHOD_DATA = "paymentMethodData"; private String paymentMethodData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodData = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 PaymentMethodGroup() {} /** @@ -43,6 +60,7 @@ public PaymentMethodGroup() {} */ public PaymentMethodGroup name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -77,6 +96,7 @@ public void setName(String name) { */ public PaymentMethodGroup paymentMethodData(String paymentMethodData) { this.paymentMethodData = paymentMethodData; + isSetPaymentMethodData = true; // mark as set return this; } @@ -102,6 +122,7 @@ public String getPaymentMethodData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodData(String paymentMethodData) { this.paymentMethodData = paymentMethodData; + isSetPaymentMethodData = true; // mark as set } /** @@ -112,6 +133,7 @@ public void setPaymentMethodData(String paymentMethodData) { */ public PaymentMethodGroup type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -135,6 +157,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentMethodGroup 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 PaymentMethodGroup object is equal to o. */ @@ -178,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 (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPaymentMethodData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_DATA, this.paymentMethodData); + } + 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 PaymentMethodGroup given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethodIssuer.java b/src/main/java/com/adyen/model/checkout/PaymentMethodIssuer.java index 914d33e43..d845db71d 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethodIssuer.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethodIssuer.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 PaymentMethodIssuer { public static final String JSON_PROPERTY_DISABLED = "disabled"; private Boolean disabled; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisabled = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_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 PaymentMethodIssuer() {} /** @@ -45,6 +62,7 @@ public PaymentMethodIssuer() {} */ public PaymentMethodIssuer disabled(Boolean disabled) { this.disabled = disabled; + isSetDisabled = true; // mark as set return this; } @@ -72,6 +90,7 @@ public Boolean getDisabled() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDisabled(Boolean disabled) { this.disabled = disabled; + isSetDisabled = true; // mark as set } /** @@ -82,6 +101,7 @@ public void setDisabled(Boolean disabled) { */ public PaymentMethodIssuer id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -105,6 +125,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -115,6 +136,7 @@ public void setId(String id) { */ public PaymentMethodIssuer name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -138,6 +160,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 PaymentMethodIssuer 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 PaymentMethodIssuer object is equal to o. */ @@ -181,6 +224,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 (isSetDisabled) { + addIfNull(nulls, JSON_PROPERTY_DISABLED, this.disabled); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + 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 PaymentMethodIssuer given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethodToStore.java b/src/main/java/com/adyen/model/checkout/PaymentMethodToStore.java index 11a4d4c4a..7b93e51be 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethodToStore.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethodToStore.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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; @@ -36,39 +38,81 @@ public class PaymentMethodToStore { public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = 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_ENCRYPTED_CARD = "encryptedCard"; private String encryptedCard; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedCard = false; + public static final String JSON_PROPERTY_ENCRYPTED_CARD_NUMBER = "encryptedCardNumber"; private String encryptedCardNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedCardNumber = false; + public static final String JSON_PROPERTY_ENCRYPTED_EXPIRY_MONTH = "encryptedExpiryMonth"; private String encryptedExpiryMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedExpiryMonth = false; + public static final String JSON_PROPERTY_ENCRYPTED_EXPIRY_YEAR = "encryptedExpiryYear"; private String encryptedExpiryYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedExpiryYear = false; + public static final String JSON_PROPERTY_ENCRYPTED_SECURITY_CODE = "encryptedSecurityCode"; private String encryptedSecurityCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedSecurityCode = 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_NUMBER = "number"; private String number; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 PaymentMethodToStore() {} /** @@ -79,6 +123,7 @@ public PaymentMethodToStore() {} */ public PaymentMethodToStore brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -102,6 +147,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -114,6 +160,7 @@ public void setBrand(String brand) { */ public PaymentMethodToStore cvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set return this; } @@ -141,6 +188,7 @@ public String getCvc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set } /** @@ -151,6 +199,7 @@ public void setCvc(String cvc) { */ public PaymentMethodToStore encryptedCard(String encryptedCard) { this.encryptedCard = encryptedCard; + isSetEncryptedCard = true; // mark as set return this; } @@ -174,6 +223,7 @@ public String getEncryptedCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedCard(String encryptedCard) { this.encryptedCard = encryptedCard; + isSetEncryptedCard = true; // mark as set } /** @@ -184,6 +234,7 @@ public void setEncryptedCard(String encryptedCard) { */ public PaymentMethodToStore encryptedCardNumber(String encryptedCardNumber) { this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set return this; } @@ -207,6 +258,7 @@ public String getEncryptedCardNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedCardNumber(String encryptedCardNumber) { this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set } /** @@ -217,6 +269,7 @@ public void setEncryptedCardNumber(String encryptedCardNumber) { */ public PaymentMethodToStore encryptedExpiryMonth(String encryptedExpiryMonth) { this.encryptedExpiryMonth = encryptedExpiryMonth; + isSetEncryptedExpiryMonth = true; // mark as set return this; } @@ -240,6 +293,7 @@ public String getEncryptedExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedExpiryMonth(String encryptedExpiryMonth) { this.encryptedExpiryMonth = encryptedExpiryMonth; + isSetEncryptedExpiryMonth = true; // mark as set } /** @@ -250,6 +304,7 @@ public void setEncryptedExpiryMonth(String encryptedExpiryMonth) { */ public PaymentMethodToStore encryptedExpiryYear(String encryptedExpiryYear) { this.encryptedExpiryYear = encryptedExpiryYear; + isSetEncryptedExpiryYear = true; // mark as set return this; } @@ -273,6 +328,7 @@ public String getEncryptedExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedExpiryYear(String encryptedExpiryYear) { this.encryptedExpiryYear = encryptedExpiryYear; + isSetEncryptedExpiryYear = true; // mark as set } /** @@ -283,6 +339,7 @@ public void setEncryptedExpiryYear(String encryptedExpiryYear) { */ public PaymentMethodToStore encryptedSecurityCode(String encryptedSecurityCode) { this.encryptedSecurityCode = encryptedSecurityCode; + isSetEncryptedSecurityCode = true; // mark as set return this; } @@ -306,6 +363,7 @@ public String getEncryptedSecurityCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedSecurityCode(String encryptedSecurityCode) { this.encryptedSecurityCode = encryptedSecurityCode; + isSetEncryptedSecurityCode = true; // mark as set } /** @@ -318,6 +376,7 @@ public void setEncryptedSecurityCode(String encryptedSecurityCode) { */ public PaymentMethodToStore expiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set return this; } @@ -345,6 +404,7 @@ public String getExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set } /** @@ -357,6 +417,7 @@ public void setExpiryMonth(String expiryMonth) { */ public PaymentMethodToStore expiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set return this; } @@ -384,6 +445,7 @@ public String getExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set } /** @@ -394,6 +456,7 @@ public void setExpiryYear(String expiryYear) { */ public PaymentMethodToStore holderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set return this; } @@ -417,6 +480,7 @@ public String getHolderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHolderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set } /** @@ -429,6 +493,7 @@ public void setHolderName(String holderName) { */ public PaymentMethodToStore number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -456,6 +521,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -466,6 +532,7 @@ public void setNumber(String number) { */ public PaymentMethodToStore type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -489,6 +556,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentMethodToStore 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 PaymentMethodToStore object is equal to o. */ @@ -570,6 +658,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 (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetCvc) { + addIfNull(nulls, JSON_PROPERTY_CVC, this.cvc); + } + if (isSetEncryptedCard) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_CARD, this.encryptedCard); + } + if (isSetEncryptedCardNumber) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_CARD_NUMBER, this.encryptedCardNumber); + } + if (isSetEncryptedExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_EXPIRY_MONTH, this.encryptedExpiryMonth); + } + if (isSetEncryptedExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_EXPIRY_YEAR, this.encryptedExpiryYear); + } + if (isSetEncryptedSecurityCode) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_SECURITY_CODE, this.encryptedSecurityCode); + } + 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 (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + 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 PaymentMethodToStore given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethodUPIApps.java b/src/main/java/com/adyen/model/checkout/PaymentMethodUPIApps.java index 272b6371c..1a15b942e 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethodUPIApps.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethodUPIApps.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 PaymentMethodUPIApps { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_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 PaymentMethodUPIApps() {} /** @@ -36,6 +50,7 @@ public PaymentMethodUPIApps() {} */ public PaymentMethodUPIApps id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setId(String id) { */ public PaymentMethodUPIApps name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -92,6 +109,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 PaymentMethodUPIApps 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 PaymentMethodUPIApps object is equal to o. */ @@ -133,6 +171,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + 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 PaymentMethodUPIApps given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethodsRequest.java b/src/main/java/com/adyen/model/checkout/PaymentMethodsRequest.java index ca82b573a..cf54a61dd 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethodsRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethodsRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,18 +52,33 @@ public class PaymentMethodsRequest { 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_ALLOWED_PAYMENT_METHODS = "allowedPaymentMethods"; private List allowedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedPaymentMethods = 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_BLOCKED_PAYMENT_METHODS = "blockedPaymentMethods"; private List blockedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBlockedPaymentMethods = 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; + /** * The platform where a payment transaction takes place. This field can be used for filtering out * payment methods that are only available on specific platforms. Possible values: * iOS * Android @@ -112,36 +129,69 @@ public static ChannelEnum fromValue(String value) { public static final String JSON_PROPERTY_CHANNEL = "channel"; private ChannelEnum channel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChannel = 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_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_ORDER = "order"; private EncryptedOrderData order; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrder = false; + public static final String JSON_PROPERTY_SHOPPER_CONVERSION_ID = "shopperConversionId"; private String shopperConversionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperConversionId = 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; + 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_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_SPLIT_CARD_FUNDING_SOURCES = "splitCardFundingSources"; private Boolean splitCardFundingSources; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplitCardFundingSources = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + /** * Specifies how payment methods should be filtered based on the 'store' parameter: - * 'exclusive': Only payment methods belonging to the specified 'store' are @@ -193,9 +243,21 @@ public static StoreFiltrationModeEnum fromValue(String value) { public static final String JSON_PROPERTY_STORE_FILTRATION_MODE = "storeFiltrationMode"; private StoreFiltrationModeEnum storeFiltrationMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoreFiltrationMode = 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 PaymentMethodsRequest() {} /** @@ -210,6 +272,7 @@ public PaymentMethodsRequest() {} */ public PaymentMethodsRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -249,6 +312,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -264,6 +328,7 @@ public void setAdditionalData(Map additionalData) { */ public PaymentMethodsRequest allowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set return this; } @@ -305,6 +370,7 @@ public List getAllowedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set } /** @@ -315,6 +381,7 @@ public void setAllowedPaymentMethods(List allowedPaymentMethods) { */ public PaymentMethodsRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -338,6 +405,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -353,6 +421,7 @@ public void setAmount(Amount amount) { */ public PaymentMethodsRequest blockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set return this; } @@ -394,6 +463,7 @@ public List getBlockedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBlockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set } /** @@ -404,6 +474,7 @@ public void setBlockedPaymentMethods(List blockedPaymentMethods) { */ public PaymentMethodsRequest browserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set return this; } @@ -427,6 +498,7 @@ public BrowserInfo getBrowserInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrowserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set } /** @@ -441,6 +513,7 @@ public void setBrowserInfo(BrowserInfo browserInfo) { */ public PaymentMethodsRequest channel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set return this; } @@ -472,6 +545,7 @@ public ChannelEnum getChannel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChannel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set } /** @@ -482,6 +556,7 @@ public void setChannel(ChannelEnum channel) { */ public PaymentMethodsRequest countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -505,6 +580,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -516,6 +592,7 @@ public void setCountryCode(String countryCode) { */ public PaymentMethodsRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -541,6 +618,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -551,6 +629,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentMethodsRequest order(EncryptedOrderData order) { this.order = order; + isSetOrder = true; // mark as set return this; } @@ -574,6 +653,7 @@ public EncryptedOrderData getOrder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrder(EncryptedOrderData order) { this.order = order; + isSetOrder = true; // mark as set } /** @@ -587,6 +667,7 @@ public void setOrder(EncryptedOrderData order) { */ public PaymentMethodsRequest shopperConversionId(String shopperConversionId) { this.shopperConversionId = shopperConversionId; + isSetShopperConversionId = true; // mark as set return this; } @@ -616,6 +697,7 @@ public String getShopperConversionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperConversionId(String shopperConversionId) { this.shopperConversionId = shopperConversionId; + isSetShopperConversionId = true; // mark as set } /** @@ -630,6 +712,7 @@ public void setShopperConversionId(String shopperConversionId) { */ public PaymentMethodsRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -661,6 +744,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -684,6 +768,7 @@ public void setShopperEmail(String shopperEmail) { */ public PaymentMethodsRequest shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -733,6 +818,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -745,6 +831,7 @@ public void setShopperIP(String shopperIP) { */ public PaymentMethodsRequest shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -772,6 +859,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -788,6 +876,7 @@ public void setShopperLocale(String shopperLocale) { */ public PaymentMethodsRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -823,6 +912,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -835,6 +925,7 @@ public void setShopperReference(String shopperReference) { */ public PaymentMethodsRequest splitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set return this; } @@ -862,6 +953,7 @@ public Boolean getSplitCardFundingSources() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set } /** @@ -885,6 +977,7 @@ public void setSplitCardFundingSources(Boolean splitCardFundingSources) { */ public PaymentMethodsRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -934,6 +1027,7 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set } /** @@ -950,6 +1044,7 @@ public void setStore(String store) { */ public PaymentMethodsRequest storeFiltrationMode(StoreFiltrationModeEnum storeFiltrationMode) { this.storeFiltrationMode = storeFiltrationMode; + isSetStoreFiltrationMode = true; // mark as set return this; } @@ -985,6 +1080,7 @@ public StoreFiltrationModeEnum getStoreFiltrationMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoreFiltrationMode(StoreFiltrationModeEnum storeFiltrationMode) { this.storeFiltrationMode = storeFiltrationMode; + isSetStoreFiltrationMode = true; // mark as set } /** @@ -1003,6 +1099,7 @@ public void setStoreFiltrationMode(StoreFiltrationModeEnum storeFiltrationMode) */ public PaymentMethodsRequest telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -1042,6 +1139,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 PaymentMethodsRequest 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 PaymentMethodsRequest object is equal to o. */ @@ -1144,6 +1262,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 (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetAllowedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_PAYMENT_METHODS, this.allowedPaymentMethods); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBlockedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_BLOCKED_PAYMENT_METHODS, this.blockedPaymentMethods); + } + if (isSetBrowserInfo) { + addIfNull(nulls, JSON_PROPERTY_BROWSER_INFO, this.browserInfo); + } + if (isSetChannel) { + addIfNull(nulls, JSON_PROPERTY_CHANNEL, this.channel); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetOrder) { + addIfNull(nulls, JSON_PROPERTY_ORDER, this.order); + } + if (isSetShopperConversionId) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_CONVERSION_ID, this.shopperConversionId); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperIP) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_I_P, this.shopperIP); + } + if (isSetShopperLocale) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_LOCALE, this.shopperLocale); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetSplitCardFundingSources) { + addIfNull(nulls, JSON_PROPERTY_SPLIT_CARD_FUNDING_SOURCES, this.splitCardFundingSources); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + if (isSetStoreFiltrationMode) { + addIfNull(nulls, JSON_PROPERTY_STORE_FILTRATION_MODE, this.storeFiltrationMode); + } + 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 PaymentMethodsRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethodsResponse.java b/src/main/java/com/adyen/model/checkout/PaymentMethodsResponse.java index ebb91e484..281e8bb0a 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethodsResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethodsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,9 +30,21 @@ public class PaymentMethodsResponse { public static final String JSON_PROPERTY_PAYMENT_METHODS = "paymentMethods"; private List paymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethods = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHODS = "storedPaymentMethods"; private List storedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethods = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentMethodsResponse() {} /** @@ -41,6 +55,7 @@ public PaymentMethodsResponse() {} */ public PaymentMethodsResponse paymentMethods(List paymentMethods) { this.paymentMethods = paymentMethods; + isSetPaymentMethods = true; // mark as set return this; } @@ -72,6 +87,7 @@ public List getPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethods(List paymentMethods) { this.paymentMethods = paymentMethods; + isSetPaymentMethods = true; // mark as set } /** @@ -83,6 +99,7 @@ public void setPaymentMethods(List paymentMethods) { public PaymentMethodsResponse storedPaymentMethods( List storedPaymentMethods) { this.storedPaymentMethods = storedPaymentMethods; + isSetStoredPaymentMethods = true; // mark as set return this; } @@ -115,6 +132,27 @@ public List getStoredPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethods(List storedPaymentMethods) { this.storedPaymentMethods = storedPaymentMethods; + isSetStoredPaymentMethods = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentMethodsResponse 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 PaymentMethodsResponse object is equal to o. */ @@ -158,6 +196,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 (isSetPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHODS, this.paymentMethods); + } + if (isSetStoredPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHODS, this.storedPaymentMethods); + } + + 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 PaymentMethodsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentRefundRequest.java b/src/main/java/com/adyen/model/checkout/PaymentRefundRequest.java index 323509c72..05e9ac3f4 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentRefundRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentRefundRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -40,21 +42,39 @@ public class PaymentRefundRequest { 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_CAPTURE_PSP_REFERENCE = "capturePspReference"; private String capturePspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapturePspReference = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA = "enhancedSchemeData"; private EnhancedSchemeData enhancedSchemeData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeData = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = 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; + /** * The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * * **RETURN** * **DUPLICATE** * **OTHER** @@ -108,15 +128,33 @@ public static MerchantRefundReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_MERCHANT_REFUND_REASON = "merchantRefundReason"; private MerchantRefundReasonEnum merchantRefundReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantRefundReason = 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_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentRefundRequest() {} /** @@ -127,6 +165,7 @@ public PaymentRefundRequest() {} */ public PaymentRefundRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -150,6 +189,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -160,6 +200,7 @@ public void setAmount(Amount amount) { */ public PaymentRefundRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -183,6 +224,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -197,6 +239,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentRefundRequest capturePspReference(String capturePspReference) { this.capturePspReference = capturePspReference; + isSetCapturePspReference = true; // mark as set return this; } @@ -228,6 +271,7 @@ public String getCapturePspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapturePspReference(String capturePspReference) { this.capturePspReference = capturePspReference; + isSetCapturePspReference = true; // mark as set } /** @@ -238,6 +282,7 @@ public void setCapturePspReference(String capturePspReference) { */ public PaymentRefundRequest enhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set return this; } @@ -261,6 +306,7 @@ public EnhancedSchemeData getEnhancedSchemeData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set } /** @@ -277,6 +323,7 @@ public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { */ public PaymentRefundRequest lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -320,6 +367,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -330,6 +378,7 @@ public void setLineItems(List lineItems) { */ public PaymentRefundRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -353,6 +402,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -365,6 +415,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentRefundRequest merchantRefundReason(MerchantRefundReasonEnum merchantRefundReason) { this.merchantRefundReason = merchantRefundReason; + isSetMerchantRefundReason = true; // mark as set return this; } @@ -392,6 +443,7 @@ public MerchantRefundReasonEnum getMerchantRefundReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantRefundReason(MerchantRefundReasonEnum merchantRefundReason) { this.merchantRefundReason = merchantRefundReason; + isSetMerchantRefundReason = true; // mark as set } /** @@ -402,6 +454,7 @@ public void setMerchantRefundReason(MerchantRefundReasonEnum merchantRefundReaso */ public PaymentRefundRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -425,6 +478,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -441,6 +495,7 @@ public void setReference(String reference) { */ public PaymentRefundRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -484,6 +539,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -500,6 +556,7 @@ public void setSplits(List splits) { */ public PaymentRefundRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -535,6 +592,27 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentRefundRequest 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 PaymentRefundRequest object is equal to o. */ @@ -606,6 +684,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetCapturePspReference) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_PSP_REFERENCE, this.capturePspReference); + } + if (isSetEnhancedSchemeData) { + addIfNull(nulls, JSON_PROPERTY_ENHANCED_SCHEME_DATA, this.enhancedSchemeData); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetMerchantRefundReason) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_REFUND_REASON, this.merchantRefundReason); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + + 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 PaymentRefundRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentRefundResponse.java b/src/main/java/com/adyen/model/checkout/PaymentRefundResponse.java index e67a3d927..399242e42 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentRefundResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentRefundResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,15 +43,27 @@ public class PaymentRefundResponse { 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_CAPTURE_PSP_REFERENCE = "capturePspReference"; private String capturePspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapturePspReference = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = 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; + /** Your reason for the refund request. */ public enum MerchantRefundReasonEnum { FRAUD(String.valueOf("FRAUD")), @@ -100,18 +114,33 @@ public static MerchantRefundReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_MERCHANT_REFUND_REASON = "merchantRefundReason"; private MerchantRefundReasonEnum merchantRefundReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantRefundReason = false; + public static final String JSON_PROPERTY_PAYMENT_PSP_REFERENCE = "paymentPspReference"; private String paymentPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentPspReference = 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; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + /** The status of your request. This will always have the value **received**. */ public enum StatusEnum { RECEIVED(String.valueOf("received")); @@ -154,9 +183,21 @@ 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_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentRefundResponse() {} /** @@ -167,6 +208,7 @@ public PaymentRefundResponse() {} */ public PaymentRefundResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -190,6 +232,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -204,6 +247,7 @@ public void setAmount(Amount amount) { */ public PaymentRefundResponse capturePspReference(String capturePspReference) { this.capturePspReference = capturePspReference; + isSetCapturePspReference = true; // mark as set return this; } @@ -235,6 +279,7 @@ public String getCapturePspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapturePspReference(String capturePspReference) { this.capturePspReference = capturePspReference; + isSetCapturePspReference = true; // mark as set } /** @@ -251,6 +296,7 @@ public void setCapturePspReference(String capturePspReference) { */ public PaymentRefundResponse lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -294,6 +340,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -304,6 +351,7 @@ public void setLineItems(List lineItems) { */ public PaymentRefundResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -327,6 +375,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -337,6 +386,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentRefundResponse merchantRefundReason(MerchantRefundReasonEnum merchantRefundReason) { this.merchantRefundReason = merchantRefundReason; + isSetMerchantRefundReason = true; // mark as set return this; } @@ -360,6 +410,7 @@ public MerchantRefundReasonEnum getMerchantRefundReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantRefundReason(MerchantRefundReasonEnum merchantRefundReason) { this.merchantRefundReason = merchantRefundReason; + isSetMerchantRefundReason = true; // mark as set } /** @@ -374,6 +425,7 @@ public void setMerchantRefundReason(MerchantRefundReasonEnum merchantRefundReaso */ public PaymentRefundResponse paymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set return this; } @@ -405,6 +457,7 @@ public String getPaymentPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set } /** @@ -415,6 +468,7 @@ public void setPaymentPspReference(String paymentPspReference) { */ public PaymentRefundResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -438,6 +492,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -448,6 +503,7 @@ public void setPspReference(String pspReference) { */ public PaymentRefundResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -471,6 +527,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -487,6 +544,7 @@ public void setReference(String reference) { */ public PaymentRefundResponse splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -530,6 +588,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -540,6 +599,7 @@ public void setSplits(List splits) { */ public PaymentRefundResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -563,6 +623,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -579,6 +640,7 @@ public void setStatus(StatusEnum status) { */ public PaymentRefundResponse store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -614,6 +676,27 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentRefundResponse 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 PaymentRefundResponse object is equal to o. */ @@ -690,6 +773,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetCapturePspReference) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_PSP_REFERENCE, this.capturePspReference); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetMerchantRefundReason) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_REFUND_REASON, this.merchantRefundReason); + } + if (isSetPaymentPspReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_PSP_REFERENCE, this.paymentPspReference); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + + 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 PaymentRefundResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentRequest.java b/src/main/java/com/adyen/model/checkout/PaymentRequest.java index b60315ad1..cc1f730ce 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -107,33 +109,63 @@ 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_AUTHENTICATION_DATA = "authenticationData"; private AuthenticationData authenticationData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationData = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private CheckoutBankAccount bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private BillingAddress 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; + /** * The platform where a payment transaction takes place. This field is optional for filtering out * payment methods that are only available on specific platforms. If this value is not set, then @@ -185,50 +217,95 @@ public static ChannelEnum fromValue(String value) { public static final String JSON_PROPERTY_CHANNEL = "channel"; private ChannelEnum channel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChannel = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_COMPANY = "company"; private Company company; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCompany = false; + public static final String JSON_PROPERTY_CONVERSION_ID = "conversionId"; @Deprecated // deprecated since Adyen Checkout API v68: Use `checkoutAttemptId` instead private String conversionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConversionId = 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_DATE_OF_BIRTH = "dateOfBirth"; private OffsetDateTime 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_DELIVER_AT = "deliverAt"; private OffsetDateTime deliverAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliverAt = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private DeliveryAddress deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_DELIVERY_DATE = "deliveryDate"; @Deprecated // deprecated since Adyen Checkout API v70: Use `deliverAt` instead. 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_ENABLE_ONE_CLICK = "enableOneClick"; private Boolean enableOneClick; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnableOneClick = false; + public static final String JSON_PROPERTY_ENABLE_PAY_OUT = "enablePayOut"; private Boolean enablePayOut; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnablePayOut = false; + public static final String JSON_PROPERTY_ENABLE_RECURRING = "enableRecurring"; private Boolean enableRecurring; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnableRecurring = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA = "enhancedSchemeData"; private EnhancedSchemeData enhancedSchemeData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeData = false; + /** The type of the entity the payment is processed for. */ public enum EntityTypeEnum { NATURALPERSON(String.valueOf("NaturalPerson")), @@ -273,15 +350,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_ORIGIN = "fundOrigin"; private FundOrigin fundOrigin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundOrigin = false; + public static final String JSON_PROPERTY_FUND_RECIPIENT = "fundRecipient"; private FundRecipient fundRecipient; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundRecipient = false; + /** * The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * * **installment** @@ -331,61 +420,118 @@ 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_INSTALLMENTS = "installments"; private Installments installments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallments = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = 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_ORDER = "order"; private EncryptedOrderData order; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrder = 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_ORIGIN = "origin"; private String origin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrigin = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private CheckoutPaymentMethod paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + public static final String JSON_PROPERTY_PAYMENT_VALIDATIONS = "paymentValidations"; private PaymentValidations paymentValidations; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentValidations = 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_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; + /** * 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 @@ -443,36 +589,69 @@ 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_REDIRECT_FROM_ISSUER_METHOD = "redirectFromIssuerMethod"; private String redirectFromIssuerMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectFromIssuerMethod = false; + public static final String JSON_PROPERTY_REDIRECT_TO_ISSUER_METHOD = "redirectToIssuerMethod"; private String redirectToIssuerMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectToIssuerMethod = 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_RETURN_URL = "returnUrl"; private String returnUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReturnUrl = false; + public static final String JSON_PROPERTY_RISK_DATA = "riskData"; private RiskData riskData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskData = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SESSION_VALIDITY = "sessionValidity"; private String sessionValidity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSessionValidity = false; + public static final String JSON_PROPERTY_SHOPPER_CONVERSION_ID = "shopperConversionId"; private String shopperConversionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperConversionId = 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 @@ -533,51 +712,102 @@ 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 ShopperName 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_STORE_PAYMENT_METHOD = "storePaymentMethod"; private Boolean storePaymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStorePaymentMethod = false; + public static final String JSON_PROPERTY_SUB_MERCHANTS = "subMerchants"; private List subMerchants; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchants = false; + public static final String JSON_PROPERTY_SURCHARGE = "surcharge"; private Surcharge surcharge; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSurcharge = 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 ThreeDS2RequestFields 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"; @Deprecated // deprecated since Adyen Checkout API v69: Use // `authenticationData.authenticationOnly` instead. private Boolean threeDSAuthenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSAuthenticationOnly = 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() {} /** @@ -588,6 +818,7 @@ public PaymentRequest() {} */ public PaymentRequest accountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set return this; } @@ -611,6 +842,7 @@ public AccountInfo getAccountInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set } /** @@ -621,6 +853,7 @@ public void setAccountInfo(AccountInfo accountInfo) { */ public PaymentRequest additionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set return this; } @@ -644,6 +877,7 @@ public Amount getAdditionalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set } /** @@ -658,6 +892,7 @@ public void setAdditionalAmount(Amount additionalAmount) { */ public PaymentRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -697,6 +932,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -707,6 +943,7 @@ public void setAdditionalData(Map additionalData) { */ public PaymentRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -730,6 +967,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -740,6 +978,7 @@ public void setAmount(Amount amount) { */ public PaymentRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -763,6 +1002,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -773,6 +1013,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentRequest authenticationData(AuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set return this; } @@ -796,6 +1037,7 @@ public AuthenticationData getAuthenticationData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationData(AuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set } /** @@ -806,6 +1048,7 @@ public void setAuthenticationData(AuthenticationData authenticationData) { */ public PaymentRequest bankAccount(CheckoutBankAccount bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -829,6 +1072,7 @@ public CheckoutBankAccount getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(CheckoutBankAccount bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -839,6 +1083,7 @@ public void setBankAccount(CheckoutBankAccount bankAccount) { */ public PaymentRequest billingAddress(BillingAddress billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -862,6 +1107,7 @@ public BillingAddress getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(BillingAddress billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -872,6 +1118,7 @@ public void setBillingAddress(BillingAddress billingAddress) { */ public PaymentRequest browserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set return this; } @@ -895,6 +1142,7 @@ public BrowserInfo getBrowserInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrowserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set } /** @@ -906,6 +1154,7 @@ public void setBrowserInfo(BrowserInfo browserInfo) { */ public PaymentRequest captureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set return this; } @@ -931,6 +1180,7 @@ public Integer getCaptureDelayHours() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set } /** @@ -947,6 +1197,7 @@ public void setCaptureDelayHours(Integer captureDelayHours) { */ public PaymentRequest channel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set return this; } @@ -982,6 +1233,7 @@ public ChannelEnum getChannel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChannel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set } /** @@ -994,6 +1246,7 @@ public void setChannel(ChannelEnum channel) { */ public PaymentRequest checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -1021,6 +1274,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -1031,6 +1285,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public PaymentRequest company(Company company) { this.company = company; + isSetCompany = true; // mark as set return this; } @@ -1054,6 +1309,7 @@ public Company getCompany() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCompany(Company company) { this.company = company; + isSetCompany = true; // mark as set } /** @@ -1068,6 +1324,7 @@ public void setCompany(Company company) { @Deprecated // deprecated since Adyen Checkout API v68: Use `checkoutAttemptId` instead public PaymentRequest conversionId(String conversionId) { this.conversionId = conversionId; + isSetConversionId = true; // mark as set return this; } @@ -1099,6 +1356,7 @@ public String getConversionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConversionId(String conversionId) { this.conversionId = conversionId; + isSetConversionId = true; // mark as set } /** @@ -1111,6 +1369,7 @@ public void setConversionId(String conversionId) { */ public PaymentRequest countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -1138,6 +1397,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -1150,6 +1410,7 @@ public void setCountryCode(String countryCode) { */ public PaymentRequest dateOfBirth(OffsetDateTime dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -1177,6 +1438,7 @@ public OffsetDateTime getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(OffsetDateTime dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -1187,6 +1449,7 @@ public void setDateOfBirth(OffsetDateTime dateOfBirth) { */ public PaymentRequest dccQuote(ForexQuote dccQuote) { this.dccQuote = dccQuote; + isSetDccQuote = true; // mark as set return this; } @@ -1210,6 +1473,7 @@ public ForexQuote getDccQuote() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDccQuote(ForexQuote dccQuote) { this.dccQuote = dccQuote; + isSetDccQuote = true; // mark as set } /** @@ -1224,6 +1488,7 @@ public void setDccQuote(ForexQuote dccQuote) { */ public PaymentRequest deliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set return this; } @@ -1255,6 +1520,7 @@ public OffsetDateTime getDeliverAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set } /** @@ -1265,6 +1531,7 @@ public void setDeliverAt(OffsetDateTime deliverAt) { */ public PaymentRequest deliveryAddress(DeliveryAddress deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -1288,6 +1555,7 @@ public DeliveryAddress getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(DeliveryAddress deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -1304,6 +1572,7 @@ public void setDeliveryAddress(DeliveryAddress deliveryAddress) { @Deprecated // deprecated since Adyen Checkout API v70: Use `deliverAt` instead. public PaymentRequest deliveryDate(OffsetDateTime deliveryDate) { this.deliveryDate = deliveryDate; + isSetDeliveryDate = true; // mark as set return this; } @@ -1339,6 +1608,7 @@ public OffsetDateTime getDeliveryDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryDate(OffsetDateTime deliveryDate) { this.deliveryDate = deliveryDate; + isSetDeliveryDate = true; // mark as set } /** @@ -1352,6 +1622,7 @@ public void setDeliveryDate(OffsetDateTime deliveryDate) { */ public PaymentRequest deviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set return this; } @@ -1381,6 +1652,7 @@ public String getDeviceFingerprint() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set } /** @@ -1395,6 +1667,7 @@ public void setDeviceFingerprint(String deviceFingerprint) { */ public PaymentRequest enableOneClick(Boolean enableOneClick) { this.enableOneClick = enableOneClick; + isSetEnableOneClick = true; // mark as set return this; } @@ -1426,6 +1699,7 @@ public Boolean getEnableOneClick() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnableOneClick(Boolean enableOneClick) { this.enableOneClick = enableOneClick; + isSetEnableOneClick = true; // mark as set } /** @@ -1438,6 +1712,7 @@ public void setEnableOneClick(Boolean enableOneClick) { */ public PaymentRequest enablePayOut(Boolean enablePayOut) { this.enablePayOut = enablePayOut; + isSetEnablePayOut = true; // mark as set return this; } @@ -1465,6 +1740,7 @@ public Boolean getEnablePayOut() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnablePayOut(Boolean enablePayOut) { this.enablePayOut = enablePayOut; + isSetEnablePayOut = true; // mark as set } /** @@ -1481,6 +1757,7 @@ public void setEnablePayOut(Boolean enablePayOut) { */ public PaymentRequest enableRecurring(Boolean enableRecurring) { this.enableRecurring = enableRecurring; + isSetEnableRecurring = true; // mark as set return this; } @@ -1516,6 +1793,7 @@ public Boolean getEnableRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnableRecurring(Boolean enableRecurring) { this.enableRecurring = enableRecurring; + isSetEnableRecurring = true; // mark as set } /** @@ -1526,6 +1804,7 @@ public void setEnableRecurring(Boolean enableRecurring) { */ public PaymentRequest enhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set return this; } @@ -1549,6 +1828,7 @@ public EnhancedSchemeData getEnhancedSchemeData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set } /** @@ -1559,6 +1839,7 @@ public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { */ public PaymentRequest entityType(EntityTypeEnum entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set return this; } @@ -1582,6 +1863,7 @@ public EntityTypeEnum getEntityType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityType(EntityTypeEnum entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set } /** @@ -1594,6 +1876,7 @@ public void setEntityType(EntityTypeEnum entityType) { */ public PaymentRequest fraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set return this; } @@ -1621,6 +1904,7 @@ public Integer getFraudOffset() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set } /** @@ -1631,6 +1915,7 @@ public void setFraudOffset(Integer fraudOffset) { */ public PaymentRequest fundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set return this; } @@ -1654,6 +1939,7 @@ public FundOrigin getFundOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set } /** @@ -1664,6 +1950,7 @@ public void setFundOrigin(FundOrigin fundOrigin) { */ public PaymentRequest fundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set return this; } @@ -1687,6 +1974,7 @@ public FundRecipient getFundRecipient() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set } /** @@ -1699,6 +1987,7 @@ public void setFundRecipient(FundRecipient fundRecipient) { */ public PaymentRequest industryUsage(IndustryUsageEnum industryUsage) { this.industryUsage = industryUsage; + isSetIndustryUsage = true; // mark as set return this; } @@ -1726,6 +2015,7 @@ public IndustryUsageEnum getIndustryUsage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIndustryUsage(IndustryUsageEnum industryUsage) { this.industryUsage = industryUsage; + isSetIndustryUsage = true; // mark as set } /** @@ -1736,6 +2026,7 @@ public void setIndustryUsage(IndustryUsageEnum industryUsage) { */ public PaymentRequest installments(Installments installments) { this.installments = installments; + isSetInstallments = true; // mark as set return this; } @@ -1759,6 +2050,7 @@ public Installments getInstallments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallments(Installments installments) { this.installments = installments; + isSetInstallments = true; // mark as set } /** @@ -1773,6 +2065,7 @@ public void setInstallments(Installments installments) { */ public PaymentRequest lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -1812,6 +2105,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -1832,6 +2126,7 @@ public void setLineItems(List lineItems) { */ public PaymentRequest localizedShopperStatement(Map localizedShopperStatement) { this.localizedShopperStatement = localizedShopperStatement; + isSetLocalizedShopperStatement = true; // mark as set return this; } @@ -1884,6 +2179,7 @@ public Map getLocalizedShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLocalizedShopperStatement(Map localizedShopperStatement) { this.localizedShopperStatement = localizedShopperStatement; + isSetLocalizedShopperStatement = true; // mark as set } /** @@ -1894,6 +2190,7 @@ public void setLocalizedShopperStatement(Map localizedShopperSta */ public PaymentRequest mandate(Mandate mandate) { this.mandate = mandate; + isSetMandate = true; // mark as set return this; } @@ -1917,6 +2214,7 @@ public Mandate getMandate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMandate(Mandate mandate) { this.mandate = mandate; + isSetMandate = true; // mark as set } /** @@ -1931,6 +2229,7 @@ public void setMandate(Mandate mandate) { */ public PaymentRequest mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -1962,6 +2261,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -1973,6 +2273,7 @@ public void setMcc(String mcc) { */ public PaymentRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -1998,6 +2299,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -2022,6 +2324,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentRequest merchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set return this; } @@ -2074,6 +2377,7 @@ public String getMerchantOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set } /** @@ -2084,6 +2388,7 @@ public void setMerchantOrderReference(String merchantOrderReference) { */ public PaymentRequest merchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator) { this.merchantRiskIndicator = merchantRiskIndicator; + isSetMerchantRiskIndicator = true; // mark as set return this; } @@ -2107,6 +2412,7 @@ public MerchantRiskIndicator getMerchantRiskIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator) { this.merchantRiskIndicator = merchantRiskIndicator; + isSetMerchantRiskIndicator = true; // mark as set } /** @@ -2123,6 +2429,7 @@ public void setMerchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator */ public PaymentRequest metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -2166,6 +2473,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -2176,6 +2484,7 @@ public void setMetadata(Map metadata) { */ public PaymentRequest mpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set return this; } @@ -2199,6 +2508,7 @@ public ThreeDSecureData getMpiData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set } /** @@ -2209,6 +2519,7 @@ public void setMpiData(ThreeDSecureData mpiData) { */ public PaymentRequest order(EncryptedOrderData order) { this.order = order; + isSetOrder = true; // mark as set return this; } @@ -2232,6 +2543,7 @@ public EncryptedOrderData getOrder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrder(EncryptedOrderData order) { this.order = order; + isSetOrder = true; // mark as set } /** @@ -2247,6 +2559,7 @@ public void setOrder(EncryptedOrderData order) { */ public PaymentRequest orderReference(String orderReference) { this.orderReference = orderReference; + isSetOrderReference = true; // mark as set return this; } @@ -2280,6 +2593,7 @@ public String getOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrderReference(String orderReference) { this.orderReference = orderReference; + isSetOrderReference = true; // mark as set } /** @@ -2294,6 +2608,7 @@ public void setOrderReference(String orderReference) { */ public PaymentRequest origin(String origin) { this.origin = origin; + isSetOrigin = true; // mark as set return this; } @@ -2325,6 +2640,7 @@ public String getOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrigin(String origin) { this.origin = origin; + isSetOrigin = true; // mark as set } /** @@ -2335,6 +2651,7 @@ public void setOrigin(String origin) { */ public PaymentRequest paymentMethod(CheckoutPaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -2358,6 +2675,7 @@ public CheckoutPaymentMethod getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(CheckoutPaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -2368,6 +2686,7 @@ public void setPaymentMethod(CheckoutPaymentMethod paymentMethod) { */ public PaymentRequest paymentValidations(PaymentValidations paymentValidations) { this.paymentValidations = paymentValidations; + isSetPaymentValidations = true; // mark as set return this; } @@ -2391,6 +2710,7 @@ public PaymentValidations getPaymentValidations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentValidations(PaymentValidations paymentValidations) { this.paymentValidations = paymentValidations; + isSetPaymentValidations = true; // mark as set } /** @@ -2401,6 +2721,7 @@ public void setPaymentValidations(PaymentValidations paymentValidations) { */ public PaymentRequest platformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -2424,6 +2745,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -2435,6 +2757,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public PaymentRequest recurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set return this; } @@ -2460,6 +2783,7 @@ public String getRecurringExpiry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set } /** @@ -2470,6 +2794,7 @@ public void setRecurringExpiry(String recurringExpiry) { */ public PaymentRequest recurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set return this; } @@ -2493,6 +2818,7 @@ public String getRecurringFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set } /** @@ -2521,6 +2847,7 @@ public void setRecurringFrequency(String recurringFrequency) { public PaymentRequest recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -2578,6 +2905,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -2589,6 +2917,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public PaymentRequest redirectFromIssuerMethod(String redirectFromIssuerMethod) { this.redirectFromIssuerMethod = redirectFromIssuerMethod; + isSetRedirectFromIssuerMethod = true; // mark as set return this; } @@ -2614,6 +2943,7 @@ public String getRedirectFromIssuerMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectFromIssuerMethod(String redirectFromIssuerMethod) { this.redirectFromIssuerMethod = redirectFromIssuerMethod; + isSetRedirectFromIssuerMethod = true; // mark as set } /** @@ -2625,6 +2955,7 @@ public void setRedirectFromIssuerMethod(String redirectFromIssuerMethod) { */ public PaymentRequest redirectToIssuerMethod(String redirectToIssuerMethod) { this.redirectToIssuerMethod = redirectToIssuerMethod; + isSetRedirectToIssuerMethod = true; // mark as set return this; } @@ -2650,6 +2981,7 @@ public String getRedirectToIssuerMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectToIssuerMethod(String redirectToIssuerMethod) { this.redirectToIssuerMethod = redirectToIssuerMethod; + isSetRedirectToIssuerMethod = true; // mark as set } /** @@ -2666,6 +2998,7 @@ public void setRedirectToIssuerMethod(String redirectToIssuerMethod) { */ public PaymentRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -2701,6 +3034,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -2738,6 +3072,7 @@ public void setReference(String reference) { */ public PaymentRequest returnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set return this; } @@ -2815,6 +3150,7 @@ public String getReturnUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set } /** @@ -2825,6 +3161,7 @@ public void setReturnUrl(String returnUrl) { */ public PaymentRequest riskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set return this; } @@ -2848,6 +3185,7 @@ public RiskData getRiskData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set } /** @@ -2860,6 +3198,7 @@ public void setRiskData(RiskData riskData) { */ public PaymentRequest sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -2888,6 +3227,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -2901,6 +3241,7 @@ public void setSdkData(String sdkData) { */ public PaymentRequest sessionValidity(String sessionValidity) { this.sessionValidity = sessionValidity; + isSetSessionValidity = true; // mark as set return this; } @@ -2930,6 +3271,7 @@ public String getSessionValidity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSessionValidity(String sessionValidity) { this.sessionValidity = sessionValidity; + isSetSessionValidity = true; // mark as set } /** @@ -2943,6 +3285,7 @@ public void setSessionValidity(String sessionValidity) { */ public PaymentRequest shopperConversionId(String shopperConversionId) { this.shopperConversionId = shopperConversionId; + isSetShopperConversionId = true; // mark as set return this; } @@ -2972,6 +3315,7 @@ public String getShopperConversionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperConversionId(String shopperConversionId) { this.shopperConversionId = shopperConversionId; + isSetShopperConversionId = true; // mark as set } /** @@ -2986,6 +3330,7 @@ public void setShopperConversionId(String shopperConversionId) { */ public PaymentRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -3017,6 +3362,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -3040,6 +3386,7 @@ public void setShopperEmail(String shopperEmail) { */ public PaymentRequest shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -3089,6 +3436,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -3120,6 +3468,7 @@ public void setShopperIP(String shopperIP) { */ public PaymentRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -3185,6 +3534,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -3197,6 +3547,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public PaymentRequest shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -3224,6 +3575,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -3234,6 +3586,7 @@ public void setShopperLocale(String shopperLocale) { */ public PaymentRequest shopperName(ShopperName shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -3257,6 +3610,7 @@ public ShopperName getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(ShopperName shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -3272,6 +3626,7 @@ public void setShopperName(ShopperName shopperName) { */ public PaymentRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -3305,6 +3660,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -3320,6 +3676,7 @@ public void setShopperReference(String shopperReference) { */ public PaymentRequest shopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set return this; } @@ -3353,6 +3710,7 @@ public String getShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set } /** @@ -3363,6 +3721,7 @@ public void setShopperStatement(String shopperStatement) { */ public PaymentRequest socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -3386,6 +3745,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -3404,6 +3764,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public PaymentRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -3451,6 +3812,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -3474,6 +3836,7 @@ public void setSplits(List splits) { */ public PaymentRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -3523,6 +3886,7 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set } /** @@ -3537,6 +3901,7 @@ public void setStore(String store) { */ public PaymentRequest storePaymentMethod(Boolean storePaymentMethod) { this.storePaymentMethod = storePaymentMethod; + isSetStorePaymentMethod = true; // mark as set return this; } @@ -3568,6 +3933,7 @@ public Boolean getStorePaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStorePaymentMethod(Boolean storePaymentMethod) { this.storePaymentMethod = storePaymentMethod; + isSetStorePaymentMethod = true; // mark as set } /** @@ -3580,6 +3946,7 @@ public void setStorePaymentMethod(Boolean storePaymentMethod) { */ public PaymentRequest subMerchants(List subMerchants) { this.subMerchants = subMerchants; + isSetSubMerchants = true; // mark as set return this; } @@ -3615,6 +3982,7 @@ public List getSubMerchants() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchants(List subMerchants) { this.subMerchants = subMerchants; + isSetSubMerchants = true; // mark as set } /** @@ -3625,6 +3993,7 @@ public void setSubMerchants(List subMerchants) { */ public PaymentRequest surcharge(Surcharge surcharge) { this.surcharge = surcharge; + isSetSurcharge = true; // mark as set return this; } @@ -3648,6 +4017,7 @@ public Surcharge getSurcharge() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSurcharge(Surcharge surcharge) { this.surcharge = surcharge; + isSetSurcharge = true; // mark as set } /** @@ -3666,6 +4036,7 @@ public void setSurcharge(Surcharge surcharge) { */ public PaymentRequest telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -3705,6 +4076,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -3715,6 +4087,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public PaymentRequest threeDS2RequestData(ThreeDS2RequestFields threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set return this; } @@ -3738,6 +4111,7 @@ public ThreeDS2RequestFields getThreeDS2RequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2RequestData(ThreeDS2RequestFields threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set } /** @@ -3758,6 +4132,7 @@ public void setThreeDS2RequestData(ThreeDS2RequestFields threeDS2RequestData) { // `authenticationData.authenticationOnly` instead. public PaymentRequest threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set return this; } @@ -3801,6 +4176,7 @@ public Boolean getThreeDSAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set } /** @@ -3811,6 +4187,7 @@ public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { */ public PaymentRequest trustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set return this; } @@ -3834,6 +4211,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. */ @@ -4115,6 +4513,249 @@ 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 (isSetAuthenticationData) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_DATA, this.authenticationData); + } + 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 (isSetChannel) { + addIfNull(nulls, JSON_PROPERTY_CHANNEL, this.channel); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetCompany) { + addIfNull(nulls, JSON_PROPERTY_COMPANY, this.company); + } + if (isSetConversionId) { + addIfNull(nulls, JSON_PROPERTY_CONVERSION_ID, this.conversionId); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetDccQuote) { + addIfNull(nulls, JSON_PROPERTY_DCC_QUOTE, this.dccQuote); + } + if (isSetDeliverAt) { + addIfNull(nulls, JSON_PROPERTY_DELIVER_AT, this.deliverAt); + } + 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 (isSetEnableOneClick) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_ONE_CLICK, this.enableOneClick); + } + if (isSetEnablePayOut) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_PAY_OUT, this.enablePayOut); + } + if (isSetEnableRecurring) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_RECURRING, this.enableRecurring); + } + if (isSetEnhancedSchemeData) { + addIfNull(nulls, JSON_PROPERTY_ENHANCED_SCHEME_DATA, this.enhancedSchemeData); + } + if (isSetEntityType) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_TYPE, this.entityType); + } + if (isSetFraudOffset) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_OFFSET, this.fraudOffset); + } + if (isSetFundOrigin) { + addIfNull(nulls, JSON_PROPERTY_FUND_ORIGIN, this.fundOrigin); + } + if (isSetFundRecipient) { + addIfNull(nulls, JSON_PROPERTY_FUND_RECIPIENT, this.fundRecipient); + } + if (isSetIndustryUsage) { + addIfNull(nulls, JSON_PROPERTY_INDUSTRY_USAGE, this.industryUsage); + } + if (isSetInstallments) { + addIfNull(nulls, JSON_PROPERTY_INSTALLMENTS, this.installments); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + 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 (isSetOrder) { + addIfNull(nulls, JSON_PROPERTY_ORDER, this.order); + } + if (isSetOrderReference) { + addIfNull(nulls, JSON_PROPERTY_ORDER_REFERENCE, this.orderReference); + } + if (isSetOrigin) { + addIfNull(nulls, JSON_PROPERTY_ORIGIN, this.origin); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetPaymentValidations) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_VALIDATIONS, this.paymentValidations); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetRecurringExpiry) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_EXPIRY, this.recurringExpiry); + } + if (isSetRecurringFrequency) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_FREQUENCY, this.recurringFrequency); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetRedirectFromIssuerMethod) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_FROM_ISSUER_METHOD, this.redirectFromIssuerMethod); + } + if (isSetRedirectToIssuerMethod) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_TO_ISSUER_METHOD, this.redirectToIssuerMethod); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReturnUrl) { + addIfNull(nulls, JSON_PROPERTY_RETURN_URL, this.returnUrl); + } + if (isSetRiskData) { + addIfNull(nulls, JSON_PROPERTY_RISK_DATA, this.riskData); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetSessionValidity) { + addIfNull(nulls, JSON_PROPERTY_SESSION_VALIDITY, this.sessionValidity); + } + if (isSetShopperConversionId) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_CONVERSION_ID, this.shopperConversionId); + } + 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 (isSetStorePaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_STORE_PAYMENT_METHOD, this.storePaymentMethod); + } + if (isSetSubMerchants) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANTS, this.subMerchants); + } + if (isSetSurcharge) { + addIfNull(nulls, JSON_PROPERTY_SURCHARGE, this.surcharge); + } + 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 (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/checkout/PaymentResponse.java b/src/main/java/com/adyen/model/checkout/PaymentResponse.java index 63d6ef5d6..815f2563e 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -46,39 +48,75 @@ public class PaymentResponse { public static final String JSON_PROPERTY_ACTION = "action"; private PaymentResponseAction action; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAction = 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_DONATION_TOKEN = "donationToken"; private String donationToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationToken = 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_MERCHANT_REFERENCE = "merchantReference"; private String merchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantReference = false; + public static final String JSON_PROPERTY_ORDER = "order"; private CheckoutOrderResponse order; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrder = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private ResponsePaymentMethod paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + public static final String JSON_PROPERTY_PAYMENT_VALIDATIONS = "paymentValidations"; private PaymentValidationsResponse paymentValidations; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentValidations = 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; + public static final String JSON_PROPERTY_REFUSAL_REASON_CODE = "refusalReasonCode"; private String refusalReasonCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRefusalReasonCode = false; + /** * The result of the payment. For more information, see [Result * codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * @@ -175,15 +213,33 @@ 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; + public static final String JSON_PROPERTY_THREE_D_S2_RESPONSE_DATA = "threeDS2ResponseData"; private ThreeDS2ResponseData threeDS2ResponseData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2ResponseData = 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_S_PAYMENT_DATA = "threeDSPaymentData"; private String threeDSPaymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSPaymentData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentResponse() {} /** @@ -194,6 +250,7 @@ public PaymentResponse() {} */ public PaymentResponse action(PaymentResponseAction action) { this.action = action; + isSetAction = true; // mark as set return this; } @@ -217,6 +274,7 @@ public PaymentResponseAction getAction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAction(PaymentResponseAction action) { this.action = action; + isSetAction = true; // mark as set } /** @@ -230,6 +288,7 @@ public void setAction(PaymentResponseAction action) { */ public PaymentResponse additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -267,6 +326,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -277,6 +337,7 @@ public void setAdditionalData(Map additionalData) { */ public PaymentResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -300,6 +361,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -310,6 +372,7 @@ public void setAmount(Amount amount) { */ public PaymentResponse donationToken(String donationToken) { this.donationToken = donationToken; + isSetDonationToken = true; // mark as set return this; } @@ -333,6 +396,7 @@ public String getDonationToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationToken(String donationToken) { this.donationToken = donationToken; + isSetDonationToken = true; // mark as set } /** @@ -343,6 +407,7 @@ public void setDonationToken(String donationToken) { */ public PaymentResponse fraudResult(FraudResult fraudResult) { this.fraudResult = fraudResult; + isSetFraudResult = true; // mark as set return this; } @@ -366,6 +431,7 @@ public FraudResult getFraudResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudResult(FraudResult fraudResult) { this.fraudResult = fraudResult; + isSetFraudResult = true; // mark as set } /** @@ -383,6 +449,7 @@ public void setFraudResult(FraudResult fraudResult) { */ public PaymentResponse merchantReference(String merchantReference) { this.merchantReference = merchantReference; + isSetMerchantReference = true; // mark as set return this; } @@ -420,6 +487,7 @@ public String getMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantReference(String merchantReference) { this.merchantReference = merchantReference; + isSetMerchantReference = true; // mark as set } /** @@ -430,6 +498,7 @@ public void setMerchantReference(String merchantReference) { */ public PaymentResponse order(CheckoutOrderResponse order) { this.order = order; + isSetOrder = true; // mark as set return this; } @@ -453,6 +522,7 @@ public CheckoutOrderResponse getOrder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrder(CheckoutOrderResponse order) { this.order = order; + isSetOrder = true; // mark as set } /** @@ -463,6 +533,7 @@ public void setOrder(CheckoutOrderResponse order) { */ public PaymentResponse paymentMethod(ResponsePaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -486,6 +557,7 @@ public ResponsePaymentMethod getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(ResponsePaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -496,6 +568,7 @@ public void setPaymentMethod(ResponsePaymentMethod paymentMethod) { */ public PaymentResponse paymentValidations(PaymentValidationsResponse paymentValidations) { this.paymentValidations = paymentValidations; + isSetPaymentValidations = true; // mark as set return this; } @@ -519,6 +592,7 @@ public PaymentValidationsResponse getPaymentValidations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentValidations(PaymentValidationsResponse paymentValidations) { this.paymentValidations = paymentValidations; + isSetPaymentValidations = true; // mark as set } /** @@ -535,6 +609,7 @@ public void setPaymentValidations(PaymentValidationsResponse paymentValidations) */ public PaymentResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -570,6 +645,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -588,6 +664,7 @@ public void setPspReference(String pspReference) { */ public PaymentResponse refusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set return this; } @@ -627,6 +704,7 @@ public String getRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set } /** @@ -640,6 +718,7 @@ public void setRefusalReason(String refusalReason) { */ public PaymentResponse refusalReasonCode(String refusalReasonCode) { this.refusalReasonCode = refusalReasonCode; + isSetRefusalReasonCode = true; // mark as set return this; } @@ -669,6 +748,7 @@ public String getRefusalReasonCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReasonCode(String refusalReasonCode) { this.refusalReasonCode = refusalReasonCode; + isSetRefusalReasonCode = true; // mark as set } /** @@ -732,6 +812,7 @@ public void setRefusalReasonCode(String refusalReasonCode) { */ public PaymentResponse resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -861,6 +942,7 @@ public ResultCodeEnum getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set } /** @@ -871,6 +953,7 @@ public void setResultCode(ResultCodeEnum resultCode) { */ public PaymentResponse threeDS2ResponseData(ThreeDS2ResponseData threeDS2ResponseData) { this.threeDS2ResponseData = threeDS2ResponseData; + isSetThreeDS2ResponseData = true; // mark as set return this; } @@ -894,6 +977,7 @@ public ThreeDS2ResponseData getThreeDS2ResponseData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2ResponseData(ThreeDS2ResponseData threeDS2ResponseData) { this.threeDS2ResponseData = threeDS2ResponseData; + isSetThreeDS2ResponseData = true; // mark as set } /** @@ -904,6 +988,7 @@ public void setThreeDS2ResponseData(ThreeDS2ResponseData threeDS2ResponseData) { */ public PaymentResponse threeDS2Result(ThreeDS2Result threeDS2Result) { this.threeDS2Result = threeDS2Result; + isSetThreeDS2Result = true; // mark as set return this; } @@ -927,6 +1012,7 @@ public ThreeDS2Result getThreeDS2Result() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2Result(ThreeDS2Result threeDS2Result) { this.threeDS2Result = threeDS2Result; + isSetThreeDS2Result = true; // mark as set } /** @@ -939,6 +1025,7 @@ public void setThreeDS2Result(ThreeDS2Result threeDS2Result) { */ public PaymentResponse threeDSPaymentData(String threeDSPaymentData) { this.threeDSPaymentData = threeDSPaymentData; + isSetThreeDSPaymentData = true; // mark as set return this; } @@ -966,6 +1053,27 @@ public String getThreeDSPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSPaymentData(String threeDSPaymentData) { this.threeDSPaymentData = threeDSPaymentData; + isSetThreeDSPaymentData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentResponse 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 PaymentResponse object is equal to o. */ @@ -1053,6 +1161,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 (isSetAction) { + addIfNull(nulls, JSON_PROPERTY_ACTION, this.action); + } + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetDonationToken) { + addIfNull(nulls, JSON_PROPERTY_DONATION_TOKEN, this.donationToken); + } + if (isSetFraudResult) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_RESULT, this.fraudResult); + } + if (isSetMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_REFERENCE, this.merchantReference); + } + if (isSetOrder) { + addIfNull(nulls, JSON_PROPERTY_ORDER, this.order); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetPaymentValidations) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_VALIDATIONS, this.paymentValidations); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetRefusalReason) { + addIfNull(nulls, JSON_PROPERTY_REFUSAL_REASON, this.refusalReason); + } + if (isSetRefusalReasonCode) { + addIfNull(nulls, JSON_PROPERTY_REFUSAL_REASON_CODE, this.refusalReasonCode); + } + if (isSetResultCode) { + addIfNull(nulls, JSON_PROPERTY_RESULT_CODE, this.resultCode); + } + if (isSetThreeDS2ResponseData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_RESPONSE_DATA, this.threeDS2ResponseData); + } + if (isSetThreeDS2Result) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_RESULT, this.threeDS2Result); + } + if (isSetThreeDSPaymentData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_PAYMENT_DATA, this.threeDSPaymentData); + } + + 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 PaymentResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentReversalRequest.java b/src/main/java/com/adyen/model/checkout/PaymentReversalRequest.java index 87c62b92d..46f9ce244 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentReversalRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentReversalRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 PaymentReversalRequest { 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_ENHANCED_SCHEME_DATA = "enhancedSchemeData"; private EnhancedSchemeData enhancedSchemeData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeData = 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_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 PaymentReversalRequest() {} /** @@ -47,6 +67,7 @@ public PaymentReversalRequest() {} */ public PaymentReversalRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -70,6 +91,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentReversalRequest enhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set return this; } @@ -103,6 +126,7 @@ public EnhancedSchemeData getEnhancedSchemeData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { */ public PaymentReversalRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentReversalRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -169,6 +196,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 PaymentReversalRequest 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 PaymentReversalRequest object is equal to o. */ @@ -214,6 +262,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetEnhancedSchemeData) { + addIfNull(nulls, JSON_PROPERTY_ENHANCED_SCHEME_DATA, this.enhancedSchemeData); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + 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 PaymentReversalRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentReversalResponse.java b/src/main/java/com/adyen/model/checkout/PaymentReversalResponse.java index 7fd0b3f2f..320390e51 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentReversalResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentReversalResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 PaymentReversalResponse { 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_PAYMENT_PSP_REFERENCE = "paymentPspReference"; private String paymentPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentPspReference = 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 your request. This will always have the value **received**. */ public enum StatusEnum { RECEIVED(String.valueOf("received")); @@ -84,6 +98,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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentReversalResponse() {} /** @@ -94,6 +117,7 @@ public PaymentReversalResponse() {} */ public PaymentReversalResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -117,6 +141,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -131,6 +156,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentReversalResponse paymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set return this; } @@ -162,6 +188,7 @@ public String getPaymentPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set } /** @@ -172,6 +199,7 @@ public void setPaymentPspReference(String paymentPspReference) { */ public PaymentReversalResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -195,6 +223,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -205,6 +234,7 @@ public void setPspReference(String pspReference) { */ public PaymentReversalResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -228,6 +258,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -238,6 +269,7 @@ public void setReference(String reference) { */ public PaymentReversalResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -261,6 +293,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentReversalResponse 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 PaymentReversalResponse object is equal to o. */ @@ -310,6 +363,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 (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentPspReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_PSP_REFERENCE, this.paymentPspReference); + } + 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); + } + + 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 PaymentReversalResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentValidations.java b/src/main/java/com/adyen/model/checkout/PaymentValidations.java index ce7ee85aa..b5098ff88 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentValidations.java +++ b/src/main/java/com/adyen/model/checkout/PaymentValidations.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 PaymentValidations { public static final String JSON_PROPERTY_NAME = "name"; private Name 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 PaymentValidations() {} /** @@ -33,6 +44,7 @@ public PaymentValidations() {} */ public PaymentValidations name(Name name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -56,6 +68,27 @@ public Name getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(Name name) { this.name = name; + isSetName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentValidations 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 PaymentValidations object is equal to o. */ @@ -95,6 +128,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 (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 PaymentValidations given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResponse.java b/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResponse.java index 037e9a6bb..ebc60f1b9 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,9 +33,15 @@ public class PaymentValidationsNameResponse { public static final String JSON_PROPERTY_RAW_RESPONSE = "rawResponse"; private PaymentValidationsNameResultRawResponse rawResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRawResponse = false; + public static final String JSON_PROPERTY_RESULT = "result"; private PaymentValidationsNameResultResponse result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResult = false; + /** * Informs you if the name validation was performed. Possible values: **performed**, * **notPerformed**, **notSupported** @@ -83,6 +91,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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentValidationsNameResponse() {} /** @@ -95,6 +112,7 @@ public PaymentValidationsNameResponse() {} public PaymentValidationsNameResponse rawResponse( PaymentValidationsNameResultRawResponse rawResponse) { this.rawResponse = rawResponse; + isSetRawResponse = true; // mark as set return this; } @@ -118,6 +136,7 @@ public PaymentValidationsNameResultRawResponse getRawResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRawResponse(PaymentValidationsNameResultRawResponse rawResponse) { this.rawResponse = rawResponse; + isSetRawResponse = true; // mark as set } /** @@ -129,6 +148,7 @@ public void setRawResponse(PaymentValidationsNameResultRawResponse rawResponse) */ public PaymentValidationsNameResponse result(PaymentValidationsNameResultResponse result) { this.result = result; + isSetResult = true; // mark as set return this; } @@ -152,6 +172,7 @@ public PaymentValidationsNameResultResponse getResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResult(PaymentValidationsNameResultResponse result) { this.result = result; + isSetResult = true; // mark as set } /** @@ -165,6 +186,7 @@ public void setResult(PaymentValidationsNameResultResponse result) { */ public PaymentValidationsNameResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -192,6 +214,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentValidationsNameResponse 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 PaymentValidationsNameResponse object is equal to o. */ @@ -236,6 +279,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 (isSetRawResponse) { + addIfNull(nulls, JSON_PROPERTY_RAW_RESPONSE, this.rawResponse); + } + if (isSetResult) { + addIfNull(nulls, JSON_PROPERTY_RESULT, this.result); + } + 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 PaymentValidationsNameResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResultRawResponse.java b/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResultRawResponse.java index 955066691..aa1a92e01 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResultRawResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResultRawResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 PaymentValidationsNameResultRawResponse { 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_FULL_NAME = "fullName"; private String fullName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFullName = 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; + public static final String JSON_PROPERTY_MIDDLE_NAME = "middleName"; private String middleName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMiddleName = false; + public static final String JSON_PROPERTY_STATUS = "status"; private String 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 PaymentValidationsNameResultRawResponse() {} /** @@ -54,6 +77,7 @@ public PaymentValidationsNameResultRawResponse() {} */ public PaymentValidationsNameResultRawResponse firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -81,6 +105,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -94,6 +119,7 @@ public void setFirstName(String firstName) { */ public PaymentValidationsNameResultRawResponse fullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set return this; } @@ -121,6 +147,7 @@ public String getFullName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set } /** @@ -134,6 +161,7 @@ public void setFullName(String fullName) { */ public PaymentValidationsNameResultRawResponse lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -161,6 +189,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -174,6 +203,7 @@ public void setLastName(String lastName) { */ public PaymentValidationsNameResultRawResponse middleName(String middleName) { this.middleName = middleName; + isSetMiddleName = true; // mark as set return this; } @@ -201,6 +231,7 @@ public String getMiddleName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMiddleName(String middleName) { this.middleName = middleName; + isSetMiddleName = true; // mark as set } /** @@ -214,6 +245,7 @@ public void setMiddleName(String middleName) { */ public PaymentValidationsNameResultRawResponse status(String status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -241,6 +273,27 @@ public String getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(String status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentValidationsNameResultRawResponse 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 PaymentValidationsNameResultRawResponse object is equal to o. */ @@ -289,6 +342,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 (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetFullName) { + addIfNull(nulls, JSON_PROPERTY_FULL_NAME, this.fullName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetMiddleName) { + addIfNull(nulls, JSON_PROPERTY_MIDDLE_NAME, this.middleName); + } + 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 PaymentValidationsNameResultRawResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResultResponse.java b/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResultResponse.java index 07716be41..1bab17aa4 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResultResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResultResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 PaymentValidationsNameResultResponse { 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_FULL_NAME = "fullName"; private String fullName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFullName = 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; + public static final String JSON_PROPERTY_MIDDLE_NAME = "middleName"; private String middleName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMiddleName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentValidationsNameResultResponse() {} /** @@ -52,6 +72,7 @@ public PaymentValidationsNameResultResponse() {} */ public PaymentValidationsNameResultResponse firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -83,6 +104,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -98,6 +120,7 @@ public void setFirstName(String firstName) { */ public PaymentValidationsNameResultResponse fullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set return this; } @@ -129,6 +152,7 @@ public String getFullName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set } /** @@ -144,6 +168,7 @@ public void setFullName(String fullName) { */ public PaymentValidationsNameResultResponse lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -175,6 +200,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -190,6 +216,7 @@ public void setLastName(String lastName) { */ public PaymentValidationsNameResultResponse middleName(String middleName) { this.middleName = middleName; + isSetMiddleName = true; // mark as set return this; } @@ -221,6 +248,27 @@ public String getMiddleName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMiddleName(String middleName) { this.middleName = middleName; + isSetMiddleName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentValidationsNameResultResponse 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 PaymentValidationsNameResultResponse object is equal to o. */ @@ -267,6 +315,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetFullName) { + addIfNull(nulls, JSON_PROPERTY_FULL_NAME, this.fullName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetMiddleName) { + addIfNull(nulls, JSON_PROPERTY_MIDDLE_NAME, this.middleName); + } + + 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 PaymentValidationsNameResultResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentValidationsResponse.java b/src/main/java/com/adyen/model/checkout/PaymentValidationsResponse.java index dfa318034..3a5cd8a91 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentValidationsResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentValidationsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 PaymentValidationsResponse { public static final String JSON_PROPERTY_NAME = "name"; private PaymentValidationsNameResponse 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 PaymentValidationsResponse() {} /** @@ -33,6 +44,7 @@ public PaymentValidationsResponse() {} */ public PaymentValidationsResponse name(PaymentValidationsNameResponse name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -56,6 +68,27 @@ public PaymentValidationsNameResponse getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(PaymentValidationsNameResponse name) { this.name = name; + isSetName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentValidationsResponse 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 PaymentValidationsResponse object is equal to o. */ @@ -95,6 +128,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 (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 PaymentValidationsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaypalUpdateOrderRequest.java b/src/main/java/com/adyen/model/checkout/PaypalUpdateOrderRequest.java index c3acb76c5..667bad328 100644 --- a/src/main/java/com/adyen/model/checkout/PaypalUpdateOrderRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaypalUpdateOrderRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 PaypalUpdateOrderRequest { 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_DELIVERY_METHODS = "deliveryMethods"; private List deliveryMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryMethods = false; + public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData"; private String paymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = 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_SESSION_ID = "sessionId"; private String sessionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSessionId = false; + public static final String JSON_PROPERTY_TAX_TOTAL = "taxTotal"; private TaxTotal taxTotal; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxTotal = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaypalUpdateOrderRequest() {} /** @@ -57,6 +83,7 @@ public PaypalUpdateOrderRequest() {} */ public PaypalUpdateOrderRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -80,6 +107,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -90,6 +118,7 @@ public void setAmount(Amount amount) { */ public PaypalUpdateOrderRequest deliveryMethods(List deliveryMethods) { this.deliveryMethods = deliveryMethods; + isSetDeliveryMethods = true; // mark as set return this; } @@ -121,6 +150,7 @@ public List getDeliveryMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryMethods(List deliveryMethods) { this.deliveryMethods = deliveryMethods; + isSetDeliveryMethods = true; // mark as set } /** @@ -133,6 +163,7 @@ public void setDeliveryMethods(List deliveryMethods) { */ public PaypalUpdateOrderRequest paymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set return this; } @@ -160,6 +191,7 @@ public String getPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set } /** @@ -171,6 +203,7 @@ public void setPaymentData(String paymentData) { */ public PaypalUpdateOrderRequest pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -196,6 +229,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -206,6 +240,7 @@ public void setPspReference(String pspReference) { */ public PaypalUpdateOrderRequest sessionId(String sessionId) { this.sessionId = sessionId; + isSetSessionId = true; // mark as set return this; } @@ -229,6 +264,7 @@ public String getSessionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSessionId(String sessionId) { this.sessionId = sessionId; + isSetSessionId = true; // mark as set } /** @@ -239,6 +275,7 @@ public void setSessionId(String sessionId) { */ public PaypalUpdateOrderRequest taxTotal(TaxTotal taxTotal) { this.taxTotal = taxTotal; + isSetTaxTotal = true; // mark as set return this; } @@ -262,6 +299,27 @@ public TaxTotal getTaxTotal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxTotal(TaxTotal taxTotal) { this.taxTotal = taxTotal; + isSetTaxTotal = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaypalUpdateOrderRequest 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 PaypalUpdateOrderRequest object is equal to o. */ @@ -311,6 +369,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 (isSetDeliveryMethods) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_METHODS, this.deliveryMethods); + } + if (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetSessionId) { + addIfNull(nulls, JSON_PROPERTY_SESSION_ID, this.sessionId); + } + if (isSetTaxTotal) { + addIfNull(nulls, JSON_PROPERTY_TAX_TOTAL, this.taxTotal); + } + + 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 PaypalUpdateOrderRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaypalUpdateOrderResponse.java b/src/main/java/com/adyen/model/checkout/PaypalUpdateOrderResponse.java index e12df3805..c75a0149d 100644 --- a/src/main/java/com/adyen/model/checkout/PaypalUpdateOrderResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaypalUpdateOrderResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -30,6 +32,9 @@ public class PaypalUpdateOrderResponse { public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData"; private String paymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = false; + /** * The status of the request. This indicates whether the order was successfully updated with * PayPal. @@ -77,6 +82,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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaypalUpdateOrderResponse() {} /** @@ -87,6 +101,7 @@ public PaypalUpdateOrderResponse() {} */ public PaypalUpdateOrderResponse paymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set return this; } @@ -110,6 +125,7 @@ public String getPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set } /** @@ -122,6 +138,7 @@ public void setPaymentData(String paymentData) { */ public PaypalUpdateOrderResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -149,6 +166,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaypalUpdateOrderResponse 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 PaypalUpdateOrderResponse object is equal to o. */ @@ -190,6 +228,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 (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + 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 PaypalUpdateOrderResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Phone.java b/src/main/java/com/adyen/model/checkout/Phone.java index 2315e4ae3..67396f4e0 100644 --- a/src/main/java/com/adyen/model/checkout/Phone.java +++ b/src/main/java/com/adyen/model/checkout/Phone.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -132,6 +170,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/checkout/PixDetails.java b/src/main/java/com/adyen/model/checkout/PixDetails.java index 553392ef7..31d25cf04 100644 --- a/src/main/java/com/adyen/model/checkout/PixDetails.java +++ b/src/main/java/com/adyen/model/checkout/PixDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,19 +36,34 @@ public class PixDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_PIX_RECURRING = "pixRecurring"; private PixRecurring pixRecurring; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPixRecurring = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** The payment method type. */ public enum TypeEnum { PIX(String.valueOf("pix")); @@ -89,6 +106,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 PixDetails() {} /** @@ -99,6 +125,7 @@ public PixDetails() {} */ public PixDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -132,6 +160,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public PixDetails pixRecurring(PixRecurring pixRecurring) { this.pixRecurring = pixRecurring; + isSetPixRecurring = true; // mark as set return this; } @@ -155,6 +184,7 @@ public PixRecurring getPixRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPixRecurring(PixRecurring pixRecurring) { this.pixRecurring = pixRecurring; + isSetPixRecurring = true; // mark as set } /** @@ -169,6 +199,7 @@ public void setPixRecurring(PixRecurring pixRecurring) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public PixDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -200,6 +231,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -210,6 +242,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public PixDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -234,6 +267,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -246,6 +280,7 @@ public void setSdkData(String sdkData) { */ public PixDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -273,6 +308,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -283,6 +319,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public PixDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -306,6 +343,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 PixDetails 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 PixDetails object is equal to o. */ @@ -365,6 +423,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetPixRecurring) { + addIfNull(nulls, JSON_PROPERTY_PIX_RECURRING, this.pixRecurring); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 PixDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PixRecurring.java b/src/main/java/com/adyen/model/checkout/PixRecurring.java index 2c146d69e..c94217857 100644 --- a/src/main/java/com/adyen/model/checkout/PixRecurring.java +++ b/src/main/java/com/adyen/model/checkout/PixRecurring.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,12 +40,21 @@ public class PixRecurring { public static final String JSON_PROPERTY_BILLING_DATE = "billingDate"; private String billingDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingDate = false; + public static final String JSON_PROPERTY_BUSINESS_DAY_ONLY = "businessDayOnly"; private Boolean businessDayOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBusinessDayOnly = 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 at which the shopper will be charged. */ public enum FrequencyEnum { WEEKLY(String.valueOf("weekly")), @@ -94,24 +105,51 @@ 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_MIN_AMOUNT = "minAmount"; private Amount minAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMinAmount = false; + public static final String JSON_PROPERTY_ORIGINAL_PSP_REFERENCE = "originalPspReference"; private String originalPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalPspReference = false; + public static final String JSON_PROPERTY_RECURRING_AMOUNT = "recurringAmount"; private Amount recurringAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringAmount = false; + public static final String JSON_PROPERTY_RECURRING_STATEMENT = "recurringStatement"; private String recurringStatement; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringStatement = false; + public static final String JSON_PROPERTY_RETRY_POLICY = "retryPolicy"; private Boolean retryPolicy; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRetryPolicy = 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 PixRecurring() {} /** @@ -123,6 +161,7 @@ public PixRecurring() {} */ public PixRecurring billingDate(String billingDate) { this.billingDate = billingDate; + isSetBillingDate = true; // mark as set return this; } @@ -148,6 +187,7 @@ public String getBillingDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingDate(String billingDate) { this.billingDate = billingDate; + isSetBillingDate = true; // mark as set } /** @@ -158,6 +198,7 @@ public void setBillingDate(String billingDate) { */ public PixRecurring businessDayOnly(Boolean businessDayOnly) { this.businessDayOnly = businessDayOnly; + isSetBusinessDayOnly = true; // mark as set return this; } @@ -182,6 +223,7 @@ public Boolean getBusinessDayOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBusinessDayOnly(Boolean businessDayOnly) { this.businessDayOnly = businessDayOnly; + isSetBusinessDayOnly = true; // mark as set } /** @@ -196,6 +238,7 @@ public void setBusinessDayOnly(Boolean businessDayOnly) { */ public PixRecurring endsAt(String endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set return this; } @@ -227,6 +270,7 @@ public String getEndsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndsAt(String endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set } /** @@ -237,6 +281,7 @@ public void setEndsAt(String endsAt) { */ public PixRecurring frequency(FrequencyEnum frequency) { this.frequency = frequency; + isSetFrequency = true; // mark as set return this; } @@ -260,6 +305,7 @@ public FrequencyEnum getFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFrequency(FrequencyEnum frequency) { this.frequency = frequency; + isSetFrequency = true; // mark as set } /** @@ -270,6 +316,7 @@ public void setFrequency(FrequencyEnum frequency) { */ public PixRecurring minAmount(Amount minAmount) { this.minAmount = minAmount; + isSetMinAmount = true; // mark as set return this; } @@ -293,6 +340,7 @@ public Amount getMinAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMinAmount(Amount minAmount) { this.minAmount = minAmount; + isSetMinAmount = true; // mark as set } /** @@ -305,6 +353,7 @@ public void setMinAmount(Amount minAmount) { */ public PixRecurring originalPspReference(String originalPspReference) { this.originalPspReference = originalPspReference; + isSetOriginalPspReference = true; // mark as set return this; } @@ -332,6 +381,7 @@ public String getOriginalPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalPspReference(String originalPspReference) { this.originalPspReference = originalPspReference; + isSetOriginalPspReference = true; // mark as set } /** @@ -342,6 +392,7 @@ public void setOriginalPspReference(String originalPspReference) { */ public PixRecurring recurringAmount(Amount recurringAmount) { this.recurringAmount = recurringAmount; + isSetRecurringAmount = true; // mark as set return this; } @@ -365,6 +416,7 @@ public Amount getRecurringAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringAmount(Amount recurringAmount) { this.recurringAmount = recurringAmount; + isSetRecurringAmount = true; // mark as set } /** @@ -379,6 +431,7 @@ public void setRecurringAmount(Amount recurringAmount) { */ public PixRecurring recurringStatement(String recurringStatement) { this.recurringStatement = recurringStatement; + isSetRecurringStatement = true; // mark as set return this; } @@ -410,6 +463,7 @@ public String getRecurringStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringStatement(String recurringStatement) { this.recurringStatement = recurringStatement; + isSetRecurringStatement = true; // mark as set } /** @@ -421,6 +475,7 @@ public void setRecurringStatement(String recurringStatement) { */ public PixRecurring retryPolicy(Boolean retryPolicy) { this.retryPolicy = retryPolicy; + isSetRetryPolicy = true; // mark as set return this; } @@ -446,6 +501,7 @@ public Boolean getRetryPolicy() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRetryPolicy(Boolean retryPolicy) { this.retryPolicy = retryPolicy; + isSetRetryPolicy = true; // mark as set } /** @@ -458,6 +514,7 @@ public void setRetryPolicy(Boolean retryPolicy) { */ public PixRecurring startsAt(String startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set return this; } @@ -485,6 +542,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 PixRecurring 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 PixRecurring object is equal to o. */ @@ -554,6 +632,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 (isSetBillingDate) { + addIfNull(nulls, JSON_PROPERTY_BILLING_DATE, this.billingDate); + } + if (isSetBusinessDayOnly) { + addIfNull(nulls, JSON_PROPERTY_BUSINESS_DAY_ONLY, this.businessDayOnly); + } + if (isSetEndsAt) { + addIfNull(nulls, JSON_PROPERTY_ENDS_AT, this.endsAt); + } + if (isSetFrequency) { + addIfNull(nulls, JSON_PROPERTY_FREQUENCY, this.frequency); + } + if (isSetMinAmount) { + addIfNull(nulls, JSON_PROPERTY_MIN_AMOUNT, this.minAmount); + } + if (isSetOriginalPspReference) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_PSP_REFERENCE, this.originalPspReference); + } + if (isSetRecurringAmount) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_AMOUNT, this.recurringAmount); + } + if (isSetRecurringStatement) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_STATEMENT, this.recurringStatement); + } + if (isSetRetryPolicy) { + addIfNull(nulls, JSON_PROPERTY_RETRY_POLICY, this.retryPolicy); + } + 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 PixRecurring given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PlatformChargebackLogic.java b/src/main/java/com/adyen/model/checkout/PlatformChargebackLogic.java index e8e0f9214..7f22b9e1e 100644 --- a/src/main/java/com/adyen/model/checkout/PlatformChargebackLogic.java +++ b/src/main/java/com/adyen/model/checkout/PlatformChargebackLogic.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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. */ @@ -251,6 +294,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/checkout/PseDetails.java b/src/main/java/com/adyen/model/checkout/PseDetails.java index 0a00753df..254bade3a 100644 --- a/src/main/java/com/adyen/model/checkout/PseDetails.java +++ b/src/main/java/com/adyen/model/checkout/PseDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,21 +37,39 @@ public class PseDetails { public static final String JSON_PROPERTY_BANK = "bank"; private String bank; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBank = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_CLIENT_TYPE = "clientType"; private String clientType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClientType = false; + public static final String JSON_PROPERTY_IDENTIFICATION = "identification"; private String identification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIdentification = false; + public static final String JSON_PROPERTY_IDENTIFICATION_TYPE = "identificationType"; private String identificationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIdentificationType = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** The payment method type. */ public enum TypeEnum { PSE_PAYULATAM(String.valueOf("pse_payulatam")); @@ -92,6 +112,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 PseDetails() {} /** @@ -102,6 +131,7 @@ public PseDetails() {} */ public PseDetails bank(String bank) { this.bank = bank; + isSetBank = true; // mark as set return this; } @@ -125,6 +155,7 @@ public String getBank() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBank(String bank) { this.bank = bank; + isSetBank = true; // mark as set } /** @@ -135,6 +166,7 @@ public void setBank(String bank) { */ public PseDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -158,6 +190,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -168,6 +201,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public PseDetails clientType(String clientType) { this.clientType = clientType; + isSetClientType = true; // mark as set return this; } @@ -191,6 +225,7 @@ public String getClientType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClientType(String clientType) { this.clientType = clientType; + isSetClientType = true; // mark as set } /** @@ -201,6 +236,7 @@ public void setClientType(String clientType) { */ public PseDetails identification(String identification) { this.identification = identification; + isSetIdentification = true; // mark as set return this; } @@ -224,6 +260,7 @@ public String getIdentification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIdentification(String identification) { this.identification = identification; + isSetIdentification = true; // mark as set } /** @@ -234,6 +271,7 @@ public void setIdentification(String identification) { */ public PseDetails identificationType(String identificationType) { this.identificationType = identificationType; + isSetIdentificationType = true; // mark as set return this; } @@ -257,6 +295,7 @@ public String getIdentificationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIdentificationType(String identificationType) { this.identificationType = identificationType; + isSetIdentificationType = true; // mark as set } /** @@ -267,6 +306,7 @@ public void setIdentificationType(String identificationType) { */ public PseDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -291,6 +331,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -301,6 +342,7 @@ public void setSdkData(String sdkData) { */ public PseDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -324,6 +366,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 PseDetails 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 PseDetails object is equal to o. */ @@ -376,6 +439,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBank) { + addIfNull(nulls, JSON_PROPERTY_BANK, this.bank); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetClientType) { + addIfNull(nulls, JSON_PROPERTY_CLIENT_TYPE, this.clientType); + } + if (isSetIdentification) { + addIfNull(nulls, JSON_PROPERTY_IDENTIFICATION, this.identification); + } + if (isSetIdentificationType) { + addIfNull(nulls, JSON_PROPERTY_IDENTIFICATION_TYPE, this.identificationType); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + 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 PseDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/RakutenPayDetails.java b/src/main/java/com/adyen/model/checkout/RakutenPayDetails.java index ac9e7d9cc..714d83c21 100644 --- a/src/main/java/com/adyen/model/checkout/RakutenPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/RakutenPayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,16 +35,28 @@ public class RakutenPayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **rakutenpay** */ public enum TypeEnum { RAKUTENPAY(String.valueOf("rakutenpay")); @@ -85,6 +99,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 RakutenPayDetails() {} /** @@ -95,6 +118,7 @@ public RakutenPayDetails() {} */ public RakutenPayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -118,6 +142,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -132,6 +157,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public RakutenPayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -163,6 +189,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -173,6 +200,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public RakutenPayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -197,6 +225,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -209,6 +238,7 @@ public void setSdkData(String sdkData) { */ public RakutenPayDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -236,6 +266,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -246,6 +277,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public RakutenPayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -269,6 +301,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 RakutenPayDetails 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 RakutenPayDetails object is equal to o. */ @@ -321,6 +374,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 RakutenPayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/RatepayDetails.java b/src/main/java/com/adyen/model/checkout/RatepayDetails.java index c687407fb..e98d43f36 100644 --- a/src/main/java/com/adyen/model/checkout/RatepayDetails.java +++ b/src/main/java/com/adyen/model/checkout/RatepayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -36,25 +38,46 @@ public class RatepayDetails { public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private String billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private String deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_PERSONAL_DETAILS = "personalDetails"; private String personalDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPersonalDetails = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **ratepay** */ public enum TypeEnum { RATEPAY(String.valueOf("ratepay")), @@ -99,6 +122,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 RatepayDetails() {} /** @@ -109,6 +141,7 @@ public RatepayDetails() {} */ public RatepayDetails billingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -132,6 +165,7 @@ public String getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -142,6 +176,7 @@ public void setBillingAddress(String billingAddress) { */ public RatepayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -165,6 +200,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -175,6 +211,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public RatepayDetails deliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -198,6 +235,7 @@ public String getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -208,6 +246,7 @@ public void setDeliveryAddress(String deliveryAddress) { */ public RatepayDetails personalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set return this; } @@ -231,6 +270,7 @@ public String getPersonalDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPersonalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set } /** @@ -245,6 +285,7 @@ public void setPersonalDetails(String personalDetails) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public RatepayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -276,6 +317,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -286,6 +328,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public RatepayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -310,6 +353,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -322,6 +366,7 @@ public void setSdkData(String sdkData) { */ public RatepayDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -349,6 +394,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -359,6 +405,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public RatepayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -382,6 +429,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 RatepayDetails 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 RatepayDetails object is equal to o. */ @@ -447,6 +515,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 (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetPersonalDetails) { + addIfNull(nulls, JSON_PROPERTY_PERSONAL_DETAILS, this.personalDetails); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 RatepayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Recurring.java b/src/main/java/com/adyen/model/checkout/Recurring.java index efe7e27e0..a578b001e 100644 --- a/src/main/java/com/adyen/model/checkout/Recurring.java +++ b/src/main/java/com/adyen/model/checkout/Recurring.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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. */ @@ -435,6 +488,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/checkout/ResponseAdditionalData3DSecure.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalData3DSecure.java index 3628a97e7..6f1079553 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalData3DSecure.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalData3DSecure.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -296,6 +349,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/checkout/ResponseAdditionalDataBillingAddress.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataBillingAddress.java index 74a83e4a7..f868d08b4 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataBillingAddress.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataBillingAddress.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -342,6 +400,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/checkout/ResponseAdditionalDataCard.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCard.java index 7621dafc0..377442b10 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCard.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCard.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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. */ @@ -576,6 +649,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/checkout/ResponseAdditionalDataCommon.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCommon.java index e12e257d2..1247a693a 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCommon.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCommon.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 Checkout 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 Checkout 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 Checkout 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. */ @@ -3277,6 +3620,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/checkout/ResponseAdditionalDataDomesticError.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataDomesticError.java index 7471b0b53..96b94e608 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataDomesticError.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataDomesticError.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -159,6 +197,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/checkout/ResponseAdditionalDataInstallments.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataInstallments.java index 2f4587e4c..b816f3c3d 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataInstallments.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataInstallments.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -707,6 +795,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/checkout/ResponseAdditionalDataNetworkTokens.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataNetworkTokens.java index 61ecf202c..14bb95fcc 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataNetworkTokens.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataNetworkTokens.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -197,6 +240,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/checkout/ResponseAdditionalDataOpi.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataOpi.java index 3729a6abc..cae0efdaf 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataOpi.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataOpi.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -119,6 +152,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/checkout/ResponseAdditionalDataSepa.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataSepa.java index 033d6db99..e9bda1fa5 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataSepa.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataSepa.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -273,6 +321,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/checkout/ResponseAdditionalDataSwish.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataSwish.java index d359fa625..ef3ecdf5f 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataSwish.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataSwish.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -95,6 +128,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/checkout/ResponsePaymentMethod.java b/src/main/java/com/adyen/model/checkout/ResponsePaymentMethod.java index 0d1d63ca3..1e10236ef 100644 --- a/src/main/java/com/adyen/model/checkout/ResponsePaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/ResponsePaymentMethod.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 ResponsePaymentMethod { public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 ResponsePaymentMethod() {} /** @@ -41,6 +55,7 @@ public ResponsePaymentMethod() {} */ public ResponsePaymentMethod brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -68,6 +83,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -78,6 +94,7 @@ public void setBrand(String brand) { */ public ResponsePaymentMethod type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -101,6 +118,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponsePaymentMethod 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 ResponsePaymentMethod object is equal to o. */ @@ -142,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 (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + 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 ResponsePaymentMethod given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/RiskData.java b/src/main/java/com/adyen/model/checkout/RiskData.java index b9c430932..53d159905 100644 --- a/src/main/java/com/adyen/model/checkout/RiskData.java +++ b/src/main/java/com/adyen/model/checkout/RiskData.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,15 +32,33 @@ public class RiskData { public static final String JSON_PROPERTY_CLIENT_DATA = "clientData"; private String clientData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClientData = false; + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "customFields"; private Map customFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCustomFields = 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_PROFILE_REFERENCE = "profileReference"; private String profileReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProfileReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RiskData() {} /** @@ -50,6 +70,7 @@ public RiskData() {} */ public RiskData clientData(String clientData) { this.clientData = clientData; + isSetClientData = true; // mark as set return this; } @@ -75,6 +96,7 @@ public String getClientData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClientData(String clientData) { this.clientData = clientData; + isSetClientData = true; // mark as set } /** @@ -85,6 +107,7 @@ public void setClientData(String clientData) { */ public RiskData customFields(Map customFields) { this.customFields = customFields; + isSetCustomFields = true; // mark as set return this; } @@ -116,6 +139,7 @@ public Map getCustomFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCustomFields(Map customFields) { this.customFields = customFields; + isSetCustomFields = true; // mark as set } /** @@ -128,6 +152,7 @@ public void setCustomFields(Map customFields) { */ public RiskData fraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set return this; } @@ -155,6 +180,7 @@ public Integer getFraudOffset() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set } /** @@ -167,6 +193,7 @@ public void setFraudOffset(Integer fraudOffset) { */ public RiskData profileReference(String profileReference) { this.profileReference = profileReference; + isSetProfileReference = true; // mark as set return this; } @@ -194,6 +221,27 @@ public String getProfileReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProfileReference(String profileReference) { this.profileReference = profileReference; + isSetProfileReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RiskData 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 RiskData object is equal to o. */ @@ -239,6 +287,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 (isSetClientData) { + addIfNull(nulls, JSON_PROPERTY_CLIENT_DATA, this.clientData); + } + if (isSetCustomFields) { + addIfNull(nulls, JSON_PROPERTY_CUSTOM_FIELDS, this.customFields); + } + if (isSetFraudOffset) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_OFFSET, this.fraudOffset); + } + if (isSetProfileReference) { + addIfNull(nulls, JSON_PROPERTY_PROFILE_REFERENCE, this.profileReference); + } + + 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 RiskData given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/RivertyDetails.java b/src/main/java/com/adyen/model/checkout/RivertyDetails.java index 68c495cae..840a669bd 100644 --- a/src/main/java/com/adyen/model/checkout/RivertyDetails.java +++ b/src/main/java/com/adyen/model/checkout/RivertyDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -39,34 +41,64 @@ public class RivertyDetails { public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private String billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private String deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = 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_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + public static final String JSON_PROPERTY_PERSONAL_DETAILS = "personalDetails"; private String personalDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPersonalDetails = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_SUBTYPE = "subtype"; private String subtype; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubtype = false; + /** **riverty** */ public enum TypeEnum { RIVERTY(String.valueOf("riverty")), @@ -115,6 +147,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 RivertyDetails() {} /** @@ -125,6 +166,7 @@ public RivertyDetails() {} */ public RivertyDetails billingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -148,6 +190,7 @@ public String getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -158,6 +201,7 @@ public void setBillingAddress(String billingAddress) { */ public RivertyDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -181,6 +225,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -191,6 +236,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public RivertyDetails deliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -214,6 +260,7 @@ public String getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -227,6 +274,7 @@ public void setDeliveryAddress(String deliveryAddress) { */ public RivertyDetails deviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set return this; } @@ -256,6 +304,7 @@ public String getDeviceFingerprint() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set } /** @@ -266,6 +315,7 @@ public void setDeviceFingerprint(String deviceFingerprint) { */ public RivertyDetails iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -289,6 +339,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -299,6 +350,7 @@ public void setIban(String iban) { */ public RivertyDetails personalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set return this; } @@ -322,6 +374,7 @@ public String getPersonalDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPersonalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set } /** @@ -336,6 +389,7 @@ public void setPersonalDetails(String personalDetails) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public RivertyDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -367,6 +421,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -377,6 +432,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public RivertyDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -401,6 +457,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -413,6 +470,7 @@ public void setSdkData(String sdkData) { */ public RivertyDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -440,6 +498,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -450,6 +509,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public RivertyDetails subtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set return this; } @@ -473,6 +533,7 @@ public String getSubtype() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set } /** @@ -483,6 +544,7 @@ public void setSubtype(String subtype) { */ public RivertyDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -506,6 +568,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 RivertyDetails 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 RivertyDetails object is equal to o. */ @@ -580,6 +663,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 (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetDeviceFingerprint) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_FINGERPRINT, this.deviceFingerprint); + } + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetPersonalDetails) { + addIfNull(nulls, JSON_PROPERTY_PERSONAL_DETAILS, this.personalDetails); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetSubtype) { + addIfNull(nulls, JSON_PROPERTY_SUBTYPE, this.subtype); + } + 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 RivertyDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/SDKEphemPubKey.java b/src/main/java/com/adyen/model/checkout/SDKEphemPubKey.java index 547873cbf..6bd923e58 100644 --- a/src/main/java/com/adyen/model/checkout/SDKEphemPubKey.java +++ b/src/main/java/com/adyen/model/checkout/SDKEphemPubKey.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -214,6 +262,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (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/checkout/SamsungPayDetails.java b/src/main/java/com/adyen/model/checkout/SamsungPayDetails.java index e941614f3..c74e20100 100644 --- a/src/main/java/com/adyen/model/checkout/SamsungPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/SamsungPayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,6 +37,9 @@ public class SamsungPayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = 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**. @@ -82,19 +87,34 @@ 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_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SAMSUNG_PAY_TOKEN = "samsungPayToken"; private String samsungPayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSamsungPayToken = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **samsungpay** */ public enum TypeEnum { SAMSUNGPAY(String.valueOf("samsungpay")); @@ -137,6 +157,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 SamsungPayDetails() {} /** @@ -147,6 +176,7 @@ public SamsungPayDetails() {} */ public SamsungPayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -170,6 +200,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -183,6 +214,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public SamsungPayDetails fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -212,6 +244,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -226,6 +259,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public SamsungPayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -257,6 +291,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -267,6 +302,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public SamsungPayDetails samsungPayToken(String samsungPayToken) { this.samsungPayToken = samsungPayToken; + isSetSamsungPayToken = true; // mark as set return this; } @@ -290,6 +326,7 @@ public String getSamsungPayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSamsungPayToken(String samsungPayToken) { this.samsungPayToken = samsungPayToken; + isSetSamsungPayToken = true; // mark as set } /** @@ -300,6 +337,7 @@ public void setSamsungPayToken(String samsungPayToken) { */ public SamsungPayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -324,6 +362,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -336,6 +375,7 @@ public void setSdkData(String sdkData) { */ public SamsungPayDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -363,6 +403,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -373,6 +414,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public SamsungPayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -396,6 +438,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 SamsungPayDetails 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 SamsungPayDetails object is equal to o. */ @@ -458,6 +521,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSamsungPayToken) { + addIfNull(nulls, JSON_PROPERTY_SAMSUNG_PAY_TOKEN, this.samsungPayToken); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 SamsungPayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/SepaDirectDebitDetails.java b/src/main/java/com/adyen/model/checkout/SepaDirectDebitDetails.java index b6dc04af6..ec35195f6 100644 --- a/src/main/java/com/adyen/model/checkout/SepaDirectDebitDetails.java +++ b/src/main/java/com/adyen/model/checkout/SepaDirectDebitDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,28 +39,52 @@ public class SepaDirectDebitDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_DUE_DATE = "dueDate"; private String dueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDueDate = 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_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + /** **sepadirectdebit** */ public enum TypeEnum { SEPADIRECTDEBIT(String.valueOf("sepadirectdebit")), @@ -103,6 +129,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 SepaDirectDebitDetails() {} /** @@ -113,6 +148,7 @@ public SepaDirectDebitDetails() {} */ public SepaDirectDebitDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -136,6 +172,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -146,6 +183,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public SepaDirectDebitDetails dueDate(String dueDate) { this.dueDate = dueDate; + isSetDueDate = true; // mark as set return this; } @@ -169,6 +207,7 @@ public String getDueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDueDate(String dueDate) { this.dueDate = dueDate; + isSetDueDate = true; // mark as set } /** @@ -179,6 +218,7 @@ public void setDueDate(String dueDate) { */ public SepaDirectDebitDetails iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -202,6 +242,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -212,6 +253,7 @@ public void setIban(String iban) { */ public SepaDirectDebitDetails ownerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set return this; } @@ -235,6 +277,7 @@ public String getOwnerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwnerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set } /** @@ -249,6 +292,7 @@ public void setOwnerName(String ownerName) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public SepaDirectDebitDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -280,6 +324,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -290,6 +335,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public SepaDirectDebitDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -314,6 +360,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -326,6 +373,7 @@ public void setSdkData(String sdkData) { */ public SepaDirectDebitDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -353,6 +401,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -365,6 +414,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public SepaDirectDebitDetails transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -392,6 +442,7 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set } /** @@ -402,6 +453,7 @@ public void setTransferInstrumentId(String transferInstrumentId) { */ public SepaDirectDebitDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -425,6 +477,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 SepaDirectDebitDetails 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 SepaDirectDebitDetails object is equal to o. */ @@ -496,6 +569,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetDueDate) { + addIfNull(nulls, JSON_PROPERTY_DUE_DATE, this.dueDate); + } + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetOwnerName) { + addIfNull(nulls, JSON_PROPERTY_OWNER_NAME, this.ownerName); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + 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 SepaDirectDebitDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ServiceError.java b/src/main/java/com/adyen/model/checkout/ServiceError.java index d81699410..1afc9b1fc 100644 --- a/src/main/java/com/adyen/model/checkout/ServiceError.java +++ b/src/main/java/com/adyen/model/checkout/ServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -311,6 +369,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/checkout/SessionResultResponse.java b/src/main/java/com/adyen/model/checkout/SessionResultResponse.java index d792465e3..cd09bd635 100644 --- a/src/main/java/com/adyen/model/checkout/SessionResultResponse.java +++ b/src/main/java/com/adyen/model/checkout/SessionResultResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,15 +39,27 @@ public class SessionResultResponse { 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_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENTS = "payments"; private List payments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayments = 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 session. The status included in the response doesn't get updated. * Don't make the request again to check for payment status updates. Possible values: * @@ -109,6 +123,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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SessionResultResponse() {} /** @@ -123,6 +146,7 @@ public SessionResultResponse() {} */ public SessionResultResponse additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -162,6 +186,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -172,6 +197,7 @@ public void setAdditionalData(Map additionalData) { */ public SessionResultResponse id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -195,6 +221,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -205,6 +232,7 @@ public void setId(String id) { */ public SessionResultResponse payments(List payments) { this.payments = payments; + isSetPayments = true; // mark as set return this; } @@ -236,6 +264,7 @@ public List getPayments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayments(List payments) { this.payments = payments; + isSetPayments = true; // mark as set } /** @@ -249,6 +278,7 @@ public void setPayments(List payments) { */ public SessionResultResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -278,6 +308,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -306,6 +337,7 @@ public void setReference(String reference) { */ public SessionResultResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -365,6 +397,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SessionResultResponse 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 SessionResultResponse object is equal to o. */ @@ -412,6 +465,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 (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPayments) { + addIfNull(nulls, JSON_PROPERTY_PAYMENTS, this.payments); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + 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 SessionResultResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ShopperIdPaymentMethod.java b/src/main/java/com/adyen/model/checkout/ShopperIdPaymentMethod.java index 65788ae8e..0d9bae59a 100644 --- a/src/main/java/com/adyen/model/checkout/ShopperIdPaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/ShopperIdPaymentMethod.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -41,6 +43,15 @@ public class ShopperIdPaymentMethod { public static final String JSON_PROPERTY_TYPE = "type"; private String 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 ShopperIdPaymentMethod() {} /** @@ -51,6 +62,7 @@ public ShopperIdPaymentMethod() {} */ public ShopperIdPaymentMethod type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -74,6 +86,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ShopperIdPaymentMethod 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 ShopperIdPaymentMethod object is equal to o. */ @@ -122,6 +155,30 @@ private String toIndentedString(Object o) { JSON.registerDiscriminator(ShopperIdPaymentMethod.class, "type", mappings); } + /** 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 ShopperIdPaymentMethod given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ShopperInteractionDevice.java b/src/main/java/com/adyen/model/checkout/ShopperInteractionDevice.java index 7b77c7b42..1f606c6ea 100644 --- a/src/main/java/com/adyen/model/checkout/ShopperInteractionDevice.java +++ b/src/main/java/com/adyen/model/checkout/ShopperInteractionDevice.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -175,6 +218,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/checkout/ShopperName.java b/src/main/java/com/adyen/model/checkout/ShopperName.java index b7ca4eef2..c3adbfe98 100644 --- a/src/main/java/com/adyen/model/checkout/ShopperName.java +++ b/src/main/java/com/adyen/model/checkout/ShopperName.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 ShopperName { 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 ShopperName() {} /** @@ -36,6 +50,7 @@ public ShopperName() {} */ public ShopperName 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 ShopperName 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 ShopperName 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 ShopperName object is equal to o. */ @@ -133,6 +171,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 ShopperName given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Split.java b/src/main/java/com/adyen/model/checkout/Split.java index 6801ac0d9..cd78a41ce 100644 --- a/src/main/java/com/adyen/model/checkout/Split.java +++ b/src/main/java/com/adyen/model/checkout/Split.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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): * @@ -137,6 +151,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() {} /** @@ -161,6 +184,7 @@ public Split() {} */ public Split account(String account) { this.account = account; + isSetAccount = true; // mark as set return this; } @@ -212,6 +236,7 @@ public String getAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccount(String account) { this.account = account; + isSetAccount = true; // mark as set } /** @@ -222,6 +247,7 @@ public void setAccount(String account) { */ public Split amount(SplitAmount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -245,6 +271,7 @@ public SplitAmount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(SplitAmount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -255,6 +282,7 @@ public void setAmount(SplitAmount amount) { */ public Split description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -278,6 +306,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -298,6 +327,7 @@ public void setDescription(String description) { */ public Split reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -341,6 +371,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -395,6 +426,7 @@ public void setReference(String reference) { */ public Split type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -506,6 +538,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. */ @@ -553,6 +606,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/checkout/SplitAmount.java b/src/main/java/com/adyen/model/checkout/SplitAmount.java index 6720faae2..de633135a 100644 --- a/src/main/java/com/adyen/model/checkout/SplitAmount.java +++ b/src/main/java/com/adyen/model/checkout/SplitAmount.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -151,6 +189,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/checkout/StandalonePaymentCancelRequest.java b/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelRequest.java index f237aaab1..006097cbf 100644 --- a/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelRequest.java +++ b/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 StandalonePaymentCancelRequest { 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_ENHANCED_SCHEME_DATA = "enhancedSchemeData"; private EnhancedSchemeData enhancedSchemeData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeData = 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_PAYMENT_REFERENCE = "paymentReference"; private String paymentReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentReference = 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 StandalonePaymentCancelRequest() {} /** @@ -52,6 +75,7 @@ public StandalonePaymentCancelRequest() {} */ public StandalonePaymentCancelRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -75,6 +99,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -86,6 +111,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public StandalonePaymentCancelRequest enhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set return this; } @@ -109,6 +135,7 @@ public EnhancedSchemeData getEnhancedSchemeData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set } /** @@ -120,6 +147,7 @@ public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { */ public StandalonePaymentCancelRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -143,6 +171,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -158,6 +187,7 @@ public void setMerchantAccount(String merchantAccount) { */ public StandalonePaymentCancelRequest paymentReference(String paymentReference) { this.paymentReference = paymentReference; + isSetPaymentReference = true; // mark as set return this; } @@ -189,6 +219,7 @@ public String getPaymentReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentReference(String paymentReference) { this.paymentReference = paymentReference; + isSetPaymentReference = true; // mark as set } /** @@ -200,6 +231,7 @@ public void setPaymentReference(String paymentReference) { */ public StandalonePaymentCancelRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -223,6 +255,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 StandalonePaymentCancelRequest 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 StandalonePaymentCancelRequest object is equal to o. */ @@ -273,6 +326,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 (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetEnhancedSchemeData) { + addIfNull(nulls, JSON_PROPERTY_ENHANCED_SCHEME_DATA, this.enhancedSchemeData); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_REFERENCE, this.paymentReference); + } + 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 StandalonePaymentCancelRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelResponse.java b/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelResponse.java index bb5a4eaae..fd90b1102 100644 --- a/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelResponse.java +++ b/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 StandalonePaymentCancelResponse { 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_PAYMENT_REFERENCE = "paymentReference"; private String paymentReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentReference = 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 your request. This will always have the value **received**. */ public enum StatusEnum { RECEIVED(String.valueOf("received")); @@ -84,6 +98,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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StandalonePaymentCancelResponse() {} /** @@ -95,6 +118,7 @@ public StandalonePaymentCancelResponse() {} */ public StandalonePaymentCancelResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -118,6 +142,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -133,6 +158,7 @@ public void setMerchantAccount(String merchantAccount) { */ public StandalonePaymentCancelResponse paymentReference(String paymentReference) { this.paymentReference = paymentReference; + isSetPaymentReference = true; // mark as set return this; } @@ -164,6 +190,7 @@ public String getPaymentReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentReference(String paymentReference) { this.paymentReference = paymentReference; + isSetPaymentReference = true; // mark as set } /** @@ -175,6 +202,7 @@ public void setPaymentReference(String paymentReference) { */ public StandalonePaymentCancelResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -198,6 +226,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -209,6 +238,7 @@ public void setPspReference(String pspReference) { */ public StandalonePaymentCancelResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -232,6 +262,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -243,6 +274,7 @@ public void setReference(String reference) { */ public StandalonePaymentCancelResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -266,6 +298,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StandalonePaymentCancelResponse 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 StandalonePaymentCancelResponse object is equal to o. */ @@ -314,6 +367,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 (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_REFERENCE, this.paymentReference); + } + 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); + } + + 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 StandalonePaymentCancelResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/StoredPaymentMethod.java b/src/main/java/com/adyen/model/checkout/StoredPaymentMethod.java index 7f1a34426..15235ad9d 100644 --- a/src/main/java/com/adyen/model/checkout/StoredPaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/StoredPaymentMethod.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,56 +45,113 @@ public class StoredPaymentMethod { 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_LOCATION_ID = "bankLocationId"; private String bankLocationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankLocationId = false; + public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = 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_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_LABEL = "label"; private String label; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLabel = false; + public static final String JSON_PROPERTY_LAST_FOUR = "lastFour"; private String lastFour; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastFour = 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_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_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SUPPORTED_RECURRING_PROCESSING_MODELS = "supportedRecurringProcessingModels"; private List supportedRecurringProcessingModels; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSupportedRecurringProcessingModels = false; + public static final String JSON_PROPERTY_SUPPORTED_SHOPPER_INTERACTIONS = "supportedShopperInteractions"; private List supportedShopperInteractions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSupportedShopperInteractions = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 StoredPaymentMethod() {} /** @@ -103,6 +162,7 @@ public StoredPaymentMethod() {} */ public StoredPaymentMethod bankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set return this; } @@ -126,6 +186,7 @@ public String getBankAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set } /** @@ -137,6 +198,7 @@ public void setBankAccountNumber(String bankAccountNumber) { */ public StoredPaymentMethod bankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set return this; } @@ -162,6 +224,7 @@ public String getBankLocationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set } /** @@ -172,6 +235,7 @@ public void setBankLocationId(String bankLocationId) { */ public StoredPaymentMethod brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -195,6 +259,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -205,6 +270,7 @@ public void setBrand(String brand) { */ public StoredPaymentMethod expiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set return this; } @@ -228,6 +294,7 @@ public String getExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set } /** @@ -239,6 +306,7 @@ public void setExpiryMonth(String expiryMonth) { */ public StoredPaymentMethod expiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set return this; } @@ -264,6 +332,7 @@ public String getExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set } /** @@ -274,6 +343,7 @@ public void setExpiryYear(String expiryYear) { */ public StoredPaymentMethod holderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set return this; } @@ -297,6 +367,7 @@ public String getHolderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHolderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set } /** @@ -307,6 +378,7 @@ public void setHolderName(String holderName) { */ public StoredPaymentMethod iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -330,6 +402,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -340,6 +413,7 @@ public void setIban(String iban) { */ public StoredPaymentMethod id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -363,6 +437,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -373,6 +448,7 @@ public void setId(String id) { */ public StoredPaymentMethod label(String label) { this.label = label; + isSetLabel = true; // mark as set return this; } @@ -396,6 +472,7 @@ public String getLabel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLabel(String label) { this.label = label; + isSetLabel = true; // mark as set } /** @@ -406,6 +483,7 @@ public void setLabel(String label) { */ public StoredPaymentMethod lastFour(String lastFour) { this.lastFour = lastFour; + isSetLastFour = true; // mark as set return this; } @@ -429,6 +507,7 @@ public String getLastFour() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastFour(String lastFour) { this.lastFour = lastFour; + isSetLastFour = true; // mark as set } /** @@ -439,6 +518,7 @@ public void setLastFour(String lastFour) { */ public StoredPaymentMethod name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -462,6 +542,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -476,6 +557,7 @@ public void setName(String name) { */ public StoredPaymentMethod networkTxReference(String networkTxReference) { this.networkTxReference = networkTxReference; + isSetNetworkTxReference = true; // mark as set return this; } @@ -507,6 +589,7 @@ public String getNetworkTxReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkTxReference(String networkTxReference) { this.networkTxReference = networkTxReference; + isSetNetworkTxReference = true; // mark as set } /** @@ -517,6 +600,7 @@ public void setNetworkTxReference(String networkTxReference) { */ public StoredPaymentMethod ownerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set return this; } @@ -540,6 +624,7 @@ public String getOwnerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwnerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set } /** @@ -550,6 +635,7 @@ public void setOwnerName(String ownerName) { */ public StoredPaymentMethod shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -573,6 +659,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -585,6 +672,7 @@ public void setShopperEmail(String shopperEmail) { public StoredPaymentMethod supportedRecurringProcessingModels( List supportedRecurringProcessingModels) { this.supportedRecurringProcessingModels = supportedRecurringProcessingModels; + isSetSupportedRecurringProcessingModels = true; // mark as set return this; } @@ -620,6 +708,7 @@ public List getSupportedRecurringProcessingModels() { public void setSupportedRecurringProcessingModels( List supportedRecurringProcessingModels) { this.supportedRecurringProcessingModels = supportedRecurringProcessingModels; + isSetSupportedRecurringProcessingModels = true; // mark as set } /** @@ -632,6 +721,7 @@ public void setSupportedRecurringProcessingModels( public StoredPaymentMethod supportedShopperInteractions( List supportedShopperInteractions) { this.supportedShopperInteractions = supportedShopperInteractions; + isSetSupportedShopperInteractions = true; // mark as set return this; } @@ -666,6 +756,7 @@ public List getSupportedShopperInteractions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSupportedShopperInteractions(List supportedShopperInteractions) { this.supportedShopperInteractions = supportedShopperInteractions; + isSetSupportedShopperInteractions = true; // mark as set } /** @@ -676,6 +767,7 @@ public void setSupportedShopperInteractions(List supportedShopperInterac */ public StoredPaymentMethod type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -699,6 +791,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredPaymentMethod 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 StoredPaymentMethod object is equal to o. */ @@ -794,6 +907,82 @@ 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 (isSetBankLocationId) { + addIfNull(nulls, JSON_PROPERTY_BANK_LOCATION_ID, this.bankLocationId); + } + if (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + 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 (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLabel) { + addIfNull(nulls, JSON_PROPERTY_LABEL, this.label); + } + if (isSetLastFour) { + addIfNull(nulls, JSON_PROPERTY_LAST_FOUR, this.lastFour); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetNetworkTxReference) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TX_REFERENCE, this.networkTxReference); + } + if (isSetOwnerName) { + addIfNull(nulls, JSON_PROPERTY_OWNER_NAME, this.ownerName); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetSupportedRecurringProcessingModels) { + addIfNull( + nulls, + JSON_PROPERTY_SUPPORTED_RECURRING_PROCESSING_MODELS, + this.supportedRecurringProcessingModels); + } + if (isSetSupportedShopperInteractions) { + addIfNull( + nulls, JSON_PROPERTY_SUPPORTED_SHOPPER_INTERACTIONS, this.supportedShopperInteractions); + } + 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 StoredPaymentMethod given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java index 328fe145d..e375bde65 100644 --- a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java +++ b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,16 +35,28 @@ public class StoredPaymentMethodDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** The payment method type. */ public enum TypeEnum { BCMC_MOBILE(String.valueOf("bcmc_mobile")), @@ -119,6 +133,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 StoredPaymentMethodDetails() {} /** @@ -129,6 +152,7 @@ public StoredPaymentMethodDetails() {} */ public StoredPaymentMethodDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -152,6 +176,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -166,6 +191,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public StoredPaymentMethodDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -197,6 +223,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -207,6 +234,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public StoredPaymentMethodDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -231,6 +259,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -243,6 +272,7 @@ public void setSdkData(String sdkData) { */ public StoredPaymentMethodDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -270,6 +300,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -280,6 +311,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public StoredPaymentMethodDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -303,6 +335,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 StoredPaymentMethodDetails 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 StoredPaymentMethodDetails object is equal to o. */ @@ -357,6 +410,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 StoredPaymentMethodDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodRequest.java b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodRequest.java index 44816338d..dce20d86f 100644 --- a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodRequest.java +++ b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,9 +36,15 @@ public class StoredPaymentMethodRequest { 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_PAYMENT_METHOD = "paymentMethod"; private PaymentMethodToStore paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + /** * Defines a recurring payment type. Required when creating a token to store payment details. * Allowed values: * `Subscription` – A transaction for a fixed or variable amount, @@ -94,15 +102,33 @@ 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_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; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StoredPaymentMethodRequest() {} /** @@ -114,6 +140,7 @@ public StoredPaymentMethodRequest() {} */ public StoredPaymentMethodRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -139,6 +166,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -149,6 +177,7 @@ public void setMerchantAccount(String merchantAccount) { */ public StoredPaymentMethodRequest paymentMethod(PaymentMethodToStore paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -172,6 +201,7 @@ public PaymentMethodToStore getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(PaymentMethodToStore paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -199,6 +229,7 @@ public void setPaymentMethod(PaymentMethodToStore paymentMethod) { public StoredPaymentMethodRequest recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -254,6 +285,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -266,6 +298,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public StoredPaymentMethodRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -293,6 +326,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -303,6 +337,7 @@ public void setShopperEmail(String shopperEmail) { */ public StoredPaymentMethodRequest shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -326,6 +361,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -337,6 +373,7 @@ public void setShopperIP(String shopperIP) { */ public StoredPaymentMethodRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -362,6 +399,27 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredPaymentMethodRequest 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 StoredPaymentMethodRequest object is equal to o. */ @@ -420,6 +478,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 (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperIP) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_I_P, this.shopperIP); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + + 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 StoredPaymentMethodRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodResource.java b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodResource.java index 838ad01b4..fd9fc94a2 100644 --- a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodResource.java +++ b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodResource.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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; @@ -44,58 +46,118 @@ public class StoredPaymentMethodResource { public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = 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_EXTERNAL_RESPONSE_CODE = "externalResponseCode"; private String externalResponseCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExternalResponseCode = false; + public static final String JSON_PROPERTY_EXTERNAL_TOKEN_REFERENCE = "externalTokenReference"; private String externalTokenReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExternalTokenReference = 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_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_ISSUER_NAME = "issuerName"; private String issuerName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuerName = false; + public static final String JSON_PROPERTY_LAST_FOUR = "lastFour"; private String lastFour; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastFour = false; + public static final String JSON_PROPERTY_MANDATE = "mandate"; private TokenMandate mandate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMandate = 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_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_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_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_SUPPORTED_RECURRING_PROCESSING_MODELS = "supportedRecurringProcessingModels"; private List supportedRecurringProcessingModels; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSupportedRecurringProcessingModels = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 StoredPaymentMethodResource() {} /** @@ -106,6 +168,7 @@ public StoredPaymentMethodResource() {} */ public StoredPaymentMethodResource brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -129,6 +192,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -139,6 +203,7 @@ public void setBrand(String brand) { */ public StoredPaymentMethodResource expiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set return this; } @@ -162,6 +227,7 @@ public String getExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set } /** @@ -173,6 +239,7 @@ public void setExpiryMonth(String expiryMonth) { */ public StoredPaymentMethodResource expiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set return this; } @@ -198,6 +265,7 @@ public String getExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set } /** @@ -209,6 +277,7 @@ public void setExpiryYear(String expiryYear) { */ public StoredPaymentMethodResource externalResponseCode(String externalResponseCode) { this.externalResponseCode = externalResponseCode; + isSetExternalResponseCode = true; // mark as set return this; } @@ -234,6 +303,7 @@ public String getExternalResponseCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExternalResponseCode(String externalResponseCode) { this.externalResponseCode = externalResponseCode; + isSetExternalResponseCode = true; // mark as set } /** @@ -246,6 +316,7 @@ public void setExternalResponseCode(String externalResponseCode) { */ public StoredPaymentMethodResource externalTokenReference(String externalTokenReference) { this.externalTokenReference = externalTokenReference; + isSetExternalTokenReference = true; // mark as set return this; } @@ -273,6 +344,7 @@ public String getExternalTokenReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExternalTokenReference(String externalTokenReference) { this.externalTokenReference = externalTokenReference; + isSetExternalTokenReference = true; // mark as set } /** @@ -283,6 +355,7 @@ public void setExternalTokenReference(String externalTokenReference) { */ public StoredPaymentMethodResource holderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set return this; } @@ -306,6 +379,7 @@ public String getHolderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHolderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set } /** @@ -316,6 +390,7 @@ public void setHolderName(String holderName) { */ public StoredPaymentMethodResource iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -339,6 +414,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -349,6 +425,7 @@ public void setIban(String iban) { */ public StoredPaymentMethodResource id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -372,6 +449,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -382,6 +460,7 @@ public void setId(String id) { */ public StoredPaymentMethodResource issuerName(String issuerName) { this.issuerName = issuerName; + isSetIssuerName = true; // mark as set return this; } @@ -405,6 +484,7 @@ public String getIssuerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuerName(String issuerName) { this.issuerName = issuerName; + isSetIssuerName = true; // mark as set } /** @@ -415,6 +495,7 @@ public void setIssuerName(String issuerName) { */ public StoredPaymentMethodResource lastFour(String lastFour) { this.lastFour = lastFour; + isSetLastFour = true; // mark as set return this; } @@ -438,6 +519,7 @@ public String getLastFour() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastFour(String lastFour) { this.lastFour = lastFour; + isSetLastFour = true; // mark as set } /** @@ -448,6 +530,7 @@ public void setLastFour(String lastFour) { */ public StoredPaymentMethodResource mandate(TokenMandate mandate) { this.mandate = mandate; + isSetMandate = true; // mark as set return this; } @@ -471,6 +554,7 @@ public TokenMandate getMandate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMandate(TokenMandate mandate) { this.mandate = mandate; + isSetMandate = true; // mark as set } /** @@ -481,6 +565,7 @@ public void setMandate(TokenMandate mandate) { */ public StoredPaymentMethodResource name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -504,6 +589,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -518,6 +604,7 @@ public void setName(String name) { */ public StoredPaymentMethodResource networkTxReference(String networkTxReference) { this.networkTxReference = networkTxReference; + isSetNetworkTxReference = true; // mark as set return this; } @@ -549,6 +636,7 @@ public String getNetworkTxReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkTxReference(String networkTxReference) { this.networkTxReference = networkTxReference; + isSetNetworkTxReference = true; // mark as set } /** @@ -559,6 +647,7 @@ public void setNetworkTxReference(String networkTxReference) { */ public StoredPaymentMethodResource ownerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set return this; } @@ -582,6 +671,7 @@ public String getOwnerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwnerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set } /** @@ -592,6 +682,7 @@ public void setOwnerName(String ownerName) { */ public StoredPaymentMethodResource shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -615,6 +706,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -630,6 +722,7 @@ public void setShopperEmail(String shopperEmail) { */ public StoredPaymentMethodResource shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -663,6 +756,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -689,6 +783,7 @@ public void setShopperReference(String shopperReference) { public StoredPaymentMethodResource supportedRecurringProcessingModels( List supportedRecurringProcessingModels) { this.supportedRecurringProcessingModels = supportedRecurringProcessingModels; + isSetSupportedRecurringProcessingModels = true; // mark as set return this; } @@ -752,6 +847,7 @@ public List getSupportedRecurringProcessingModels() { public void setSupportedRecurringProcessingModels( List supportedRecurringProcessingModels) { this.supportedRecurringProcessingModels = supportedRecurringProcessingModels; + isSetSupportedRecurringProcessingModels = true; // mark as set } /** @@ -762,6 +858,7 @@ public void setSupportedRecurringProcessingModels( */ public StoredPaymentMethodResource type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -785,6 +882,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredPaymentMethodResource 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 StoredPaymentMethodResource object is equal to o. */ @@ -886,6 +1004,84 @@ 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 (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_MONTH, this.expiryMonth); + } + if (isSetExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_YEAR, this.expiryYear); + } + if (isSetExternalResponseCode) { + addIfNull(nulls, JSON_PROPERTY_EXTERNAL_RESPONSE_CODE, this.externalResponseCode); + } + if (isSetExternalTokenReference) { + addIfNull(nulls, JSON_PROPERTY_EXTERNAL_TOKEN_REFERENCE, this.externalTokenReference); + } + if (isSetHolderName) { + addIfNull(nulls, JSON_PROPERTY_HOLDER_NAME, this.holderName); + } + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetIssuerName) { + addIfNull(nulls, JSON_PROPERTY_ISSUER_NAME, this.issuerName); + } + if (isSetLastFour) { + addIfNull(nulls, JSON_PROPERTY_LAST_FOUR, this.lastFour); + } + if (isSetMandate) { + addIfNull(nulls, JSON_PROPERTY_MANDATE, this.mandate); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetNetworkTxReference) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TX_REFERENCE, this.networkTxReference); + } + if (isSetOwnerName) { + addIfNull(nulls, JSON_PROPERTY_OWNER_NAME, this.ownerName); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetSupportedRecurringProcessingModels) { + addIfNull( + nulls, + JSON_PROPERTY_SUPPORTED_RECURRING_PROCESSING_MODELS, + this.supportedRecurringProcessingModels); + } + 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 StoredPaymentMethodResource given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/SubInputDetail.java b/src/main/java/com/adyen/model/checkout/SubInputDetail.java index eb296ac31..a98e4be1e 100644 --- a/src/main/java/com/adyen/model/checkout/SubInputDetail.java +++ b/src/main/java/com/adyen/model/checkout/SubInputDetail.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,21 +36,45 @@ public class SubInputDetail { public static final String JSON_PROPERTY_CONFIGURATION = "configuration"; private Map configuration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConfiguration = false; + public static final String JSON_PROPERTY_ITEMS = "items"; private List items; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetItems = false; + public static final String JSON_PROPERTY_KEY = "key"; private String key; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetKey = false; + public static final String JSON_PROPERTY_OPTIONAL = "optional"; private Boolean optional; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOptional = 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_VALUE = "value"; private String 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 SubInputDetail() {} /** @@ -59,6 +85,7 @@ public SubInputDetail() {} */ public SubInputDetail configuration(Map configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set return this; } @@ -90,6 +117,7 @@ public Map getConfiguration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConfiguration(Map configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set } /** @@ -100,6 +128,7 @@ public void setConfiguration(Map configuration) { */ public SubInputDetail items(List items) { this.items = items; + isSetItems = true; // mark as set return this; } @@ -131,6 +160,7 @@ public List getItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setItems(List items) { this.items = items; + isSetItems = true; // mark as set } /** @@ -141,6 +171,7 @@ public void setItems(List items) { */ public SubInputDetail key(String key) { this.key = key; + isSetKey = true; // mark as set return this; } @@ -164,6 +195,7 @@ public String getKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setKey(String key) { this.key = key; + isSetKey = true; // mark as set } /** @@ -174,6 +206,7 @@ public void setKey(String key) { */ public SubInputDetail optional(Boolean optional) { this.optional = optional; + isSetOptional = true; // mark as set return this; } @@ -197,6 +230,7 @@ public Boolean getOptional() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOptional(Boolean optional) { this.optional = optional; + isSetOptional = true; // mark as set } /** @@ -207,6 +241,7 @@ public void setOptional(Boolean optional) { */ public SubInputDetail type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -230,6 +265,7 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set } /** @@ -240,6 +276,7 @@ public void setType(String type) { */ public SubInputDetail value(String value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -263,6 +300,27 @@ public String getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(String value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SubInputDetail 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 SubInputDetail object is equal to o. */ @@ -312,6 +370,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 (isSetConfiguration) { + addIfNull(nulls, JSON_PROPERTY_CONFIGURATION, this.configuration); + } + if (isSetItems) { + addIfNull(nulls, JSON_PROPERTY_ITEMS, this.items); + } + if (isSetKey) { + addIfNull(nulls, JSON_PROPERTY_KEY, this.key); + } + if (isSetOptional) { + addIfNull(nulls, JSON_PROPERTY_OPTIONAL, this.optional); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + 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 SubInputDetail given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/SubMerchant.java b/src/main/java/com/adyen/model/checkout/SubMerchant.java index be16e3e08..40f307ee7 100644 --- a/src/main/java/com/adyen/model/checkout/SubMerchant.java +++ b/src/main/java/com/adyen/model/checkout/SubMerchant.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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. */ @@ -295,6 +348,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/checkout/SubMerchantInfo.java b/src/main/java/com/adyen/model/checkout/SubMerchantInfo.java index 9cdb9eb25..02189a65b 100644 --- a/src/main/java/com/adyen/model/checkout/SubMerchantInfo.java +++ b/src/main/java/com/adyen/model/checkout/SubMerchantInfo.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,33 +36,69 @@ public class SubMerchantInfo { public static final String JSON_PROPERTY_ADDRESS = "address"; private BillingAddress address; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddress = 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_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_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_PHONE_NUMBER = "phoneNumber"; private String phoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneNumber = false; + public static final String JSON_PROPERTY_REGISTERED_SINCE = "registeredSince"; private String registeredSince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRegisteredSince = 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; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SubMerchantInfo() {} /** @@ -71,6 +109,7 @@ public SubMerchantInfo() {} */ public SubMerchantInfo address(BillingAddress address) { this.address = address; + isSetAddress = true; // mark as set return this; } @@ -94,6 +133,7 @@ public BillingAddress getAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddress(BillingAddress address) { this.address = address; + isSetAddress = true; // mark as set } /** @@ -104,6 +144,7 @@ public void setAddress(BillingAddress address) { */ public SubMerchantInfo amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -127,6 +168,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -139,6 +181,7 @@ public void setAmount(Amount amount) { */ public SubMerchantInfo email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -166,6 +209,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -180,6 +224,7 @@ public void setEmail(String email) { */ public SubMerchantInfo id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -211,6 +256,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -224,6 +270,7 @@ public void setId(String id) { */ public SubMerchantInfo mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -253,6 +300,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -270,6 +318,7 @@ public void setMcc(String mcc) { */ public SubMerchantInfo name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -307,6 +356,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -319,6 +369,7 @@ public void setName(String name) { */ public SubMerchantInfo phoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set return this; } @@ -346,6 +397,7 @@ public String getPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set } /** @@ -356,6 +408,7 @@ public void setPhoneNumber(String phoneNumber) { */ public SubMerchantInfo registeredSince(String registeredSince) { this.registeredSince = registeredSince; + isSetRegisteredSince = true; // mark as set return this; } @@ -379,6 +432,7 @@ public String getRegisteredSince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRegisteredSince(String registeredSince) { this.registeredSince = registeredSince; + isSetRegisteredSince = true; // mark as set } /** @@ -392,6 +446,7 @@ public void setRegisteredSince(String registeredSince) { */ public SubMerchantInfo taxId(String taxId) { this.taxId = taxId; + isSetTaxId = true; // mark as set return this; } @@ -421,6 +476,7 @@ public String getTaxId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxId(String taxId) { this.taxId = taxId; + isSetTaxId = true; // mark as set } /** @@ -433,6 +489,7 @@ public void setTaxId(String taxId) { */ public SubMerchantInfo url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -460,6 +517,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SubMerchantInfo 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 SubMerchantInfo object is equal to o. */ @@ -518,6 +596,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 (isSetAddress) { + addIfNull(nulls, JSON_PROPERTY_ADDRESS, this.address); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPhoneNumber) { + addIfNull(nulls, JSON_PROPERTY_PHONE_NUMBER, this.phoneNumber); + } + if (isSetRegisteredSince) { + addIfNull(nulls, JSON_PROPERTY_REGISTERED_SINCE, this.registeredSince); + } + if (isSetTaxId) { + addIfNull(nulls, JSON_PROPERTY_TAX_ID, this.taxId); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + 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 SubMerchantInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Surcharge.java b/src/main/java/com/adyen/model/checkout/Surcharge.java index 0ae6704cf..a70697447 100644 --- a/src/main/java/com/adyen/model/checkout/Surcharge.java +++ b/src/main/java/com/adyen/model/checkout/Surcharge.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 Surcharge { 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 Surcharge() {} /** @@ -44,6 +55,7 @@ public Surcharge() {} */ public Surcharge value(Long value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -89,6 +101,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 Surcharge 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 Surcharge object is equal to o. */ @@ -128,6 +161,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 (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 Surcharge given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/TaxTotal.java b/src/main/java/com/adyen/model/checkout/TaxTotal.java index a97781446..6357e1bd2 100644 --- a/src/main/java/com/adyen/model/checkout/TaxTotal.java +++ b/src/main/java/com/adyen/model/checkout/TaxTotal.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 TaxTotal { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TaxTotal() {} /** @@ -33,6 +44,7 @@ public TaxTotal() {} */ public TaxTotal amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -56,6 +68,27 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TaxTotal 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 TaxTotal object is equal to o. */ @@ -95,6 +128,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + + 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 TaxTotal given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ThreeDS2RequestData.java b/src/main/java/com/adyen/model/checkout/ThreeDS2RequestData.java index 7eee2029a..74454c033 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDS2RequestData.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDS2RequestData.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 Checkout 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` * @@ -228,78 +248,150 @@ public static ChallengeIndicatorEnum fromValue(String value) { // 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 @@ -359,19 +451,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** @@ -426,6 +533,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")), @@ -476,12 +586,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() {} /** @@ -492,6 +617,7 @@ public ThreeDS2RequestData() {} */ public ThreeDS2RequestData acctInfo(AcctInfo acctInfo) { this.acctInfo = acctInfo; + isSetAcctInfo = true; // mark as set return this; } @@ -515,6 +641,7 @@ public AcctInfo getAcctInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcctInfo(AcctInfo acctInfo) { this.acctInfo = acctInfo; + isSetAcctInfo = true; // mark as set } /** @@ -528,6 +655,7 @@ public void setAcctInfo(AcctInfo acctInfo) { */ public ThreeDS2RequestData acctType(AcctTypeEnum acctType) { this.acctType = acctType; + isSetAcctType = true; // mark as set return this; } @@ -557,6 +685,7 @@ public AcctTypeEnum getAcctType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcctType(AcctTypeEnum acctType) { this.acctType = acctType; + isSetAcctType = true; // mark as set } /** @@ -573,6 +702,7 @@ public void setAcctType(AcctTypeEnum acctType) { */ public ThreeDS2RequestData acquirerBIN(String acquirerBIN) { this.acquirerBIN = acquirerBIN; + isSetAcquirerBIN = true; // mark as set return this; } @@ -608,6 +738,7 @@ public String getAcquirerBIN() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerBIN(String acquirerBIN) { this.acquirerBIN = acquirerBIN; + isSetAcquirerBIN = true; // mark as set } /** @@ -625,6 +756,7 @@ public void setAcquirerBIN(String acquirerBIN) { */ public ThreeDS2RequestData acquirerMerchantID(String acquirerMerchantID) { this.acquirerMerchantID = acquirerMerchantID; + isSetAcquirerMerchantID = true; // mark as set return this; } @@ -662,6 +794,7 @@ public String getAcquirerMerchantID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerMerchantID(String acquirerMerchantID) { this.acquirerMerchantID = acquirerMerchantID; + isSetAcquirerMerchantID = true; // mark as set } /** @@ -676,6 +809,7 @@ public void setAcquirerMerchantID(String acquirerMerchantID) { */ public ThreeDS2RequestData addrMatch(AddrMatchEnum addrMatch) { this.addrMatch = addrMatch; + isSetAddrMatch = true; // mark as set return this; } @@ -707,6 +841,7 @@ public AddrMatchEnum getAddrMatch() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddrMatch(AddrMatchEnum addrMatch) { this.addrMatch = addrMatch; + isSetAddrMatch = true; // mark as set } /** @@ -723,6 +858,7 @@ public void setAddrMatch(AddrMatchEnum addrMatch) { @Deprecated // deprecated since Adyen Checkout API v50: Use `threeDSAuthenticationOnly` instead. public ThreeDS2RequestData authenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; + isSetAuthenticationOnly = true; // mark as set return this; } @@ -759,6 +895,7 @@ public Boolean getAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; + isSetAuthenticationOnly = true; // mark as set } /** @@ -776,6 +913,7 @@ public void setAuthenticationOnly(Boolean authenticationOnly) { // instead. public ThreeDS2RequestData challengeIndicator(ChallengeIndicatorEnum challengeIndicator) { this.challengeIndicator = challengeIndicator; + isSetChallengeIndicator = true; // mark as set return this; } @@ -814,6 +952,7 @@ public ChallengeIndicatorEnum getChallengeIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallengeIndicator(ChallengeIndicatorEnum challengeIndicator) { this.challengeIndicator = challengeIndicator; + isSetChallengeIndicator = true; // mark as set } /** @@ -825,6 +964,7 @@ public void setChallengeIndicator(ChallengeIndicatorEnum challengeIndicator) { */ public ThreeDS2RequestData deviceChannel(String deviceChannel) { this.deviceChannel = deviceChannel; + isSetDeviceChannel = true; // mark as set return this; } @@ -850,6 +990,7 @@ public String getDeviceChannel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceChannel(String deviceChannel) { this.deviceChannel = deviceChannel; + isSetDeviceChannel = true; // mark as set } /** @@ -860,6 +1001,7 @@ public void setDeviceChannel(String deviceChannel) { */ public ThreeDS2RequestData deviceRenderOptions(DeviceRenderOptions deviceRenderOptions) { this.deviceRenderOptions = deviceRenderOptions; + isSetDeviceRenderOptions = true; // mark as set return this; } @@ -883,6 +1025,7 @@ public DeviceRenderOptions getDeviceRenderOptions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceRenderOptions(DeviceRenderOptions deviceRenderOptions) { this.deviceRenderOptions = deviceRenderOptions; + isSetDeviceRenderOptions = true; // mark as set } /** @@ -893,6 +1036,7 @@ public void setDeviceRenderOptions(DeviceRenderOptions deviceRenderOptions) { */ public ThreeDS2RequestData homePhone(Phone homePhone) { this.homePhone = homePhone; + isSetHomePhone = true; // mark as set return this; } @@ -916,6 +1060,7 @@ public Phone getHomePhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHomePhone(Phone homePhone) { this.homePhone = homePhone; + isSetHomePhone = true; // mark as set } /** @@ -934,6 +1079,7 @@ public void setHomePhone(Phone homePhone) { */ public ThreeDS2RequestData mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -973,6 +1119,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -997,6 +1144,7 @@ public void setMcc(String mcc) { */ public ThreeDS2RequestData merchantName(String merchantName) { this.merchantName = merchantName; + isSetMerchantName = true; // mark as set return this; } @@ -1048,6 +1196,7 @@ public String getMerchantName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantName(String merchantName) { this.merchantName = merchantName; + isSetMerchantName = true; // mark as set } /** @@ -1059,6 +1208,7 @@ public void setMerchantName(String merchantName) { */ public ThreeDS2RequestData messageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set return this; } @@ -1084,6 +1234,7 @@ public String getMessageVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set } /** @@ -1094,6 +1245,7 @@ public void setMessageVersion(String messageVersion) { */ public ThreeDS2RequestData mobilePhone(Phone mobilePhone) { this.mobilePhone = mobilePhone; + isSetMobilePhone = true; // mark as set return this; } @@ -1117,6 +1269,7 @@ public Phone getMobilePhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMobilePhone(Phone mobilePhone) { this.mobilePhone = mobilePhone; + isSetMobilePhone = true; // mark as set } /** @@ -1131,6 +1284,7 @@ public void setMobilePhone(Phone mobilePhone) { */ public ThreeDS2RequestData notificationURL(String notificationURL) { this.notificationURL = notificationURL; + isSetNotificationURL = true; // mark as set return this; } @@ -1162,6 +1316,7 @@ public String getNotificationURL() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationURL(String notificationURL) { this.notificationURL = notificationURL; + isSetNotificationURL = true; // mark as set } /** @@ -1174,6 +1329,7 @@ public void setNotificationURL(String notificationURL) { */ public ThreeDS2RequestData payTokenInd(Boolean payTokenInd) { this.payTokenInd = payTokenInd; + isSetPayTokenInd = true; // mark as set return this; } @@ -1201,6 +1357,7 @@ public Boolean getPayTokenInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayTokenInd(Boolean payTokenInd) { this.payTokenInd = payTokenInd; + isSetPayTokenInd = true; // mark as set } /** @@ -1212,6 +1369,7 @@ public void setPayTokenInd(Boolean payTokenInd) { */ public ThreeDS2RequestData paymentAuthenticationUseCase(String paymentAuthenticationUseCase) { this.paymentAuthenticationUseCase = paymentAuthenticationUseCase; + isSetPaymentAuthenticationUseCase = true; // mark as set return this; } @@ -1237,6 +1395,7 @@ public String getPaymentAuthenticationUseCase() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentAuthenticationUseCase(String paymentAuthenticationUseCase) { this.paymentAuthenticationUseCase = paymentAuthenticationUseCase; + isSetPaymentAuthenticationUseCase = true; // mark as set } /** @@ -1249,6 +1408,7 @@ public void setPaymentAuthenticationUseCase(String paymentAuthenticationUseCase) */ public ThreeDS2RequestData purchaseInstalData(String purchaseInstalData) { this.purchaseInstalData = purchaseInstalData; + isSetPurchaseInstalData = true; // mark as set return this; } @@ -1276,6 +1436,7 @@ public String getPurchaseInstalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPurchaseInstalData(String purchaseInstalData) { this.purchaseInstalData = purchaseInstalData; + isSetPurchaseInstalData = true; // mark as set } /** @@ -1287,6 +1448,7 @@ public void setPurchaseInstalData(String purchaseInstalData) { */ public ThreeDS2RequestData recurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set return this; } @@ -1312,6 +1474,7 @@ public String getRecurringExpiry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set } /** @@ -1323,6 +1486,7 @@ public void setRecurringExpiry(String recurringExpiry) { */ public ThreeDS2RequestData recurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set return this; } @@ -1348,6 +1512,7 @@ public String getRecurringFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set } /** @@ -1360,6 +1525,7 @@ public void setRecurringFrequency(String recurringFrequency) { */ public ThreeDS2RequestData sdkAppID(String sdkAppID) { this.sdkAppID = sdkAppID; + isSetSdkAppID = true; // mark as set return this; } @@ -1387,6 +1553,7 @@ public String getSdkAppID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkAppID(String sdkAppID) { this.sdkAppID = sdkAppID; + isSetSdkAppID = true; // mark as set } /** @@ -1399,6 +1566,7 @@ public void setSdkAppID(String sdkAppID) { */ public ThreeDS2RequestData sdkEncData(String sdkEncData) { this.sdkEncData = sdkEncData; + isSetSdkEncData = true; // mark as set return this; } @@ -1426,6 +1594,7 @@ public String getSdkEncData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkEncData(String sdkEncData) { this.sdkEncData = sdkEncData; + isSetSdkEncData = true; // mark as set } /** @@ -1436,6 +1605,7 @@ public void setSdkEncData(String sdkEncData) { */ public ThreeDS2RequestData sdkEphemPubKey(SDKEphemPubKey sdkEphemPubKey) { this.sdkEphemPubKey = sdkEphemPubKey; + isSetSdkEphemPubKey = true; // mark as set return this; } @@ -1459,6 +1629,7 @@ public SDKEphemPubKey getSdkEphemPubKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkEphemPubKey(SDKEphemPubKey sdkEphemPubKey) { this.sdkEphemPubKey = sdkEphemPubKey; + isSetSdkEphemPubKey = true; // mark as set } /** @@ -1472,6 +1643,7 @@ public void setSdkEphemPubKey(SDKEphemPubKey sdkEphemPubKey) { */ public ThreeDS2RequestData sdkMaxTimeout(Integer sdkMaxTimeout) { this.sdkMaxTimeout = sdkMaxTimeout; + isSetSdkMaxTimeout = true; // mark as set return this; } @@ -1501,6 +1673,7 @@ public Integer getSdkMaxTimeout() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkMaxTimeout(Integer sdkMaxTimeout) { this.sdkMaxTimeout = sdkMaxTimeout; + isSetSdkMaxTimeout = true; // mark as set } /** @@ -1513,6 +1686,7 @@ public void setSdkMaxTimeout(Integer sdkMaxTimeout) { */ public ThreeDS2RequestData sdkReferenceNumber(String sdkReferenceNumber) { this.sdkReferenceNumber = sdkReferenceNumber; + isSetSdkReferenceNumber = true; // mark as set return this; } @@ -1540,6 +1714,7 @@ public String getSdkReferenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkReferenceNumber(String sdkReferenceNumber) { this.sdkReferenceNumber = sdkReferenceNumber; + isSetSdkReferenceNumber = true; // mark as set } /** @@ -1552,6 +1727,7 @@ public void setSdkReferenceNumber(String sdkReferenceNumber) { */ public ThreeDS2RequestData sdkTransID(String sdkTransID) { this.sdkTransID = sdkTransID; + isSetSdkTransID = true; // mark as set return this; } @@ -1579,6 +1755,7 @@ public String getSdkTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkTransID(String sdkTransID) { this.sdkTransID = sdkTransID; + isSetSdkTransID = true; // mark as set } /** @@ -1590,6 +1767,7 @@ public void setSdkTransID(String sdkTransID) { */ public ThreeDS2RequestData sdkVersion(String sdkVersion) { this.sdkVersion = sdkVersion; + isSetSdkVersion = true; // mark as set return this; } @@ -1615,6 +1793,7 @@ public String getSdkVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkVersion(String sdkVersion) { this.sdkVersion = sdkVersion; + isSetSdkVersion = true; // mark as set } /** @@ -1625,6 +1804,7 @@ public void setSdkVersion(String sdkVersion) { */ public ThreeDS2RequestData threeDSCompInd(String threeDSCompInd) { this.threeDSCompInd = threeDSCompInd; + isSetThreeDSCompInd = true; // mark as set return this; } @@ -1648,6 +1828,7 @@ public String getThreeDSCompInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSCompInd(String threeDSCompInd) { this.threeDSCompInd = threeDSCompInd; + isSetThreeDSCompInd = true; // mark as set } /** @@ -1659,6 +1840,7 @@ public void setThreeDSCompInd(String threeDSCompInd) { public ThreeDS2RequestData threeDSRequestorAuthenticationInd( String threeDSRequestorAuthenticationInd) { this.threeDSRequestorAuthenticationInd = threeDSRequestorAuthenticationInd; + isSetThreeDSRequestorAuthenticationInd = true; // mark as set return this; } @@ -1682,6 +1864,7 @@ public String getThreeDSRequestorAuthenticationInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorAuthenticationInd(String threeDSRequestorAuthenticationInd) { this.threeDSRequestorAuthenticationInd = threeDSRequestorAuthenticationInd; + isSetThreeDSRequestorAuthenticationInd = true; // mark as set } /** @@ -1693,6 +1876,7 @@ public void setThreeDSRequestorAuthenticationInd(String threeDSRequestorAuthenti public ThreeDS2RequestData threeDSRequestorAuthenticationInfo( ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo) { this.threeDSRequestorAuthenticationInfo = threeDSRequestorAuthenticationInfo; + isSetThreeDSRequestorAuthenticationInfo = true; // mark as set return this; } @@ -1717,6 +1901,7 @@ public ThreeDSRequestorAuthenticationInfo getThreeDSRequestorAuthenticationInfo( public void setThreeDSRequestorAuthenticationInfo( ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo) { this.threeDSRequestorAuthenticationInfo = threeDSRequestorAuthenticationInfo; + isSetThreeDSRequestorAuthenticationInfo = true; // mark as set } /** @@ -1735,6 +1920,7 @@ public void setThreeDSRequestorAuthenticationInfo( public ThreeDS2RequestData threeDSRequestorChallengeInd( ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd) { this.threeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + isSetThreeDSRequestorChallengeInd = true; // mark as set return this; } @@ -1773,6 +1959,7 @@ public ThreeDSRequestorChallengeIndEnum getThreeDSRequestorChallengeInd() { public void setThreeDSRequestorChallengeInd( ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd) { this.threeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + isSetThreeDSRequestorChallengeInd = true; // mark as set } /** @@ -1789,6 +1976,7 @@ public void setThreeDSRequestorChallengeInd( */ public ThreeDS2RequestData threeDSRequestorID(String threeDSRequestorID) { this.threeDSRequestorID = threeDSRequestorID; + isSetThreeDSRequestorID = true; // mark as set return this; } @@ -1824,6 +2012,7 @@ public String getThreeDSRequestorID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorID(String threeDSRequestorID) { this.threeDSRequestorID = threeDSRequestorID; + isSetThreeDSRequestorID = true; // mark as set } /** @@ -1840,6 +2029,7 @@ public void setThreeDSRequestorID(String threeDSRequestorID) { */ public ThreeDS2RequestData threeDSRequestorName(String threeDSRequestorName) { this.threeDSRequestorName = threeDSRequestorName; + isSetThreeDSRequestorName = true; // mark as set return this; } @@ -1875,6 +2065,7 @@ public String getThreeDSRequestorName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorName(String threeDSRequestorName) { this.threeDSRequestorName = threeDSRequestorName; + isSetThreeDSRequestorName = true; // mark as set } /** @@ -1886,6 +2077,7 @@ public void setThreeDSRequestorName(String threeDSRequestorName) { public ThreeDS2RequestData threeDSRequestorPriorAuthenticationInfo( ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo) { this.threeDSRequestorPriorAuthenticationInfo = threeDSRequestorPriorAuthenticationInfo; + isSetThreeDSRequestorPriorAuthenticationInfo = true; // mark as set return this; } @@ -1910,6 +2102,7 @@ public ThreeDSRequestorPriorAuthenticationInfo getThreeDSRequestorPriorAuthentic public void setThreeDSRequestorPriorAuthenticationInfo( ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo) { this.threeDSRequestorPriorAuthenticationInfo = threeDSRequestorPriorAuthenticationInfo; + isSetThreeDSRequestorPriorAuthenticationInfo = true; // mark as set } /** @@ -1922,6 +2115,7 @@ public void setThreeDSRequestorPriorAuthenticationInfo( */ public ThreeDS2RequestData threeDSRequestorURL(String threeDSRequestorURL) { this.threeDSRequestorURL = threeDSRequestorURL; + isSetThreeDSRequestorURL = true; // mark as set return this; } @@ -1949,6 +2143,7 @@ public String getThreeDSRequestorURL() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorURL(String threeDSRequestorURL) { this.threeDSRequestorURL = threeDSRequestorURL; + isSetThreeDSRequestorURL = true; // mark as set } /** @@ -1963,6 +2158,7 @@ public void setThreeDSRequestorURL(String threeDSRequestorURL) { */ public ThreeDS2RequestData transType(TransTypeEnum transType) { this.transType = transType; + isSetTransType = true; // mark as set return this; } @@ -1994,6 +2190,7 @@ public TransTypeEnum getTransType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransType(TransTypeEnum transType) { this.transType = transType; + isSetTransType = true; // mark as set } /** @@ -2004,6 +2201,7 @@ public void setTransType(TransTypeEnum transType) { */ public ThreeDS2RequestData transactionType(TransactionTypeEnum transactionType) { this.transactionType = transactionType; + isSetTransactionType = true; // mark as set return this; } @@ -2027,6 +2225,7 @@ public TransactionTypeEnum getTransactionType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionType(TransactionTypeEnum transactionType) { this.transactionType = transactionType; + isSetTransactionType = true; // mark as set } /** @@ -2039,6 +2238,7 @@ public void setTransactionType(TransactionTypeEnum transactionType) { */ public ThreeDS2RequestData whiteListStatus(String whiteListStatus) { this.whiteListStatus = whiteListStatus; + isSetWhiteListStatus = true; // mark as set return this; } @@ -2066,6 +2266,7 @@ public String getWhiteListStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWhiteListStatus(String whiteListStatus) { this.whiteListStatus = whiteListStatus; + isSetWhiteListStatus = true; // mark as set } /** @@ -2076,6 +2277,7 @@ public void setWhiteListStatus(String whiteListStatus) { */ public ThreeDS2RequestData workPhone(Phone workPhone) { this.workPhone = workPhone; + isSetWorkPhone = true; // mark as set return this; } @@ -2099,6 +2301,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. */ @@ -2277,6 +2500,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/checkout/ThreeDS2RequestFields.java b/src/main/java/com/adyen/model/checkout/ThreeDS2RequestFields.java index a8895bd16..da6c298c1 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDS2RequestFields.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDS2RequestFields.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -64,6 +66,9 @@ public class ThreeDS2RequestFields { 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 @@ -113,12 +118,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 @@ -167,10 +181,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 Checkout 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` * @@ -225,69 +245,132 @@ public static ChallengeIndicatorEnum fromValue(String value) { // instead. private ChallengeIndicatorEnum challengeIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChallengeIndicator = 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_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_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 @@ -347,19 +430,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** @@ -414,6 +512,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")), @@ -464,12 +565,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 ThreeDS2RequestFields() {} /** @@ -480,6 +596,7 @@ public ThreeDS2RequestFields() {} */ public ThreeDS2RequestFields acctInfo(AcctInfo acctInfo) { this.acctInfo = acctInfo; + isSetAcctInfo = true; // mark as set return this; } @@ -503,6 +620,7 @@ public AcctInfo getAcctInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcctInfo(AcctInfo acctInfo) { this.acctInfo = acctInfo; + isSetAcctInfo = true; // mark as set } /** @@ -516,6 +634,7 @@ public void setAcctInfo(AcctInfo acctInfo) { */ public ThreeDS2RequestFields acctType(AcctTypeEnum acctType) { this.acctType = acctType; + isSetAcctType = true; // mark as set return this; } @@ -545,6 +664,7 @@ public AcctTypeEnum getAcctType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcctType(AcctTypeEnum acctType) { this.acctType = acctType; + isSetAcctType = true; // mark as set } /** @@ -561,6 +681,7 @@ public void setAcctType(AcctTypeEnum acctType) { */ public ThreeDS2RequestFields acquirerBIN(String acquirerBIN) { this.acquirerBIN = acquirerBIN; + isSetAcquirerBIN = true; // mark as set return this; } @@ -596,6 +717,7 @@ public String getAcquirerBIN() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerBIN(String acquirerBIN) { this.acquirerBIN = acquirerBIN; + isSetAcquirerBIN = true; // mark as set } /** @@ -613,6 +735,7 @@ public void setAcquirerBIN(String acquirerBIN) { */ public ThreeDS2RequestFields acquirerMerchantID(String acquirerMerchantID) { this.acquirerMerchantID = acquirerMerchantID; + isSetAcquirerMerchantID = true; // mark as set return this; } @@ -650,6 +773,7 @@ public String getAcquirerMerchantID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerMerchantID(String acquirerMerchantID) { this.acquirerMerchantID = acquirerMerchantID; + isSetAcquirerMerchantID = true; // mark as set } /** @@ -664,6 +788,7 @@ public void setAcquirerMerchantID(String acquirerMerchantID) { */ public ThreeDS2RequestFields addrMatch(AddrMatchEnum addrMatch) { this.addrMatch = addrMatch; + isSetAddrMatch = true; // mark as set return this; } @@ -695,6 +820,7 @@ public AddrMatchEnum getAddrMatch() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddrMatch(AddrMatchEnum addrMatch) { this.addrMatch = addrMatch; + isSetAddrMatch = true; // mark as set } /** @@ -711,6 +837,7 @@ public void setAddrMatch(AddrMatchEnum addrMatch) { @Deprecated // deprecated since Adyen Checkout API v50: Use `threeDSAuthenticationOnly` instead. public ThreeDS2RequestFields authenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; + isSetAuthenticationOnly = true; // mark as set return this; } @@ -747,6 +874,7 @@ public Boolean getAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; + isSetAuthenticationOnly = true; // mark as set } /** @@ -764,6 +892,7 @@ public void setAuthenticationOnly(Boolean authenticationOnly) { // instead. public ThreeDS2RequestFields challengeIndicator(ChallengeIndicatorEnum challengeIndicator) { this.challengeIndicator = challengeIndicator; + isSetChallengeIndicator = true; // mark as set return this; } @@ -802,6 +931,7 @@ public ChallengeIndicatorEnum getChallengeIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallengeIndicator(ChallengeIndicatorEnum challengeIndicator) { this.challengeIndicator = challengeIndicator; + isSetChallengeIndicator = true; // mark as set } /** @@ -812,6 +942,7 @@ public void setChallengeIndicator(ChallengeIndicatorEnum challengeIndicator) { */ public ThreeDS2RequestFields deviceRenderOptions(DeviceRenderOptions deviceRenderOptions) { this.deviceRenderOptions = deviceRenderOptions; + isSetDeviceRenderOptions = true; // mark as set return this; } @@ -835,6 +966,7 @@ public DeviceRenderOptions getDeviceRenderOptions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceRenderOptions(DeviceRenderOptions deviceRenderOptions) { this.deviceRenderOptions = deviceRenderOptions; + isSetDeviceRenderOptions = true; // mark as set } /** @@ -845,6 +977,7 @@ public void setDeviceRenderOptions(DeviceRenderOptions deviceRenderOptions) { */ public ThreeDS2RequestFields homePhone(Phone homePhone) { this.homePhone = homePhone; + isSetHomePhone = true; // mark as set return this; } @@ -868,6 +1001,7 @@ public Phone getHomePhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHomePhone(Phone homePhone) { this.homePhone = homePhone; + isSetHomePhone = true; // mark as set } /** @@ -886,6 +1020,7 @@ public void setHomePhone(Phone homePhone) { */ public ThreeDS2RequestFields mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -925,6 +1060,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -949,6 +1085,7 @@ public void setMcc(String mcc) { */ public ThreeDS2RequestFields merchantName(String merchantName) { this.merchantName = merchantName; + isSetMerchantName = true; // mark as set return this; } @@ -1000,6 +1137,7 @@ public String getMerchantName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantName(String merchantName) { this.merchantName = merchantName; + isSetMerchantName = true; // mark as set } /** @@ -1011,6 +1149,7 @@ public void setMerchantName(String merchantName) { */ public ThreeDS2RequestFields messageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set return this; } @@ -1036,6 +1175,7 @@ public String getMessageVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set } /** @@ -1046,6 +1186,7 @@ public void setMessageVersion(String messageVersion) { */ public ThreeDS2RequestFields mobilePhone(Phone mobilePhone) { this.mobilePhone = mobilePhone; + isSetMobilePhone = true; // mark as set return this; } @@ -1069,6 +1210,7 @@ public Phone getMobilePhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMobilePhone(Phone mobilePhone) { this.mobilePhone = mobilePhone; + isSetMobilePhone = true; // mark as set } /** @@ -1083,6 +1225,7 @@ public void setMobilePhone(Phone mobilePhone) { */ public ThreeDS2RequestFields notificationURL(String notificationURL) { this.notificationURL = notificationURL; + isSetNotificationURL = true; // mark as set return this; } @@ -1114,6 +1257,7 @@ public String getNotificationURL() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationURL(String notificationURL) { this.notificationURL = notificationURL; + isSetNotificationURL = true; // mark as set } /** @@ -1126,6 +1270,7 @@ public void setNotificationURL(String notificationURL) { */ public ThreeDS2RequestFields payTokenInd(Boolean payTokenInd) { this.payTokenInd = payTokenInd; + isSetPayTokenInd = true; // mark as set return this; } @@ -1153,6 +1298,7 @@ public Boolean getPayTokenInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayTokenInd(Boolean payTokenInd) { this.payTokenInd = payTokenInd; + isSetPayTokenInd = true; // mark as set } /** @@ -1164,6 +1310,7 @@ public void setPayTokenInd(Boolean payTokenInd) { */ public ThreeDS2RequestFields paymentAuthenticationUseCase(String paymentAuthenticationUseCase) { this.paymentAuthenticationUseCase = paymentAuthenticationUseCase; + isSetPaymentAuthenticationUseCase = true; // mark as set return this; } @@ -1189,6 +1336,7 @@ public String getPaymentAuthenticationUseCase() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentAuthenticationUseCase(String paymentAuthenticationUseCase) { this.paymentAuthenticationUseCase = paymentAuthenticationUseCase; + isSetPaymentAuthenticationUseCase = true; // mark as set } /** @@ -1201,6 +1349,7 @@ public void setPaymentAuthenticationUseCase(String paymentAuthenticationUseCase) */ public ThreeDS2RequestFields purchaseInstalData(String purchaseInstalData) { this.purchaseInstalData = purchaseInstalData; + isSetPurchaseInstalData = true; // mark as set return this; } @@ -1228,6 +1377,7 @@ public String getPurchaseInstalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPurchaseInstalData(String purchaseInstalData) { this.purchaseInstalData = purchaseInstalData; + isSetPurchaseInstalData = true; // mark as set } /** @@ -1239,6 +1389,7 @@ public void setPurchaseInstalData(String purchaseInstalData) { */ public ThreeDS2RequestFields recurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set return this; } @@ -1264,6 +1415,7 @@ public String getRecurringExpiry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set } /** @@ -1275,6 +1427,7 @@ public void setRecurringExpiry(String recurringExpiry) { */ public ThreeDS2RequestFields recurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set return this; } @@ -1300,6 +1453,7 @@ public String getRecurringFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set } /** @@ -1310,6 +1464,7 @@ public void setRecurringFrequency(String recurringFrequency) { */ public ThreeDS2RequestFields sdkAppID(String sdkAppID) { this.sdkAppID = sdkAppID; + isSetSdkAppID = true; // mark as set return this; } @@ -1333,6 +1488,7 @@ public String getSdkAppID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkAppID(String sdkAppID) { this.sdkAppID = sdkAppID; + isSetSdkAppID = true; // mark as set } /** @@ -1343,6 +1499,7 @@ public void setSdkAppID(String sdkAppID) { */ public ThreeDS2RequestFields sdkEphemPubKey(SDKEphemPubKey sdkEphemPubKey) { this.sdkEphemPubKey = sdkEphemPubKey; + isSetSdkEphemPubKey = true; // mark as set return this; } @@ -1366,6 +1523,7 @@ public SDKEphemPubKey getSdkEphemPubKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkEphemPubKey(SDKEphemPubKey sdkEphemPubKey) { this.sdkEphemPubKey = sdkEphemPubKey; + isSetSdkEphemPubKey = true; // mark as set } /** @@ -1379,6 +1537,7 @@ public void setSdkEphemPubKey(SDKEphemPubKey sdkEphemPubKey) { */ public ThreeDS2RequestFields sdkMaxTimeout(Integer sdkMaxTimeout) { this.sdkMaxTimeout = sdkMaxTimeout; + isSetSdkMaxTimeout = true; // mark as set return this; } @@ -1408,6 +1567,7 @@ public Integer getSdkMaxTimeout() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkMaxTimeout(Integer sdkMaxTimeout) { this.sdkMaxTimeout = sdkMaxTimeout; + isSetSdkMaxTimeout = true; // mark as set } /** @@ -1419,6 +1579,7 @@ public void setSdkMaxTimeout(Integer sdkMaxTimeout) { */ public ThreeDS2RequestFields sdkReferenceNumber(String sdkReferenceNumber) { this.sdkReferenceNumber = sdkReferenceNumber; + isSetSdkReferenceNumber = true; // mark as set return this; } @@ -1444,6 +1605,7 @@ public String getSdkReferenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkReferenceNumber(String sdkReferenceNumber) { this.sdkReferenceNumber = sdkReferenceNumber; + isSetSdkReferenceNumber = true; // mark as set } /** @@ -1454,6 +1616,7 @@ public void setSdkReferenceNumber(String sdkReferenceNumber) { */ public ThreeDS2RequestFields sdkTransID(String sdkTransID) { this.sdkTransID = sdkTransID; + isSetSdkTransID = true; // mark as set return this; } @@ -1477,6 +1640,7 @@ public String getSdkTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkTransID(String sdkTransID) { this.sdkTransID = sdkTransID; + isSetSdkTransID = true; // mark as set } /** @@ -1487,6 +1651,7 @@ public void setSdkTransID(String sdkTransID) { */ public ThreeDS2RequestFields threeDSCompInd(String threeDSCompInd) { this.threeDSCompInd = threeDSCompInd; + isSetThreeDSCompInd = true; // mark as set return this; } @@ -1510,6 +1675,7 @@ public String getThreeDSCompInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSCompInd(String threeDSCompInd) { this.threeDSCompInd = threeDSCompInd; + isSetThreeDSCompInd = true; // mark as set } /** @@ -1521,6 +1687,7 @@ public void setThreeDSCompInd(String threeDSCompInd) { public ThreeDS2RequestFields threeDSRequestorAuthenticationInd( String threeDSRequestorAuthenticationInd) { this.threeDSRequestorAuthenticationInd = threeDSRequestorAuthenticationInd; + isSetThreeDSRequestorAuthenticationInd = true; // mark as set return this; } @@ -1544,6 +1711,7 @@ public String getThreeDSRequestorAuthenticationInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorAuthenticationInd(String threeDSRequestorAuthenticationInd) { this.threeDSRequestorAuthenticationInd = threeDSRequestorAuthenticationInd; + isSetThreeDSRequestorAuthenticationInd = true; // mark as set } /** @@ -1555,6 +1723,7 @@ public void setThreeDSRequestorAuthenticationInd(String threeDSRequestorAuthenti public ThreeDS2RequestFields threeDSRequestorAuthenticationInfo( ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo) { this.threeDSRequestorAuthenticationInfo = threeDSRequestorAuthenticationInfo; + isSetThreeDSRequestorAuthenticationInfo = true; // mark as set return this; } @@ -1579,6 +1748,7 @@ public ThreeDSRequestorAuthenticationInfo getThreeDSRequestorAuthenticationInfo( public void setThreeDSRequestorAuthenticationInfo( ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo) { this.threeDSRequestorAuthenticationInfo = threeDSRequestorAuthenticationInfo; + isSetThreeDSRequestorAuthenticationInfo = true; // mark as set } /** @@ -1597,6 +1767,7 @@ public void setThreeDSRequestorAuthenticationInfo( public ThreeDS2RequestFields threeDSRequestorChallengeInd( ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd) { this.threeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + isSetThreeDSRequestorChallengeInd = true; // mark as set return this; } @@ -1635,6 +1806,7 @@ public ThreeDSRequestorChallengeIndEnum getThreeDSRequestorChallengeInd() { public void setThreeDSRequestorChallengeInd( ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd) { this.threeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + isSetThreeDSRequestorChallengeInd = true; // mark as set } /** @@ -1651,6 +1823,7 @@ public void setThreeDSRequestorChallengeInd( */ public ThreeDS2RequestFields threeDSRequestorID(String threeDSRequestorID) { this.threeDSRequestorID = threeDSRequestorID; + isSetThreeDSRequestorID = true; // mark as set return this; } @@ -1686,6 +1859,7 @@ public String getThreeDSRequestorID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorID(String threeDSRequestorID) { this.threeDSRequestorID = threeDSRequestorID; + isSetThreeDSRequestorID = true; // mark as set } /** @@ -1702,6 +1876,7 @@ public void setThreeDSRequestorID(String threeDSRequestorID) { */ public ThreeDS2RequestFields threeDSRequestorName(String threeDSRequestorName) { this.threeDSRequestorName = threeDSRequestorName; + isSetThreeDSRequestorName = true; // mark as set return this; } @@ -1737,6 +1912,7 @@ public String getThreeDSRequestorName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorName(String threeDSRequestorName) { this.threeDSRequestorName = threeDSRequestorName; + isSetThreeDSRequestorName = true; // mark as set } /** @@ -1748,6 +1924,7 @@ public void setThreeDSRequestorName(String threeDSRequestorName) { public ThreeDS2RequestFields threeDSRequestorPriorAuthenticationInfo( ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo) { this.threeDSRequestorPriorAuthenticationInfo = threeDSRequestorPriorAuthenticationInfo; + isSetThreeDSRequestorPriorAuthenticationInfo = true; // mark as set return this; } @@ -1772,6 +1949,7 @@ public ThreeDSRequestorPriorAuthenticationInfo getThreeDSRequestorPriorAuthentic public void setThreeDSRequestorPriorAuthenticationInfo( ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo) { this.threeDSRequestorPriorAuthenticationInfo = threeDSRequestorPriorAuthenticationInfo; + isSetThreeDSRequestorPriorAuthenticationInfo = true; // mark as set } /** @@ -1784,6 +1962,7 @@ public void setThreeDSRequestorPriorAuthenticationInfo( */ public ThreeDS2RequestFields threeDSRequestorURL(String threeDSRequestorURL) { this.threeDSRequestorURL = threeDSRequestorURL; + isSetThreeDSRequestorURL = true; // mark as set return this; } @@ -1811,6 +1990,7 @@ public String getThreeDSRequestorURL() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorURL(String threeDSRequestorURL) { this.threeDSRequestorURL = threeDSRequestorURL; + isSetThreeDSRequestorURL = true; // mark as set } /** @@ -1825,6 +2005,7 @@ public void setThreeDSRequestorURL(String threeDSRequestorURL) { */ public ThreeDS2RequestFields transType(TransTypeEnum transType) { this.transType = transType; + isSetTransType = true; // mark as set return this; } @@ -1856,6 +2037,7 @@ public TransTypeEnum getTransType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransType(TransTypeEnum transType) { this.transType = transType; + isSetTransType = true; // mark as set } /** @@ -1866,6 +2048,7 @@ public void setTransType(TransTypeEnum transType) { */ public ThreeDS2RequestFields transactionType(TransactionTypeEnum transactionType) { this.transactionType = transactionType; + isSetTransactionType = true; // mark as set return this; } @@ -1889,6 +2072,7 @@ public TransactionTypeEnum getTransactionType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionType(TransactionTypeEnum transactionType) { this.transactionType = transactionType; + isSetTransactionType = true; // mark as set } /** @@ -1901,6 +2085,7 @@ public void setTransactionType(TransactionTypeEnum transactionType) { */ public ThreeDS2RequestFields whiteListStatus(String whiteListStatus) { this.whiteListStatus = whiteListStatus; + isSetWhiteListStatus = true; // mark as set return this; } @@ -1928,6 +2113,7 @@ public String getWhiteListStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWhiteListStatus(String whiteListStatus) { this.whiteListStatus = whiteListStatus; + isSetWhiteListStatus = true; // mark as set } /** @@ -1938,6 +2124,7 @@ public void setWhiteListStatus(String whiteListStatus) { */ public ThreeDS2RequestFields workPhone(Phone workPhone) { this.workPhone = workPhone; + isSetWorkPhone = true; // mark as set return this; } @@ -1961,6 +2148,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 ThreeDS2RequestFields 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 ThreeDS2RequestFields object is equal to o. */ @@ -2130,6 +2338,148 @@ 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 (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 (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 (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 ThreeDS2RequestFields given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ThreeDS2ResponseData.java b/src/main/java/com/adyen/model/checkout/ThreeDS2ResponseData.java index 0820a8dc0..3d3aeaec4 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDS2ResponseData.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDS2ResponseData.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,60 +45,123 @@ public class ThreeDS2ResponseData { public static final String JSON_PROPERTY_ACS_CHALLENGE_MANDATED = "acsChallengeMandated"; private String acsChallengeMandated; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsChallengeMandated = false; + public static final String JSON_PROPERTY_ACS_OPERATOR_I_D = "acsOperatorID"; private String acsOperatorID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsOperatorID = false; + public static final String JSON_PROPERTY_ACS_REFERENCE_NUMBER = "acsReferenceNumber"; private String acsReferenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsReferenceNumber = false; + public static final String JSON_PROPERTY_ACS_SIGNED_CONTENT = "acsSignedContent"; private String acsSignedContent; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsSignedContent = false; + public static final String JSON_PROPERTY_ACS_TRANS_I_D = "acsTransID"; private String acsTransID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsTransID = false; + public static final String JSON_PROPERTY_ACS_U_R_L = "acsURL"; private String acsURL; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsURL = false; + public static final String JSON_PROPERTY_AUTHENTICATION_TYPE = "authenticationType"; private String authenticationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationType = false; + 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_ALGORITHM = "cavvAlgorithm"; private String cavvAlgorithm; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCavvAlgorithm = false; + public static final String JSON_PROPERTY_CHALLENGE_INDICATOR = "challengeIndicator"; private String challengeIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChallengeIndicator = false; + public static final String JSON_PROPERTY_DS_REFERENCE_NUMBER = "dsReferenceNumber"; private String dsReferenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDsReferenceNumber = 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_EXEMPTION_INDICATOR = "exemptionIndicator"; private String 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; + public static final String JSON_PROPERTY_SDK_EPHEM_PUB_KEY = "sdkEphemPubKey"; private String sdkEphemPubKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkEphemPubKey = 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_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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDS2ResponseData() {} /** @@ -107,6 +172,7 @@ public ThreeDS2ResponseData() {} */ public ThreeDS2ResponseData acsChallengeMandated(String acsChallengeMandated) { this.acsChallengeMandated = acsChallengeMandated; + isSetAcsChallengeMandated = true; // mark as set return this; } @@ -130,6 +196,7 @@ public String getAcsChallengeMandated() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsChallengeMandated(String acsChallengeMandated) { this.acsChallengeMandated = acsChallengeMandated; + isSetAcsChallengeMandated = true; // mark as set } /** @@ -140,6 +207,7 @@ public void setAcsChallengeMandated(String acsChallengeMandated) { */ public ThreeDS2ResponseData acsOperatorID(String acsOperatorID) { this.acsOperatorID = acsOperatorID; + isSetAcsOperatorID = true; // mark as set return this; } @@ -163,6 +231,7 @@ public String getAcsOperatorID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsOperatorID(String acsOperatorID) { this.acsOperatorID = acsOperatorID; + isSetAcsOperatorID = true; // mark as set } /** @@ -173,6 +242,7 @@ public void setAcsOperatorID(String acsOperatorID) { */ public ThreeDS2ResponseData acsReferenceNumber(String acsReferenceNumber) { this.acsReferenceNumber = acsReferenceNumber; + isSetAcsReferenceNumber = true; // mark as set return this; } @@ -196,6 +266,7 @@ public String getAcsReferenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsReferenceNumber(String acsReferenceNumber) { this.acsReferenceNumber = acsReferenceNumber; + isSetAcsReferenceNumber = true; // mark as set } /** @@ -206,6 +277,7 @@ public void setAcsReferenceNumber(String acsReferenceNumber) { */ public ThreeDS2ResponseData acsSignedContent(String acsSignedContent) { this.acsSignedContent = acsSignedContent; + isSetAcsSignedContent = true; // mark as set return this; } @@ -229,6 +301,7 @@ public String getAcsSignedContent() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsSignedContent(String acsSignedContent) { this.acsSignedContent = acsSignedContent; + isSetAcsSignedContent = true; // mark as set } /** @@ -239,6 +312,7 @@ public void setAcsSignedContent(String acsSignedContent) { */ public ThreeDS2ResponseData acsTransID(String acsTransID) { this.acsTransID = acsTransID; + isSetAcsTransID = true; // mark as set return this; } @@ -262,6 +336,7 @@ public String getAcsTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsTransID(String acsTransID) { this.acsTransID = acsTransID; + isSetAcsTransID = true; // mark as set } /** @@ -272,6 +347,7 @@ public void setAcsTransID(String acsTransID) { */ public ThreeDS2ResponseData acsURL(String acsURL) { this.acsURL = acsURL; + isSetAcsURL = true; // mark as set return this; } @@ -295,6 +371,7 @@ public String getAcsURL() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsURL(String acsURL) { this.acsURL = acsURL; + isSetAcsURL = true; // mark as set } /** @@ -305,6 +382,7 @@ public void setAcsURL(String acsURL) { */ public ThreeDS2ResponseData authenticationType(String authenticationType) { this.authenticationType = authenticationType; + isSetAuthenticationType = true; // mark as set return this; } @@ -328,6 +406,7 @@ public String getAuthenticationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationType(String authenticationType) { this.authenticationType = authenticationType; + isSetAuthenticationType = true; // mark as set } /** @@ -338,6 +417,7 @@ public void setAuthenticationType(String authenticationType) { */ public ThreeDS2ResponseData cardHolderInfo(String cardHolderInfo) { this.cardHolderInfo = cardHolderInfo; + isSetCardHolderInfo = true; // mark as set return this; } @@ -361,6 +441,7 @@ public String getCardHolderInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardHolderInfo(String cardHolderInfo) { this.cardHolderInfo = cardHolderInfo; + isSetCardHolderInfo = true; // mark as set } /** @@ -371,6 +452,7 @@ public void setCardHolderInfo(String cardHolderInfo) { */ public ThreeDS2ResponseData cavvAlgorithm(String cavvAlgorithm) { this.cavvAlgorithm = cavvAlgorithm; + isSetCavvAlgorithm = true; // mark as set return this; } @@ -394,6 +476,7 @@ public String getCavvAlgorithm() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCavvAlgorithm(String cavvAlgorithm) { this.cavvAlgorithm = cavvAlgorithm; + isSetCavvAlgorithm = true; // mark as set } /** @@ -404,6 +487,7 @@ public void setCavvAlgorithm(String cavvAlgorithm) { */ public ThreeDS2ResponseData challengeIndicator(String challengeIndicator) { this.challengeIndicator = challengeIndicator; + isSetChallengeIndicator = true; // mark as set return this; } @@ -427,6 +511,7 @@ public String getChallengeIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallengeIndicator(String challengeIndicator) { this.challengeIndicator = challengeIndicator; + isSetChallengeIndicator = true; // mark as set } /** @@ -437,6 +522,7 @@ public void setChallengeIndicator(String challengeIndicator) { */ public ThreeDS2ResponseData dsReferenceNumber(String dsReferenceNumber) { this.dsReferenceNumber = dsReferenceNumber; + isSetDsReferenceNumber = true; // mark as set return this; } @@ -460,6 +546,7 @@ public String getDsReferenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDsReferenceNumber(String dsReferenceNumber) { this.dsReferenceNumber = dsReferenceNumber; + isSetDsReferenceNumber = true; // mark as set } /** @@ -470,6 +557,7 @@ public void setDsReferenceNumber(String dsReferenceNumber) { */ public ThreeDS2ResponseData dsTransID(String dsTransID) { this.dsTransID = dsTransID; + isSetDsTransID = true; // mark as set return this; } @@ -493,6 +581,7 @@ public String getDsTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDsTransID(String dsTransID) { this.dsTransID = dsTransID; + isSetDsTransID = true; // mark as set } /** @@ -503,6 +592,7 @@ public void setDsTransID(String dsTransID) { */ public ThreeDS2ResponseData exemptionIndicator(String exemptionIndicator) { this.exemptionIndicator = exemptionIndicator; + isSetExemptionIndicator = true; // mark as set return this; } @@ -526,6 +616,7 @@ public String getExemptionIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExemptionIndicator(String exemptionIndicator) { this.exemptionIndicator = exemptionIndicator; + isSetExemptionIndicator = true; // mark as set } /** @@ -536,6 +627,7 @@ public void setExemptionIndicator(String exemptionIndicator) { */ public ThreeDS2ResponseData messageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set return this; } @@ -559,6 +651,7 @@ public String getMessageVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set } /** @@ -569,6 +662,7 @@ public void setMessageVersion(String messageVersion) { */ public ThreeDS2ResponseData riskScore(String riskScore) { this.riskScore = riskScore; + isSetRiskScore = true; // mark as set return this; } @@ -592,6 +686,7 @@ public String getRiskScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskScore(String riskScore) { this.riskScore = riskScore; + isSetRiskScore = true; // mark as set } /** @@ -602,6 +697,7 @@ public void setRiskScore(String riskScore) { */ public ThreeDS2ResponseData sdkEphemPubKey(String sdkEphemPubKey) { this.sdkEphemPubKey = sdkEphemPubKey; + isSetSdkEphemPubKey = true; // mark as set return this; } @@ -625,6 +721,7 @@ public String getSdkEphemPubKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkEphemPubKey(String sdkEphemPubKey) { this.sdkEphemPubKey = sdkEphemPubKey; + isSetSdkEphemPubKey = true; // mark as set } /** @@ -635,6 +732,7 @@ public void setSdkEphemPubKey(String sdkEphemPubKey) { */ public ThreeDS2ResponseData threeDSServerTransID(String threeDSServerTransID) { this.threeDSServerTransID = threeDSServerTransID; + isSetThreeDSServerTransID = true; // mark as set return this; } @@ -658,6 +756,7 @@ public String getThreeDSServerTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSServerTransID(String threeDSServerTransID) { this.threeDSServerTransID = threeDSServerTransID; + isSetThreeDSServerTransID = true; // mark as set } /** @@ -668,6 +767,7 @@ public void setThreeDSServerTransID(String threeDSServerTransID) { */ public ThreeDS2ResponseData transStatus(String transStatus) { this.transStatus = transStatus; + isSetTransStatus = true; // mark as set return this; } @@ -691,6 +791,7 @@ public String getTransStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransStatus(String transStatus) { this.transStatus = transStatus; + isSetTransStatus = true; // mark as set } /** @@ -701,6 +802,7 @@ public void setTransStatus(String transStatus) { */ public ThreeDS2ResponseData transStatusReason(String transStatusReason) { this.transStatusReason = transStatusReason; + isSetTransStatusReason = true; // mark as set return this; } @@ -724,6 +826,27 @@ public String getTransStatusReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransStatusReason(String transStatusReason) { this.transStatusReason = transStatusReason; + isSetTransStatusReason = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDS2ResponseData 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 ThreeDS2ResponseData object is equal to o. */ @@ -822,6 +945,84 @@ 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 (isSetAcsChallengeMandated) { + addIfNull(nulls, JSON_PROPERTY_ACS_CHALLENGE_MANDATED, this.acsChallengeMandated); + } + if (isSetAcsOperatorID) { + addIfNull(nulls, JSON_PROPERTY_ACS_OPERATOR_I_D, this.acsOperatorID); + } + if (isSetAcsReferenceNumber) { + addIfNull(nulls, JSON_PROPERTY_ACS_REFERENCE_NUMBER, this.acsReferenceNumber); + } + if (isSetAcsSignedContent) { + addIfNull(nulls, JSON_PROPERTY_ACS_SIGNED_CONTENT, this.acsSignedContent); + } + if (isSetAcsTransID) { + addIfNull(nulls, JSON_PROPERTY_ACS_TRANS_I_D, this.acsTransID); + } + if (isSetAcsURL) { + addIfNull(nulls, JSON_PROPERTY_ACS_U_R_L, this.acsURL); + } + if (isSetAuthenticationType) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_TYPE, this.authenticationType); + } + if (isSetCardHolderInfo) { + addIfNull(nulls, JSON_PROPERTY_CARD_HOLDER_INFO, this.cardHolderInfo); + } + if (isSetCavvAlgorithm) { + addIfNull(nulls, JSON_PROPERTY_CAVV_ALGORITHM, this.cavvAlgorithm); + } + if (isSetChallengeIndicator) { + addIfNull(nulls, JSON_PROPERTY_CHALLENGE_INDICATOR, this.challengeIndicator); + } + if (isSetDsReferenceNumber) { + addIfNull(nulls, JSON_PROPERTY_DS_REFERENCE_NUMBER, this.dsReferenceNumber); + } + if (isSetDsTransID) { + addIfNull(nulls, JSON_PROPERTY_DS_TRANS_I_D, this.dsTransID); + } + 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 (isSetSdkEphemPubKey) { + addIfNull(nulls, JSON_PROPERTY_SDK_EPHEM_PUB_KEY, this.sdkEphemPubKey); + } + if (isSetThreeDSServerTransID) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_SERVER_TRANS_I_D, this.threeDSServerTransID); + } + if (isSetTransStatus) { + addIfNull(nulls, JSON_PROPERTY_TRANS_STATUS, this.transStatus); + } + if (isSetTransStatusReason) { + addIfNull(nulls, JSON_PROPERTY_TRANS_STATUS_REASON, this.transStatusReason); + } + + 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 ThreeDS2ResponseData given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ThreeDS2Result.java b/src/main/java/com/adyen/model/checkout/ThreeDS2Result.java index ad1b3164b..7273e1efe 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDS2Result.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDS2Result.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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. */ @@ -875,6 +973,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/checkout/ThreeDSRequestData.java b/src/main/java/com/adyen/model/checkout/ThreeDSRequestData.java index a6be4a5a3..9270ef221 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDSRequestData.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDSRequestData.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -83,6 +85,9 @@ 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; + /** * Required to trigger the [data-only * flow](https://docs.adyen.com/online-payments/3d-secure/data-only/). When set to **true**, @@ -131,6 +136,9 @@ public static DataOnlyEnum fromValue(String value) { public static final String JSON_PROPERTY_DATA_ONLY = "dataOnly"; private DataOnlyEnum dataOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDataOnly = false; + /** * Indicates if [native 3D Secure * authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be @@ -182,6 +190,9 @@ public static NativeThreeDSEnum fromValue(String value) { public static final String JSON_PROPERTY_NATIVE_THREE_D_S = "nativeThreeDS"; private NativeThreeDSEnum nativeThreeDS; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNativeThreeDS = false; + /** The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0** */ public enum ThreeDSVersionEnum { _2_1_0(String.valueOf("2.1.0")), @@ -226,6 +237,15 @@ public static ThreeDSVersionEnum fromValue(String value) { public static final String JSON_PROPERTY_THREE_D_S_VERSION = "threeDSVersion"; private ThreeDSVersionEnum 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 ThreeDSRequestData() {} /** @@ -240,6 +260,7 @@ public ThreeDSRequestData() {} */ public ThreeDSRequestData challengeWindowSize(ChallengeWindowSizeEnum challengeWindowSize) { this.challengeWindowSize = challengeWindowSize; + isSetChallengeWindowSize = true; // mark as set return this; } @@ -271,6 +292,7 @@ public ChallengeWindowSizeEnum getChallengeWindowSize() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallengeWindowSize(ChallengeWindowSizeEnum challengeWindowSize) { this.challengeWindowSize = challengeWindowSize; + isSetChallengeWindowSize = true; // mark as set } /** @@ -285,6 +307,7 @@ public void setChallengeWindowSize(ChallengeWindowSizeEnum challengeWindowSize) */ public ThreeDSRequestData dataOnly(DataOnlyEnum dataOnly) { this.dataOnly = dataOnly; + isSetDataOnly = true; // mark as set return this; } @@ -316,6 +339,7 @@ public DataOnlyEnum getDataOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDataOnly(DataOnlyEnum dataOnly) { this.dataOnly = dataOnly; + isSetDataOnly = true; // mark as set } /** @@ -336,6 +360,7 @@ public void setDataOnly(DataOnlyEnum dataOnly) { */ public ThreeDSRequestData nativeThreeDS(NativeThreeDSEnum nativeThreeDS) { this.nativeThreeDS = nativeThreeDS; + isSetNativeThreeDS = true; // mark as set return this; } @@ -379,6 +404,7 @@ public NativeThreeDSEnum getNativeThreeDS() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNativeThreeDS(NativeThreeDSEnum nativeThreeDS) { this.nativeThreeDS = nativeThreeDS; + isSetNativeThreeDS = true; // mark as set } /** @@ -389,6 +415,7 @@ public void setNativeThreeDS(NativeThreeDSEnum nativeThreeDS) { */ public ThreeDSRequestData threeDSVersion(ThreeDSVersionEnum threeDSVersion) { this.threeDSVersion = threeDSVersion; + isSetThreeDSVersion = true; // mark as set return this; } @@ -413,6 +440,27 @@ public ThreeDSVersionEnum getThreeDSVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSVersion(ThreeDSVersionEnum threeDSVersion) { this.threeDSVersion = threeDSVersion; + isSetThreeDSVersion = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDSRequestData 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 ThreeDSRequestData object is equal to o. */ @@ -460,6 +508,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 (isSetChallengeWindowSize) { + addIfNull(nulls, JSON_PROPERTY_CHALLENGE_WINDOW_SIZE, this.challengeWindowSize); + } + if (isSetDataOnly) { + addIfNull(nulls, JSON_PROPERTY_DATA_ONLY, this.dataOnly); + } + if (isSetNativeThreeDS) { + addIfNull(nulls, JSON_PROPERTY_NATIVE_THREE_D_S, this.nativeThreeDS); + } + 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 ThreeDSRequestData given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ThreeDSRequestorAuthenticationInfo.java b/src/main/java/com/adyen/model/checkout/ThreeDSRequestorAuthenticationInfo.java index 308310740..20a9465fc 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDSRequestorAuthenticationInfo.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDSRequestorAuthenticationInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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. */ @@ -302,6 +345,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/checkout/ThreeDSRequestorPriorAuthenticationInfo.java b/src/main/java/com/adyen/model/checkout/ThreeDSRequestorPriorAuthenticationInfo.java index 024ad833a..4b1ba68b8 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDSRequestorPriorAuthenticationInfo.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDSRequestorPriorAuthenticationInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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. */ @@ -336,6 +384,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/checkout/ThreeDSecureData.java b/src/main/java/com/adyen/model/checkout/ThreeDSecureData.java index a3a49acb1..ff40954f5 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDSecureData.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDSecureData.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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. */ @@ -761,6 +849,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/checkout/Ticket.java b/src/main/java/com/adyen/model/checkout/Ticket.java index bf48628c4..38c39ed81 100644 --- a/src/main/java/com/adyen/model/checkout/Ticket.java +++ b/src/main/java/com/adyen/model/checkout/Ticket.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,12 +30,27 @@ public class Ticket { public static final String JSON_PROPERTY_ISSUE_ADDRESS = "issueAddress"; private String issueAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssueAddress = false; + public static final String JSON_PROPERTY_ISSUE_DATE = "issueDate"; private LocalDate issueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssueDate = false; + public static final String JSON_PROPERTY_NUMBER = "number"; private String number; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Ticket() {} /** @@ -46,6 +63,7 @@ public Ticket() {} */ public Ticket issueAddress(String issueAddress) { this.issueAddress = issueAddress; + isSetIssueAddress = true; // mark as set return this; } @@ -73,6 +91,7 @@ public String getIssueAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssueAddress(String issueAddress) { this.issueAddress = issueAddress; + isSetIssueAddress = true; // mark as set } /** @@ -86,6 +105,7 @@ public void setIssueAddress(String issueAddress) { */ public Ticket issueDate(LocalDate issueDate) { this.issueDate = issueDate; + isSetIssueDate = true; // mark as set return this; } @@ -115,6 +135,7 @@ public LocalDate getIssueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssueDate(LocalDate issueDate) { this.issueDate = issueDate; + isSetIssueDate = true; // mark as set } /** @@ -127,6 +148,7 @@ public void setIssueDate(LocalDate issueDate) { */ public Ticket number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -154,6 +176,27 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Ticket 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 Ticket object is equal to o. */ @@ -197,6 +240,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 (isSetIssueAddress) { + addIfNull(nulls, JSON_PROPERTY_ISSUE_ADDRESS, this.issueAddress); + } + if (isSetIssueDate) { + addIfNull(nulls, JSON_PROPERTY_ISSUE_DATE, this.issueDate); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + + 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 Ticket given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/TokenMandate.java b/src/main/java/com/adyen/model/checkout/TokenMandate.java index 320941510..73f4f56b0 100644 --- a/src/main/java/com/adyen/model/checkout/TokenMandate.java +++ b/src/main/java/com/adyen/model/checkout/TokenMandate.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -44,9 +46,15 @@ public class TokenMandate { public static final String JSON_PROPERTY_ACCOUNT_ID_TYPE = "accountIdType"; private String accountIdType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountIdType = false; + 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 @@ -95,6 +103,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 @@ -145,18 +156,33 @@ 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_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = 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: **adhoc**, **daily**, * **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. @@ -216,27 +242,57 @@ 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_MANDATE_ID = "mandateId"; private String mandateId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMandateId = false; + public static final String JSON_PROPERTY_MASKED_ACCOUNT_ID = "maskedAccountId"; private String maskedAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaskedAccountId = false; + public static final String JSON_PROPERTY_PROVIDER_ID = "providerId"; private String providerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProviderId = 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; + public static final String JSON_PROPERTY_STATUS = "status"; private String status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TX_VARIANT = "txVariant"; private String txVariant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTxVariant = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TokenMandate() {} /** @@ -247,6 +303,7 @@ public TokenMandate() {} */ public TokenMandate accountIdType(String accountIdType) { this.accountIdType = accountIdType; + isSetAccountIdType = true; // mark as set return this; } @@ -270,6 +327,7 @@ public String getAccountIdType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountIdType(String accountIdType) { this.accountIdType = accountIdType; + isSetAccountIdType = true; // mark as set } /** @@ -280,6 +338,7 @@ public void setAccountIdType(String accountIdType) { */ public TokenMandate amount(String amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -303,6 +362,7 @@ public String getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(String amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -317,6 +377,7 @@ public void setAmount(String amount) { */ public TokenMandate amountRule(AmountRuleEnum amountRule) { this.amountRule = amountRule; + isSetAmountRule = true; // mark as set return this; } @@ -348,6 +409,7 @@ public AmountRuleEnum getAmountRule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountRule(AmountRuleEnum amountRule) { this.amountRule = amountRule; + isSetAmountRule = true; // mark as set } /** @@ -363,6 +425,7 @@ public void setAmountRule(AmountRuleEnum amountRule) { */ public TokenMandate billingAttemptsRule(BillingAttemptsRuleEnum billingAttemptsRule) { this.billingAttemptsRule = billingAttemptsRule; + isSetBillingAttemptsRule = true; // mark as set return this; } @@ -396,6 +459,7 @@ public BillingAttemptsRuleEnum getBillingAttemptsRule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAttemptsRule(BillingAttemptsRuleEnum billingAttemptsRule) { this.billingAttemptsRule = billingAttemptsRule; + isSetBillingAttemptsRule = true; // mark as set } /** @@ -410,6 +474,7 @@ public void setBillingAttemptsRule(BillingAttemptsRuleEnum billingAttemptsRule) */ public TokenMandate billingDay(String billingDay) { this.billingDay = billingDay; + isSetBillingDay = true; // mark as set return this; } @@ -441,6 +506,7 @@ public String getBillingDay() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingDay(String billingDay) { this.billingDay = billingDay; + isSetBillingDay = true; // mark as set } /** @@ -451,6 +517,7 @@ public void setBillingDay(String billingDay) { */ public TokenMandate count(String count) { this.count = count; + isSetCount = true; // mark as set return this; } @@ -474,6 +541,7 @@ public String getCount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCount(String count) { this.count = count; + isSetCount = true; // mark as set } /** @@ -486,6 +554,7 @@ public void setCount(String count) { */ public TokenMandate currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -513,6 +582,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -523,6 +593,7 @@ public void setCurrency(String currency) { */ public TokenMandate endsAt(String endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set return this; } @@ -546,6 +617,7 @@ public String getEndsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndsAt(String endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set } /** @@ -559,6 +631,7 @@ public void setEndsAt(String endsAt) { */ public TokenMandate frequency(FrequencyEnum frequency) { this.frequency = frequency; + isSetFrequency = true; // mark as set return this; } @@ -588,6 +661,7 @@ public FrequencyEnum getFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFrequency(FrequencyEnum frequency) { this.frequency = frequency; + isSetFrequency = true; // mark as set } /** @@ -598,6 +672,7 @@ public void setFrequency(FrequencyEnum frequency) { */ public TokenMandate mandateId(String mandateId) { this.mandateId = mandateId; + isSetMandateId = true; // mark as set return this; } @@ -621,6 +696,7 @@ public String getMandateId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMandateId(String mandateId) { this.mandateId = mandateId; + isSetMandateId = true; // mark as set } /** @@ -631,6 +707,7 @@ public void setMandateId(String mandateId) { */ public TokenMandate maskedAccountId(String maskedAccountId) { this.maskedAccountId = maskedAccountId; + isSetMaskedAccountId = true; // mark as set return this; } @@ -654,6 +731,7 @@ public String getMaskedAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaskedAccountId(String maskedAccountId) { this.maskedAccountId = maskedAccountId; + isSetMaskedAccountId = true; // mark as set } /** @@ -664,6 +742,7 @@ public void setMaskedAccountId(String maskedAccountId) { */ public TokenMandate providerId(String providerId) { this.providerId = providerId; + isSetProviderId = true; // mark as set return this; } @@ -687,6 +766,7 @@ public String getProviderId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProviderId(String providerId) { this.providerId = providerId; + isSetProviderId = true; // mark as set } /** @@ -697,6 +777,7 @@ public void setProviderId(String providerId) { */ public TokenMandate remarks(String remarks) { this.remarks = remarks; + isSetRemarks = true; // mark as set return this; } @@ -720,6 +801,7 @@ public String getRemarks() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemarks(String remarks) { this.remarks = remarks; + isSetRemarks = true; // mark as set } /** @@ -731,6 +813,7 @@ public void setRemarks(String remarks) { */ public TokenMandate startsAt(String startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set return this; } @@ -756,6 +839,7 @@ public String getStartsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartsAt(String startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set } /** @@ -766,6 +850,7 @@ public void setStartsAt(String startsAt) { */ public TokenMandate status(String status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -789,6 +874,7 @@ public String getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(String status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -799,6 +885,7 @@ public void setStatus(String status) { */ public TokenMandate txVariant(String txVariant) { this.txVariant = txVariant; + isSetTxVariant = true; // mark as set return this; } @@ -822,6 +909,27 @@ public String getTxVariant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTxVariant(String txVariant) { this.txVariant = txVariant; + isSetTxVariant = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TokenMandate 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 TokenMandate object is equal to o. */ @@ -909,6 +1017,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 (isSetAccountIdType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_ID_TYPE, this.accountIdType); + } + 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 (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetEndsAt) { + addIfNull(nulls, JSON_PROPERTY_ENDS_AT, this.endsAt); + } + if (isSetFrequency) { + addIfNull(nulls, JSON_PROPERTY_FREQUENCY, this.frequency); + } + if (isSetMandateId) { + addIfNull(nulls, JSON_PROPERTY_MANDATE_ID, this.mandateId); + } + if (isSetMaskedAccountId) { + addIfNull(nulls, JSON_PROPERTY_MASKED_ACCOUNT_ID, this.maskedAccountId); + } + if (isSetProviderId) { + addIfNull(nulls, JSON_PROPERTY_PROVIDER_ID, this.providerId); + } + if (isSetRemarks) { + addIfNull(nulls, JSON_PROPERTY_REMARKS, this.remarks); + } + if (isSetStartsAt) { + addIfNull(nulls, JSON_PROPERTY_STARTS_AT, this.startsAt); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTxVariant) { + addIfNull(nulls, JSON_PROPERTY_TX_VARIANT, this.txVariant); + } + + 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 TokenMandate given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/TravelAgency.java b/src/main/java/com/adyen/model/checkout/TravelAgency.java index c8f2cd418..ab725da84 100644 --- a/src/main/java/com/adyen/model/checkout/TravelAgency.java +++ b/src/main/java/com/adyen/model/checkout/TravelAgency.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 TravelAgency { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = 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 TravelAgency() {} /** @@ -40,6 +54,7 @@ public TravelAgency() {} */ public TravelAgency code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -71,6 +86,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -84,6 +100,7 @@ public void setCode(String code) { */ public TravelAgency name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -113,6 +130,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 TravelAgency 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 TravelAgency object is equal to o. */ @@ -154,6 +192,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 (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + 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 TravelAgency given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/TwintDetails.java b/src/main/java/com/adyen/model/checkout/TwintDetails.java index f1a88c362..06688f8c6 100644 --- a/src/main/java/com/adyen/model/checkout/TwintDetails.java +++ b/src/main/java/com/adyen/model/checkout/TwintDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,19 +36,34 @@ public class TwintDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_SUBTYPE = "subtype"; private String subtype; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubtype = false; + /** The payment method type. */ public enum TypeEnum { TWINT(String.valueOf("twint")); @@ -89,6 +106,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 TwintDetails() {} /** @@ -99,6 +125,7 @@ public TwintDetails() {} */ public TwintDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -136,6 +164,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public TwintDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -167,6 +196,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -177,6 +207,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public TwintDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -201,6 +232,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -213,6 +245,7 @@ public void setSdkData(String sdkData) { */ public TwintDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -240,6 +273,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -250,6 +284,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public TwintDetails subtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set return this; } @@ -273,6 +308,7 @@ public String getSubtype() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set } /** @@ -283,6 +319,7 @@ public void setSubtype(String subtype) { */ public TwintDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -306,6 +343,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 TwintDetails 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 TwintDetails object is equal to o. */ @@ -360,6 +418,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetSubtype) { + addIfNull(nulls, JSON_PROPERTY_SUBTYPE, this.subtype); + } + 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 TwintDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/UPIPaymentMethod.java b/src/main/java/com/adyen/model/checkout/UPIPaymentMethod.java index fbb9998c4..dfe9075ba 100644 --- a/src/main/java/com/adyen/model/checkout/UPIPaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/UPIPaymentMethod.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -36,6 +38,15 @@ public class UPIPaymentMethod extends ShopperIdPaymentMethod { public static final String JSON_PROPERTY_VIRTUAL_PAYMENT_ADDRESS = "virtualPaymentAddress"; private String virtualPaymentAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVirtualPaymentAddress = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UPIPaymentMethod() {} /** @@ -46,6 +57,7 @@ public UPIPaymentMethod() {} */ public UPIPaymentMethod virtualPaymentAddress(String virtualPaymentAddress) { this.virtualPaymentAddress = virtualPaymentAddress; + isSetVirtualPaymentAddress = true; // mark as set return this; } @@ -69,6 +81,27 @@ public String getVirtualPaymentAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVirtualPaymentAddress(String virtualPaymentAddress) { this.virtualPaymentAddress = virtualPaymentAddress; + isSetVirtualPaymentAddress = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UPIPaymentMethod 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 UPIPaymentMethod object is equal to o. */ @@ -119,6 +152,30 @@ private String toIndentedString(Object o) { JSON.registerDiscriminator(UPIPaymentMethod.class, "type", mappings); } + /** 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 (isSetVirtualPaymentAddress) { + addIfNull(nulls, JSON_PROPERTY_VIRTUAL_PAYMENT_ADDRESS, this.virtualPaymentAddress); + } + + 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 UPIPaymentMethod given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/UpdatePaymentLinkRequest.java b/src/main/java/com/adyen/model/checkout/UpdatePaymentLinkRequest.java index 8c2a9b740..4b58cfdde 100644 --- a/src/main/java/com/adyen/model/checkout/UpdatePaymentLinkRequest.java +++ b/src/main/java/com/adyen/model/checkout/UpdatePaymentLinkRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -66,6 +68,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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UpdatePaymentLinkRequest() {} /** @@ -76,6 +87,7 @@ public UpdatePaymentLinkRequest() {} */ public UpdatePaymentLinkRequest status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -99,6 +111,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UpdatePaymentLinkRequest 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 UpdatePaymentLinkRequest object is equal to o. */ @@ -138,6 +171,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 (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 UpdatePaymentLinkRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/UpiCollectDetails.java b/src/main/java/com/adyen/model/checkout/UpiCollectDetails.java index 4b97e0100..497adf128 100644 --- a/src/main/java/com/adyen/model/checkout/UpiCollectDetails.java +++ b/src/main/java/com/adyen/model/checkout/UpiCollectDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -36,23 +38,41 @@ public class UpiCollectDetails { public static final String JSON_PROPERTY_BILLING_SEQUENCE_NUMBER = "billingSequenceNumber"; private String billingSequenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingSequenceNumber = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE = "shopperNotificationReference"; private String shopperNotificationReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperNotificationReference = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **upi_collect** */ public enum TypeEnum { UPI_COLLECT(String.valueOf("upi_collect")); @@ -95,9 +115,21 @@ 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; + public static final String JSON_PROPERTY_VIRTUAL_PAYMENT_ADDRESS = "virtualPaymentAddress"; private String virtualPaymentAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVirtualPaymentAddress = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UpiCollectDetails() {} /** @@ -111,6 +143,7 @@ public UpiCollectDetails() {} */ public UpiCollectDetails billingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set return this; } @@ -140,6 +173,7 @@ public String getBillingSequenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set } /** @@ -150,6 +184,7 @@ public void setBillingSequenceNumber(String billingSequenceNumber) { */ public UpiCollectDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -173,6 +208,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -187,6 +223,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public UpiCollectDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -218,6 +255,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -228,6 +266,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public UpiCollectDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -252,6 +291,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -264,6 +304,7 @@ public void setSdkData(String sdkData) { */ public UpiCollectDetails shopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set return this; } @@ -291,6 +332,7 @@ public String getShopperNotificationReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set } /** @@ -303,6 +345,7 @@ public void setShopperNotificationReference(String shopperNotificationReference) */ public UpiCollectDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -330,6 +373,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -340,6 +384,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public UpiCollectDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -363,6 +408,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -373,6 +419,7 @@ public void setType(TypeEnum type) { */ public UpiCollectDetails virtualPaymentAddress(String virtualPaymentAddress) { this.virtualPaymentAddress = virtualPaymentAddress; + isSetVirtualPaymentAddress = true; // mark as set return this; } @@ -396,6 +443,27 @@ public String getVirtualPaymentAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVirtualPaymentAddress(String virtualPaymentAddress) { this.virtualPaymentAddress = virtualPaymentAddress; + isSetVirtualPaymentAddress = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UpiCollectDetails 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 UpiCollectDetails object is equal to o. */ @@ -468,6 +536,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 (isSetBillingSequenceNumber) { + addIfNull(nulls, JSON_PROPERTY_BILLING_SEQUENCE_NUMBER, this.billingSequenceNumber); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperNotificationReference) { + addIfNull( + nulls, JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE, this.shopperNotificationReference); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetVirtualPaymentAddress) { + addIfNull(nulls, JSON_PROPERTY_VIRTUAL_PAYMENT_ADDRESS, this.virtualPaymentAddress); + } + + 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 UpiCollectDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/UpiIntentDetails.java b/src/main/java/com/adyen/model/checkout/UpiIntentDetails.java index be40f6d0c..4fbe55503 100644 --- a/src/main/java/com/adyen/model/checkout/UpiIntentDetails.java +++ b/src/main/java/com/adyen/model/checkout/UpiIntentDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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; @@ -36,26 +38,47 @@ public class UpiIntentDetails { public static final String JSON_PROPERTY_APP_ID = "appId"; private String appId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAppId = false; + public static final String JSON_PROPERTY_BILLING_SEQUENCE_NUMBER = "billingSequenceNumber"; private String billingSequenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingSequenceNumber = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE = "shopperNotificationReference"; private String shopperNotificationReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperNotificationReference = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **upi_intent** */ public enum TypeEnum { UPI_INTENT(String.valueOf("upi_intent")); @@ -98,6 +121,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 UpiIntentDetails() {} /** @@ -108,6 +140,7 @@ public UpiIntentDetails() {} */ public UpiIntentDetails appId(String appId) { this.appId = appId; + isSetAppId = true; // mark as set return this; } @@ -131,6 +164,7 @@ public String getAppId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAppId(String appId) { this.appId = appId; + isSetAppId = true; // mark as set } /** @@ -144,6 +178,7 @@ public void setAppId(String appId) { */ public UpiIntentDetails billingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set return this; } @@ -173,6 +208,7 @@ public String getBillingSequenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set } /** @@ -183,6 +219,7 @@ public void setBillingSequenceNumber(String billingSequenceNumber) { */ public UpiIntentDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -206,6 +243,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -220,6 +258,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public UpiIntentDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -251,6 +290,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -261,6 +301,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public UpiIntentDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -285,6 +326,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -297,6 +339,7 @@ public void setSdkData(String sdkData) { */ public UpiIntentDetails shopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set return this; } @@ -324,6 +367,7 @@ public String getShopperNotificationReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set } /** @@ -336,6 +380,7 @@ public void setShopperNotificationReference(String shopperNotificationReference) */ public UpiIntentDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -363,6 +408,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -373,6 +419,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public UpiIntentDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -396,6 +443,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 UpiIntentDetails 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 UpiIntentDetails object is equal to o. */ @@ -466,6 +534,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 (isSetAppId) { + addIfNull(nulls, JSON_PROPERTY_APP_ID, this.appId); + } + if (isSetBillingSequenceNumber) { + addIfNull(nulls, JSON_PROPERTY_BILLING_SEQUENCE_NUMBER, this.billingSequenceNumber); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperNotificationReference) { + addIfNull( + nulls, JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE, this.shopperNotificationReference); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 UpiIntentDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/UpiQrDetails.java b/src/main/java/com/adyen/model/checkout/UpiQrDetails.java index d8f77ff27..525ff3daa 100644 --- a/src/main/java/com/adyen/model/checkout/UpiQrDetails.java +++ b/src/main/java/com/adyen/model/checkout/UpiQrDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,23 +37,41 @@ public class UpiQrDetails { public static final String JSON_PROPERTY_BILLING_SEQUENCE_NUMBER = "billingSequenceNumber"; private String billingSequenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingSequenceNumber = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE = "shopperNotificationReference"; private String shopperNotificationReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperNotificationReference = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **upi_qr** */ public enum TypeEnum { UPI_QR(String.valueOf("upi_qr")); @@ -94,6 +114,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 UpiQrDetails() {} /** @@ -107,6 +136,7 @@ public UpiQrDetails() {} */ public UpiQrDetails billingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set return this; } @@ -136,6 +166,7 @@ public String getBillingSequenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set } /** @@ -146,6 +177,7 @@ public void setBillingSequenceNumber(String billingSequenceNumber) { */ public UpiQrDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -169,6 +201,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -183,6 +216,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public UpiQrDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -214,6 +248,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -224,6 +259,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public UpiQrDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -248,6 +284,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -260,6 +297,7 @@ public void setSdkData(String sdkData) { */ public UpiQrDetails shopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set return this; } @@ -287,6 +325,7 @@ public String getShopperNotificationReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set } /** @@ -299,6 +338,7 @@ public void setShopperNotificationReference(String shopperNotificationReference) */ public UpiQrDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -326,6 +366,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -336,6 +377,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public UpiQrDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -359,6 +401,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 UpiQrDetails 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 UpiQrDetails object is equal to o. */ @@ -426,6 +489,49 @@ 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 (isSetBillingSequenceNumber) { + addIfNull(nulls, JSON_PROPERTY_BILLING_SEQUENCE_NUMBER, this.billingSequenceNumber); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperNotificationReference) { + addIfNull( + nulls, JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE, this.shopperNotificationReference); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 UpiQrDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/UtilityRequest.java b/src/main/java/com/adyen/model/checkout/UtilityRequest.java index cff9c4bd7..5f2192af6 100644 --- a/src/main/java/com/adyen/model/checkout/UtilityRequest.java +++ b/src/main/java/com/adyen/model/checkout/UtilityRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,6 +27,15 @@ public class UtilityRequest { public static final String JSON_PROPERTY_ORIGIN_DOMAINS = "originDomains"; private List originDomains; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginDomains = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UtilityRequest() {} /** @@ -35,6 +46,7 @@ public UtilityRequest() {} */ public UtilityRequest originDomains(List originDomains) { this.originDomains = originDomains; + isSetOriginDomains = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getOriginDomains() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginDomains(List originDomains) { this.originDomains = originDomains; + isSetOriginDomains = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UtilityRequest 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 UtilityRequest object is equal to o. */ @@ -105,6 +138,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 (isSetOriginDomains) { + addIfNull(nulls, JSON_PROPERTY_ORIGIN_DOMAINS, this.originDomains); + } + + 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 UtilityRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/UtilityResponse.java b/src/main/java/com/adyen/model/checkout/UtilityResponse.java index fcf98951d..ad84f5502 100644 --- a/src/main/java/com/adyen/model/checkout/UtilityResponse.java +++ b/src/main/java/com/adyen/model/checkout/UtilityResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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,6 +27,15 @@ public class UtilityResponse { public static final String JSON_PROPERTY_ORIGIN_KEYS = "originKeys"; private Map originKeys; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginKeys = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UtilityResponse() {} /** @@ -37,6 +48,7 @@ public UtilityResponse() {} */ public UtilityResponse originKeys(Map originKeys) { this.originKeys = originKeys; + isSetOriginKeys = true; // mark as set return this; } @@ -72,6 +84,27 @@ public Map getOriginKeys() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginKeys(Map originKeys) { this.originKeys = originKeys; + isSetOriginKeys = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UtilityResponse 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 UtilityResponse object is equal to o. */ @@ -111,6 +144,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 (isSetOriginKeys) { + addIfNull(nulls, JSON_PROPERTY_ORIGIN_KEYS, this.originKeys); + } + + 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 UtilityResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ValidateShopperIdRequest.java b/src/main/java/com/adyen/model/checkout/ValidateShopperIdRequest.java index 61bd95a9c..baf28230f 100644 --- a/src/main/java/com/adyen/model/checkout/ValidateShopperIdRequest.java +++ b/src/main/java/com/adyen/model/checkout/ValidateShopperIdRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 ValidateShopperIdRequest { 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_PAYMENT_METHOD = "paymentMethod"; private ShopperIdPaymentMethod paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = 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; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ValidateShopperIdRequest() {} /** @@ -52,6 +75,7 @@ public ValidateShopperIdRequest() {} */ public ValidateShopperIdRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -77,6 +101,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -87,6 +112,7 @@ public void setMerchantAccount(String merchantAccount) { */ public ValidateShopperIdRequest paymentMethod(ShopperIdPaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -110,6 +136,7 @@ public ShopperIdPaymentMethod getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(ShopperIdPaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -120,6 +147,7 @@ public void setPaymentMethod(ShopperIdPaymentMethod paymentMethod) { */ public ValidateShopperIdRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -143,6 +171,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -153,6 +182,7 @@ public void setShopperEmail(String shopperEmail) { */ public ValidateShopperIdRequest shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -176,6 +206,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -186,6 +217,7 @@ public void setShopperIP(String shopperIP) { */ public ValidateShopperIdRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -209,6 +241,27 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ValidateShopperIdRequest 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 ValidateShopperIdRequest object is equal to o. */ @@ -256,6 +309,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 (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperIP) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_I_P, this.shopperIP); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + + 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 ValidateShopperIdRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ValidateShopperIdResponse.java b/src/main/java/com/adyen/model/checkout/ValidateShopperIdResponse.java index 6cfb52834..1db22f502 100644 --- a/src/main/java/com/adyen/model/checkout/ValidateShopperIdResponse.java +++ b/src/main/java/com/adyen/model/checkout/ValidateShopperIdResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +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 ValidateShopperIdResponse { public static final String JSON_PROPERTY_REASON = "reason"; private String reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_RESULT = "result"; private Result result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResult = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ValidateShopperIdResponse() {} /** @@ -39,6 +53,7 @@ public ValidateShopperIdResponse() {} */ public ValidateShopperIdResponse reason(String reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(String reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setReason(String reason) { */ public ValidateShopperIdResponse result(Result result) { this.result = result; + isSetResult = true; // mark as set return this; } @@ -95,6 +112,27 @@ public Result getResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResult(Result result) { this.result = result; + isSetResult = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ValidateShopperIdResponse 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 ValidateShopperIdResponse object is equal to o. */ @@ -136,6 +174,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 (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetResult) { + addIfNull(nulls, JSON_PROPERTY_RESULT, this.result); + } + + 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 ValidateShopperIdResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/VippsDetails.java b/src/main/java/com/adyen/model/checkout/VippsDetails.java index 2ef5bac82..bdd7f1e25 100644 --- a/src/main/java/com/adyen/model/checkout/VippsDetails.java +++ b/src/main/java/com/adyen/model/checkout/VippsDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,19 +36,34 @@ public class VippsDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = 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; + /** **vipps** */ public enum TypeEnum { VIPPS(String.valueOf("vipps")); @@ -89,6 +106,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 VippsDetails() {} /** @@ -99,6 +125,7 @@ public VippsDetails() {} */ public VippsDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -136,6 +164,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public VippsDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -167,6 +196,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -177,6 +207,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public VippsDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -201,6 +232,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -213,6 +245,7 @@ public void setSdkData(String sdkData) { */ public VippsDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -240,6 +273,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -248,6 +282,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public VippsDetails telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -267,6 +302,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -277,6 +313,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public VippsDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -300,6 +337,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 VippsDetails 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 VippsDetails object is equal to o. */ @@ -359,6 +417,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + 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 VippsDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/VisaCheckoutDetails.java b/src/main/java/com/adyen/model/checkout/VisaCheckoutDetails.java index ea3bbb9b4..5b5b8a0b5 100644 --- a/src/main/java/com/adyen/model/checkout/VisaCheckoutDetails.java +++ b/src/main/java/com/adyen/model/checkout/VisaCheckoutDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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 VisaCheckoutDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = 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**. @@ -80,9 +85,15 @@ 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_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **visacheckout** */ public enum TypeEnum { VISACHECKOUT(String.valueOf("visacheckout")); @@ -125,9 +136,21 @@ 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; + public static final String JSON_PROPERTY_VISA_CHECKOUT_CALL_ID = "visaCheckoutCallId"; 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 VisaCheckoutDetails() {} /** @@ -138,6 +161,7 @@ public VisaCheckoutDetails() {} */ public VisaCheckoutDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -161,6 +185,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -174,6 +199,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public VisaCheckoutDetails fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -203,6 +229,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -213,6 +240,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public VisaCheckoutDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -237,6 +265,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -247,6 +276,7 @@ public void setSdkData(String sdkData) { */ public VisaCheckoutDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -270,6 +300,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -283,6 +314,7 @@ public void setType(TypeEnum type) { */ public VisaCheckoutDetails visaCheckoutCallId(String visaCheckoutCallId) { this.visaCheckoutCallId = visaCheckoutCallId; + isSetVisaCheckoutCallId = true; // mark as set return this; } @@ -312,6 +344,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 VisaCheckoutDetails 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 VisaCheckoutDetails object is equal to o. */ @@ -359,6 +412,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetVisaCheckoutCallId) { + addIfNull(nulls, JSON_PROPERTY_VISA_CHECKOUT_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 VisaCheckoutDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/WeChatPayDetails.java b/src/main/java/com/adyen/model/checkout/WeChatPayDetails.java index 765d56fb8..a8414ea52 100644 --- a/src/main/java/com/adyen/model/checkout/WeChatPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/WeChatPayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,9 +33,15 @@ public class WeChatPayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **wechatpay** */ public enum TypeEnum { WECHATPAY(String.valueOf("wechatpay")), @@ -78,6 +86,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 WeChatPayDetails() {} /** @@ -88,6 +105,7 @@ public WeChatPayDetails() {} */ public WeChatPayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -111,6 +129,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -121,6 +140,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public WeChatPayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -145,6 +165,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -155,6 +176,7 @@ public void setSdkData(String sdkData) { */ public WeChatPayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -178,6 +200,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 WeChatPayDetails 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 WeChatPayDetails object is equal to o. */ @@ -221,6 +264,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + 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 WeChatPayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/WeChatPayMiniProgramDetails.java b/src/main/java/com/adyen/model/checkout/WeChatPayMiniProgramDetails.java index da6f0f456..831e40767 100644 --- a/src/main/java/com/adyen/model/checkout/WeChatPayMiniProgramDetails.java +++ b/src/main/java/com/adyen/model/checkout/WeChatPayMiniProgramDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,22 +37,40 @@ public class WeChatPayMiniProgramDetails { public static final String JSON_PROPERTY_APP_ID = "appId"; private String appId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAppId = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_OPENID = "openid"; private String openid; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpenid = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **wechatpayMiniProgram** */ public enum TypeEnum { WECHATPAYMINIPROGRAM(String.valueOf("wechatpayMiniProgram")); @@ -93,6 +113,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 WeChatPayMiniProgramDetails() {} /** @@ -103,6 +132,7 @@ public WeChatPayMiniProgramDetails() {} */ public WeChatPayMiniProgramDetails appId(String appId) { this.appId = appId; + isSetAppId = true; // mark as set return this; } @@ -126,6 +156,7 @@ public String getAppId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAppId(String appId) { this.appId = appId; + isSetAppId = true; // mark as set } /** @@ -136,6 +167,7 @@ public void setAppId(String appId) { */ public WeChatPayMiniProgramDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -159,6 +191,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -169,6 +202,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public WeChatPayMiniProgramDetails openid(String openid) { this.openid = openid; + isSetOpenid = true; // mark as set return this; } @@ -192,6 +226,7 @@ public String getOpenid() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpenid(String openid) { this.openid = openid; + isSetOpenid = true; // mark as set } /** @@ -206,6 +241,7 @@ public void setOpenid(String openid) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public WeChatPayMiniProgramDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -237,6 +273,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -247,6 +284,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public WeChatPayMiniProgramDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -271,6 +309,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -283,6 +322,7 @@ public void setSdkData(String sdkData) { */ public WeChatPayMiniProgramDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -310,6 +350,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -320,6 +361,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public WeChatPayMiniProgramDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -343,6 +385,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 WeChatPayMiniProgramDetails 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 WeChatPayMiniProgramDetails object is equal to o. */ @@ -407,6 +470,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAppId) { + addIfNull(nulls, JSON_PROPERTY_APP_ID, this.appId); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetOpenid) { + addIfNull(nulls, JSON_PROPERTY_OPENID, this.openid); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 WeChatPayMiniProgramDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ZipDetails.java b/src/main/java/com/adyen/model/checkout/ZipDetails.java index e8b0b303e..781ea139f 100644 --- a/src/main/java/com/adyen/model/checkout/ZipDetails.java +++ b/src/main/java/com/adyen/model/checkout/ZipDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +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,19 +36,34 @@ public class ZipDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_CLICK_AND_COLLECT = "clickAndCollect"; private String clickAndCollect; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClickAndCollect = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **zip** */ public enum TypeEnum { ZIP(String.valueOf("zip")), @@ -91,6 +108,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 ZipDetails() {} /** @@ -101,6 +127,7 @@ public ZipDetails() {} */ public ZipDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -124,6 +151,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -136,6 +164,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public ZipDetails clickAndCollect(String clickAndCollect) { this.clickAndCollect = clickAndCollect; + isSetClickAndCollect = true; // mark as set return this; } @@ -163,6 +192,7 @@ public String getClickAndCollect() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClickAndCollect(String clickAndCollect) { this.clickAndCollect = clickAndCollect; + isSetClickAndCollect = true; // mark as set } /** @@ -177,6 +207,7 @@ public void setClickAndCollect(String clickAndCollect) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public ZipDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -208,6 +239,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -218,6 +250,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public ZipDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -242,6 +275,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -254,6 +288,7 @@ public void setSdkData(String sdkData) { */ public ZipDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -281,6 +316,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -291,6 +327,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public ZipDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -314,6 +351,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 ZipDetails 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 ZipDetails object is equal to o. */ @@ -373,6 +431,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 (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetClickAndCollect) { + addIfNull(nulls, JSON_PROPERTY_CLICK_AND_COLLECT, this.clickAndCollect); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 ZipDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/AccountHolder.java b/src/main/java/com/adyen/model/configurationwebhooks/AccountHolder.java index 7b41ee8d7..7e4d8d964 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/AccountHolder.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/AccountHolder.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +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; @@ -45,35 +47,65 @@ public class AccountHolder { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private Map capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_CONTACT_DETAILS = "contactDetails"; @Deprecated // deprecated private ContactDetails contactDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContactDetails = 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_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_LEGAL_ENTITY_ID = "legalEntityId"; private String legalEntityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalEntityId = 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_MIGRATED_ACCOUNT_HOLDER_CODE = "migratedAccountHolderCode"; private String migratedAccountHolderCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMigratedAccountHolderCode = false; + public static final String JSON_PROPERTY_PRIMARY_BALANCE_ACCOUNT = "primaryBalanceAccount"; private String primaryBalanceAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrimaryBalanceAccount = 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 account holder. Possible values: * **active**: The account holder is active * and allowed to use its capabilities. This is the initial status for account holders and balance @@ -127,12 +159,27 @@ 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_TIME_ZONE = "timeZone"; private String timeZone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZone = false; + public static final String JSON_PROPERTY_VERIFICATION_DEADLINES = "verificationDeadlines"; private List verificationDeadlines; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationDeadlines = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountHolder() {} /** @@ -149,6 +196,7 @@ public AccountHolder() {} */ public AccountHolder balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -184,6 +232,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -199,6 +248,7 @@ public void setBalancePlatform(String balancePlatform) { */ public AccountHolder capabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -240,6 +290,7 @@ public Map getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -252,6 +303,7 @@ public void setCapabilities(Map capabilities) { @Deprecated // deprecated public AccountHolder contactDetails(ContactDetails contactDetails) { this.contactDetails = contactDetails; + isSetContactDetails = true; // mark as set return this; } @@ -279,6 +331,7 @@ public ContactDetails getContactDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContactDetails(ContactDetails contactDetails) { this.contactDetails = contactDetails; + isSetContactDetails = true; // mark as set } /** @@ -289,6 +342,7 @@ public void setContactDetails(ContactDetails contactDetails) { */ public AccountHolder description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -312,6 +366,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -322,6 +377,7 @@ public void setDescription(String description) { */ public AccountHolder id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -345,6 +401,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -361,6 +418,7 @@ public void setId(String id) { */ public AccountHolder legalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set return this; } @@ -396,6 +454,7 @@ public String getLegalEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set } /** @@ -411,6 +470,7 @@ public void setLegalEntityId(String legalEntityId) { */ public AccountHolder metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -452,6 +512,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -463,6 +524,7 @@ public void setMetadata(Map metadata) { */ public AccountHolder migratedAccountHolderCode(String migratedAccountHolderCode) { this.migratedAccountHolderCode = migratedAccountHolderCode; + isSetMigratedAccountHolderCode = true; // mark as set return this; } @@ -488,6 +550,7 @@ public String getMigratedAccountHolderCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMigratedAccountHolderCode(String migratedAccountHolderCode) { this.migratedAccountHolderCode = migratedAccountHolderCode; + isSetMigratedAccountHolderCode = true; // mark as set } /** @@ -502,6 +565,7 @@ public void setMigratedAccountHolderCode(String migratedAccountHolderCode) { */ public AccountHolder primaryBalanceAccount(String primaryBalanceAccount) { this.primaryBalanceAccount = primaryBalanceAccount; + isSetPrimaryBalanceAccount = true; // mark as set return this; } @@ -533,6 +597,7 @@ public String getPrimaryBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrimaryBalanceAccount(String primaryBalanceAccount) { this.primaryBalanceAccount = primaryBalanceAccount; + isSetPrimaryBalanceAccount = true; // mark as set } /** @@ -543,6 +608,7 @@ public void setPrimaryBalanceAccount(String primaryBalanceAccount) { */ public AccountHolder reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -566,6 +632,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -587,6 +654,7 @@ public void setReference(String reference) { */ public AccountHolder status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -632,6 +700,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -647,6 +716,7 @@ public void setStatus(StatusEnum status) { */ public AccountHolder timeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set return this; } @@ -680,6 +750,7 @@ public String getTimeZone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set } /** @@ -692,6 +763,7 @@ public void setTimeZone(String timeZone) { */ public AccountHolder verificationDeadlines(List verificationDeadlines) { this.verificationDeadlines = verificationDeadlines; + isSetVerificationDeadlines = true; // mark as set return this; } @@ -728,6 +800,27 @@ public List getVerificationDeadlines() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVerificationDeadlines(List verificationDeadlines) { this.verificationDeadlines = verificationDeadlines; + isSetVerificationDeadlines = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountHolder 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 AccountHolder object is equal to o. */ @@ -810,6 +903,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 (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetContactDetails) { + addIfNull(nulls, JSON_PROPERTY_CONTACT_DETAILS, this.contactDetails); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLegalEntityId) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_ENTITY_ID, this.legalEntityId); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMigratedAccountHolderCode) { + addIfNull(nulls, JSON_PROPERTY_MIGRATED_ACCOUNT_HOLDER_CODE, this.migratedAccountHolderCode); + } + if (isSetPrimaryBalanceAccount) { + addIfNull(nulls, JSON_PROPERTY_PRIMARY_BALANCE_ACCOUNT, this.primaryBalanceAccount); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTimeZone) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE, this.timeZone); + } + if (isSetVerificationDeadlines) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_DEADLINES, this.verificationDeadlines); + } + + 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 AccountHolder given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderCapability.java b/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderCapability.java index f4919a926..74a886a3f 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderCapability.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderCapability.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +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; @@ -40,6 +42,9 @@ public class AccountHolderCapability { public static final String JSON_PROPERTY_ALLOWED = "allowed"; private Boolean allowed; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowed = false; + /** * The capability level that is allowed for the account holder. Possible values: * **notApplicable**, **low**, **medium**, **high**. @@ -91,18 +96,33 @@ public static AllowedLevelEnum fromValue(String value) { public static final String JSON_PROPERTY_ALLOWED_LEVEL = "allowedLevel"; private AllowedLevelEnum allowedLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedLevel = false; + public static final String JSON_PROPERTY_ALLOWED_SETTINGS = "allowedSettings"; private CapabilitySettings allowedSettings; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedSettings = false; + public static final String JSON_PROPERTY_ENABLED = "enabled"; private Boolean enabled; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnabled = false; + public static final String JSON_PROPERTY_PROBLEMS = "problems"; private List problems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProblems = false; + public static final String JSON_PROPERTY_REQUESTED = "requested"; private Boolean requested; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequested = false; + /** * The requested level of the capability. Some capabilities, such as those used in [card * issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different @@ -156,12 +176,21 @@ public static RequestedLevelEnum fromValue(String value) { public static final String JSON_PROPERTY_REQUESTED_LEVEL = "requestedLevel"; private RequestedLevelEnum requestedLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedLevel = false; + public static final String JSON_PROPERTY_REQUESTED_SETTINGS = "requestedSettings"; private CapabilitySettings requestedSettings; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedSettings = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENTS = "transferInstruments"; private List transferInstruments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstruments = false; + /** * The status of the verification checks for the capability. Possible values: * **pending**: Adyen * is running the verification. * **invalid**: The verification failed. Check if the @@ -216,6 +245,15 @@ public static VerificationStatusEnum fromValue(String value) { public static final String JSON_PROPERTY_VERIFICATION_STATUS = "verificationStatus"; private VerificationStatusEnum verificationStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountHolderCapability() {} /** @@ -228,6 +266,7 @@ public AccountHolderCapability() {} */ public AccountHolderCapability allowed(Boolean allowed) { this.allowed = allowed; + isSetAllowed = true; // mark as set return this; } @@ -255,6 +294,7 @@ public Boolean getAllowed() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowed(Boolean allowed) { this.allowed = allowed; + isSetAllowed = true; // mark as set } /** @@ -267,6 +307,7 @@ public void setAllowed(Boolean allowed) { */ public AccountHolderCapability allowedLevel(AllowedLevelEnum allowedLevel) { this.allowedLevel = allowedLevel; + isSetAllowedLevel = true; // mark as set return this; } @@ -294,6 +335,7 @@ public AllowedLevelEnum getAllowedLevel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowedLevel(AllowedLevelEnum allowedLevel) { this.allowedLevel = allowedLevel; + isSetAllowedLevel = true; // mark as set } /** @@ -304,6 +346,7 @@ public void setAllowedLevel(AllowedLevelEnum allowedLevel) { */ public AccountHolderCapability allowedSettings(CapabilitySettings allowedSettings) { this.allowedSettings = allowedSettings; + isSetAllowedSettings = true; // mark as set return this; } @@ -327,6 +370,7 @@ public CapabilitySettings getAllowedSettings() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowedSettings(CapabilitySettings allowedSettings) { this.allowedSettings = allowedSettings; + isSetAllowedSettings = true; // mark as set } /** @@ -339,6 +383,7 @@ public void setAllowedSettings(CapabilitySettings allowedSettings) { */ public AccountHolderCapability enabled(Boolean enabled) { this.enabled = enabled; + isSetEnabled = true; // mark as set return this; } @@ -366,6 +411,7 @@ public Boolean getEnabled() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnabled(Boolean enabled) { this.enabled = enabled; + isSetEnabled = true; // mark as set } /** @@ -376,6 +422,7 @@ public void setEnabled(Boolean enabled) { */ public AccountHolderCapability problems(List problems) { this.problems = problems; + isSetProblems = true; // mark as set return this; } @@ -408,6 +455,7 @@ public List getProblems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProblems(List problems) { this.problems = problems; + isSetProblems = true; // mark as set } /** @@ -420,6 +468,7 @@ public void setProblems(List problems) { */ public AccountHolderCapability requested(Boolean requested) { this.requested = requested; + isSetRequested = true; // mark as set return this; } @@ -447,6 +496,7 @@ public Boolean getRequested() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequested(Boolean requested) { this.requested = requested; + isSetRequested = true; // mark as set } /** @@ -464,6 +514,7 @@ public void setRequested(Boolean requested) { */ public AccountHolderCapability requestedLevel(RequestedLevelEnum requestedLevel) { this.requestedLevel = requestedLevel; + isSetRequestedLevel = true; // mark as set return this; } @@ -501,6 +552,7 @@ public RequestedLevelEnum getRequestedLevel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestedLevel(RequestedLevelEnum requestedLevel) { this.requestedLevel = requestedLevel; + isSetRequestedLevel = true; // mark as set } /** @@ -511,6 +563,7 @@ public void setRequestedLevel(RequestedLevelEnum requestedLevel) { */ public AccountHolderCapability requestedSettings(CapabilitySettings requestedSettings) { this.requestedSettings = requestedSettings; + isSetRequestedSettings = true; // mark as set return this; } @@ -534,6 +587,7 @@ public CapabilitySettings getRequestedSettings() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestedSettings(CapabilitySettings requestedSettings) { this.requestedSettings = requestedSettings; + isSetRequestedSettings = true; // mark as set } /** @@ -546,6 +600,7 @@ public void setRequestedSettings(CapabilitySettings requestedSettings) { public AccountHolderCapability transferInstruments( List transferInstruments) { this.transferInstruments = transferInstruments; + isSetTransferInstruments = true; // mark as set return this; } @@ -580,6 +635,7 @@ public List getTransferInstruments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstruments(List transferInstruments) { this.transferInstruments = transferInstruments; + isSetTransferInstruments = true; // mark as set } /** @@ -598,6 +654,7 @@ public void setTransferInstruments(List trans */ public AccountHolderCapability verificationStatus(VerificationStatusEnum verificationStatus) { this.verificationStatus = verificationStatus; + isSetVerificationStatus = true; // mark as set return this; } @@ -637,6 +694,27 @@ public VerificationStatusEnum getVerificationStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVerificationStatus(VerificationStatusEnum verificationStatus) { this.verificationStatus = verificationStatus; + isSetVerificationStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountHolderCapability 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 AccountHolderCapability object is equal to o. */ @@ -706,6 +784,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 (isSetAllowed) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED, this.allowed); + } + if (isSetAllowedLevel) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_LEVEL, this.allowedLevel); + } + if (isSetAllowedSettings) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_SETTINGS, this.allowedSettings); + } + if (isSetEnabled) { + addIfNull(nulls, JSON_PROPERTY_ENABLED, this.enabled); + } + if (isSetProblems) { + addIfNull(nulls, JSON_PROPERTY_PROBLEMS, this.problems); + } + if (isSetRequested) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED, this.requested); + } + if (isSetRequestedLevel) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED_LEVEL, this.requestedLevel); + } + if (isSetRequestedSettings) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED_SETTINGS, this.requestedSettings); + } + if (isSetTransferInstruments) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENTS, this.transferInstruments); + } + if (isSetVerificationStatus) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_STATUS, this.verificationStatus); + } + + 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 AccountHolderCapability given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderNotificationData.java b/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderNotificationData.java index d85544171..caa04c4e7 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderNotificationData.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderNotificationData.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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 AccountHolderNotificationData { public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; private AccountHolder accountHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountHolderNotificationData() {} /** @@ -40,6 +54,7 @@ public AccountHolderNotificationData() {} */ public AccountHolderNotificationData accountHolder(AccountHolder accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -63,6 +78,7 @@ public AccountHolder getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(AccountHolder accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setAccountHolder(AccountHolder accountHolder) { */ public AccountHolderNotificationData balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -97,6 +114,27 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountHolderNotificationData 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 AccountHolderNotificationData object is equal to o. */ @@ -138,6 +176,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 (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + + 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 AccountHolderNotificationData given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderNotificationRequest.java b/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderNotificationRequest.java index 437fb8cb1..1cbb9f958 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderNotificationRequest.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class AccountHolderNotificationRequest { public static final String JSON_PROPERTY_DATA = "data"; private AccountHolderNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + /** Type of webhook. */ public enum TypeEnum { BALANCEPLATFORM_ACCOUNTHOLDER_UPDATED(String.valueOf("balancePlatform.accountHolder.updated")), @@ -83,6 +94,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 AccountHolderNotificationRequest() {} /** @@ -94,6 +114,7 @@ public AccountHolderNotificationRequest() {} */ public AccountHolderNotificationRequest data(AccountHolderNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -117,6 +138,7 @@ public AccountHolderNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(AccountHolderNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -129,6 +151,7 @@ public void setData(AccountHolderNotificationData data) { */ public AccountHolderNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -154,6 +177,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -165,6 +189,7 @@ public void setEnvironment(String environment) { */ public AccountHolderNotificationRequest timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set return this; } @@ -188,6 +213,7 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set } /** @@ -199,6 +225,7 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public AccountHolderNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -222,6 +249,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 AccountHolderNotificationRequest 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 AccountHolderNotificationRequest object is equal to o. */ @@ -268,6 +316,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AccountHolderNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/AccountSupportingEntityCapability.java b/src/main/java/com/adyen/model/configurationwebhooks/AccountSupportingEntityCapability.java index a433c3279..62ff7ef4d 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/AccountSupportingEntityCapability.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/AccountSupportingEntityCapability.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,6 +37,9 @@ public class AccountSupportingEntityCapability { public static final String JSON_PROPERTY_ALLOWED = "allowed"; private Boolean allowed; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowed = false; + /** * The capability level that is allowed for the account holder. Possible values: * **notApplicable**, **low**, **medium**, **high**. @@ -86,15 +91,27 @@ public static AllowedLevelEnum fromValue(String value) { public static final String JSON_PROPERTY_ALLOWED_LEVEL = "allowedLevel"; private AllowedLevelEnum allowedLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedLevel = false; + public static final String JSON_PROPERTY_ENABLED = "enabled"; private Boolean enabled; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnabled = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REQUESTED = "requested"; private Boolean requested; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequested = false; + /** * The requested level of the capability. Some capabilities, such as those used in [card * issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different @@ -148,6 +165,9 @@ public static RequestedLevelEnum fromValue(String value) { public static final String JSON_PROPERTY_REQUESTED_LEVEL = "requestedLevel"; private RequestedLevelEnum requestedLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedLevel = false; + /** * The status of the verification checks for the supporting entity capability. Possible values: * * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check @@ -202,6 +222,15 @@ public static VerificationStatusEnum fromValue(String value) { public static final String JSON_PROPERTY_VERIFICATION_STATUS = "verificationStatus"; private VerificationStatusEnum verificationStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountSupportingEntityCapability() {} /** @@ -216,6 +245,7 @@ public AccountSupportingEntityCapability() {} */ public AccountSupportingEntityCapability allowed(Boolean allowed) { this.allowed = allowed; + isSetAllowed = true; // mark as set return this; } @@ -245,6 +275,7 @@ public Boolean getAllowed() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowed(Boolean allowed) { this.allowed = allowed; + isSetAllowed = true; // mark as set } /** @@ -258,6 +289,7 @@ public void setAllowed(Boolean allowed) { */ public AccountSupportingEntityCapability allowedLevel(AllowedLevelEnum allowedLevel) { this.allowedLevel = allowedLevel; + isSetAllowedLevel = true; // mark as set return this; } @@ -285,6 +317,7 @@ public AllowedLevelEnum getAllowedLevel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowedLevel(AllowedLevelEnum allowedLevel) { this.allowedLevel = allowedLevel; + isSetAllowedLevel = true; // mark as set } /** @@ -298,6 +331,7 @@ public void setAllowedLevel(AllowedLevelEnum allowedLevel) { */ public AccountSupportingEntityCapability enabled(Boolean enabled) { this.enabled = enabled; + isSetEnabled = true; // mark as set return this; } @@ -325,6 +359,7 @@ public Boolean getEnabled() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnabled(Boolean enabled) { this.enabled = enabled; + isSetEnabled = true; // mark as set } /** @@ -336,6 +371,7 @@ public void setEnabled(Boolean enabled) { */ public AccountSupportingEntityCapability id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -359,6 +395,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -372,6 +409,7 @@ public void setId(String id) { */ public AccountSupportingEntityCapability requested(Boolean requested) { this.requested = requested; + isSetRequested = true; // mark as set return this; } @@ -399,6 +437,7 @@ public Boolean getRequested() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequested(Boolean requested) { this.requested = requested; + isSetRequested = true; // mark as set } /** @@ -417,6 +456,7 @@ public void setRequested(Boolean requested) { */ public AccountSupportingEntityCapability requestedLevel(RequestedLevelEnum requestedLevel) { this.requestedLevel = requestedLevel; + isSetRequestedLevel = true; // mark as set return this; } @@ -454,6 +494,7 @@ public RequestedLevelEnum getRequestedLevel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestedLevel(RequestedLevelEnum requestedLevel) { this.requestedLevel = requestedLevel; + isSetRequestedLevel = true; // mark as set } /** @@ -474,6 +515,7 @@ public void setRequestedLevel(RequestedLevelEnum requestedLevel) { public AccountSupportingEntityCapability verificationStatus( VerificationStatusEnum verificationStatus) { this.verificationStatus = verificationStatus; + isSetVerificationStatus = true; // mark as set return this; } @@ -513,6 +555,27 @@ public VerificationStatusEnum getVerificationStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVerificationStatus(VerificationStatusEnum verificationStatus) { this.verificationStatus = verificationStatus; + isSetVerificationStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountSupportingEntityCapability 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 AccountSupportingEntityCapability object is equal to o. */ @@ -567,6 +630,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAllowed) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED, this.allowed); + } + if (isSetAllowedLevel) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_LEVEL, this.allowedLevel); + } + if (isSetEnabled) { + addIfNull(nulls, JSON_PROPERTY_ENABLED, this.enabled); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetRequested) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED, this.requested); + } + if (isSetRequestedLevel) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED_LEVEL, this.requestedLevel); + } + if (isSetVerificationStatus) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_STATUS, this.verificationStatus); + } + + 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 AccountSupportingEntityCapability given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/Address.java b/src/main/java/com/adyen/model/configurationwebhooks/Address.java index 5acb96d00..41b2f7eb7 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/Address.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/Address.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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. */ @@ -325,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 (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/configurationwebhooks/Amount.java b/src/main/java/com/adyen/model/configurationwebhooks/Amount.java index 706cfa8f0..ff0edb6b6 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/Amount.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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. */ @@ -145,6 +189,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/configurationwebhooks/Authentication.java b/src/main/java/com/adyen/model/configurationwebhooks/Authentication.java index 940164259..288c87977 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/Authentication.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/Authentication.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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 Authentication { public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_PASSWORD = "password"; private String password; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPassword = false; + public static final String JSON_PROPERTY_PHONE = "phone"; private Phone phone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Authentication() {} /** @@ -43,6 +60,7 @@ public Authentication() {} */ public Authentication email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -82,6 +101,7 @@ public void setEmail(String email) { */ public Authentication password(String password) { this.password = password; + isSetPassword = true; // mark as set return this; } @@ -117,6 +137,7 @@ public String getPassword() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPassword(String password) { this.password = password; + isSetPassword = true; // mark as set } /** @@ -127,6 +148,7 @@ public void setPassword(String password) { */ public Authentication phone(Phone phone) { this.phone = phone; + isSetPhone = true; // mark as set return this; } @@ -150,6 +172,27 @@ public Phone getPhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhone(Phone phone) { this.phone = phone; + isSetPhone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Authentication 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 Authentication object is equal to o. */ @@ -193,6 +236,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 (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetPassword) { + addIfNull(nulls, JSON_PROPERTY_PASSWORD, this.password); + } + if (isSetPhone) { + addIfNull(nulls, JSON_PROPERTY_PHONE, this.phone); + } + + 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 Authentication given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/Balance.java b/src/main/java/com/adyen/model/configurationwebhooks/Balance.java index 6f9b28e06..91f8674cf 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/Balance.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/Balance.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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,24 +25,52 @@ Balance.JSON_PROPERTY_BALANCE, Balance.JSON_PROPERTY_CURRENCY, Balance.JSON_PROPERTY_PENDING, + Balance.JSON_PROPERTY_PENDING_AVAILABLE, Balance.JSON_PROPERTY_RESERVED }) public class Balance { public static final String JSON_PROPERTY_AVAILABLE = "available"; private Long available; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAvailable = false; + public static final String JSON_PROPERTY_BALANCE = "balance"; private Long balance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalance = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_PENDING = "pending"; private Long pending; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPending = false; + + public static final String JSON_PROPERTY_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; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReserved = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Balance() {} /** @@ -51,6 +81,7 @@ public Balance() {} */ public Balance available(Long available) { this.available = available; + isSetAvailable = true; // mark as set return this; } @@ -74,6 +105,7 @@ public Long getAvailable() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAvailable(Long available) { this.available = available; + isSetAvailable = true; // mark as set } /** @@ -84,6 +116,7 @@ public void setAvailable(Long available) { */ public Balance balance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set return this; } @@ -107,6 +140,7 @@ public Long getBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set } /** @@ -119,6 +153,7 @@ public void setBalance(Long balance) { */ public Balance currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -146,6 +181,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -156,6 +192,7 @@ public void setCurrency(String currency) { */ public Balance pending(Long pending) { this.pending = pending; + isSetPending = true; // mark as set return this; } @@ -179,6 +216,36 @@ public Long getPending() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPending(Long pending) { this.pending = 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 } /** @@ -189,6 +256,7 @@ public void setPending(Long pending) { */ public Balance reserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set return this; } @@ -212,6 +280,27 @@ public Long getReserved() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Balance 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 Balance object is equal to o. */ @@ -228,12 +317,13 @@ public boolean equals(Object o) { && Objects.equals(this.balance, balance.balance) && Objects.equals(this.currency, balance.currency) && Objects.equals(this.pending, balance.pending) + && Objects.equals(this.pendingAvailable, balance.pendingAvailable) && Objects.equals(this.reserved, balance.reserved); } @Override public int hashCode() { - return Objects.hash(available, balance, currency, pending, reserved); + return Objects.hash(available, balance, currency, pending, pendingAvailable, reserved); } @Override @@ -244,6 +334,7 @@ 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(); @@ -259,6 +350,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 (isSetAvailable) { + addIfNull(nulls, JSON_PROPERTY_AVAILABLE, this.available); + } + if (isSetBalance) { + addIfNull(nulls, JSON_PROPERTY_BALANCE, this.balance); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + 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); + } + + 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 Balance given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccount.java b/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccount.java index fe5eb468f..38a94ddb0 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccount.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccount.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +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,31 +45,58 @@ public class BalanceAccount { public static final String JSON_PROPERTY_ACCOUNT_HOLDER_ID = "accountHolderId"; private String accountHolderId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderId = false; + public static final String JSON_PROPERTY_BALANCES = "balances"; private List balances; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalances = false; + public static final String JSON_PROPERTY_DEFAULT_CURRENCY_CODE = "defaultCurrencyCode"; private String defaultCurrencyCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefaultCurrencyCode = 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_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = 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_MIGRATED_ACCOUNT_CODE = "migratedAccountCode"; private String migratedAccountCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMigratedAccountCode = false; + public static final String JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION = "platformPaymentConfiguration"; private PlatformPaymentConfiguration platformPaymentConfiguration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformPaymentConfiguration = 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 account, set to **active** by default. */ public enum StatusEnum { ACTIVE(String.valueOf("active")), @@ -116,9 +145,21 @@ 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_TIME_ZONE = "timeZone"; private String timeZone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceAccount() {} /** @@ -133,6 +174,7 @@ public BalanceAccount() {} */ public BalanceAccount accountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set return this; } @@ -164,6 +206,7 @@ public String getAccountHolderId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set } /** @@ -174,6 +217,7 @@ public void setAccountHolderId(String accountHolderId) { */ public BalanceAccount balances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set return this; } @@ -205,6 +249,7 @@ public List getBalances() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set } /** @@ -223,6 +268,7 @@ public void setBalances(List balances) { */ public BalanceAccount defaultCurrencyCode(String defaultCurrencyCode) { this.defaultCurrencyCode = defaultCurrencyCode; + isSetDefaultCurrencyCode = true; // mark as set return this; } @@ -262,6 +308,7 @@ public String getDefaultCurrencyCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDefaultCurrencyCode(String defaultCurrencyCode) { this.defaultCurrencyCode = defaultCurrencyCode; + isSetDefaultCurrencyCode = true; // mark as set } /** @@ -275,6 +322,7 @@ public void setDefaultCurrencyCode(String defaultCurrencyCode) { */ public BalanceAccount description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -304,6 +352,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -314,6 +363,7 @@ public void setDescription(String description) { */ public BalanceAccount id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -337,6 +387,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -352,6 +403,7 @@ public void setId(String id) { */ public BalanceAccount metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -393,6 +445,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -404,6 +457,7 @@ public void setMetadata(Map metadata) { */ public BalanceAccount migratedAccountCode(String migratedAccountCode) { this.migratedAccountCode = migratedAccountCode; + isSetMigratedAccountCode = true; // mark as set return this; } @@ -429,6 +483,7 @@ public String getMigratedAccountCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMigratedAccountCode(String migratedAccountCode) { this.migratedAccountCode = migratedAccountCode; + isSetMigratedAccountCode = true; // mark as set } /** @@ -440,6 +495,7 @@ public void setMigratedAccountCode(String migratedAccountCode) { public BalanceAccount platformPaymentConfiguration( PlatformPaymentConfiguration platformPaymentConfiguration) { this.platformPaymentConfiguration = platformPaymentConfiguration; + isSetPlatformPaymentConfiguration = true; // mark as set return this; } @@ -464,6 +520,7 @@ public PlatformPaymentConfiguration getPlatformPaymentConfiguration() { public void setPlatformPaymentConfiguration( PlatformPaymentConfiguration platformPaymentConfiguration) { this.platformPaymentConfiguration = platformPaymentConfiguration; + isSetPlatformPaymentConfiguration = true; // mark as set } /** @@ -474,6 +531,7 @@ public void setPlatformPaymentConfiguration( */ public BalanceAccount reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -497,6 +555,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -507,6 +566,7 @@ public void setReference(String reference) { */ public BalanceAccount status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -530,6 +590,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -545,6 +606,7 @@ public void setStatus(StatusEnum status) { */ public BalanceAccount timeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set return this; } @@ -578,6 +640,27 @@ public String getTimeZone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZone(String timeZone) { this.timeZone = timeZone; + isSetTimeZone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceAccount 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 BalanceAccount object is equal to o. */ @@ -655,6 +738,61 @@ 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 (isSetAccountHolderId) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_ID, this.accountHolderId); + } + if (isSetBalances) { + addIfNull(nulls, JSON_PROPERTY_BALANCES, this.balances); + } + if (isSetDefaultCurrencyCode) { + addIfNull(nulls, JSON_PROPERTY_DEFAULT_CURRENCY_CODE, this.defaultCurrencyCode); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMigratedAccountCode) { + addIfNull(nulls, JSON_PROPERTY_MIGRATED_ACCOUNT_CODE, this.migratedAccountCode); + } + if (isSetPlatformPaymentConfiguration) { + addIfNull( + nulls, JSON_PROPERTY_PLATFORM_PAYMENT_CONFIGURATION, this.platformPaymentConfiguration); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTimeZone) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE, this.timeZone); + } + + 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 BalanceAccount given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccountNotificationData.java b/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccountNotificationData.java index 98f88d5a1..343a79918 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccountNotificationData.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccountNotificationData.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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 BalanceAccountNotificationData { public static final String JSON_PROPERTY_BALANCE_ACCOUNT = "balanceAccount"; private BalanceAccount balanceAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccount = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceAccountNotificationData() {} /** @@ -40,6 +54,7 @@ public BalanceAccountNotificationData() {} */ public BalanceAccountNotificationData balanceAccount(BalanceAccount balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set return this; } @@ -63,6 +78,7 @@ public BalanceAccount getBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccount(BalanceAccount balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setBalanceAccount(BalanceAccount balanceAccount) { */ public BalanceAccountNotificationData balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -97,6 +114,27 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceAccountNotificationData 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 BalanceAccountNotificationData object is equal to o. */ @@ -139,6 +177,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 (isSetBalanceAccount) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT, this.balanceAccount); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + + 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 BalanceAccountNotificationData given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccountNotificationRequest.java b/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccountNotificationRequest.java index 36906dadb..2b469f7d4 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccountNotificationRequest.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccountNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class BalanceAccountNotificationRequest { public static final String JSON_PROPERTY_DATA = "data"; private BalanceAccountNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + /** Type of webhook. */ public enum TypeEnum { BALANCEPLATFORM_BALANCEACCOUNT_UPDATED( @@ -85,6 +96,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 BalanceAccountNotificationRequest() {} /** @@ -96,6 +116,7 @@ public BalanceAccountNotificationRequest() {} */ public BalanceAccountNotificationRequest data(BalanceAccountNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -119,6 +140,7 @@ public BalanceAccountNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(BalanceAccountNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -131,6 +153,7 @@ public void setData(BalanceAccountNotificationData data) { */ public BalanceAccountNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -156,6 +179,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -167,6 +191,7 @@ public void setEnvironment(String environment) { */ public BalanceAccountNotificationRequest timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set return this; } @@ -190,6 +215,7 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set } /** @@ -201,6 +227,7 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public BalanceAccountNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -224,6 +251,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 BalanceAccountNotificationRequest 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 BalanceAccountNotificationRequest object is equal to o. */ @@ -270,6 +318,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceAccountNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/BalancePlatformNotificationResponse.java b/src/main/java/com/adyen/model/configurationwebhooks/BalancePlatformNotificationResponse.java index c004a6522..9d154c8b5 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/BalancePlatformNotificationResponse.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/BalancePlatformNotificationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class BalancePlatformNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalancePlatformNotificationResponse() {} /** @@ -36,6 +47,7 @@ public BalancePlatformNotificationResponse() {} */ public BalancePlatformNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalancePlatformNotificationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalancePlatformNotificationResponse object is equal to o. */ @@ -106,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalancePlatformNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/BankAccountDetails.java b/src/main/java/com/adyen/model/configurationwebhooks/BankAccountDetails.java index a23641709..3c8b6c7ca 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/BankAccountDetails.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/BankAccountDetails.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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 BankAccountDetails { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = 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_BRANCH_NUMBER = "branchNumber"; private String branchNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBranchNumber = false; + public static final String JSON_PROPERTY_FORM_FACTOR = "formFactor"; private String formFactor; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFormFactor = 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_ROUTING_NUMBER = "routingNumber"; private String routingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRoutingNumber = false; + public static final String JSON_PROPERTY_SORT_CODE = "sortCode"; private String sortCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSortCode = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 BankAccountDetails() {} /** @@ -63,6 +95,7 @@ public BankAccountDetails() {} */ public BankAccountDetails accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -86,6 +119,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -97,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public BankAccountDetails accountType(String accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -122,6 +157,7 @@ public String getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(String accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -132,6 +168,7 @@ public void setAccountType(String accountType) { */ public BankAccountDetails branchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set return this; } @@ -155,6 +192,7 @@ public String getBranchNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBranchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set } /** @@ -175,6 +213,7 @@ public void setBranchNumber(String branchNumber) { */ public BankAccountDetails formFactor(String formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set return this; } @@ -218,6 +257,7 @@ public String getFormFactor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFormFactor(String formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set } /** @@ -230,6 +270,7 @@ public void setFormFactor(String formFactor) { */ public BankAccountDetails iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -257,6 +298,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -270,6 +312,7 @@ public void setIban(String iban) { */ public BankAccountDetails routingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set return this; } @@ -299,6 +342,7 @@ public String getRoutingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRoutingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set } /** @@ -310,6 +354,7 @@ public void setRoutingNumber(String routingNumber) { */ public BankAccountDetails sortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set return this; } @@ -335,6 +380,7 @@ public String getSortCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set } /** @@ -345,6 +391,7 @@ public void setSortCode(String sortCode) { */ public BankAccountDetails type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -368,6 +415,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankAccountDetails 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 BankAccountDetails object is equal to o. */ @@ -422,6 +490,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetBranchNumber) { + addIfNull(nulls, JSON_PROPERTY_BRANCH_NUMBER, this.branchNumber); + } + if (isSetFormFactor) { + addIfNull(nulls, JSON_PROPERTY_FORM_FACTOR, this.formFactor); + } + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetRoutingNumber) { + addIfNull(nulls, JSON_PROPERTY_ROUTING_NUMBER, this.routingNumber); + } + if (isSetSortCode) { + addIfNull(nulls, JSON_PROPERTY_SORT_CODE, this.sortCode); + } + 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 BankAccountDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/BankScoreSignalTriggeredData.java b/src/main/java/com/adyen/model/configurationwebhooks/BankScoreSignalTriggeredData.java index 51cabd168..3c9763aac 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/BankScoreSignalTriggeredData.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/BankScoreSignalTriggeredData.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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; @@ -36,30 +38,63 @@ public class BankScoreSignalTriggeredData { public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; private ResourceReference accountHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + public static final String JSON_PROPERTY_ACCOUNT_HOLDER_STATUS = "accountHolderStatus"; private String accountHolderStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderStatus = false; + public static final String JSON_PROPERTY_AUTOMATED_ACTIONS = "automatedActions"; private List automatedActions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAutomatedActions = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_RISK_SCORE = "riskScore"; private Integer riskScore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskScore = false; + public static final String JSON_PROPERTY_SCORE_SIGNALS_TRIGGERED = "scoreSignalsTriggered"; private List scoreSignalsTriggered; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScoreSignalsTriggered = false; + public static final String JSON_PROPERTY_SIGNAL_SOURCE_TYPES = "signalSourceTypes"; private List signalSourceTypes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSignalSourceTypes = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BankScoreSignalTriggeredData() {} /** @@ -70,6 +105,7 @@ public BankScoreSignalTriggeredData() {} */ public BankScoreSignalTriggeredData accountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -93,6 +129,7 @@ public ResourceReference getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set } /** @@ -103,6 +140,7 @@ public void setAccountHolder(ResourceReference accountHolder) { */ public BankScoreSignalTriggeredData accountHolderStatus(String accountHolderStatus) { this.accountHolderStatus = accountHolderStatus; + isSetAccountHolderStatus = true; // mark as set return this; } @@ -126,6 +164,7 @@ public String getAccountHolderStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolderStatus(String accountHolderStatus) { this.accountHolderStatus = accountHolderStatus; + isSetAccountHolderStatus = true; // mark as set } /** @@ -137,6 +176,7 @@ public void setAccountHolderStatus(String accountHolderStatus) { */ public BankScoreSignalTriggeredData automatedActions(List automatedActions) { this.automatedActions = automatedActions; + isSetAutomatedActions = true; // mark as set return this; } @@ -170,6 +210,7 @@ public List getAutomatedActions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAutomatedActions(List automatedActions) { this.automatedActions = automatedActions; + isSetAutomatedActions = true; // mark as set } /** @@ -180,6 +221,7 @@ public void setAutomatedActions(List automatedActions) { */ public BankScoreSignalTriggeredData balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -203,6 +245,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -215,6 +258,7 @@ public void setBalancePlatform(String balancePlatform) { */ public BankScoreSignalTriggeredData creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -242,6 +286,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -252,6 +297,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public BankScoreSignalTriggeredData id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -275,6 +321,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -285,6 +332,7 @@ public void setId(String id) { */ public BankScoreSignalTriggeredData riskScore(Integer riskScore) { this.riskScore = riskScore; + isSetRiskScore = true; // mark as set return this; } @@ -308,6 +356,7 @@ public Integer getRiskScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskScore(Integer riskScore) { this.riskScore = riskScore; + isSetRiskScore = true; // mark as set } /** @@ -318,6 +367,7 @@ public void setRiskScore(Integer riskScore) { */ public BankScoreSignalTriggeredData scoreSignalsTriggered(List scoreSignalsTriggered) { this.scoreSignalsTriggered = scoreSignalsTriggered; + isSetScoreSignalsTriggered = true; // mark as set return this; } @@ -350,6 +400,7 @@ public List getScoreSignalsTriggered() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScoreSignalsTriggered(List scoreSignalsTriggered) { this.scoreSignalsTriggered = scoreSignalsTriggered; + isSetScoreSignalsTriggered = true; // mark as set } /** @@ -360,6 +411,7 @@ public void setScoreSignalsTriggered(List scoreSignalsTriggered) { */ public BankScoreSignalTriggeredData signalSourceTypes(List signalSourceTypes) { this.signalSourceTypes = signalSourceTypes; + isSetSignalSourceTypes = true; // mark as set return this; } @@ -391,6 +443,27 @@ public List getSignalSourceTypes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSignalSourceTypes(List signalSourceTypes) { this.signalSourceTypes = signalSourceTypes; + isSetSignalSourceTypes = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankScoreSignalTriggeredData 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 BankScoreSignalTriggeredData object is equal to o. */ @@ -461,6 +534,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 (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAccountHolderStatus) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_STATUS, this.accountHolderStatus); + } + if (isSetAutomatedActions) { + addIfNull(nulls, JSON_PROPERTY_AUTOMATED_ACTIONS, this.automatedActions); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetRiskScore) { + addIfNull(nulls, JSON_PROPERTY_RISK_SCORE, this.riskScore); + } + if (isSetScoreSignalsTriggered) { + addIfNull(nulls, JSON_PROPERTY_SCORE_SIGNALS_TRIGGERED, this.scoreSignalsTriggered); + } + if (isSetSignalSourceTypes) { + addIfNull(nulls, JSON_PROPERTY_SIGNAL_SOURCE_TYPES, this.signalSourceTypes); + } + + 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 BankScoreSignalTriggeredData given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/BulkAddress.java b/src/main/java/com/adyen/model/configurationwebhooks/BulkAddress.java index d5892bebc..b134c3cbf 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/BulkAddress.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/BulkAddress.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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,6 +30,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 @@ -36,39 +39,87 @@ public class BulkAddress { 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_COMPANY = "company"; private String company; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCompany = 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_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = 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_LINE1 = "line1"; private String line1; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine1 = false; + public static final String JSON_PROPERTY_LINE2 = "line2"; private String line2; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine2 = false; + public static final String JSON_PROPERTY_LINE3 = "line3"; private String line3; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine3 = false; + public static final String JSON_PROPERTY_MOBILE = "mobile"; private String mobile; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMobile = 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_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 BulkAddress() {} /** @@ -79,6 +130,7 @@ public BulkAddress() {} */ public BulkAddress city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -102,6 +154,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -112,6 +165,7 @@ public void setCity(String city) { */ public BulkAddress company(String company) { this.company = company; + isSetCompany = true; // mark as set return this; } @@ -135,6 +189,7 @@ public String getCompany() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCompany(String company) { this.company = company; + isSetCompany = true; // mark as set } /** @@ -145,6 +200,7 @@ public void setCompany(String company) { */ public BulkAddress country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -168,6 +224,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -178,6 +235,7 @@ public void setCountry(String country) { */ public BulkAddress email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -201,6 +259,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -211,6 +270,7 @@ public void setEmail(String email) { */ public BulkAddress houseNumberOrName(String houseNumberOrName) { this.houseNumberOrName = houseNumberOrName; + isSetHouseNumberOrName = true; // mark as set return this; } @@ -234,6 +294,7 @@ public String getHouseNumberOrName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHouseNumberOrName(String houseNumberOrName) { this.houseNumberOrName = houseNumberOrName; + isSetHouseNumberOrName = true; // mark as set } /** @@ -246,6 +307,7 @@ public void setHouseNumberOrName(String houseNumberOrName) { */ public BulkAddress line1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set return this; } @@ -273,6 +335,7 @@ public String getLine1() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set } /** @@ -284,6 +347,7 @@ public void setLine1(String line1) { */ public BulkAddress line2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set return this; } @@ -309,6 +373,7 @@ public String getLine2() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set } /** @@ -319,6 +384,7 @@ public void setLine2(String line2) { */ public BulkAddress line3(String line3) { this.line3 = line3; + isSetLine3 = true; // mark as set return this; } @@ -342,6 +408,7 @@ public String getLine3() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine3(String line3) { this.line3 = line3; + isSetLine3 = true; // mark as set } /** @@ -352,6 +419,7 @@ public void setLine3(String line3) { */ public BulkAddress mobile(String mobile) { this.mobile = mobile; + isSetMobile = true; // mark as set return this; } @@ -375,6 +443,42 @@ public String getMobile() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMobile(String mobile) { this.mobile = mobile; + isSetMobile = true; // mark as set + } + + /** + * 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; + isSetName = true; // mark as set + 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; + isSetName = true; // mark as set } /** @@ -387,6 +491,7 @@ public void setMobile(String mobile) { */ public BulkAddress postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -414,6 +519,7 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set } /** @@ -426,6 +532,7 @@ public void setPostalCode(String postalCode) { */ public BulkAddress stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set return this; } @@ -453,6 +560,7 @@ public String getStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set } /** @@ -463,6 +571,7 @@ public void setStateOrProvince(String stateOrProvince) { */ public BulkAddress street(String street) { this.street = street; + isSetStreet = true; // mark as set return this; } @@ -486,6 +595,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 BulkAddress 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 BulkAddress object is equal to o. */ @@ -507,6 +637,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 +655,7 @@ public int hashCode() { line2, line3, mobile, + name, postalCode, stateOrProvince, street); @@ -542,6 +674,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"); @@ -559,6 +692,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 (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCompany) { + addIfNull(nulls, JSON_PROPERTY_COMPANY, this.company); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetHouseNumberOrName) { + addIfNull(nulls, JSON_PROPERTY_HOUSE_NUMBER_OR_NAME, this.houseNumberOrName); + } + if (isSetLine1) { + addIfNull(nulls, JSON_PROPERTY_LINE1, this.line1); + } + if (isSetLine2) { + addIfNull(nulls, JSON_PROPERTY_LINE2, this.line2); + } + if (isSetLine3) { + addIfNull(nulls, JSON_PROPERTY_LINE3, this.line3); + } + if (isSetMobile) { + addIfNull(nulls, JSON_PROPERTY_MOBILE, this.mobile); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + 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 BulkAddress given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/CapabilityProblem.java b/src/main/java/com/adyen/model/configurationwebhooks/CapabilityProblem.java index 405a147aa..f4e6bb632 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/CapabilityProblem.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/CapabilityProblem.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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,9 +30,21 @@ public class CapabilityProblem { public static final String JSON_PROPERTY_ENTITY = "entity"; private CapabilityProblemEntity entity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntity = false; + public static final String JSON_PROPERTY_VERIFICATION_ERRORS = "verificationErrors"; private List verificationErrors; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationErrors = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapabilityProblem() {} /** @@ -41,6 +55,7 @@ public CapabilityProblem() {} */ public CapabilityProblem entity(CapabilityProblemEntity entity) { this.entity = entity; + isSetEntity = true; // mark as set return this; } @@ -64,6 +79,7 @@ public CapabilityProblemEntity getEntity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntity(CapabilityProblemEntity entity) { this.entity = entity; + isSetEntity = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setEntity(CapabilityProblemEntity entity) { */ public CapabilityProblem verificationErrors(List verificationErrors) { this.verificationErrors = verificationErrors; + isSetVerificationErrors = true; // mark as set return this; } @@ -105,6 +122,27 @@ public List getVerificationErrors() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVerificationErrors(List verificationErrors) { this.verificationErrors = verificationErrors; + isSetVerificationErrors = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapabilityProblem 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 CapabilityProblem object is equal to o. */ @@ -146,6 +184,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 (isSetEntity) { + addIfNull(nulls, JSON_PROPERTY_ENTITY, this.entity); + } + if (isSetVerificationErrors) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_ERRORS, this.verificationErrors); + } + + 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 CapabilityProblem given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/CapabilityProblemEntity.java b/src/main/java/com/adyen/model/configurationwebhooks/CapabilityProblemEntity.java index 9e69b916a..d828b1728 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/CapabilityProblemEntity.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/CapabilityProblemEntity.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +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,12 +36,21 @@ public class CapabilityProblemEntity { public static final String JSON_PROPERTY_DOCUMENTS = "documents"; private List documents; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocuments = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_OWNER = "owner"; private CapabilityProblemEntityRecursive owner; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOwner = false; + /** Type of entity. Possible values: **LegalEntity**, **BankAccount**, **Document**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("BankAccount")), @@ -86,6 +97,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 CapabilityProblemEntity() {} /** @@ -98,6 +118,7 @@ public CapabilityProblemEntity() {} */ public CapabilityProblemEntity documents(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set return this; } @@ -133,6 +154,7 @@ public List getDocuments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocuments(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set } /** @@ -143,6 +165,7 @@ public void setDocuments(List documents) { */ public CapabilityProblemEntity id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -166,6 +189,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -176,6 +200,7 @@ public void setId(String id) { */ public CapabilityProblemEntity owner(CapabilityProblemEntityRecursive owner) { this.owner = owner; + isSetOwner = true; // mark as set return this; } @@ -199,6 +224,7 @@ public CapabilityProblemEntityRecursive getOwner() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwner(CapabilityProblemEntityRecursive owner) { this.owner = owner; + isSetOwner = true; // mark as set } /** @@ -209,6 +235,7 @@ public void setOwner(CapabilityProblemEntityRecursive owner) { */ public CapabilityProblemEntity type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -232,6 +259,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 CapabilityProblemEntity 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 CapabilityProblemEntity object is equal to o. */ @@ -277,6 +325,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 (isSetDocuments) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENTS, this.documents); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetOwner) { + addIfNull(nulls, JSON_PROPERTY_OWNER, this.owner); + } + 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 CapabilityProblemEntity given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/CapabilityProblemEntityRecursive.java b/src/main/java/com/adyen/model/configurationwebhooks/CapabilityProblemEntityRecursive.java index f553e8278..fb18ab14d 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/CapabilityProblemEntityRecursive.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/CapabilityProblemEntityRecursive.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +37,15 @@ public class CapabilityProblemEntityRecursive { public static final String JSON_PROPERTY_DOCUMENTS = "documents"; private List documents; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocuments = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + /** Type of entity. Possible values: **LegalEntity**, **BankAccount**, **Document**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("BankAccount")), @@ -84,6 +92,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 CapabilityProblemEntityRecursive() {} /** @@ -97,6 +114,7 @@ public CapabilityProblemEntityRecursive() {} */ public CapabilityProblemEntityRecursive documents(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set return this; } @@ -132,6 +150,7 @@ public List getDocuments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocuments(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set } /** @@ -143,6 +162,7 @@ public void setDocuments(List documents) { */ public CapabilityProblemEntityRecursive id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -177,6 +198,7 @@ public void setId(String id) { */ public CapabilityProblemEntityRecursive type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -200,6 +222,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 CapabilityProblemEntityRecursive 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 CapabilityProblemEntity-recursive object is equal to o. */ @@ -244,6 +287,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 (isSetDocuments) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENTS, this.documents); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + 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 CapabilityProblemEntityRecursive given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/CapabilitySettings.java b/src/main/java/com/adyen/model/configurationwebhooks/CapabilitySettings.java index 816edc10c..df702daf4 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/CapabilitySettings.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/CapabilitySettings.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +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,9 +39,15 @@ public class CapabilitySettings { public static final String JSON_PROPERTY_AMOUNT_PER_INDUSTRY = "amountPerIndustry"; private Map amountPerIndustry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountPerIndustry = false; + public static final String JSON_PROPERTY_AUTHORIZED_CARD_USERS = "authorizedCardUsers"; private Boolean authorizedCardUsers; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorizedCardUsers = false; + /** Gets or Sets fundingSource */ public enum FundingSourceEnum { CREDIT(String.valueOf("credit")), @@ -86,6 +94,9 @@ public static FundingSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private List fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + /** */ public enum IntervalEnum { DAILY(String.valueOf("daily")), @@ -132,9 +143,21 @@ public static IntervalEnum fromValue(String value) { public static final String JSON_PROPERTY_INTERVAL = "interval"; private IntervalEnum interval; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInterval = false; + public static final String JSON_PROPERTY_MAX_AMOUNT = "maxAmount"; private Amount maxAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaxAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapabilitySettings() {} /** @@ -143,6 +166,7 @@ public CapabilitySettings() {} */ public CapabilitySettings amountPerIndustry(Map amountPerIndustry) { this.amountPerIndustry = amountPerIndustry; + isSetAmountPerIndustry = true; // mark as set return this; } @@ -170,6 +194,7 @@ public Map getAmountPerIndustry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountPerIndustry(Map amountPerIndustry) { this.amountPerIndustry = amountPerIndustry; + isSetAmountPerIndustry = true; // mark as set } /** @@ -178,6 +203,7 @@ public void setAmountPerIndustry(Map amountPerIndustry) { */ public CapabilitySettings authorizedCardUsers(Boolean authorizedCardUsers) { this.authorizedCardUsers = authorizedCardUsers; + isSetAuthorizedCardUsers = true; // mark as set return this; } @@ -197,6 +223,7 @@ public Boolean getAuthorizedCardUsers() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorizedCardUsers(Boolean authorizedCardUsers) { this.authorizedCardUsers = authorizedCardUsers; + isSetAuthorizedCardUsers = true; // mark as set } /** @@ -205,6 +232,7 @@ public void setAuthorizedCardUsers(Boolean authorizedCardUsers) { */ public CapabilitySettings fundingSource(List fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -232,6 +260,7 @@ public List getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(List fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -240,6 +269,7 @@ public void setFundingSource(List fundingSource) { */ public CapabilitySettings interval(IntervalEnum interval) { this.interval = interval; + isSetInterval = true; // mark as set return this; } @@ -259,6 +289,7 @@ public IntervalEnum getInterval() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInterval(IntervalEnum interval) { this.interval = interval; + isSetInterval = true; // mark as set } /** @@ -269,6 +300,7 @@ public void setInterval(IntervalEnum interval) { */ public CapabilitySettings maxAmount(Amount maxAmount) { this.maxAmount = maxAmount; + isSetMaxAmount = true; // mark as set return this; } @@ -292,6 +324,27 @@ public Amount getMaxAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaxAmount(Amount maxAmount) { this.maxAmount = maxAmount; + isSetMaxAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapabilitySettings 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 CapabilitySettings object is equal to o. */ @@ -341,6 +394,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 (isSetAmountPerIndustry) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_PER_INDUSTRY, this.amountPerIndustry); + } + if (isSetAuthorizedCardUsers) { + addIfNull(nulls, JSON_PROPERTY_AUTHORIZED_CARD_USERS, this.authorizedCardUsers); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetInterval) { + addIfNull(nulls, JSON_PROPERTY_INTERVAL, this.interval); + } + if (isSetMaxAmount) { + addIfNull(nulls, JSON_PROPERTY_MAX_AMOUNT, this.maxAmount); + } + + 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 CapabilitySettings given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/Card.java b/src/main/java/com/adyen/model/configurationwebhooks/Card.java index e2086496b..92a3d4fc5 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/Card.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/Card.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +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,30 +44,57 @@ public class Card { public static final String JSON_PROPERTY_AUTHENTICATION = "authentication"; private Authentication authentication; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthentication = 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_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_BRAND_VARIANT = "brandVariant"; private String brandVariant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrandVariant = false; + public static final String JSON_PROPERTY_CARDHOLDER_NAME = "cardholderName"; private String cardholderName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardholderName = false; + public static final String JSON_PROPERTY_CONFIGURATION = "configuration"; private CardConfiguration configuration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConfiguration = 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_DELIVERY_CONTACT = "deliveryContact"; private DeliveryContact deliveryContact; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryContact = false; + public static final String JSON_PROPERTY_EXPIRATION = "expiration"; private Expiry expiration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiration = false; + /** The form factor of the card. Possible values: **virtual**, **physical**. */ public enum FormFactorEnum { PHYSICAL(String.valueOf("physical")), @@ -112,18 +141,39 @@ public static FormFactorEnum fromValue(String value) { public static final String JSON_PROPERTY_FORM_FACTOR = "formFactor"; private FormFactorEnum formFactor; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFormFactor = false; + public static final String JSON_PROPERTY_LAST_FOUR = "lastFour"; private String lastFour; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastFour = 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_THREE_D_SECURE = "threeDSecure"; private String threeDSecure; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSecure = false; + public static final String JSON_PROPERTY_USAGE = "usage"; private String usage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUsage = 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() {} /** @@ -134,6 +184,7 @@ public Card() {} */ public Card authentication(Authentication authentication) { this.authentication = authentication; + isSetAuthentication = true; // mark as set return this; } @@ -157,6 +208,7 @@ public Authentication getAuthentication() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthentication(Authentication authentication) { this.authentication = authentication; + isSetAuthentication = true; // mark as set } /** @@ -167,6 +219,7 @@ public void setAuthentication(Authentication authentication) { */ public Card bin(String bin) { this.bin = bin; + isSetBin = true; // mark as set return this; } @@ -190,6 +243,7 @@ public String getBin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBin(String bin) { this.bin = bin; + isSetBin = true; // mark as set } /** @@ -200,6 +254,7 @@ public void setBin(String bin) { */ public Card brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -223,6 +278,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -237,6 +293,7 @@ public void setBrand(String brand) { */ public Card brandVariant(String brandVariant) { this.brandVariant = brandVariant; + isSetBrandVariant = true; // mark as set return this; } @@ -268,6 +325,7 @@ public String getBrandVariant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrandVariant(String brandVariant) { this.brandVariant = brandVariant; + isSetBrandVariant = true; // mark as set } /** @@ -278,6 +336,7 @@ public void setBrandVariant(String brandVariant) { */ public Card cardholderName(String cardholderName) { this.cardholderName = cardholderName; + isSetCardholderName = true; // mark as set return this; } @@ -301,6 +360,7 @@ public String getCardholderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardholderName(String cardholderName) { this.cardholderName = cardholderName; + isSetCardholderName = true; // mark as set } /** @@ -311,6 +371,7 @@ public void setCardholderName(String cardholderName) { */ public Card configuration(CardConfiguration configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set return this; } @@ -334,6 +395,7 @@ public CardConfiguration getConfiguration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConfiguration(CardConfiguration configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set } /** @@ -346,6 +408,7 @@ public void setConfiguration(CardConfiguration configuration) { */ public Card cvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set return this; } @@ -373,6 +436,7 @@ public String getCvc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set } /** @@ -383,6 +447,7 @@ public void setCvc(String cvc) { */ public Card deliveryContact(DeliveryContact deliveryContact) { this.deliveryContact = deliveryContact; + isSetDeliveryContact = true; // mark as set return this; } @@ -406,6 +471,7 @@ public DeliveryContact getDeliveryContact() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryContact(DeliveryContact deliveryContact) { this.deliveryContact = deliveryContact; + isSetDeliveryContact = true; // mark as set } /** @@ -416,6 +482,7 @@ public void setDeliveryContact(DeliveryContact deliveryContact) { */ public Card expiration(Expiry expiration) { this.expiration = expiration; + isSetExpiration = true; // mark as set return this; } @@ -439,6 +506,7 @@ public Expiry getExpiration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiration(Expiry expiration) { this.expiration = expiration; + isSetExpiration = true; // mark as set } /** @@ -449,6 +517,7 @@ public void setExpiration(Expiry expiration) { */ public Card formFactor(FormFactorEnum formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set return this; } @@ -472,6 +541,7 @@ public FormFactorEnum getFormFactor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFormFactor(FormFactorEnum formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set } /** @@ -482,6 +552,7 @@ public void setFormFactor(FormFactorEnum formFactor) { */ public Card lastFour(String lastFour) { this.lastFour = lastFour; + isSetLastFour = true; // mark as set return this; } @@ -505,6 +576,7 @@ public String getLastFour() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastFour(String lastFour) { this.lastFour = lastFour; + isSetLastFour = true; // mark as set } /** @@ -517,6 +589,7 @@ public void setLastFour(String lastFour) { */ public Card number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -544,6 +617,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -558,6 +632,7 @@ public void setNumber(String number) { */ public Card threeDSecure(String threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set return this; } @@ -589,6 +664,7 @@ public String getThreeDSecure() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSecure(String threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set } /** @@ -602,6 +678,7 @@ public void setThreeDSecure(String threeDSecure) { */ public Card usage(String usage) { this.usage = usage; + isSetUsage = true; // mark as set return this; } @@ -631,6 +708,27 @@ public String getUsage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUsage(String usage) { this.usage = usage; + isSetUsage = 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. */ @@ -710,6 +808,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 (isSetAuthentication) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION, this.authentication); + } + if (isSetBin) { + addIfNull(nulls, JSON_PROPERTY_BIN, this.bin); + } + if (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetBrandVariant) { + addIfNull(nulls, JSON_PROPERTY_BRAND_VARIANT, this.brandVariant); + } + if (isSetCardholderName) { + addIfNull(nulls, JSON_PROPERTY_CARDHOLDER_NAME, this.cardholderName); + } + if (isSetConfiguration) { + addIfNull(nulls, JSON_PROPERTY_CONFIGURATION, this.configuration); + } + if (isSetCvc) { + addIfNull(nulls, JSON_PROPERTY_CVC, this.cvc); + } + if (isSetDeliveryContact) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_CONTACT, this.deliveryContact); + } + if (isSetExpiration) { + addIfNull(nulls, JSON_PROPERTY_EXPIRATION, this.expiration); + } + if (isSetFormFactor) { + addIfNull(nulls, JSON_PROPERTY_FORM_FACTOR, this.formFactor); + } + if (isSetLastFour) { + addIfNull(nulls, JSON_PROPERTY_LAST_FOUR, this.lastFour); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + if (isSetThreeDSecure) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_SECURE, this.threeDSecure); + } + if (isSetUsage) { + addIfNull(nulls, JSON_PROPERTY_USAGE, this.usage); + } + + 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/configurationwebhooks/CardConfiguration.java b/src/main/java/com/adyen/model/configurationwebhooks/CardConfiguration.java index dd2eeaa80..9e72f0f66 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/CardConfiguration.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/CardConfiguration.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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,68 +40,117 @@ public class CardConfiguration { public static final String JSON_PROPERTY_ACTIVATION = "activation"; private String activation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetActivation = false; + public static final String JSON_PROPERTY_ACTIVATION_URL = "activationUrl"; private String activationUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetActivationUrl = false; + public static final String JSON_PROPERTY_BULK_ADDRESS = "bulkAddress"; private BulkAddress bulkAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBulkAddress = false; + public static final String JSON_PROPERTY_CARD_IMAGE_ID = "cardImageId"; private String cardImageId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardImageId = false; + public static final String JSON_PROPERTY_CARRIER = "carrier"; private String carrier; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarrier = false; + public static final String JSON_PROPERTY_CARRIER_IMAGE_ID = "carrierImageId"; private String carrierImageId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarrierImageId = false; + public static final String JSON_PROPERTY_CONFIGURATION_PROFILE_ID = "configurationProfileId"; private String configurationProfileId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConfigurationProfileId = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_ENVELOPE = "envelope"; private String envelope; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvelope = false; + public static final String JSON_PROPERTY_INSERT = "insert"; private String insert; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInsert = 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_LOGO_IMAGE_ID = "logoImageId"; private String logoImageId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLogoImageId = false; + public static final String JSON_PROPERTY_PIN_MAILER = "pinMailer"; private String pinMailer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPinMailer = false; + public static final String JSON_PROPERTY_SHIPMENT_METHOD = "shipmentMethod"; private String shipmentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShipmentMethod = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + 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) { this.activation = activation; + isSetActivation = true; // mark as set return this; } /** - * 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,17 +159,18 @@ 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) public void setActivation(String activation) { this.activation = activation; + isSetActivation = true; // mark as set } /** @@ -135,6 +187,7 @@ public void setActivation(String activation) { */ public CardConfiguration activationUrl(String activationUrl) { this.activationUrl = activationUrl; + isSetActivationUrl = true; // mark as set return this; } @@ -170,6 +223,7 @@ public String getActivationUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setActivationUrl(String activationUrl) { this.activationUrl = activationUrl; + isSetActivationUrl = true; // mark as set } /** @@ -180,6 +234,7 @@ public void setActivationUrl(String activationUrl) { */ public CardConfiguration bulkAddress(BulkAddress bulkAddress) { this.bulkAddress = bulkAddress; + isSetBulkAddress = true; // mark as set return this; } @@ -203,25 +258,27 @@ public BulkAddress getBulkAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBulkAddress(BulkAddress bulkAddress) { this.bulkAddress = bulkAddress; + isSetBulkAddress = true; // mark as set } /** - * 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 */ public CardConfiguration cardImageId(String cardImageId) { this.cardImageId = cardImageId; + isSetCardImageId = true; // mark as set return this; } /** - * 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,38 +287,38 @@ 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) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardImageId(String cardImageId) { this.cardImageId = cardImageId; + isSetCardImageId = true; // mark as set } /** - * 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) { this.carrier = carrier; + isSetCarrier = true; // mark as set return this; } /** - * 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,37 +327,38 @@ 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) public void setCarrier(String carrier) { this.carrier = carrier; + isSetCarrier = true; // mark as set } /** - * 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 */ public CardConfiguration carrierImageId(String carrierImageId) { this.carrierImageId = carrierImageId; + isSetCarrierImageId = true; // mark as set return this; } /** - * 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,51 +368,55 @@ 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) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarrierImageId(String carrierImageId) { this.carrierImageId = carrierImageId; + isSetCarrierImageId = true; // mark as set } /** - * 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) { this.configurationProfileId = configurationProfileId; + isSetConfigurationProfileId = true; // mark as set return this; } /** - * 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,44 +425,51 @@ 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) public void setConfigurationProfileId(String configurationProfileId) { this.configurationProfileId = configurationProfileId; + isSetConfigurationProfileId = true; // mark as set } /** * 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) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } /** * 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,34 +479,36 @@ 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) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** - * 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) { this.envelope = envelope; + isSetEnvelope = true; // mark as set return this; } /** - * 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,38 +517,39 @@ 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) public void setEnvelope(String envelope) { this.envelope = envelope; + isSetEnvelope = true; // mark as set } /** - * 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) { this.insert = insert; + isSetInsert = true; // mark as set return this; } /** - * 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,17 +558,18 @@ 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) public void setInsert(String insert) { this.insert = insert; + isSetInsert = true; // mark as set } /** @@ -510,6 +583,7 @@ public void setInsert(String insert) { */ public CardConfiguration language(String language) { this.language = language; + isSetLanguage = true; // mark as set return this; } @@ -539,27 +613,29 @@ public String getLanguage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLanguage(String language) { this.language = language; + isSetLanguage = true; // mark as set } /** - * 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) { this.logoImageId = logoImageId; + isSetLogoImageId = true; // mark as set return this; } /** - * 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,39 +644,39 @@ 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) public void setLogoImageId(String logoImageId) { this.logoImageId = logoImageId; + isSetLogoImageId = true; // mark as set } /** - * 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) { this.pinMailer = pinMailer; + isSetPinMailer = true; // mark as set return this; } /** - * 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,36 +685,39 @@ 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) public void setPinMailer(String pinMailer) { this.pinMailer = pinMailer; + isSetPinMailer = true; // mark as set } /** - * 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) { this.shipmentMethod = shipmentMethod; + isSetShipmentMethod = true; // mark as set return this; } /** - * 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,15 +726,37 @@ 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) public void setShipmentMethod(String shipmentMethod) { this.shipmentMethod = shipmentMethod; + isSetShipmentMethod = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardConfiguration 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 CardConfiguration object is equal to o. */ @@ -737,6 +838,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 (isSetActivation) { + addIfNull(nulls, JSON_PROPERTY_ACTIVATION, this.activation); + } + if (isSetActivationUrl) { + addIfNull(nulls, JSON_PROPERTY_ACTIVATION_URL, this.activationUrl); + } + if (isSetBulkAddress) { + addIfNull(nulls, JSON_PROPERTY_BULK_ADDRESS, this.bulkAddress); + } + if (isSetCardImageId) { + addIfNull(nulls, JSON_PROPERTY_CARD_IMAGE_ID, this.cardImageId); + } + if (isSetCarrier) { + addIfNull(nulls, JSON_PROPERTY_CARRIER, this.carrier); + } + if (isSetCarrierImageId) { + addIfNull(nulls, JSON_PROPERTY_CARRIER_IMAGE_ID, this.carrierImageId); + } + if (isSetConfigurationProfileId) { + addIfNull(nulls, JSON_PROPERTY_CONFIGURATION_PROFILE_ID, this.configurationProfileId); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetEnvelope) { + addIfNull(nulls, JSON_PROPERTY_ENVELOPE, this.envelope); + } + if (isSetInsert) { + addIfNull(nulls, JSON_PROPERTY_INSERT, this.insert); + } + if (isSetLanguage) { + addIfNull(nulls, JSON_PROPERTY_LANGUAGE, this.language); + } + if (isSetLogoImageId) { + addIfNull(nulls, JSON_PROPERTY_LOGO_IMAGE_ID, this.logoImageId); + } + if (isSetPinMailer) { + addIfNull(nulls, JSON_PROPERTY_PIN_MAILER, this.pinMailer); + } + if (isSetShipmentMethod) { + addIfNull(nulls, JSON_PROPERTY_SHIPMENT_METHOD, this.shipmentMethod); + } + + 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 CardConfiguration given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/CardOrderItem.java b/src/main/java/com/adyen/model/configurationwebhooks/CardOrderItem.java index 6b607b4d7..0d4debd2b 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/CardOrderItem.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/CardOrderItem.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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,27 +35,57 @@ public class CardOrderItem { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CARD = "card"; private CardOrderItemDeliveryStatus card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = false; + public static final String JSON_PROPERTY_CARD_ORDER_ITEM_ID = "cardOrderItemId"; private String cardOrderItemId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardOrderItemId = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + public static final String JSON_PROPERTY_PIN = "pin"; private CardOrderItemDeliveryStatus pin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPin = false; + public static final String JSON_PROPERTY_SHIPPING_METHOD = "shippingMethod"; private String shippingMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShippingMethod = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardOrderItem() {} /** @@ -64,6 +96,7 @@ public CardOrderItem() {} */ public CardOrderItem balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -87,6 +120,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -97,6 +131,7 @@ public void setBalancePlatform(String balancePlatform) { */ public CardOrderItem card(CardOrderItemDeliveryStatus card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -120,6 +155,7 @@ public CardOrderItemDeliveryStatus getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(CardOrderItemDeliveryStatus card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -130,6 +166,7 @@ public void setCard(CardOrderItemDeliveryStatus card) { */ public CardOrderItem cardOrderItemId(String cardOrderItemId) { this.cardOrderItemId = cardOrderItemId; + isSetCardOrderItemId = true; // mark as set return this; } @@ -153,6 +190,7 @@ public String getCardOrderItemId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardOrderItemId(String cardOrderItemId) { this.cardOrderItemId = cardOrderItemId; + isSetCardOrderItemId = true; // mark as set } /** @@ -165,6 +203,7 @@ public void setCardOrderItemId(String cardOrderItemId) { */ public CardOrderItem creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -192,6 +231,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -202,6 +242,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public CardOrderItem id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -225,6 +266,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -236,6 +278,7 @@ public void setId(String id) { */ public CardOrderItem paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -261,6 +304,7 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set } /** @@ -271,6 +315,7 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { */ public CardOrderItem pin(CardOrderItemDeliveryStatus pin) { this.pin = pin; + isSetPin = true; // mark as set return this; } @@ -294,6 +339,7 @@ public CardOrderItemDeliveryStatus getPin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPin(CardOrderItemDeliveryStatus pin) { this.pin = pin; + isSetPin = true; // mark as set } /** @@ -304,6 +350,7 @@ public void setPin(CardOrderItemDeliveryStatus pin) { */ public CardOrderItem shippingMethod(String shippingMethod) { this.shippingMethod = shippingMethod; + isSetShippingMethod = true; // mark as set return this; } @@ -327,6 +374,27 @@ public String getShippingMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShippingMethod(String shippingMethod) { this.shippingMethod = shippingMethod; + isSetShippingMethod = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardOrderItem 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 CardOrderItem object is equal to o. */ @@ -390,6 +458,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 (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetCardOrderItemId) { + addIfNull(nulls, JSON_PROPERTY_CARD_ORDER_ITEM_ID, this.cardOrderItemId); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + if (isSetPin) { + addIfNull(nulls, JSON_PROPERTY_PIN, this.pin); + } + if (isSetShippingMethod) { + addIfNull(nulls, JSON_PROPERTY_SHIPPING_METHOD, this.shippingMethod); + } + + 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 CardOrderItem given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/CardOrderItemDeliveryStatus.java b/src/main/java/com/adyen/model/configurationwebhooks/CardOrderItemDeliveryStatus.java index 23c35058f..1b5473141 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/CardOrderItemDeliveryStatus.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/CardOrderItemDeliveryStatus.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +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 CardOrderItemDeliveryStatus { public static final String JSON_PROPERTY_ERROR_MESSAGE = "errorMessage"; private String errorMessage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorMessage = false; + /** The status of the PIN delivery. */ public enum StatusEnum { CREATED(String.valueOf("created")), @@ -87,9 +92,21 @@ 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_TRACKING_NUMBER = "trackingNumber"; private String trackingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrackingNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardOrderItemDeliveryStatus() {} /** @@ -100,6 +117,7 @@ public CardOrderItemDeliveryStatus() {} */ public CardOrderItemDeliveryStatus errorMessage(String errorMessage) { this.errorMessage = errorMessage; + isSetErrorMessage = true; // mark as set return this; } @@ -123,6 +141,7 @@ public String getErrorMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; + isSetErrorMessage = true; // mark as set } /** @@ -133,6 +152,7 @@ public void setErrorMessage(String errorMessage) { */ public CardOrderItemDeliveryStatus status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -156,6 +176,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -166,6 +187,7 @@ public void setStatus(StatusEnum status) { */ public CardOrderItemDeliveryStatus trackingNumber(String trackingNumber) { this.trackingNumber = trackingNumber; + isSetTrackingNumber = true; // mark as set return this; } @@ -189,6 +211,27 @@ public String getTrackingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrackingNumber(String trackingNumber) { this.trackingNumber = trackingNumber; + isSetTrackingNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardOrderItemDeliveryStatus 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 CardOrderItemDeliveryStatus object is equal to o. */ @@ -232,6 +275,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 (isSetErrorMessage) { + addIfNull(nulls, JSON_PROPERTY_ERROR_MESSAGE, this.errorMessage); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTrackingNumber) { + addIfNull(nulls, JSON_PROPERTY_TRACKING_NUMBER, this.trackingNumber); + } + + 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 CardOrderItemDeliveryStatus given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/CardOrderNotificationRequest.java b/src/main/java/com/adyen/model/configurationwebhooks/CardOrderNotificationRequest.java index 28b6962e0..869616fd3 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/CardOrderNotificationRequest.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/CardOrderNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class CardOrderNotificationRequest { public static final String JSON_PROPERTY_DATA = "data"; private CardOrderItem data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + /** Type of webhook. */ public enum TypeEnum { BALANCEPLATFORM_CARDORDER_CREATED(String.valueOf("balancePlatform.cardorder.created")), @@ -83,6 +94,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 CardOrderNotificationRequest() {} /** @@ -93,6 +113,7 @@ public CardOrderNotificationRequest() {} */ public CardOrderNotificationRequest data(CardOrderItem data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -116,6 +137,7 @@ public CardOrderItem getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(CardOrderItem data) { this.data = data; + isSetData = true; // mark as set } /** @@ -127,6 +149,7 @@ public void setData(CardOrderItem data) { */ public CardOrderNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -152,6 +175,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -162,6 +186,7 @@ public void setEnvironment(String environment) { */ public CardOrderNotificationRequest timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set return this; } @@ -185,6 +210,7 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set } /** @@ -195,6 +221,7 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public CardOrderNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -218,6 +245,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 CardOrderNotificationRequest 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 CardOrderNotificationRequest object is equal to o. */ @@ -263,6 +311,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CardOrderNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/ContactDetails.java b/src/main/java/com/adyen/model/configurationwebhooks/ContactDetails.java index c938ba416..0c90993d1 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/ContactDetails.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/ContactDetails.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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,15 +35,33 @@ public class ContactDetails { public static final String JSON_PROPERTY_ADDRESS = "address"; private Address address; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddress = false; + public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_PHONE = "phone"; private Phone phone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhone = false; + public static final String JSON_PROPERTY_WEB_ADDRESS = "webAddress"; private String webAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebAddress = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ContactDetails() {} /** @@ -52,6 +72,7 @@ public ContactDetails() {} */ public ContactDetails address(Address address) { this.address = address; + isSetAddress = true; // mark as set return this; } @@ -75,6 +96,7 @@ public Address getAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddress(Address address) { this.address = address; + isSetAddress = true; // mark as set } /** @@ -85,6 +107,7 @@ public void setAddress(Address address) { */ public ContactDetails email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -108,6 +131,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -118,6 +142,7 @@ public void setEmail(String email) { */ public ContactDetails phone(Phone phone) { this.phone = phone; + isSetPhone = true; // mark as set return this; } @@ -141,6 +166,7 @@ public Phone getPhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhone(Phone phone) { this.phone = phone; + isSetPhone = true; // mark as set } /** @@ -151,6 +177,7 @@ public void setPhone(Phone phone) { */ public ContactDetails webAddress(String webAddress) { this.webAddress = webAddress; + isSetWebAddress = true; // mark as set return this; } @@ -174,6 +201,27 @@ public String getWebAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebAddress(String webAddress) { this.webAddress = webAddress; + isSetWebAddress = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ContactDetails 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 ContactDetails object is equal to o. */ @@ -219,6 +267,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 (isSetAddress) { + addIfNull(nulls, JSON_PROPERTY_ADDRESS, this.address); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetPhone) { + addIfNull(nulls, JSON_PROPERTY_PHONE, this.phone); + } + if (isSetWebAddress) { + addIfNull(nulls, JSON_PROPERTY_WEB_ADDRESS, this.webAddress); + } + + 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 ContactDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/DeliveryAddress.java b/src/main/java/com/adyen/model/configurationwebhooks/DeliveryAddress.java index 7a23d99ef..51fbc8bee 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/DeliveryAddress.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/DeliveryAddress.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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; @@ -31,24 +33,51 @@ public class DeliveryAddress { 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_LINE1 = "line1"; private String line1; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine1 = false; + public static final String JSON_PROPERTY_LINE2 = "line2"; private String line2; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine2 = false; + public static final String JSON_PROPERTY_LINE3 = "line3"; private String line3; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine3 = 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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DeliveryAddress() {} /** @@ -59,6 +88,7 @@ public DeliveryAddress() {} */ public DeliveryAddress city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -82,6 +112,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -96,6 +127,7 @@ public void setCity(String city) { */ public DeliveryAddress country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -127,6 +159,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -139,6 +172,7 @@ public void setCountry(String country) { */ public DeliveryAddress line1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set return this; } @@ -166,6 +200,7 @@ public String getLine1() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set } /** @@ -178,6 +213,7 @@ public void setLine1(String line1) { */ public DeliveryAddress line2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set return this; } @@ -205,6 +241,7 @@ public String getLine2() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set } /** @@ -215,6 +252,7 @@ public void setLine2(String line2) { */ public DeliveryAddress line3(String line3) { this.line3 = line3; + isSetLine3 = true; // mark as set return this; } @@ -238,6 +276,7 @@ public String getLine3() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine3(String line3) { this.line3 = line3; + isSetLine3 = true; // mark as set } /** @@ -250,6 +289,7 @@ public void setLine3(String line3) { */ public DeliveryAddress postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -277,6 +317,7 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set } /** @@ -290,6 +331,7 @@ public void setPostalCode(String postalCode) { */ public DeliveryAddress stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set return this; } @@ -319,6 +361,27 @@ public String getStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DeliveryAddress 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 DeliveryAddress object is equal to o. */ @@ -370,6 +433,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetLine1) { + addIfNull(nulls, JSON_PROPERTY_LINE1, this.line1); + } + if (isSetLine2) { + addIfNull(nulls, JSON_PROPERTY_LINE2, this.line2); + } + if (isSetLine3) { + addIfNull(nulls, JSON_PROPERTY_LINE3, this.line3); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + if (isSetStateOrProvince) { + addIfNull(nulls, JSON_PROPERTY_STATE_OR_PROVINCE, this.stateOrProvince); + } + + 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 DeliveryAddress given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/DeliveryContact.java b/src/main/java/com/adyen/model/configurationwebhooks/DeliveryContact.java index 4e9478cbc..1fc94734f 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/DeliveryContact.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/DeliveryContact.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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; @@ -31,24 +33,51 @@ public class DeliveryContact { public static final String JSON_PROPERTY_ADDRESS = "address"; private DeliveryAddress address; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddress = false; + public static final String JSON_PROPERTY_COMPANY = "company"; private String company; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCompany = false; + public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_FULL_PHONE_NUMBER = "fullPhoneNumber"; private String fullPhoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFullPhoneNumber = false; + public static final String JSON_PROPERTY_NAME = "name"; private Name name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_PHONE_NUMBER = "phoneNumber"; private PhoneNumber phoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneNumber = false; + public static final String JSON_PROPERTY_WEB_ADDRESS = "webAddress"; private String webAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebAddress = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DeliveryContact() {} /** @@ -59,6 +88,7 @@ public DeliveryContact() {} */ public DeliveryContact address(DeliveryAddress address) { this.address = address; + isSetAddress = true; // mark as set return this; } @@ -82,6 +112,7 @@ public DeliveryAddress getAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddress(DeliveryAddress address) { this.address = address; + isSetAddress = true; // mark as set } /** @@ -92,6 +123,7 @@ public void setAddress(DeliveryAddress address) { */ public DeliveryContact company(String company) { this.company = company; + isSetCompany = true; // mark as set return this; } @@ -115,6 +147,7 @@ public String getCompany() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCompany(String company) { this.company = company; + isSetCompany = true; // mark as set } /** @@ -125,6 +158,7 @@ public void setCompany(String company) { */ public DeliveryContact email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -148,6 +182,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -162,6 +197,7 @@ public void setEmail(String email) { */ public DeliveryContact fullPhoneNumber(String fullPhoneNumber) { this.fullPhoneNumber = fullPhoneNumber; + isSetFullPhoneNumber = true; // mark as set return this; } @@ -193,6 +229,7 @@ public String getFullPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFullPhoneNumber(String fullPhoneNumber) { this.fullPhoneNumber = fullPhoneNumber; + isSetFullPhoneNumber = true; // mark as set } /** @@ -203,6 +240,7 @@ public void setFullPhoneNumber(String fullPhoneNumber) { */ public DeliveryContact name(Name name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -226,6 +264,7 @@ public Name getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(Name name) { this.name = name; + isSetName = true; // mark as set } /** @@ -236,6 +275,7 @@ public void setName(Name name) { */ public DeliveryContact phoneNumber(PhoneNumber phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set return this; } @@ -259,6 +299,7 @@ public PhoneNumber getPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhoneNumber(PhoneNumber phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set } /** @@ -269,6 +310,7 @@ public void setPhoneNumber(PhoneNumber phoneNumber) { */ public DeliveryContact webAddress(String webAddress) { this.webAddress = webAddress; + isSetWebAddress = true; // mark as set return this; } @@ -292,6 +334,27 @@ public String getWebAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebAddress(String webAddress) { this.webAddress = webAddress; + isSetWebAddress = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DeliveryContact 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 DeliveryContact object is equal to o. */ @@ -343,6 +406,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAddress) { + addIfNull(nulls, JSON_PROPERTY_ADDRESS, this.address); + } + if (isSetCompany) { + addIfNull(nulls, JSON_PROPERTY_COMPANY, this.company); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetFullPhoneNumber) { + addIfNull(nulls, JSON_PROPERTY_FULL_PHONE_NUMBER, this.fullPhoneNumber); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPhoneNumber) { + addIfNull(nulls, JSON_PROPERTY_PHONE_NUMBER, this.phoneNumber); + } + if (isSetWebAddress) { + addIfNull(nulls, JSON_PROPERTY_WEB_ADDRESS, this.webAddress); + } + + 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 DeliveryContact given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/Device.java b/src/main/java/com/adyen/model/configurationwebhooks/Device.java index abcac2738..bbf1ef076 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/Device.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/Device.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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 Device { public static final String JSON_PROPERTY_DEVICE_ID = "deviceId"; private String deviceId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceId = false; + public static final String JSON_PROPERTY_FORM_FACTOR = "formFactor"; private String formFactor; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFormFactor = false; + public static final String JSON_PROPERTY_OS_NAME = "osName"; private String osName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOsName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Device() {} /** @@ -43,6 +60,7 @@ public Device() {} */ public Device deviceId(String deviceId) { this.deviceId = deviceId; + isSetDeviceId = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getDeviceId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceId(String deviceId) { this.deviceId = deviceId; + isSetDeviceId = true; // mark as set } /** @@ -78,6 +97,7 @@ public void setDeviceId(String deviceId) { */ public Device formFactor(String formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set return this; } @@ -105,6 +125,7 @@ public String getFormFactor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFormFactor(String formFactor) { this.formFactor = formFactor; + isSetFormFactor = true; // mark as set } /** @@ -115,6 +136,7 @@ public void setFormFactor(String formFactor) { */ public Device osName(String osName) { this.osName = osName; + isSetOsName = true; // mark as set return this; } @@ -138,6 +160,27 @@ public String getOsName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOsName(String osName) { this.osName = osName; + isSetOsName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Device 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 Device object is equal to o. */ @@ -181,6 +224,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 (isSetDeviceId) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_ID, this.deviceId); + } + if (isSetFormFactor) { + addIfNull(nulls, JSON_PROPERTY_FORM_FACTOR, this.formFactor); + } + if (isSetOsName) { + addIfNull(nulls, JSON_PROPERTY_OS_NAME, this.osName); + } + + 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 Device given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/Expiry.java b/src/main/java/com/adyen/model/configurationwebhooks/Expiry.java index eeaac49df..f5d61e2ca 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/Expiry.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/Expiry.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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 Expiry { public static final String JSON_PROPERTY_MONTH = "month"; private String month; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMonth = false; + public static final String JSON_PROPERTY_YEAR = "year"; private String year; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetYear = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Expiry() {} /** @@ -36,6 +50,7 @@ public Expiry() {} */ public Expiry month(String month) { this.month = month; + isSetMonth = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMonth(String month) { this.month = month; + isSetMonth = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setMonth(String month) { */ public Expiry year(String year) { this.year = year; + isSetYear = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setYear(String year) { this.year = year; + isSetYear = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Expiry 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 Expiry object is equal to o. */ @@ -132,6 +170,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 (isSetMonth) { + addIfNull(nulls, JSON_PROPERTY_MONTH, this.month); + } + if (isSetYear) { + addIfNull(nulls, JSON_PROPERTY_YEAR, this.year); + } + + 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 Expiry given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/IbanAccountIdentification.java b/src/main/java/com/adyen/model/configurationwebhooks/IbanAccountIdentification.java index fa9be03e0..884487148 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/IbanAccountIdentification.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/IbanAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +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; @@ -30,6 +32,9 @@ public class IbanAccountIdentification { public static final String JSON_PROPERTY_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + /** **iban** */ public enum TypeEnum { IBAN(String.valueOf("iban")); @@ -72,6 +77,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 IbanAccountIdentification() {} /** @@ -84,6 +98,7 @@ public IbanAccountIdentification() {} */ public IbanAccountIdentification iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -111,6 +126,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -121,6 +137,7 @@ public void setIban(String iban) { */ public IbanAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -144,6 +161,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 IbanAccountIdentification 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 IbanAccountIdentification object is equal to o. */ @@ -185,6 +223,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 (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + 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 IbanAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/Name.java b/src/main/java/com/adyen/model/configurationwebhooks/Name.java index ce1fdf421..ea1c069da 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/Name.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/Name.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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. */ @@ -133,6 +171,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/configurationwebhooks/NetworkTokenNotificationDataV2.java b/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenNotificationDataV2.java index 7b908f52e..583305624 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenNotificationDataV2.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenNotificationDataV2.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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; @@ -40,45 +42,93 @@ public class NetworkTokenNotificationDataV2 { public static final String JSON_PROPERTY_AUTHENTICATION = "authentication"; private TokenAuthentication authentication; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthentication = false; + public static final String JSON_PROPERTY_AUTHENTICATION_APPLIED = "authenticationApplied"; private Boolean authenticationApplied; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationApplied = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_DECISION = "decision"; private String decision; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDecision = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + public static final String JSON_PROPERTY_SCHEME_RISK_SCORE = "schemeRiskScore"; private String schemeRiskScore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchemeRiskScore = false; + public static final String JSON_PROPERTY_STATUS = "status"; private String status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TOKEN_LAST_FOUR = "tokenLastFour"; private String tokenLastFour; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenLastFour = false; + public static final String JSON_PROPERTY_TOKEN_REQUESTOR = "tokenRequestor"; private NetworkTokenRequestor tokenRequestor; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenRequestor = false; + public static final String JSON_PROPERTY_TRANSACTION_RULES_RESULT = "transactionRulesResult"; private NetworkTokenTransactionRulesResult transactionRulesResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRulesResult = 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_VALIDATION_FACTS = "validationFacts"; private List validationFacts; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValidationFacts = false; + public static final String JSON_PROPERTY_WALLET = "wallet"; private Wallet wallet; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWallet = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NetworkTokenNotificationDataV2() {} /** @@ -90,6 +140,7 @@ public NetworkTokenNotificationDataV2() {} */ public NetworkTokenNotificationDataV2 authentication(TokenAuthentication authentication) { this.authentication = authentication; + isSetAuthentication = true; // mark as set return this; } @@ -113,6 +164,7 @@ public TokenAuthentication getAuthentication() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthentication(TokenAuthentication authentication) { this.authentication = authentication; + isSetAuthentication = true; // mark as set } /** @@ -125,6 +177,7 @@ public void setAuthentication(TokenAuthentication authentication) { */ public NetworkTokenNotificationDataV2 authenticationApplied(Boolean authenticationApplied) { this.authenticationApplied = authenticationApplied; + isSetAuthenticationApplied = true; // mark as set return this; } @@ -150,6 +203,7 @@ public Boolean getAuthenticationApplied() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationApplied(Boolean authenticationApplied) { this.authenticationApplied = authenticationApplied; + isSetAuthenticationApplied = true; // mark as set } /** @@ -161,6 +215,7 @@ public void setAuthenticationApplied(Boolean authenticationApplied) { */ public NetworkTokenNotificationDataV2 balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -184,6 +239,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -197,6 +253,7 @@ public void setBalancePlatform(String balancePlatform) { */ public NetworkTokenNotificationDataV2 decision(String decision) { this.decision = decision; + isSetDecision = true; // mark as set return this; } @@ -224,6 +281,7 @@ public String getDecision() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDecision(String decision) { this.decision = decision; + isSetDecision = true; // mark as set } /** @@ -235,6 +293,7 @@ public void setDecision(String decision) { */ public NetworkTokenNotificationDataV2 id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -258,6 +317,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -270,6 +330,7 @@ public void setId(String id) { */ public NetworkTokenNotificationDataV2 paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -295,6 +356,7 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set } /** @@ -311,6 +373,7 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { */ public NetworkTokenNotificationDataV2 schemeRiskScore(String schemeRiskScore) { this.schemeRiskScore = schemeRiskScore; + isSetSchemeRiskScore = true; // mark as set return this; } @@ -344,6 +407,7 @@ public String getSchemeRiskScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchemeRiskScore(String schemeRiskScore) { this.schemeRiskScore = schemeRiskScore; + isSetSchemeRiskScore = true; // mark as set } /** @@ -355,6 +419,7 @@ public void setSchemeRiskScore(String schemeRiskScore) { */ public NetworkTokenNotificationDataV2 status(String status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -378,6 +443,7 @@ public String getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(String status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -391,6 +457,7 @@ public void setStatus(String status) { */ public NetworkTokenNotificationDataV2 tokenLastFour(String tokenLastFour) { this.tokenLastFour = tokenLastFour; + isSetTokenLastFour = true; // mark as set return this; } @@ -418,6 +485,7 @@ public String getTokenLastFour() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenLastFour(String tokenLastFour) { this.tokenLastFour = tokenLastFour; + isSetTokenLastFour = true; // mark as set } /** @@ -429,6 +497,7 @@ public void setTokenLastFour(String tokenLastFour) { */ public NetworkTokenNotificationDataV2 tokenRequestor(NetworkTokenRequestor tokenRequestor) { this.tokenRequestor = tokenRequestor; + isSetTokenRequestor = true; // mark as set return this; } @@ -452,6 +521,7 @@ public NetworkTokenRequestor getTokenRequestor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenRequestor(NetworkTokenRequestor tokenRequestor) { this.tokenRequestor = tokenRequestor; + isSetTokenRequestor = true; // mark as set } /** @@ -464,6 +534,7 @@ public void setTokenRequestor(NetworkTokenRequestor tokenRequestor) { public NetworkTokenNotificationDataV2 transactionRulesResult( NetworkTokenTransactionRulesResult transactionRulesResult) { this.transactionRulesResult = transactionRulesResult; + isSetTransactionRulesResult = true; // mark as set return this; } @@ -487,6 +558,7 @@ public NetworkTokenTransactionRulesResult getTransactionRulesResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRulesResult(NetworkTokenTransactionRulesResult transactionRulesResult) { this.transactionRulesResult = transactionRulesResult; + isSetTransactionRulesResult = true; // mark as set } /** @@ -498,6 +570,7 @@ public void setTransactionRulesResult(NetworkTokenTransactionRulesResult transac */ public NetworkTokenNotificationDataV2 type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -521,6 +594,7 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set } /** @@ -533,6 +607,7 @@ public void setType(String type) { */ public NetworkTokenNotificationDataV2 validationFacts(List validationFacts) { this.validationFacts = validationFacts; + isSetValidationFacts = true; // mark as set return this; } @@ -567,6 +642,7 @@ public List getValidationFacts() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValidationFacts(List validationFacts) { this.validationFacts = validationFacts; + isSetValidationFacts = true; // mark as set } /** @@ -578,6 +654,7 @@ public void setValidationFacts(List validationFacts) { */ public NetworkTokenNotificationDataV2 wallet(Wallet wallet) { this.wallet = wallet; + isSetWallet = true; // mark as set return this; } @@ -601,6 +678,27 @@ public Wallet getWallet() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWallet(Wallet wallet) { this.wallet = wallet; + isSetWallet = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NetworkTokenNotificationDataV2 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 NetworkTokenNotificationDataV2 object is equal to o. */ @@ -690,6 +788,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 (isSetAuthentication) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION, this.authentication); + } + if (isSetAuthenticationApplied) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_APPLIED, this.authenticationApplied); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetDecision) { + addIfNull(nulls, JSON_PROPERTY_DECISION, this.decision); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + if (isSetSchemeRiskScore) { + addIfNull(nulls, JSON_PROPERTY_SCHEME_RISK_SCORE, this.schemeRiskScore); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTokenLastFour) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_LAST_FOUR, this.tokenLastFour); + } + if (isSetTokenRequestor) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_REQUESTOR, this.tokenRequestor); + } + if (isSetTransactionRulesResult) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULES_RESULT, this.transactionRulesResult); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetValidationFacts) { + addIfNull(nulls, JSON_PROPERTY_VALIDATION_FACTS, this.validationFacts); + } + if (isSetWallet) { + addIfNull(nulls, JSON_PROPERTY_WALLET, this.wallet); + } + + 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 NetworkTokenNotificationDataV2 given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenNotificationRequest.java b/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenNotificationRequest.java index e17f650ab..a323a0f92 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenNotificationRequest.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class NetworkTokenNotificationRequest { public static final String JSON_PROPERTY_DATA = "data"; private NetworkTokenNotificationDataV2 data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + /** The type of webhook. */ public enum TypeEnum { BALANCEPLATFORM_NETWORKTOKEN_CREATED(String.valueOf("balancePlatform.networkToken.created")), @@ -83,6 +94,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 NetworkTokenNotificationRequest() {} /** @@ -94,6 +114,7 @@ public NetworkTokenNotificationRequest() {} */ public NetworkTokenNotificationRequest data(NetworkTokenNotificationDataV2 data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -117,6 +138,7 @@ public NetworkTokenNotificationDataV2 getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(NetworkTokenNotificationDataV2 data) { this.data = data; + isSetData = true; // mark as set } /** @@ -129,6 +151,7 @@ public void setData(NetworkTokenNotificationDataV2 data) { */ public NetworkTokenNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -154,6 +177,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -165,6 +189,7 @@ public void setEnvironment(String environment) { */ public NetworkTokenNotificationRequest timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set return this; } @@ -188,6 +213,7 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set } /** @@ -199,6 +225,7 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public NetworkTokenNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -222,6 +249,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 NetworkTokenNotificationRequest 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 NetworkTokenNotificationRequest object is equal to o. */ @@ -268,6 +316,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NetworkTokenNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenRequestor.java b/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenRequestor.java index 60aa90363..e8b68d052 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenRequestor.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenRequestor.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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 NetworkTokenRequestor { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_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 NetworkTokenRequestor() {} /** @@ -39,6 +53,7 @@ public NetworkTokenRequestor() {} */ public NetworkTokenRequestor id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setId(String id) { */ public NetworkTokenRequestor name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -95,6 +112,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 NetworkTokenRequestor 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 NetworkTokenRequestor object is equal to o. */ @@ -136,6 +174,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + 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 NetworkTokenRequestor given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenRiskRuleData.java b/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenRiskRuleData.java index 6cb95aa83..a19ee28d8 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenRiskRuleData.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenRiskRuleData.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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 NetworkTokenRiskRuleData { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_OUTCOME_TYPE = "outcomeType"; private String outcomeType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutcomeType = 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_SCORE = "score"; private Integer score; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScore = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NetworkTokenRiskRuleData() {} /** @@ -51,6 +74,7 @@ public NetworkTokenRiskRuleData() {} */ public NetworkTokenRiskRuleData description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -74,6 +98,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setDescription(String description) { */ public NetworkTokenRiskRuleData id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setId(String id) { */ public NetworkTokenRiskRuleData outcomeType(String outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set return this; } @@ -140,6 +168,7 @@ public String getOutcomeType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOutcomeType(String outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setOutcomeType(String outcomeType) { */ public NetworkTokenRiskRuleData reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -173,6 +203,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -183,6 +214,7 @@ public void setReference(String reference) { */ public NetworkTokenRiskRuleData score(Integer score) { this.score = score; + isSetScore = true; // mark as set return this; } @@ -206,6 +238,27 @@ public Integer getScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScore(Integer score) { this.score = score; + isSetScore = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NetworkTokenRiskRuleData 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 NetworkTokenRiskRuleData object is equal to o. */ @@ -253,6 +306,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetOutcomeType) { + addIfNull(nulls, JSON_PROPERTY_OUTCOME_TYPE, this.outcomeType); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetScore) { + addIfNull(nulls, JSON_PROPERTY_SCORE, this.score); + } + + 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 NetworkTokenRiskRuleData given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenRiskRuleSource.java b/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenRiskRuleSource.java index 4a5f85e4f..d3c00bcee 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenRiskRuleSource.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenRiskRuleSource.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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 NetworkTokenRiskRuleSource { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 NetworkTokenRiskRuleSource() {} /** @@ -39,6 +53,7 @@ public NetworkTokenRiskRuleSource() {} */ public NetworkTokenRiskRuleSource id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -78,6 +94,7 @@ public void setId(String id) { */ public NetworkTokenRiskRuleSource type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -113,6 +130,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NetworkTokenRiskRuleSource 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 NetworkTokenRiskRuleSource object is equal to o. */ @@ -154,6 +192,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + 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 NetworkTokenRiskRuleSource given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenTransactionRulesResult.java b/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenTransactionRulesResult.java index 3a6444eeb..f33f0de15 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenTransactionRulesResult.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenTransactionRulesResult.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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,16 +32,34 @@ public class NetworkTokenTransactionRulesResult { public static final String JSON_PROPERTY_ADVICE = "advice"; private String advice; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdvice = false; + public static final String JSON_PROPERTY_ALL_HARD_BLOCK_RULES_PASSED = "allHardBlockRulesPassed"; private Boolean allHardBlockRulesPassed; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllHardBlockRulesPassed = false; + public static final String JSON_PROPERTY_SCORE = "score"; private Integer score; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScore = false; + public static final String JSON_PROPERTY_TRIGGERED_TRANSACTION_RULES = "triggeredTransactionRules"; private List triggeredTransactionRules; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTriggeredTransactionRules = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NetworkTokenTransactionRulesResult() {} /** @@ -51,6 +71,7 @@ public NetworkTokenTransactionRulesResult() {} */ public NetworkTokenTransactionRulesResult advice(String advice) { this.advice = advice; + isSetAdvice = true; // mark as set return this; } @@ -74,6 +95,7 @@ public String getAdvice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdvice(String advice) { this.advice = advice; + isSetAdvice = true; // mark as set } /** @@ -87,6 +109,7 @@ public void setAdvice(String advice) { public NetworkTokenTransactionRulesResult allHardBlockRulesPassed( Boolean allHardBlockRulesPassed) { this.allHardBlockRulesPassed = allHardBlockRulesPassed; + isSetAllHardBlockRulesPassed = true; // mark as set return this; } @@ -112,6 +135,7 @@ public Boolean getAllHardBlockRulesPassed() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { this.allHardBlockRulesPassed = allHardBlockRulesPassed; + isSetAllHardBlockRulesPassed = true; // mark as set } /** @@ -123,6 +147,7 @@ public void setAllHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { */ public NetworkTokenTransactionRulesResult score(Integer score) { this.score = score; + isSetScore = true; // mark as set return this; } @@ -146,6 +171,7 @@ public Integer getScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScore(Integer score) { this.score = score; + isSetScore = true; // mark as set } /** @@ -159,6 +185,7 @@ public void setScore(Integer score) { public NetworkTokenTransactionRulesResult triggeredTransactionRules( List triggeredTransactionRules) { this.triggeredTransactionRules = triggeredTransactionRules; + isSetTriggeredTransactionRules = true; // mark as set return this; } @@ -194,6 +221,27 @@ public List getTriggeredTransactionRules() { public void setTriggeredTransactionRules( List triggeredTransactionRules) { this.triggeredTransactionRules = triggeredTransactionRules; + isSetTriggeredTransactionRules = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NetworkTokenTransactionRulesResult 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 NetworkTokenTransactionRulesResult object is equal to o. */ @@ -248,6 +296,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 (isSetAdvice) { + addIfNull(nulls, JSON_PROPERTY_ADVICE, this.advice); + } + if (isSetAllHardBlockRulesPassed) { + addIfNull(nulls, JSON_PROPERTY_ALL_HARD_BLOCK_RULES_PASSED, this.allHardBlockRulesPassed); + } + if (isSetScore) { + addIfNull(nulls, JSON_PROPERTY_SCORE, this.score); + } + if (isSetTriggeredTransactionRules) { + addIfNull(nulls, JSON_PROPERTY_TRIGGERED_TRANSACTION_RULES, this.triggeredTransactionRules); + } + + 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 NetworkTokenTransactionRulesResult given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenTriggeredRiskRule.java b/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenTriggeredRiskRule.java index b9e7c9203..4f3172102 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenTriggeredRiskRule.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/NetworkTokenTriggeredRiskRule.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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 NetworkTokenTriggeredRiskRule { public static final String JSON_PROPERTY_REASON = "reason"; private String reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_TRANSACTION_RULE = "transactionRule"; private NetworkTokenRiskRuleData transactionRule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRule = false; + public static final String JSON_PROPERTY_TRANSACTION_RULE_SOURCE = "transactionRuleSource"; private NetworkTokenRiskRuleSource transactionRuleSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRuleSource = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NetworkTokenTriggeredRiskRule() {} /** @@ -44,6 +61,7 @@ public NetworkTokenTriggeredRiskRule() {} */ public NetworkTokenTriggeredRiskRule reason(String reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -67,6 +85,7 @@ public String getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(String reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -78,6 +97,7 @@ public void setReason(String reason) { */ public NetworkTokenTriggeredRiskRule transactionRule(NetworkTokenRiskRuleData transactionRule) { this.transactionRule = transactionRule; + isSetTransactionRule = true; // mark as set return this; } @@ -101,6 +121,7 @@ public NetworkTokenRiskRuleData getTransactionRule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRule(NetworkTokenRiskRuleData transactionRule) { this.transactionRule = transactionRule; + isSetTransactionRule = true; // mark as set } /** @@ -113,6 +134,7 @@ public void setTransactionRule(NetworkTokenRiskRuleData transactionRule) { public NetworkTokenTriggeredRiskRule transactionRuleSource( NetworkTokenRiskRuleSource transactionRuleSource) { this.transactionRuleSource = transactionRuleSource; + isSetTransactionRuleSource = true; // mark as set return this; } @@ -136,6 +158,27 @@ public NetworkTokenRiskRuleSource getTransactionRuleSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRuleSource(NetworkTokenRiskRuleSource transactionRuleSource) { this.transactionRuleSource = transactionRuleSource; + isSetTransactionRuleSource = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NetworkTokenTriggeredRiskRule 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 NetworkTokenTriggeredRiskRule object is equal to o. */ @@ -182,6 +225,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 (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetTransactionRule) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULE, this.transactionRule); + } + if (isSetTransactionRuleSource) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULE_SOURCE, this.transactionRuleSource); + } + + 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 NetworkTokenTriggeredRiskRule given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrument.java b/src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrument.java index fb4aad75d..d5d23948a 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrument.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrument.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +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; @@ -48,36 +50,69 @@ public class PaymentInstrument { private List additionalBankAccountIdentifications; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalBankAccountIdentifications = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountDetails bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = 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_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_ISSUING_COUNTRY_CODE = "issuingCountryCode"; private String issuingCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuingCountryCode = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_GROUP_ID = "paymentInstrumentGroupId"; private String paymentInstrumentGroupId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentGroupId = 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_REPLACED_BY_ID = "replacedById"; private String replacedById; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReplacedById = false; + public static final String JSON_PROPERTY_REPLACEMENT_OF_ID = "replacementOfId"; private String replacementOfId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReplacementOfId = false; + /** * The status of the payment instrument. If a status is not specified when creating a payment * instrument, it is set to **active** by default. However, there can be exceptions for cards @@ -135,9 +170,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_STATUS_COMMENT = "statusComment"; private String statusComment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusComment = false; + /** * The reason for the status of the payment instrument. Possible values: **accountClosure**, * **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, @@ -201,6 +242,9 @@ public static StatusReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS_REASON = "statusReason"; private StatusReasonEnum statusReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusReason = false; + /** The type of payment instrument. Possible values: **card**, **bankAccount**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("bankAccount")), @@ -245,6 +289,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 PaymentInstrument() {} /** @@ -262,6 +315,7 @@ public PaymentInstrument additionalBankAccountIdentifications( List additionalBankAccountIdentifications) { this.additionalBankAccountIdentifications = additionalBankAccountIdentifications; + isSetAdditionalBankAccountIdentifications = true; // mark as set return this; } @@ -309,6 +363,7 @@ public void setAdditionalBankAccountIdentifications( List additionalBankAccountIdentifications) { this.additionalBankAccountIdentifications = additionalBankAccountIdentifications; + isSetAdditionalBankAccountIdentifications = true; // mark as set } /** @@ -323,6 +378,7 @@ public void setAdditionalBankAccountIdentifications( */ public PaymentInstrument balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -354,6 +410,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -364,6 +421,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public PaymentInstrument bankAccount(BankAccountDetails bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -387,6 +445,7 @@ public BankAccountDetails getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountDetails bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -397,6 +456,7 @@ public void setBankAccount(BankAccountDetails bankAccount) { */ public PaymentInstrument card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -420,6 +480,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -430,6 +491,7 @@ public void setCard(Card card) { */ public PaymentInstrument description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -453,6 +515,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -463,6 +526,7 @@ public void setDescription(String description) { */ public PaymentInstrument id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -486,6 +550,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -499,6 +564,7 @@ public void setId(String id) { */ public PaymentInstrument issuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set return this; } @@ -528,6 +594,7 @@ public String getIssuingCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set } /** @@ -542,6 +609,7 @@ public void setIssuingCountryCode(String issuingCountryCode) { */ public PaymentInstrument paymentInstrumentGroupId(String paymentInstrumentGroupId) { this.paymentInstrumentGroupId = paymentInstrumentGroupId; + isSetPaymentInstrumentGroupId = true; // mark as set return this; } @@ -573,6 +641,7 @@ public String getPaymentInstrumentGroupId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentGroupId(String paymentInstrumentGroupId) { this.paymentInstrumentGroupId = paymentInstrumentGroupId; + isSetPaymentInstrumentGroupId = true; // mark as set } /** @@ -583,6 +652,7 @@ public void setPaymentInstrumentGroupId(String paymentInstrumentGroupId) { */ public PaymentInstrument reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -606,6 +676,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -617,6 +688,7 @@ public void setReference(String reference) { */ public PaymentInstrument replacedById(String replacedById) { this.replacedById = replacedById; + isSetReplacedById = true; // mark as set return this; } @@ -642,6 +714,7 @@ public String getReplacedById() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReplacedById(String replacedById) { this.replacedById = replacedById; + isSetReplacedById = true; // mark as set } /** @@ -653,6 +726,7 @@ public void setReplacedById(String replacedById) { */ public PaymentInstrument replacementOfId(String replacementOfId) { this.replacementOfId = replacementOfId; + isSetReplacementOfId = true; // mark as set return this; } @@ -678,6 +752,7 @@ public String getReplacementOfId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReplacementOfId(String replacementOfId) { this.replacementOfId = replacementOfId; + isSetReplacementOfId = true; // mark as set } /** @@ -703,6 +778,7 @@ public void setReplacementOfId(String replacementOfId) { */ public PaymentInstrument status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -756,6 +832,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -768,6 +845,7 @@ public void setStatus(StatusEnum status) { */ public PaymentInstrument statusComment(String statusComment) { this.statusComment = statusComment; + isSetStatusComment = true; // mark as set return this; } @@ -795,6 +873,7 @@ public String getStatusComment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusComment(String statusComment) { this.statusComment = statusComment; + isSetStatusComment = true; // mark as set } /** @@ -811,6 +890,7 @@ public void setStatusComment(String statusComment) { */ public PaymentInstrument statusReason(StatusReasonEnum statusReason) { this.statusReason = statusReason; + isSetStatusReason = true; // mark as set return this; } @@ -846,6 +926,7 @@ public StatusReasonEnum getStatusReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusReason(StatusReasonEnum statusReason) { this.statusReason = statusReason; + isSetStatusReason = true; // mark as set } /** @@ -856,6 +937,7 @@ public void setStatusReason(StatusReasonEnum statusReason) { */ public PaymentInstrument type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -879,6 +961,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 PaymentInstrument 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 PaymentInstrument object is equal to o. */ @@ -967,6 +1070,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 (isSetAdditionalBankAccountIdentifications) { + addIfNull( + nulls, + JSON_PROPERTY_ADDITIONAL_BANK_ACCOUNT_IDENTIFICATIONS, + this.additionalBankAccountIdentifications); + } + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetIssuingCountryCode) { + addIfNull(nulls, JSON_PROPERTY_ISSUING_COUNTRY_CODE, this.issuingCountryCode); + } + if (isSetPaymentInstrumentGroupId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_GROUP_ID, this.paymentInstrumentGroupId); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReplacedById) { + addIfNull(nulls, JSON_PROPERTY_REPLACED_BY_ID, this.replacedById); + } + if (isSetReplacementOfId) { + addIfNull(nulls, JSON_PROPERTY_REPLACEMENT_OF_ID, this.replacementOfId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetStatusComment) { + addIfNull(nulls, JSON_PROPERTY_STATUS_COMMENT, this.statusComment); + } + if (isSetStatusReason) { + addIfNull(nulls, JSON_PROPERTY_STATUS_REASON, this.statusReason); + } + 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 PaymentInstrument given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrumentNotificationData.java b/src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrumentNotificationData.java index 3d37771ab..794948c64 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrumentNotificationData.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrumentNotificationData.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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 PaymentInstrumentNotificationData { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT = "paymentInstrument"; private PaymentInstrument paymentInstrument; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrument = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrumentNotificationData() {} /** @@ -40,6 +54,7 @@ public PaymentInstrumentNotificationData() {} */ public PaymentInstrumentNotificationData balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -63,6 +78,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setBalancePlatform(String balancePlatform) { */ public PaymentInstrumentNotificationData paymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set return this; } @@ -97,6 +114,27 @@ public PaymentInstrument getPaymentInstrument() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrumentNotificationData 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 PaymentInstrumentNotificationData object is equal to o. */ @@ -140,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 (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetPaymentInstrument) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT, this.paymentInstrument); + } + + 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 PaymentInstrumentNotificationData given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/PaymentNotificationRequest.java b/src/main/java/com/adyen/model/configurationwebhooks/PaymentNotificationRequest.java index 09d8479b5..af23386bd 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/PaymentNotificationRequest.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/PaymentNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class PaymentNotificationRequest { public static final String JSON_PROPERTY_DATA = "data"; private PaymentInstrumentNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + /** Type of webhook. */ public enum TypeEnum { BALANCEPLATFORM_PAYMENTINSTRUMENT_CREATED( @@ -85,6 +96,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 PaymentNotificationRequest() {} /** @@ -95,6 +115,7 @@ public PaymentNotificationRequest() {} */ public PaymentNotificationRequest data(PaymentInstrumentNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -118,6 +139,7 @@ public PaymentInstrumentNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(PaymentInstrumentNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -129,6 +151,7 @@ public void setData(PaymentInstrumentNotificationData data) { */ public PaymentNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -154,6 +177,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -164,6 +188,7 @@ public void setEnvironment(String environment) { */ public PaymentNotificationRequest timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set return this; } @@ -187,6 +212,7 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set } /** @@ -197,6 +223,7 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public PaymentNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -220,6 +247,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 PaymentNotificationRequest 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 PaymentNotificationRequest object is equal to o. */ @@ -265,6 +313,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/Phone.java b/src/main/java/com/adyen/model/configurationwebhooks/Phone.java index 08460eb12..0a26fbb43 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/Phone.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/Phone.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +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; @@ -27,6 +29,9 @@ public class Phone { public static final String JSON_PROPERTY_NUMBER = "number"; private String number; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + /** Type of phone number. Possible values: **Landline**, **Mobile**. */ public enum TypeEnum { LANDLINE(String.valueOf("landline")), @@ -71,6 +76,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 Phone() {} /** @@ -84,6 +98,7 @@ public Phone() {} */ public Phone number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -113,6 +128,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -123,6 +139,7 @@ public void setNumber(String number) { */ public Phone type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -146,6 +163,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 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. */ @@ -186,6 +224,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 (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + 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 Phone given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/PhoneNumber.java b/src/main/java/com/adyen/model/configurationwebhooks/PhoneNumber.java index d746ec95a..1daeb2905 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/PhoneNumber.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/PhoneNumber.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +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,9 +33,15 @@ public class PhoneNumber { public static final String JSON_PROPERTY_PHONE_COUNTRY_CODE = "phoneCountryCode"; private String phoneCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneCountryCode = false; + public static final String JSON_PROPERTY_PHONE_NUMBER = "phoneNumber"; private String phoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneNumber = false; + /** The type of the phone number. Possible values: **Landline**, **Mobile**, **SIP**, **Fax**. */ public enum PhoneTypeEnum { FAX(String.valueOf("Fax")), @@ -82,6 +90,15 @@ public static PhoneTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_PHONE_TYPE = "phoneType"; private PhoneTypeEnum phoneType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PhoneNumber() {} /** @@ -94,6 +111,7 @@ public PhoneNumber() {} */ public PhoneNumber phoneCountryCode(String phoneCountryCode) { this.phoneCountryCode = phoneCountryCode; + isSetPhoneCountryCode = true; // mark as set return this; } @@ -121,6 +139,7 @@ public String getPhoneCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhoneCountryCode(String phoneCountryCode) { this.phoneCountryCode = phoneCountryCode; + isSetPhoneCountryCode = true; // mark as set } /** @@ -132,6 +151,7 @@ public void setPhoneCountryCode(String phoneCountryCode) { */ public PhoneNumber phoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set return this; } @@ -157,6 +177,7 @@ public String getPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set } /** @@ -168,6 +189,7 @@ public void setPhoneNumber(String phoneNumber) { */ public PhoneNumber phoneType(PhoneTypeEnum phoneType) { this.phoneType = phoneType; + isSetPhoneType = true; // mark as set return this; } @@ -193,6 +215,27 @@ public PhoneTypeEnum getPhoneType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhoneType(PhoneTypeEnum phoneType) { this.phoneType = phoneType; + isSetPhoneType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PhoneNumber 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 PhoneNumber object is equal to o. */ @@ -236,6 +279,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 (isSetPhoneCountryCode) { + addIfNull(nulls, JSON_PROPERTY_PHONE_COUNTRY_CODE, this.phoneCountryCode); + } + if (isSetPhoneNumber) { + addIfNull(nulls, JSON_PROPERTY_PHONE_NUMBER, this.phoneNumber); + } + if (isSetPhoneType) { + addIfNull(nulls, JSON_PROPERTY_PHONE_TYPE, this.phoneType); + } + + 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 PhoneNumber given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/PlatformPaymentConfiguration.java b/src/main/java/com/adyen/model/configurationwebhooks/PlatformPaymentConfiguration.java index 376a23994..0f91a4dde 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/PlatformPaymentConfiguration.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/PlatformPaymentConfiguration.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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 PlatformPaymentConfiguration { public static final String JSON_PROPERTY_SALES_DAY_CLOSING_TIME = "salesDayClosingTime"; private String salesDayClosingTime; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSalesDayClosingTime = false; + public static final String JSON_PROPERTY_SETTLEMENT_DELAY_DAYS = "settlementDelayDays"; private Integer settlementDelayDays; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSettlementDelayDays = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PlatformPaymentConfiguration() {} /** @@ -43,6 +57,7 @@ public PlatformPaymentConfiguration() {} */ public PlatformPaymentConfiguration salesDayClosingTime(String salesDayClosingTime) { this.salesDayClosingTime = salesDayClosingTime; + isSetSalesDayClosingTime = true; // mark as set return this; } @@ -74,6 +89,7 @@ public String getSalesDayClosingTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSalesDayClosingTime(String salesDayClosingTime) { this.salesDayClosingTime = salesDayClosingTime; + isSetSalesDayClosingTime = true; // mark as set } /** @@ -87,6 +103,7 @@ public void setSalesDayClosingTime(String salesDayClosingTime) { */ public PlatformPaymentConfiguration settlementDelayDays(Integer settlementDelayDays) { this.settlementDelayDays = settlementDelayDays; + isSetSettlementDelayDays = true; // mark as set return this; } @@ -116,6 +133,27 @@ public Integer getSettlementDelayDays() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSettlementDelayDays(Integer settlementDelayDays) { this.settlementDelayDays = settlementDelayDays; + isSetSettlementDelayDays = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PlatformPaymentConfiguration 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 PlatformPaymentConfiguration object is equal to o. */ @@ -163,6 +201,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 (isSetSalesDayClosingTime) { + addIfNull(nulls, JSON_PROPERTY_SALES_DAY_CLOSING_TIME, this.salesDayClosingTime); + } + if (isSetSettlementDelayDays) { + addIfNull(nulls, JSON_PROPERTY_SETTLEMENT_DELAY_DAYS, this.settlementDelayDays); + } + + 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 PlatformPaymentConfiguration given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/RemediatingAction.java b/src/main/java/com/adyen/model/configurationwebhooks/RemediatingAction.java index 92f4cef85..151a90b93 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/RemediatingAction.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/RemediatingAction.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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 RemediatingAction { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RemediatingAction() {} /** @@ -36,6 +50,7 @@ public RemediatingAction() {} */ public RemediatingAction code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCode(String code) { */ public RemediatingAction message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RemediatingAction 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 RemediatingAction object is equal to o. */ @@ -133,6 +171,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 (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + + 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 RemediatingAction given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/Resource.java b/src/main/java/com/adyen/model/configurationwebhooks/Resource.java index 90f36aea5..653b3909e 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/Resource.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/Resource.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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,12 +30,27 @@ public class Resource { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Resource() {} /** @@ -44,6 +61,7 @@ public Resource() {} */ public Resource balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -67,6 +85,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -79,6 +98,7 @@ public void setBalancePlatform(String balancePlatform) { */ public Resource creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -106,6 +126,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -116,6 +137,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public Resource id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -139,6 +161,27 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Resource 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 Resource object is equal to o. */ @@ -182,6 +225,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 (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + + 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 Resource given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/ResourceReference.java b/src/main/java/com/adyen/model/configurationwebhooks/ResourceReference.java index a015a573b..de6df6f84 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/ResourceReference.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/ResourceReference.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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 ResourceReference { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResourceReference() {} /** @@ -43,6 +60,7 @@ public ResourceReference() {} */ public ResourceReference description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setDescription(String description) { */ public ResourceReference id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setId(String id) { */ public ResourceReference 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 ResourceReference includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResourceReference object is equal to o. */ @@ -175,6 +218,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResourceReference given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/ScoreNotificationRequest.java b/src/main/java/com/adyen/model/configurationwebhooks/ScoreNotificationRequest.java index e25fb7b3e..8b8aa2baf 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/ScoreNotificationRequest.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/ScoreNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class ScoreNotificationRequest { public static final String JSON_PROPERTY_DATA = "data"; private BankScoreSignalTriggeredData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + /** Type of webhook. */ public enum TypeEnum { BALANCEPLATFORM_SCORE_TRIGGERED(String.valueOf("balancePlatform.score.triggered")); @@ -81,6 +92,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 ScoreNotificationRequest() {} /** @@ -91,6 +111,7 @@ public ScoreNotificationRequest() {} */ public ScoreNotificationRequest data(BankScoreSignalTriggeredData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -114,6 +135,7 @@ public BankScoreSignalTriggeredData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(BankScoreSignalTriggeredData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -125,6 +147,7 @@ public void setData(BankScoreSignalTriggeredData data) { */ public ScoreNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -150,6 +173,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -160,6 +184,7 @@ public void setEnvironment(String environment) { */ public ScoreNotificationRequest timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set return this; } @@ -183,6 +208,7 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set } /** @@ -193,6 +219,7 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public ScoreNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -216,6 +243,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 ScoreNotificationRequest 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 ScoreNotificationRequest object is equal to o. */ @@ -261,6 +309,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ScoreNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationNotificationData.java b/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationNotificationData.java index 55bcb7120..5f118b91a 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationNotificationData.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationNotificationData.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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 SweepConfigurationNotificationData { public static final String JSON_PROPERTY_ACCOUNT_ID = "accountId"; private String accountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountId = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_SWEEP = "sweep"; private SweepConfigurationV2 sweep; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSweep = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SweepConfigurationNotificationData() {} /** @@ -45,6 +62,7 @@ public SweepConfigurationNotificationData() {} */ public SweepConfigurationNotificationData accountId(String accountId) { this.accountId = accountId; + isSetAccountId = true; // mark as set return this; } @@ -70,6 +88,7 @@ public String getAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountId(String accountId) { this.accountId = accountId; + isSetAccountId = true; // mark as set } /** @@ -81,6 +100,7 @@ public void setAccountId(String accountId) { */ public SweepConfigurationNotificationData balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -104,6 +124,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -115,6 +136,7 @@ public void setBalancePlatform(String balancePlatform) { */ public SweepConfigurationNotificationData sweep(SweepConfigurationV2 sweep) { this.sweep = sweep; + isSetSweep = true; // mark as set return this; } @@ -138,6 +160,27 @@ public SweepConfigurationV2 getSweep() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSweep(SweepConfigurationV2 sweep) { this.sweep = sweep; + isSetSweep = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SweepConfigurationNotificationData 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 SweepConfigurationNotificationData object is equal to o. */ @@ -182,6 +225,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 (isSetAccountId) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_ID, this.accountId); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetSweep) { + addIfNull(nulls, JSON_PROPERTY_SWEEP, this.sweep); + } + + 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 SweepConfigurationNotificationData given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationNotificationRequest.java b/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationNotificationRequest.java index fe3140ab2..9d6e27152 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationNotificationRequest.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class SweepConfigurationNotificationRequest { public static final String JSON_PROPERTY_DATA = "data"; private SweepConfigurationNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + /** Type of webhook. */ public enum TypeEnum { BALANCEPLATFORM_BALANCEACCOUNTSWEEP_CREATED( @@ -88,6 +99,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 SweepConfigurationNotificationRequest() {} /** @@ -99,6 +119,7 @@ public SweepConfigurationNotificationRequest() {} */ public SweepConfigurationNotificationRequest data(SweepConfigurationNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -122,6 +143,7 @@ public SweepConfigurationNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(SweepConfigurationNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -134,6 +156,7 @@ public void setData(SweepConfigurationNotificationData data) { */ public SweepConfigurationNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -159,6 +182,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -170,6 +194,7 @@ public void setEnvironment(String environment) { */ public SweepConfigurationNotificationRequest timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set return this; } @@ -193,6 +218,7 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set } /** @@ -204,6 +230,7 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public SweepConfigurationNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -227,6 +254,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 SweepConfigurationNotificationRequest 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 SweepConfigurationNotificationRequest object is equal to o. */ @@ -273,6 +321,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SweepConfigurationNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationV2.java b/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationV2.java index 228e1fac8..0eea6c987 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationV2.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationV2.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +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; @@ -96,18 +98,33 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private SweepCounterparty counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + /** Gets or Sets priorities */ public enum PrioritiesEnum { CROSSBORDER(String.valueOf("crossBorder")), @@ -160,6 +177,9 @@ public static PrioritiesEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITIES = "priorities"; private List priorities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriorities = false; + /** The reason for disabling the sweep. */ public enum ReasonEnum { ACCOUNTHIERARCHYNOTACTIVE(String.valueOf("accountHierarchyNotActive")), @@ -209,6 +229,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -251,18 +273,33 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_REASON_DETAIL = "reasonDetail"; private String reasonDetail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReasonDetail = 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_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; private String referenceForBeneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + public static final String JSON_PROPERTY_SCHEDULE = "schedule"; private SweepSchedule schedule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchedule = false; + /** * The status of the sweep. If not provided, by default, this is set to **active**. Possible * values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on @@ -311,15 +348,27 @@ 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_SWEEP_AMOUNT = "sweepAmount"; private Amount sweepAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSweepAmount = false; + public static final String JSON_PROPERTY_TARGET_AMOUNT = "targetAmount"; private Amount targetAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTargetAmount = false; + public static final String JSON_PROPERTY_TRIGGER_AMOUNT = "triggerAmount"; private Amount triggerAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTriggerAmount = false; + /** * The direction of sweep, whether pushing out or pulling in funds to the balance account. If not * provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to @@ -369,6 +418,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 SweepConfigurationV2() {} /** @@ -389,6 +447,7 @@ public SweepConfigurationV2() {} */ public SweepConfigurationV2 category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } @@ -432,6 +491,7 @@ public CategoryEnum getCategory() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -442,6 +502,7 @@ public void setCategory(CategoryEnum category) { */ public SweepConfigurationV2 counterparty(SweepCounterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -465,6 +526,7 @@ public SweepCounterparty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(SweepCounterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -481,6 +543,7 @@ public void setCounterparty(SweepCounterparty counterparty) { */ public SweepConfigurationV2 currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -516,6 +579,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -530,6 +594,7 @@ public void setCurrency(String currency) { */ public SweepConfigurationV2 description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -561,6 +626,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -571,6 +637,7 @@ public void setDescription(String description) { */ public SweepConfigurationV2 id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -594,6 +661,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -605,14 +673,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 +696,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) @@ -645,6 +713,7 @@ public void setId(String id) { */ public SweepConfigurationV2 priorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set return this; } @@ -665,14 +734,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 +757,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 +786,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 +809,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) @@ -758,6 +827,7 @@ public List getPriorities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set } /** @@ -768,6 +838,7 @@ public void setPriorities(List priorities) { */ public SweepConfigurationV2 reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -791,6 +862,7 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -801,6 +873,7 @@ public void setReason(ReasonEnum reason) { */ public SweepConfigurationV2 reasonDetail(String reasonDetail) { this.reasonDetail = reasonDetail; + isSetReasonDetail = true; // mark as set return this; } @@ -824,6 +897,7 @@ public String getReasonDetail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReasonDetail(String reasonDetail) { this.reasonDetail = reasonDetail; + isSetReasonDetail = true; // mark as set } /** @@ -834,6 +908,7 @@ public void setReasonDetail(String reasonDetail) { */ public SweepConfigurationV2 reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -857,6 +932,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -869,6 +945,7 @@ public void setReference(String reference) { */ public SweepConfigurationV2 referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -896,6 +973,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -906,6 +984,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public SweepConfigurationV2 schedule(SweepSchedule schedule) { this.schedule = schedule; + isSetSchedule = true; // mark as set return this; } @@ -929,6 +1008,7 @@ public SweepSchedule getSchedule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchedule(SweepSchedule schedule) { this.schedule = schedule; + isSetSchedule = true; // mark as set } /** @@ -944,6 +1024,7 @@ public void setSchedule(SweepSchedule schedule) { */ public SweepConfigurationV2 status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -977,6 +1058,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -987,6 +1069,7 @@ public void setStatus(StatusEnum status) { */ public SweepConfigurationV2 sweepAmount(Amount sweepAmount) { this.sweepAmount = sweepAmount; + isSetSweepAmount = true; // mark as set return this; } @@ -1010,6 +1093,7 @@ public Amount getSweepAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSweepAmount(Amount sweepAmount) { this.sweepAmount = sweepAmount; + isSetSweepAmount = true; // mark as set } /** @@ -1020,6 +1104,7 @@ public void setSweepAmount(Amount sweepAmount) { */ public SweepConfigurationV2 targetAmount(Amount targetAmount) { this.targetAmount = targetAmount; + isSetTargetAmount = true; // mark as set return this; } @@ -1043,6 +1128,7 @@ public Amount getTargetAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTargetAmount(Amount targetAmount) { this.targetAmount = targetAmount; + isSetTargetAmount = true; // mark as set } /** @@ -1053,6 +1139,7 @@ public void setTargetAmount(Amount targetAmount) { */ public SweepConfigurationV2 triggerAmount(Amount triggerAmount) { this.triggerAmount = triggerAmount; + isSetTriggerAmount = true; // mark as set return this; } @@ -1076,6 +1163,7 @@ public Amount getTriggerAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTriggerAmount(Amount triggerAmount) { this.triggerAmount = triggerAmount; + isSetTriggerAmount = true; // mark as set } /** @@ -1092,6 +1180,7 @@ public void setTriggerAmount(Amount triggerAmount) { */ public SweepConfigurationV2 type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1127,6 +1216,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 SweepConfigurationV2 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 SweepConfigurationV2 object is equal to o. */ @@ -1215,6 +1325,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 (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPriorities) { + addIfNull(nulls, JSON_PROPERTY_PRIORITIES, this.priorities); + } + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetReasonDetail) { + addIfNull(nulls, JSON_PROPERTY_REASON_DETAIL, this.reasonDetail); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetSchedule) { + addIfNull(nulls, JSON_PROPERTY_SCHEDULE, this.schedule); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetSweepAmount) { + addIfNull(nulls, JSON_PROPERTY_SWEEP_AMOUNT, this.sweepAmount); + } + if (isSetTargetAmount) { + addIfNull(nulls, JSON_PROPERTY_TARGET_AMOUNT, this.targetAmount); + } + if (isSetTriggerAmount) { + addIfNull(nulls, JSON_PROPERTY_TRIGGER_AMOUNT, this.triggerAmount); + } + 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 SweepConfigurationV2 given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/SweepCounterparty.java b/src/main/java/com/adyen/model/configurationwebhooks/SweepCounterparty.java index 3334d36cb..094d21b80 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/SweepCounterparty.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/SweepCounterparty.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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 SweepCounterparty { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SweepCounterparty() {} /** @@ -49,6 +66,7 @@ public SweepCounterparty() {} */ public SweepCounterparty balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -84,6 +102,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -97,6 +116,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public SweepCounterparty merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -126,6 +146,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -155,6 +176,7 @@ public void setMerchantAccount(String merchantAccount) { */ public SweepCounterparty transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -216,6 +238,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SweepCounterparty 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 SweepCounterparty object is equal to o. */ @@ -261,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 (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + 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 SweepCounterparty given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/SweepSchedule.java b/src/main/java/com/adyen/model/configurationwebhooks/SweepSchedule.java index 34cb25fa4..0093b1162 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/SweepSchedule.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/SweepSchedule.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +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; @@ -27,6 +29,9 @@ public class SweepSchedule { public static final String JSON_PROPERTY_CRON_EXPRESSION = "cronExpression"; private String cronExpression; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCronExpression = false; + /** * The schedule type. Possible values: * **cron**: push out funds based on a * `cronExpression`. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: @@ -83,6 +88,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 SweepSchedule() {} /** @@ -108,6 +122,7 @@ public SweepSchedule() {} */ public SweepSchedule cronExpression(String cronExpression) { this.cronExpression = cronExpression; + isSetCronExpression = true; // mark as set return this; } @@ -161,6 +176,7 @@ public String getCronExpression() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCronExpression(String cronExpression) { this.cronExpression = cronExpression; + isSetCronExpression = true; // mark as set } /** @@ -179,6 +195,7 @@ public void setCronExpression(String cronExpression) { */ public SweepSchedule type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -218,6 +235,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 SweepSchedule 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 SweepSchedule object is equal to o. */ @@ -259,6 +297,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 (isSetCronExpression) { + addIfNull(nulls, JSON_PROPERTY_CRON_EXPRESSION, this.cronExpression); + } + 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 SweepSchedule given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/TokenAuthentication.java b/src/main/java/com/adyen/model/configurationwebhooks/TokenAuthentication.java index e5ec7a521..f91275ef7 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/TokenAuthentication.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/TokenAuthentication.java @@ -11,6 +11,8 @@ package com.adyen.model.configurationwebhooks; +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 TokenAuthentication { public static final String JSON_PROPERTY_METHOD = "method"; private String method; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMethod = false; + public static final String JSON_PROPERTY_RESULT = "result"; private String result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResult = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TokenAuthentication() {} /** @@ -41,6 +55,7 @@ public TokenAuthentication() {} */ public TokenAuthentication method(String method) { this.method = method; + isSetMethod = true; // mark as set return this; } @@ -68,6 +83,7 @@ public String getMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMethod(String method) { this.method = method; + isSetMethod = true; // mark as set } /** @@ -78,6 +94,7 @@ public void setMethod(String method) { */ public TokenAuthentication result(String result) { this.result = result; + isSetResult = true; // mark as set return this; } @@ -101,6 +118,27 @@ public String getResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResult(String result) { this.result = result; + isSetResult = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TokenAuthentication 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 TokenAuthentication object is equal to o. */ @@ -142,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 (isSetMethod) { + addIfNull(nulls, JSON_PROPERTY_METHOD, this.method); + } + if (isSetResult) { + addIfNull(nulls, JSON_PROPERTY_RESULT, this.result); + } + + 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 TokenAuthentication given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/ValidationFacts.java b/src/main/java/com/adyen/model/configurationwebhooks/ValidationFacts.java index 6d65ae64c..57c1a35dc 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/ValidationFacts.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/ValidationFacts.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +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 ValidationFacts { public static final String JSON_PROPERTY_REASONS = "reasons"; private List reasons; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReasons = false; + /** * The evaluation result of the validation facts. Possible values: **valid**, **invalid**, * **notValidated**, **notApplicable**. @@ -84,9 +89,21 @@ public static ResultEnum fromValue(String value) { public static final String JSON_PROPERTY_RESULT = "result"; private ResultEnum result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResult = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 ValidationFacts() {} /** @@ -101,6 +118,7 @@ public ValidationFacts() {} */ public ValidationFacts reasons(List reasons) { this.reasons = reasons; + isSetReasons = true; // mark as set return this; } @@ -140,6 +158,7 @@ public List getReasons() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReasons(List reasons) { this.reasons = reasons; + isSetReasons = true; // mark as set } /** @@ -152,6 +171,7 @@ public void setReasons(List reasons) { */ public ValidationFacts result(ResultEnum result) { this.result = result; + isSetResult = true; // mark as set return this; } @@ -179,6 +199,7 @@ public ResultEnum getResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResult(ResultEnum result) { this.result = result; + isSetResult = true; // mark as set } /** @@ -189,6 +210,7 @@ public void setResult(ResultEnum result) { */ public ValidationFacts type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -212,6 +234,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ValidationFacts 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 ValidationFacts object is equal to o. */ @@ -255,6 +298,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 (isSetReasons) { + addIfNull(nulls, JSON_PROPERTY_REASONS, this.reasons); + } + if (isSetResult) { + addIfNull(nulls, JSON_PROPERTY_RESULT, this.result); + } + 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 ValidationFacts given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/VerificationDeadline.java b/src/main/java/com/adyen/model/configurationwebhooks/VerificationDeadline.java index 1c116b82e..0d750a474 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/VerificationDeadline.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/VerificationDeadline.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +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; @@ -193,12 +195,27 @@ public static CapabilitiesEnum fromValue(String value) { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private List capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_ENTITY_IDS = "entityIds"; private List entityIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityIds = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private OffsetDateTime expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public VerificationDeadline() {} /** @@ -209,6 +226,7 @@ public VerificationDeadline() {} */ public VerificationDeadline capabilities(List capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -240,6 +258,7 @@ public List getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(List capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -250,6 +269,7 @@ public void setCapabilities(List capabilities) { */ public VerificationDeadline entityIds(List entityIds) { this.entityIds = entityIds; + isSetEntityIds = true; // mark as set return this; } @@ -281,6 +301,7 @@ public List getEntityIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityIds(List entityIds) { this.entityIds = entityIds; + isSetEntityIds = true; // mark as set } /** @@ -291,6 +312,7 @@ public void setEntityIds(List entityIds) { */ public VerificationDeadline expiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -314,6 +336,27 @@ public OffsetDateTime getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public VerificationDeadline 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 VerificationDeadline object is equal to o. */ @@ -357,6 +400,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 (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetEntityIds) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_IDS, this.entityIds); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + + 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 VerificationDeadline given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/VerificationError.java b/src/main/java/com/adyen/model/configurationwebhooks/VerificationError.java index 8089e1975..75c13b860 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/VerificationError.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/VerificationError.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +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; @@ -195,18 +197,33 @@ public static CapabilitiesEnum fromValue(String value) { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private List capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = 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_REMEDIATING_ACTIONS = "remediatingActions"; private List remediatingActions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemediatingActions = false; + public static final String JSON_PROPERTY_SUB_ERRORS = "subErrors"; private List subErrors; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubErrors = false; + /** * The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * * **dataReview** @@ -258,6 +275,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 VerificationError() {} /** @@ -268,6 +294,7 @@ public VerificationError() {} */ public VerificationError capabilities(List capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -299,6 +326,7 @@ public List getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(List capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -309,6 +337,7 @@ public void setCapabilities(List capabilities) { */ public VerificationError code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -332,6 +361,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -342,6 +372,7 @@ public void setCode(String code) { */ public VerificationError message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -365,6 +396,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -376,6 +408,7 @@ public void setMessage(String message) { */ public VerificationError remediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set return this; } @@ -409,6 +442,7 @@ public List getRemediatingActions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set } /** @@ -419,6 +453,7 @@ public void setRemediatingActions(List remediatingActions) { */ public VerificationError subErrors(List subErrors) { this.subErrors = subErrors; + isSetSubErrors = true; // mark as set return this; } @@ -450,6 +485,7 @@ public List getSubErrors() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubErrors(List subErrors) { this.subErrors = subErrors; + isSetSubErrors = true; // mark as set } /** @@ -462,6 +498,7 @@ public void setSubErrors(List subErrors) { */ public VerificationError type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -489,6 +526,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 VerificationError 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 VerificationError object is equal to o. */ @@ -538,6 +596,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 (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetRemediatingActions) { + addIfNull(nulls, JSON_PROPERTY_REMEDIATING_ACTIONS, this.remediatingActions); + } + if (isSetSubErrors) { + addIfNull(nulls, JSON_PROPERTY_SUB_ERRORS, this.subErrors); + } + 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 VerificationError given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/VerificationErrorRecursive.java b/src/main/java/com/adyen/model/configurationwebhooks/VerificationErrorRecursive.java index 111126f9f..62720ae06 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/VerificationErrorRecursive.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/VerificationErrorRecursive.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +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; @@ -196,12 +198,21 @@ public static CapabilitiesEnum fromValue(String value) { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private List capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + /** * The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * * **dataReview** @@ -253,9 +264,21 @@ 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; + public static final String JSON_PROPERTY_REMEDIATING_ACTIONS = "remediatingActions"; private List remediatingActions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemediatingActions = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public VerificationErrorRecursive() {} /** @@ -266,6 +289,7 @@ public VerificationErrorRecursive() {} */ public VerificationErrorRecursive capabilities(List capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -297,6 +321,7 @@ public List getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(List capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -307,6 +332,7 @@ public void setCapabilities(List capabilities) { */ public VerificationErrorRecursive code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -330,6 +356,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -340,6 +367,7 @@ public void setCode(String code) { */ public VerificationErrorRecursive message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -363,6 +391,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -375,6 +404,7 @@ public void setMessage(String message) { */ public VerificationErrorRecursive type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -402,6 +432,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -413,6 +444,7 @@ public void setType(TypeEnum type) { */ public VerificationErrorRecursive remediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set return this; } @@ -447,6 +479,27 @@ public List getRemediatingActions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public VerificationErrorRecursive 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 VerificationError-recursive object is equal to o. */ @@ -494,6 +547,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 (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetRemediatingActions) { + addIfNull(nulls, JSON_PROPERTY_REMEDIATING_ACTIONS, this.remediatingActions); + } + + 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 VerificationErrorRecursive given an JSON string * diff --git a/src/main/java/com/adyen/model/configurationwebhooks/Wallet.java b/src/main/java/com/adyen/model/configurationwebhooks/Wallet.java index 28097d897..ed7977182 100644 --- a/src/main/java/com/adyen/model/configurationwebhooks/Wallet.java +++ b/src/main/java/com/adyen/model/configurationwebhooks/Wallet.java @@ -11,7 +11,9 @@ package com.adyen.model.configurationwebhooks; +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; @@ -36,15 +38,27 @@ public class Wallet { public static final String JSON_PROPERTY_ACCOUNT_SCORE = "accountScore"; private String accountScore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountScore = false; + public static final String JSON_PROPERTY_DEVICE = "device"; private Device device; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDevice = false; + public static final String JSON_PROPERTY_DEVICE_SCORE = "deviceScore"; private String deviceScore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceScore = false; + public static final String JSON_PROPERTY_PROVISIONING_METHOD = "provisioningMethod"; private String provisioningMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProvisioningMethod = false; + /** Gets or Sets recommendationReasons */ public enum RecommendationReasonsEnum { ACCOUNTCARDTOONEW(String.valueOf("accountCardTooNew")), @@ -195,11 +209,23 @@ public static RecommendationReasonsEnum fromValue(String value) { public static final String JSON_PROPERTY_RECOMMENDATION_REASONS = "recommendationReasons"; private List recommendationReasons; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecommendationReasons = false; + public static final String JSON_PROPERTY_TYPE = "type"; @Deprecated // deprecated since Configuration webhooks v2: Use name of the `tokenRequestor` // instead. private String 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 Wallet() {} /** @@ -214,6 +240,7 @@ public Wallet() {} */ public Wallet accountScore(String accountScore) { this.accountScore = accountScore; + isSetAccountScore = true; // mark as set return this; } @@ -245,6 +272,7 @@ public String getAccountScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountScore(String accountScore) { this.accountScore = accountScore; + isSetAccountScore = true; // mark as set } /** @@ -255,6 +283,7 @@ public void setAccountScore(String accountScore) { */ public Wallet device(Device device) { this.device = device; + isSetDevice = true; // mark as set return this; } @@ -278,6 +307,7 @@ public Device getDevice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDevice(Device device) { this.device = device; + isSetDevice = true; // mark as set } /** @@ -292,6 +322,7 @@ public void setDevice(Device device) { */ public Wallet deviceScore(String deviceScore) { this.deviceScore = deviceScore; + isSetDeviceScore = true; // mark as set return this; } @@ -323,6 +354,7 @@ public String getDeviceScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceScore(String deviceScore) { this.deviceScore = deviceScore; + isSetDeviceScore = true; // mark as set } /** @@ -335,6 +367,7 @@ public void setDeviceScore(String deviceScore) { */ public Wallet provisioningMethod(String provisioningMethod) { this.provisioningMethod = provisioningMethod; + isSetProvisioningMethod = true; // mark as set return this; } @@ -362,6 +395,7 @@ public String getProvisioningMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProvisioningMethod(String provisioningMethod) { this.provisioningMethod = provisioningMethod; + isSetProvisioningMethod = true; // mark as set } /** @@ -377,6 +411,7 @@ public void setProvisioningMethod(String provisioningMethod) { */ public Wallet recommendationReasons(List recommendationReasons) { this.recommendationReasons = recommendationReasons; + isSetRecommendationReasons = true; // mark as set return this; } @@ -418,6 +453,7 @@ public List getRecommendationReasons() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecommendationReasons(List recommendationReasons) { this.recommendationReasons = recommendationReasons; + isSetRecommendationReasons = true; // mark as set } /** @@ -433,6 +469,7 @@ public void setRecommendationReasons(List recommendat // instead. public Wallet type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -467,6 +504,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Wallet 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 Wallet object is equal to o. */ @@ -519,6 +577,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 (isSetAccountScore) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_SCORE, this.accountScore); + } + if (isSetDevice) { + addIfNull(nulls, JSON_PROPERTY_DEVICE, this.device); + } + if (isSetDeviceScore) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_SCORE, this.deviceScore); + } + if (isSetProvisioningMethod) { + addIfNull(nulls, JSON_PROPERTY_PROVISIONING_METHOD, this.provisioningMethod); + } + if (isSetRecommendationReasons) { + addIfNull(nulls, JSON_PROPERTY_RECOMMENDATION_REASONS, this.recommendationReasons); + } + 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 Wallet given an JSON string * diff --git a/src/main/java/com/adyen/model/dataprotection/ServiceError.java b/src/main/java/com/adyen/model/dataprotection/ServiceError.java index 180eb0078..20b9d7781 100644 --- a/src/main/java/com/adyen/model/dataprotection/ServiceError.java +++ b/src/main/java/com/adyen/model/dataprotection/ServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.dataprotection; +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 ServiceError { 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() {} /** @@ -51,6 +74,7 @@ public ServiceError() {} */ public ServiceError errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -74,6 +98,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setErrorCode(String errorCode) { */ public ServiceError errorType(String errorType) { this.errorType = errorType; + isSetErrorType = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getErrorType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorType(String errorType) { this.errorType = errorType; + isSetErrorType = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setErrorType(String errorType) { */ public ServiceError message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -140,6 +168,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setMessage(String message) { */ public ServiceError pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -173,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 } /** @@ -183,6 +214,7 @@ public void setPspReference(String pspReference) { */ public ServiceError status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -206,6 +238,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. */ @@ -253,6 +306,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 (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/dataprotection/SubjectErasureByPspReferenceRequest.java b/src/main/java/com/adyen/model/dataprotection/SubjectErasureByPspReferenceRequest.java index 4604a2398..bcc5c73e5 100644 --- a/src/main/java/com/adyen/model/dataprotection/SubjectErasureByPspReferenceRequest.java +++ b/src/main/java/com/adyen/model/dataprotection/SubjectErasureByPspReferenceRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.dataprotection; +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 SubjectErasureByPspReferenceRequest { public static final String JSON_PROPERTY_FORCE_ERASURE = "forceErasure"; private Boolean forceErasure; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetForceErasure = 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_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 SubjectErasureByPspReferenceRequest() {} /** @@ -48,6 +65,7 @@ public SubjectErasureByPspReferenceRequest() {} */ public SubjectErasureByPspReferenceRequest forceErasure(Boolean forceErasure) { this.forceErasure = forceErasure; + isSetForceErasure = true; // mark as set return this; } @@ -79,6 +97,7 @@ public Boolean getForceErasure() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setForceErasure(Boolean forceErasure) { this.forceErasure = forceErasure; + isSetForceErasure = true; // mark as set } /** @@ -90,6 +109,7 @@ public void setForceErasure(Boolean forceErasure) { */ public SubjectErasureByPspReferenceRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -113,6 +133,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -125,6 +146,7 @@ public void setMerchantAccount(String merchantAccount) { */ public SubjectErasureByPspReferenceRequest pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -150,6 +172,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 SubjectErasureByPspReferenceRequest 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 SubjectErasureByPspReferenceRequest object is equal to o. */ @@ -194,6 +237,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 (isSetForceErasure) { + addIfNull(nulls, JSON_PROPERTY_FORCE_ERASURE, this.forceErasure); + } + 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 SubjectErasureByPspReferenceRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/dataprotection/SubjectErasureResponse.java b/src/main/java/com/adyen/model/dataprotection/SubjectErasureResponse.java index 08c2891e1..3626858d6 100644 --- a/src/main/java/com/adyen/model/dataprotection/SubjectErasureResponse.java +++ b/src/main/java/com/adyen/model/dataprotection/SubjectErasureResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.dataprotection; +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; @@ -72,6 +74,15 @@ public static ResultEnum fromValue(String value) { public static final String JSON_PROPERTY_RESULT = "result"; private ResultEnum result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResult = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SubjectErasureResponse() {} /** @@ -82,6 +93,7 @@ public SubjectErasureResponse() {} */ public SubjectErasureResponse result(ResultEnum result) { this.result = result; + isSetResult = true; // mark as set return this; } @@ -105,6 +117,27 @@ public ResultEnum getResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResult(ResultEnum result) { this.result = result; + isSetResult = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SubjectErasureResponse 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 SubjectErasureResponse object is equal to o. */ @@ -144,6 +177,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 (isSetResult) { + addIfNull(nulls, JSON_PROPERTY_RESULT, this.result); + } + + 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 SubjectErasureResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/disputes/AcceptDisputeRequest.java b/src/main/java/com/adyen/model/disputes/AcceptDisputeRequest.java index 33fdc103c..b48415bed 100644 --- a/src/main/java/com/adyen/model/disputes/AcceptDisputeRequest.java +++ b/src/main/java/com/adyen/model/disputes/AcceptDisputeRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.disputes; +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 AcceptDisputeRequest { public static final String JSON_PROPERTY_DISPUTE_PSP_REFERENCE = "disputePspReference"; private String disputePspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisputePspReference = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT_CODE = "merchantAccountCode"; private String merchantAccountCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccountCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AcceptDisputeRequest() {} /** @@ -39,6 +53,7 @@ public AcceptDisputeRequest() {} */ public AcceptDisputeRequest disputePspReference(String disputePspReference) { this.disputePspReference = disputePspReference; + isSetDisputePspReference = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getDisputePspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDisputePspReference(String disputePspReference) { this.disputePspReference = disputePspReference; + isSetDisputePspReference = true; // mark as set } /** @@ -73,6 +89,7 @@ public void setDisputePspReference(String disputePspReference) { */ public AcceptDisputeRequest merchantAccountCode(String merchantAccountCode) { this.merchantAccountCode = merchantAccountCode; + isSetMerchantAccountCode = true; // mark as set return this; } @@ -98,6 +115,27 @@ public String getMerchantAccountCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccountCode(String merchantAccountCode) { this.merchantAccountCode = merchantAccountCode; + isSetMerchantAccountCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AcceptDisputeRequest 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 AcceptDisputeRequest object is equal to o. */ @@ -143,6 +181,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 (isSetDisputePspReference) { + addIfNull(nulls, JSON_PROPERTY_DISPUTE_PSP_REFERENCE, this.disputePspReference); + } + if (isSetMerchantAccountCode) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT_CODE, this.merchantAccountCode); + } + + 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 AcceptDisputeRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/disputes/AcceptDisputeResponse.java b/src/main/java/com/adyen/model/disputes/AcceptDisputeResponse.java index 57ac7ad90..1291af88c 100644 --- a/src/main/java/com/adyen/model/disputes/AcceptDisputeResponse.java +++ b/src/main/java/com/adyen/model/disputes/AcceptDisputeResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.disputes; +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 AcceptDisputeResponse { public static final String JSON_PROPERTY_DISPUTE_SERVICE_RESULT = "disputeServiceResult"; private DisputeServiceResult disputeServiceResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisputeServiceResult = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AcceptDisputeResponse() {} /** @@ -33,6 +44,7 @@ public AcceptDisputeResponse() {} */ public AcceptDisputeResponse disputeServiceResult(DisputeServiceResult disputeServiceResult) { this.disputeServiceResult = disputeServiceResult; + isSetDisputeServiceResult = true; // mark as set return this; } @@ -56,6 +68,27 @@ public DisputeServiceResult getDisputeServiceResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDisputeServiceResult(DisputeServiceResult disputeServiceResult) { this.disputeServiceResult = disputeServiceResult; + isSetDisputeServiceResult = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AcceptDisputeResponse 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 AcceptDisputeResponse object is equal to o. */ @@ -97,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 (isSetDisputeServiceResult) { + addIfNull(nulls, JSON_PROPERTY_DISPUTE_SERVICE_RESULT, this.disputeServiceResult); + } + + 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 AcceptDisputeResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/disputes/DefendDisputeRequest.java b/src/main/java/com/adyen/model/disputes/DefendDisputeRequest.java index d9469e27d..3848c7802 100644 --- a/src/main/java/com/adyen/model/disputes/DefendDisputeRequest.java +++ b/src/main/java/com/adyen/model/disputes/DefendDisputeRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.disputes; +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 DefendDisputeRequest { public static final String JSON_PROPERTY_DEFENSE_REASON_CODE = "defenseReasonCode"; private String defenseReasonCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefenseReasonCode = false; + public static final String JSON_PROPERTY_DISPUTE_PSP_REFERENCE = "disputePspReference"; private String disputePspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisputePspReference = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT_CODE = "merchantAccountCode"; private String merchantAccountCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccountCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DefendDisputeRequest() {} /** @@ -43,6 +60,7 @@ public DefendDisputeRequest() {} */ public DefendDisputeRequest defenseReasonCode(String defenseReasonCode) { this.defenseReasonCode = defenseReasonCode; + isSetDefenseReasonCode = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getDefenseReasonCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDefenseReasonCode(String defenseReasonCode) { this.defenseReasonCode = defenseReasonCode; + isSetDefenseReasonCode = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setDefenseReasonCode(String defenseReasonCode) { */ public DefendDisputeRequest disputePspReference(String disputePspReference) { this.disputePspReference = disputePspReference; + isSetDisputePspReference = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getDisputePspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDisputePspReference(String disputePspReference) { this.disputePspReference = disputePspReference; + isSetDisputePspReference = true; // mark as set } /** @@ -110,6 +131,7 @@ public void setDisputePspReference(String disputePspReference) { */ public DefendDisputeRequest merchantAccountCode(String merchantAccountCode) { this.merchantAccountCode = merchantAccountCode; + isSetMerchantAccountCode = true; // mark as set return this; } @@ -135,6 +157,27 @@ public String getMerchantAccountCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccountCode(String merchantAccountCode) { this.merchantAccountCode = merchantAccountCode; + isSetMerchantAccountCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DefendDisputeRequest 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 DefendDisputeRequest object is equal to o. */ @@ -182,6 +225,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 (isSetDefenseReasonCode) { + addIfNull(nulls, JSON_PROPERTY_DEFENSE_REASON_CODE, this.defenseReasonCode); + } + if (isSetDisputePspReference) { + addIfNull(nulls, JSON_PROPERTY_DISPUTE_PSP_REFERENCE, this.disputePspReference); + } + if (isSetMerchantAccountCode) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT_CODE, this.merchantAccountCode); + } + + 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 DefendDisputeRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/disputes/DefendDisputeResponse.java b/src/main/java/com/adyen/model/disputes/DefendDisputeResponse.java index e9105ad79..c8b493d7e 100644 --- a/src/main/java/com/adyen/model/disputes/DefendDisputeResponse.java +++ b/src/main/java/com/adyen/model/disputes/DefendDisputeResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.disputes; +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 DefendDisputeResponse { public static final String JSON_PROPERTY_DISPUTE_SERVICE_RESULT = "disputeServiceResult"; private DisputeServiceResult disputeServiceResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisputeServiceResult = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DefendDisputeResponse() {} /** @@ -33,6 +44,7 @@ public DefendDisputeResponse() {} */ public DefendDisputeResponse disputeServiceResult(DisputeServiceResult disputeServiceResult) { this.disputeServiceResult = disputeServiceResult; + isSetDisputeServiceResult = true; // mark as set return this; } @@ -56,6 +68,27 @@ public DisputeServiceResult getDisputeServiceResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDisputeServiceResult(DisputeServiceResult disputeServiceResult) { this.disputeServiceResult = disputeServiceResult; + isSetDisputeServiceResult = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DefendDisputeResponse 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 DefendDisputeResponse object is equal to o. */ @@ -97,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 (isSetDisputeServiceResult) { + addIfNull(nulls, JSON_PROPERTY_DISPUTE_SERVICE_RESULT, this.disputeServiceResult); + } + + 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 DefendDisputeResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/disputes/DefenseDocument.java b/src/main/java/com/adyen/model/disputes/DefenseDocument.java index b0e433107..c16e8069e 100644 --- a/src/main/java/com/adyen/model/disputes/DefenseDocument.java +++ b/src/main/java/com/adyen/model/disputes/DefenseDocument.java @@ -11,6 +11,8 @@ package com.adyen.model.disputes; +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,12 +30,27 @@ public class DefenseDocument { public static final String JSON_PROPERTY_CONTENT = "content"; private byte[] content; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContent = false; + public static final String JSON_PROPERTY_CONTENT_TYPE = "contentType"; private String contentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContentType = false; + public static final String JSON_PROPERTY_DEFENSE_DOCUMENT_TYPE_CODE = "defenseDocumentTypeCode"; private String defenseDocumentTypeCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefenseDocumentTypeCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DefenseDocument() {} /** @@ -44,6 +61,7 @@ public DefenseDocument() {} */ public DefenseDocument content(byte[] content) { this.content = content; + isSetContent = true; // mark as set return this; } @@ -67,6 +85,7 @@ public byte[] getContent() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContent(byte[] content) { this.content = content; + isSetContent = true; // mark as set } /** @@ -77,6 +96,7 @@ public void setContent(byte[] content) { */ public DefenseDocument contentType(String contentType) { this.contentType = contentType; + isSetContentType = true; // mark as set return this; } @@ -100,6 +120,7 @@ public String getContentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContentType(String contentType) { this.contentType = contentType; + isSetContentType = true; // mark as set } /** @@ -110,6 +131,7 @@ public void setContentType(String contentType) { */ public DefenseDocument defenseDocumentTypeCode(String defenseDocumentTypeCode) { this.defenseDocumentTypeCode = defenseDocumentTypeCode; + isSetDefenseDocumentTypeCode = true; // mark as set return this; } @@ -133,6 +155,27 @@ public String getDefenseDocumentTypeCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDefenseDocumentTypeCode(String defenseDocumentTypeCode) { this.defenseDocumentTypeCode = defenseDocumentTypeCode; + isSetDefenseDocumentTypeCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DefenseDocument 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 DefenseDocument object is equal to o. */ @@ -178,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 (isSetContent) { + addIfNull(nulls, JSON_PROPERTY_CONTENT, this.content); + } + if (isSetContentType) { + addIfNull(nulls, JSON_PROPERTY_CONTENT_TYPE, this.contentType); + } + if (isSetDefenseDocumentTypeCode) { + addIfNull(nulls, JSON_PROPERTY_DEFENSE_DOCUMENT_TYPE_CODE, this.defenseDocumentTypeCode); + } + + 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 DefenseDocument given an JSON string * diff --git a/src/main/java/com/adyen/model/disputes/DefenseDocumentType.java b/src/main/java/com/adyen/model/disputes/DefenseDocumentType.java index fdee69c07..944a387a2 100644 --- a/src/main/java/com/adyen/model/disputes/DefenseDocumentType.java +++ b/src/main/java/com/adyen/model/disputes/DefenseDocumentType.java @@ -11,6 +11,8 @@ package com.adyen.model.disputes; +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 DefenseDocumentType { public static final String JSON_PROPERTY_AVAILABLE = "available"; private Boolean available; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAvailable = false; + public static final String JSON_PROPERTY_DEFENSE_DOCUMENT_TYPE_CODE = "defenseDocumentTypeCode"; private String defenseDocumentTypeCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefenseDocumentTypeCode = false; + public static final String JSON_PROPERTY_REQUIREMENT_LEVEL = "requirementLevel"; private String requirementLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequirementLevel = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DefenseDocumentType() {} /** @@ -45,6 +62,7 @@ public DefenseDocumentType() {} */ public DefenseDocumentType available(Boolean available) { this.available = available; + isSetAvailable = true; // mark as set return this; } @@ -72,6 +90,7 @@ public Boolean getAvailable() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAvailable(Boolean available) { this.available = available; + isSetAvailable = true; // mark as set } /** @@ -82,6 +101,7 @@ public void setAvailable(Boolean available) { */ public DefenseDocumentType defenseDocumentTypeCode(String defenseDocumentTypeCode) { this.defenseDocumentTypeCode = defenseDocumentTypeCode; + isSetDefenseDocumentTypeCode = true; // mark as set return this; } @@ -105,6 +125,7 @@ public String getDefenseDocumentTypeCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDefenseDocumentTypeCode(String defenseDocumentTypeCode) { this.defenseDocumentTypeCode = defenseDocumentTypeCode; + isSetDefenseDocumentTypeCode = true; // mark as set } /** @@ -125,6 +146,7 @@ public void setDefenseDocumentTypeCode(String defenseDocumentTypeCode) { */ public DefenseDocumentType requirementLevel(String requirementLevel) { this.requirementLevel = requirementLevel; + isSetRequirementLevel = true; // mark as set return this; } @@ -168,6 +190,27 @@ public String getRequirementLevel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequirementLevel(String requirementLevel) { this.requirementLevel = requirementLevel; + isSetRequirementLevel = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DefenseDocumentType 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 DefenseDocumentType object is equal to o. */ @@ -213,6 +256,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 (isSetAvailable) { + addIfNull(nulls, JSON_PROPERTY_AVAILABLE, this.available); + } + if (isSetDefenseDocumentTypeCode) { + addIfNull(nulls, JSON_PROPERTY_DEFENSE_DOCUMENT_TYPE_CODE, this.defenseDocumentTypeCode); + } + if (isSetRequirementLevel) { + addIfNull(nulls, JSON_PROPERTY_REQUIREMENT_LEVEL, this.requirementLevel); + } + + 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 DefenseDocumentType given an JSON string * diff --git a/src/main/java/com/adyen/model/disputes/DefenseReason.java b/src/main/java/com/adyen/model/disputes/DefenseReason.java index 326bd6d1c..0d453cc91 100644 --- a/src/main/java/com/adyen/model/disputes/DefenseReason.java +++ b/src/main/java/com/adyen/model/disputes/DefenseReason.java @@ -11,6 +11,8 @@ package com.adyen.model.disputes; +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,12 +31,27 @@ public class DefenseReason { public static final String JSON_PROPERTY_DEFENSE_DOCUMENT_TYPES = "defenseDocumentTypes"; private List defenseDocumentTypes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefenseDocumentTypes = false; + public static final String JSON_PROPERTY_DEFENSE_REASON_CODE = "defenseReasonCode"; private String defenseReasonCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefenseReasonCode = false; + public static final String JSON_PROPERTY_SATISFIED = "satisfied"; private Boolean satisfied; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSatisfied = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DefenseReason() {} /** @@ -48,6 +65,7 @@ public DefenseReason() {} */ public DefenseReason defenseDocumentTypes(List defenseDocumentTypes) { this.defenseDocumentTypes = defenseDocumentTypes; + isSetDefenseDocumentTypes = true; // mark as set return this; } @@ -85,6 +103,7 @@ public List getDefenseDocumentTypes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDefenseDocumentTypes(List defenseDocumentTypes) { this.defenseDocumentTypes = defenseDocumentTypes; + isSetDefenseDocumentTypes = true; // mark as set } /** @@ -95,6 +114,7 @@ public void setDefenseDocumentTypes(List defenseDocumentTyp */ public DefenseReason defenseReasonCode(String defenseReasonCode) { this.defenseReasonCode = defenseReasonCode; + isSetDefenseReasonCode = true; // mark as set return this; } @@ -118,6 +138,7 @@ public String getDefenseReasonCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDefenseReasonCode(String defenseReasonCode) { this.defenseReasonCode = defenseReasonCode; + isSetDefenseReasonCode = true; // mark as set } /** @@ -128,6 +149,7 @@ public void setDefenseReasonCode(String defenseReasonCode) { */ public DefenseReason satisfied(Boolean satisfied) { this.satisfied = satisfied; + isSetSatisfied = true; // mark as set return this; } @@ -151,6 +173,27 @@ public Boolean getSatisfied() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSatisfied(Boolean satisfied) { this.satisfied = satisfied; + isSetSatisfied = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DefenseReason 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 DefenseReason object is equal to o. */ @@ -196,6 +239,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 (isSetDefenseDocumentTypes) { + addIfNull(nulls, JSON_PROPERTY_DEFENSE_DOCUMENT_TYPES, this.defenseDocumentTypes); + } + if (isSetDefenseReasonCode) { + addIfNull(nulls, JSON_PROPERTY_DEFENSE_REASON_CODE, this.defenseReasonCode); + } + if (isSetSatisfied) { + addIfNull(nulls, JSON_PROPERTY_SATISFIED, this.satisfied); + } + + 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 DefenseReason given an JSON string * diff --git a/src/main/java/com/adyen/model/disputes/DefenseReasonsRequest.java b/src/main/java/com/adyen/model/disputes/DefenseReasonsRequest.java index 44632e0b6..6e7896664 100644 --- a/src/main/java/com/adyen/model/disputes/DefenseReasonsRequest.java +++ b/src/main/java/com/adyen/model/disputes/DefenseReasonsRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.disputes; +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 DefenseReasonsRequest { public static final String JSON_PROPERTY_DISPUTE_PSP_REFERENCE = "disputePspReference"; private String disputePspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisputePspReference = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT_CODE = "merchantAccountCode"; private String merchantAccountCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccountCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DefenseReasonsRequest() {} /** @@ -39,6 +53,7 @@ public DefenseReasonsRequest() {} */ public DefenseReasonsRequest disputePspReference(String disputePspReference) { this.disputePspReference = disputePspReference; + isSetDisputePspReference = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getDisputePspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDisputePspReference(String disputePspReference) { this.disputePspReference = disputePspReference; + isSetDisputePspReference = true; // mark as set } /** @@ -73,6 +89,7 @@ public void setDisputePspReference(String disputePspReference) { */ public DefenseReasonsRequest merchantAccountCode(String merchantAccountCode) { this.merchantAccountCode = merchantAccountCode; + isSetMerchantAccountCode = true; // mark as set return this; } @@ -98,6 +115,27 @@ public String getMerchantAccountCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccountCode(String merchantAccountCode) { this.merchantAccountCode = merchantAccountCode; + isSetMerchantAccountCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DefenseReasonsRequest 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 DefenseReasonsRequest object is equal to o. */ @@ -143,6 +181,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 (isSetDisputePspReference) { + addIfNull(nulls, JSON_PROPERTY_DISPUTE_PSP_REFERENCE, this.disputePspReference); + } + if (isSetMerchantAccountCode) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT_CODE, this.merchantAccountCode); + } + + 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 DefenseReasonsRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/disputes/DefenseReasonsResponse.java b/src/main/java/com/adyen/model/disputes/DefenseReasonsResponse.java index 101b2c02c..a6727db5c 100644 --- a/src/main/java/com/adyen/model/disputes/DefenseReasonsResponse.java +++ b/src/main/java/com/adyen/model/disputes/DefenseReasonsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.disputes; +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,9 +30,21 @@ public class DefenseReasonsResponse { public static final String JSON_PROPERTY_DEFENSE_REASONS = "defenseReasons"; private List defenseReasons; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefenseReasons = false; + public static final String JSON_PROPERTY_DISPUTE_SERVICE_RESULT = "disputeServiceResult"; private DisputeServiceResult disputeServiceResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisputeServiceResult = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DefenseReasonsResponse() {} /** @@ -41,6 +55,7 @@ public DefenseReasonsResponse() {} */ public DefenseReasonsResponse defenseReasons(List defenseReasons) { this.defenseReasons = defenseReasons; + isSetDefenseReasons = true; // mark as set return this; } @@ -72,6 +87,7 @@ public List getDefenseReasons() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDefenseReasons(List defenseReasons) { this.defenseReasons = defenseReasons; + isSetDefenseReasons = true; // mark as set } /** @@ -82,6 +98,7 @@ public void setDefenseReasons(List defenseReasons) { */ public DefenseReasonsResponse disputeServiceResult(DisputeServiceResult disputeServiceResult) { this.disputeServiceResult = disputeServiceResult; + isSetDisputeServiceResult = true; // mark as set return this; } @@ -105,6 +122,27 @@ public DisputeServiceResult getDisputeServiceResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDisputeServiceResult(DisputeServiceResult disputeServiceResult) { this.disputeServiceResult = disputeServiceResult; + isSetDisputeServiceResult = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DefenseReasonsResponse 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 DefenseReasonsResponse object is equal to o. */ @@ -148,6 +186,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 (isSetDefenseReasons) { + addIfNull(nulls, JSON_PROPERTY_DEFENSE_REASONS, this.defenseReasons); + } + if (isSetDisputeServiceResult) { + addIfNull(nulls, JSON_PROPERTY_DISPUTE_SERVICE_RESULT, this.disputeServiceResult); + } + + 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 DefenseReasonsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/disputes/DeleteDefenseDocumentRequest.java b/src/main/java/com/adyen/model/disputes/DeleteDefenseDocumentRequest.java index ff04185ed..298155946 100644 --- a/src/main/java/com/adyen/model/disputes/DeleteDefenseDocumentRequest.java +++ b/src/main/java/com/adyen/model/disputes/DeleteDefenseDocumentRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.disputes; +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 DeleteDefenseDocumentRequest { public static final String JSON_PROPERTY_DEFENSE_DOCUMENT_TYPE = "defenseDocumentType"; private String defenseDocumentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefenseDocumentType = false; + public static final String JSON_PROPERTY_DISPUTE_PSP_REFERENCE = "disputePspReference"; private String disputePspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisputePspReference = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT_CODE = "merchantAccountCode"; private String merchantAccountCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccountCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DeleteDefenseDocumentRequest() {} /** @@ -43,6 +60,7 @@ public DeleteDefenseDocumentRequest() {} */ public DeleteDefenseDocumentRequest defenseDocumentType(String defenseDocumentType) { this.defenseDocumentType = defenseDocumentType; + isSetDefenseDocumentType = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getDefenseDocumentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDefenseDocumentType(String defenseDocumentType) { this.defenseDocumentType = defenseDocumentType; + isSetDefenseDocumentType = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setDefenseDocumentType(String defenseDocumentType) { */ public DeleteDefenseDocumentRequest disputePspReference(String disputePspReference) { this.disputePspReference = disputePspReference; + isSetDisputePspReference = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getDisputePspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDisputePspReference(String disputePspReference) { this.disputePspReference = disputePspReference; + isSetDisputePspReference = true; // mark as set } /** @@ -110,6 +131,7 @@ public void setDisputePspReference(String disputePspReference) { */ public DeleteDefenseDocumentRequest merchantAccountCode(String merchantAccountCode) { this.merchantAccountCode = merchantAccountCode; + isSetMerchantAccountCode = true; // mark as set return this; } @@ -135,6 +157,27 @@ public String getMerchantAccountCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccountCode(String merchantAccountCode) { this.merchantAccountCode = merchantAccountCode; + isSetMerchantAccountCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DeleteDefenseDocumentRequest 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 DeleteDefenseDocumentRequest object is equal to o. */ @@ -187,6 +230,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 (isSetDefenseDocumentType) { + addIfNull(nulls, JSON_PROPERTY_DEFENSE_DOCUMENT_TYPE, this.defenseDocumentType); + } + if (isSetDisputePspReference) { + addIfNull(nulls, JSON_PROPERTY_DISPUTE_PSP_REFERENCE, this.disputePspReference); + } + if (isSetMerchantAccountCode) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT_CODE, this.merchantAccountCode); + } + + 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 DeleteDefenseDocumentRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/disputes/DeleteDefenseDocumentResponse.java b/src/main/java/com/adyen/model/disputes/DeleteDefenseDocumentResponse.java index 65526c3a0..6f28ea85c 100644 --- a/src/main/java/com/adyen/model/disputes/DeleteDefenseDocumentResponse.java +++ b/src/main/java/com/adyen/model/disputes/DeleteDefenseDocumentResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.disputes; +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 DeleteDefenseDocumentResponse { public static final String JSON_PROPERTY_DISPUTE_SERVICE_RESULT = "disputeServiceResult"; private DisputeServiceResult disputeServiceResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisputeServiceResult = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DeleteDefenseDocumentResponse() {} /** @@ -35,6 +46,7 @@ public DeleteDefenseDocumentResponse() {} public DeleteDefenseDocumentResponse disputeServiceResult( DisputeServiceResult disputeServiceResult) { this.disputeServiceResult = disputeServiceResult; + isSetDisputeServiceResult = true; // mark as set return this; } @@ -58,6 +70,27 @@ public DisputeServiceResult getDisputeServiceResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDisputeServiceResult(DisputeServiceResult disputeServiceResult) { this.disputeServiceResult = disputeServiceResult; + isSetDisputeServiceResult = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DeleteDefenseDocumentResponse 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 DeleteDefenseDocumentResponse object is equal to o. */ @@ -100,6 +133,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 (isSetDisputeServiceResult) { + addIfNull(nulls, JSON_PROPERTY_DISPUTE_SERVICE_RESULT, this.disputeServiceResult); + } + + 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 DeleteDefenseDocumentResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/disputes/DisputeServiceResult.java b/src/main/java/com/adyen/model/disputes/DisputeServiceResult.java index b975f1173..0ff33a2ce 100644 --- a/src/main/java/com/adyen/model/disputes/DisputeServiceResult.java +++ b/src/main/java/com/adyen/model/disputes/DisputeServiceResult.java @@ -11,6 +11,8 @@ package com.adyen.model.disputes; +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 DisputeServiceResult { public static final String JSON_PROPERTY_ERROR_MESSAGE = "errorMessage"; private String errorMessage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorMessage = false; + public static final String JSON_PROPERTY_SUCCESS = "success"; private Boolean success; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSuccess = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DisputeServiceResult() {} /** @@ -39,6 +53,7 @@ public DisputeServiceResult() {} */ public DisputeServiceResult errorMessage(String errorMessage) { this.errorMessage = errorMessage; + isSetErrorMessage = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getErrorMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; + isSetErrorMessage = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setErrorMessage(String errorMessage) { */ public DisputeServiceResult success(Boolean success) { this.success = success; + isSetSuccess = true; // mark as set return this; } @@ -95,6 +112,27 @@ public Boolean getSuccess() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSuccess(Boolean success) { this.success = success; + isSetSuccess = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DisputeServiceResult 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 DisputeServiceResult object is equal to o. */ @@ -136,6 +174,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 (isSetErrorMessage) { + addIfNull(nulls, JSON_PROPERTY_ERROR_MESSAGE, this.errorMessage); + } + if (isSetSuccess) { + addIfNull(nulls, JSON_PROPERTY_SUCCESS, this.success); + } + + 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 DisputeServiceResult given an JSON string * diff --git a/src/main/java/com/adyen/model/disputes/ServiceError.java b/src/main/java/com/adyen/model/disputes/ServiceError.java index d8f51bd6d..2367ef0df 100644 --- a/src/main/java/com/adyen/model/disputes/ServiceError.java +++ b/src/main/java/com/adyen/model/disputes/ServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.disputes; +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 ServiceError { 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() {} /** @@ -51,6 +74,7 @@ public ServiceError() {} */ public ServiceError errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -74,6 +98,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setErrorCode(String errorCode) { */ public ServiceError errorType(String errorType) { this.errorType = errorType; + isSetErrorType = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getErrorType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorType(String errorType) { this.errorType = errorType; + isSetErrorType = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setErrorType(String errorType) { */ public ServiceError message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -140,6 +168,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setMessage(String message) { */ public ServiceError pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -173,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 } /** @@ -183,6 +214,7 @@ public void setPspReference(String pspReference) { */ public ServiceError status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -206,6 +238,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. */ @@ -253,6 +306,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 (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/disputes/SupplyDefenseDocumentRequest.java b/src/main/java/com/adyen/model/disputes/SupplyDefenseDocumentRequest.java index 26602008d..d638306d7 100644 --- a/src/main/java/com/adyen/model/disputes/SupplyDefenseDocumentRequest.java +++ b/src/main/java/com/adyen/model/disputes/SupplyDefenseDocumentRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.disputes; +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,12 +31,27 @@ public class SupplyDefenseDocumentRequest { public static final String JSON_PROPERTY_DEFENSE_DOCUMENTS = "defenseDocuments"; private List defenseDocuments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDefenseDocuments = false; + public static final String JSON_PROPERTY_DISPUTE_PSP_REFERENCE = "disputePspReference"; private String disputePspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisputePspReference = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT_CODE = "merchantAccountCode"; private String merchantAccountCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccountCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SupplyDefenseDocumentRequest() {} /** @@ -45,6 +62,7 @@ public SupplyDefenseDocumentRequest() {} */ public SupplyDefenseDocumentRequest defenseDocuments(List defenseDocuments) { this.defenseDocuments = defenseDocuments; + isSetDefenseDocuments = true; // mark as set return this; } @@ -77,6 +95,7 @@ public List getDefenseDocuments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDefenseDocuments(List defenseDocuments) { this.defenseDocuments = defenseDocuments; + isSetDefenseDocuments = true; // mark as set } /** @@ -87,6 +106,7 @@ public void setDefenseDocuments(List defenseDocuments) { */ public SupplyDefenseDocumentRequest disputePspReference(String disputePspReference) { this.disputePspReference = disputePspReference; + isSetDisputePspReference = true; // mark as set return this; } @@ -110,6 +130,7 @@ public String getDisputePspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDisputePspReference(String disputePspReference) { this.disputePspReference = disputePspReference; + isSetDisputePspReference = true; // mark as set } /** @@ -121,6 +142,7 @@ public void setDisputePspReference(String disputePspReference) { */ public SupplyDefenseDocumentRequest merchantAccountCode(String merchantAccountCode) { this.merchantAccountCode = merchantAccountCode; + isSetMerchantAccountCode = true; // mark as set return this; } @@ -146,6 +168,27 @@ public String getMerchantAccountCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccountCode(String merchantAccountCode) { this.merchantAccountCode = merchantAccountCode; + isSetMerchantAccountCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SupplyDefenseDocumentRequest 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 SupplyDefenseDocumentRequest object is equal to o. */ @@ -195,6 +238,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 (isSetDefenseDocuments) { + addIfNull(nulls, JSON_PROPERTY_DEFENSE_DOCUMENTS, this.defenseDocuments); + } + if (isSetDisputePspReference) { + addIfNull(nulls, JSON_PROPERTY_DISPUTE_PSP_REFERENCE, this.disputePspReference); + } + if (isSetMerchantAccountCode) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT_CODE, this.merchantAccountCode); + } + + 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 SupplyDefenseDocumentRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/disputes/SupplyDefenseDocumentResponse.java b/src/main/java/com/adyen/model/disputes/SupplyDefenseDocumentResponse.java index 5290497df..5520e9f9e 100644 --- a/src/main/java/com/adyen/model/disputes/SupplyDefenseDocumentResponse.java +++ b/src/main/java/com/adyen/model/disputes/SupplyDefenseDocumentResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.disputes; +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 SupplyDefenseDocumentResponse { public static final String JSON_PROPERTY_DISPUTE_SERVICE_RESULT = "disputeServiceResult"; private DisputeServiceResult disputeServiceResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisputeServiceResult = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SupplyDefenseDocumentResponse() {} /** @@ -35,6 +46,7 @@ public SupplyDefenseDocumentResponse() {} public SupplyDefenseDocumentResponse disputeServiceResult( DisputeServiceResult disputeServiceResult) { this.disputeServiceResult = disputeServiceResult; + isSetDisputeServiceResult = true; // mark as set return this; } @@ -58,6 +70,27 @@ public DisputeServiceResult getDisputeServiceResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDisputeServiceResult(DisputeServiceResult disputeServiceResult) { this.disputeServiceResult = disputeServiceResult; + isSetDisputeServiceResult = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SupplyDefenseDocumentResponse 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 SupplyDefenseDocumentResponse object is equal to o. */ @@ -100,6 +133,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 (isSetDisputeServiceResult) { + addIfNull(nulls, JSON_PROPERTY_DISPUTE_SERVICE_RESULT, this.disputeServiceResult); + } + + 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 SupplyDefenseDocumentResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/disputewebhooks/Amount.java b/src/main/java/com/adyen/model/disputewebhooks/Amount.java index a9259cf49..b2c6335c3 100644 --- a/src/main/java/com/adyen/model/disputewebhooks/Amount.java +++ b/src/main/java/com/adyen/model/disputewebhooks/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.disputewebhooks; +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. */ @@ -145,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 (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/disputewebhooks/BalancePlatformNotificationResponse.java b/src/main/java/com/adyen/model/disputewebhooks/BalancePlatformNotificationResponse.java index 0efc4d399..57a866175 100644 --- a/src/main/java/com/adyen/model/disputewebhooks/BalancePlatformNotificationResponse.java +++ b/src/main/java/com/adyen/model/disputewebhooks/BalancePlatformNotificationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.disputewebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class BalancePlatformNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalancePlatformNotificationResponse() {} /** @@ -36,6 +47,7 @@ public BalancePlatformNotificationResponse() {} */ public BalancePlatformNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalancePlatformNotificationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalancePlatformNotificationResponse object is equal to o. */ @@ -106,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalancePlatformNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/disputewebhooks/DisputeEventNotification.java b/src/main/java/com/adyen/model/disputewebhooks/DisputeEventNotification.java index ec90f9371..3ef696135 100644 --- a/src/main/java/com/adyen/model/disputewebhooks/DisputeEventNotification.java +++ b/src/main/java/com/adyen/model/disputewebhooks/DisputeEventNotification.java @@ -11,7 +11,9 @@ package com.adyen.model.disputewebhooks; +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; @@ -39,30 +41,57 @@ public class DisputeEventNotification { public static final String JSON_PROPERTY_ARN = "arn"; private String arn; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetArn = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = 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_DISPUTED_AMOUNT = "disputedAmount"; private Amount disputedAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisputedAmount = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_STATUS = "status"; private String status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_STATUS_DETAIL = "statusDetail"; private String statusDetail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusDetail = false; + public static final String JSON_PROPERTY_TRANSACTION_ID = "transactionId"; private String transactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionId = false; + /** The type of dispute raised for the transaction. */ public enum TypeEnum { FRAUD(String.valueOf("fraud")), @@ -111,6 +140,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 DisputeEventNotification() {} /** @@ -123,6 +161,7 @@ public DisputeEventNotification() {} */ public DisputeEventNotification arn(String arn) { this.arn = arn; + isSetArn = true; // mark as set return this; } @@ -150,6 +189,7 @@ public String getArn() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setArn(String arn) { this.arn = arn; + isSetArn = true; // mark as set } /** @@ -160,6 +200,7 @@ public void setArn(String arn) { */ public DisputeEventNotification balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -183,6 +224,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -195,6 +237,7 @@ public void setBalancePlatform(String balancePlatform) { */ public DisputeEventNotification creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -222,6 +265,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -232,6 +276,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public DisputeEventNotification description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -255,6 +300,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -265,6 +311,7 @@ public void setDescription(String description) { */ public DisputeEventNotification disputedAmount(Amount disputedAmount) { this.disputedAmount = disputedAmount; + isSetDisputedAmount = true; // mark as set return this; } @@ -288,6 +335,7 @@ public Amount getDisputedAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDisputedAmount(Amount disputedAmount) { this.disputedAmount = disputedAmount; + isSetDisputedAmount = true; // mark as set } /** @@ -298,6 +346,7 @@ public void setDisputedAmount(Amount disputedAmount) { */ public DisputeEventNotification id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -321,6 +370,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -331,6 +381,7 @@ public void setId(String id) { */ public DisputeEventNotification status(String status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -354,6 +405,7 @@ public String getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(String status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -364,6 +416,7 @@ public void setStatus(String status) { */ public DisputeEventNotification statusDetail(String statusDetail) { this.statusDetail = statusDetail; + isSetStatusDetail = true; // mark as set return this; } @@ -387,6 +440,7 @@ public String getStatusDetail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusDetail(String statusDetail) { this.statusDetail = statusDetail; + isSetStatusDetail = true; // mark as set } /** @@ -398,6 +452,7 @@ public void setStatusDetail(String statusDetail) { */ public DisputeEventNotification transactionId(String transactionId) { this.transactionId = transactionId; + isSetTransactionId = true; // mark as set return this; } @@ -423,6 +478,7 @@ public String getTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionId(String transactionId) { this.transactionId = transactionId; + isSetTransactionId = true; // mark as set } /** @@ -433,6 +489,7 @@ public void setTransactionId(String transactionId) { */ public DisputeEventNotification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -456,6 +513,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 DisputeEventNotification 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 DisputeEventNotification object is equal to o. */ @@ -523,6 +601,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 (isSetArn) { + addIfNull(nulls, JSON_PROPERTY_ARN, this.arn); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetDisputedAmount) { + addIfNull(nulls, JSON_PROPERTY_DISPUTED_AMOUNT, this.disputedAmount); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetStatusDetail) { + addIfNull(nulls, JSON_PROPERTY_STATUS_DETAIL, this.statusDetail); + } + if (isSetTransactionId) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_ID, this.transactionId); + } + 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 DisputeEventNotification given an JSON string * diff --git a/src/main/java/com/adyen/model/disputewebhooks/DisputeNotificationRequest.java b/src/main/java/com/adyen/model/disputewebhooks/DisputeNotificationRequest.java index f3ce75be5..947492221 100644 --- a/src/main/java/com/adyen/model/disputewebhooks/DisputeNotificationRequest.java +++ b/src/main/java/com/adyen/model/disputewebhooks/DisputeNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.disputewebhooks; +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; @@ -30,6 +32,9 @@ public class DisputeNotificationRequest { public static final String JSON_PROPERTY_DATA = "data"; private DisputeEventNotification data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + /** Type of webhook. */ public enum TypeEnum { BALANCEPLATFORM_DISPUTE_CREATED(String.valueOf("balancePlatform.dispute.created")), @@ -74,6 +79,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 DisputeNotificationRequest() {} /** @@ -84,6 +98,7 @@ public DisputeNotificationRequest() {} */ public DisputeNotificationRequest data(DisputeEventNotification data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -107,6 +122,7 @@ public DisputeEventNotification getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(DisputeEventNotification data) { this.data = data; + isSetData = true; // mark as set } /** @@ -117,6 +133,7 @@ public void setData(DisputeEventNotification data) { */ public DisputeNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -140,6 +157,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 DisputeNotificationRequest 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 DisputeNotificationRequest object is equal to o. */ @@ -181,6 +219,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 (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + 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 DisputeNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/AULocalAccountIdentification.java index da2a420d0..b391b2124 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AULocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,9 +33,15 @@ public class AULocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BSB_CODE = "bsbCode"; private String bsbCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBsbCode = false; + /** **auLocal** */ public enum TypeEnum { AULOCAL(String.valueOf("auLocal")); @@ -76,6 +84,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 AULocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public AULocalAccountIdentification() {} */ public AULocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -121,6 +140,7 @@ public void setAccountNumber(String accountNumber) { */ public AULocalAccountIdentification bsbCode(String bsbCode) { this.bsbCode = bsbCode; + isSetBsbCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getBsbCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBsbCode(String bsbCode) { this.bsbCode = bsbCode; + isSetBsbCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setBsbCode(String bsbCode) { */ public AULocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,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 AULocalAccountIdentification 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 AULocalAccountIdentification object is equal to o. */ @@ -224,6 +267,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBsbCode) { + addIfNull(nulls, JSON_PROPERTY_BSB_CODE, this.bsbCode); + } + 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 AULocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java index a8a220a16..131b17fff 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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 AcceptTermsOfServiceRequest { public static final String JSON_PROPERTY_ACCEPTED_BY = "acceptedBy"; private String acceptedBy; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcceptedBy = false; + public static final String JSON_PROPERTY_IP_ADDRESS = "ipAddress"; private String ipAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIpAddress = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AcceptTermsOfServiceRequest() {} /** @@ -46,6 +60,7 @@ public AcceptTermsOfServiceRequest() {} */ public AcceptTermsOfServiceRequest acceptedBy(String acceptedBy) { this.acceptedBy = acceptedBy; + isSetAcceptedBy = true; // mark as set return this; } @@ -83,6 +98,7 @@ public String getAcceptedBy() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcceptedBy(String acceptedBy) { this.acceptedBy = acceptedBy; + isSetAcceptedBy = true; // mark as set } /** @@ -93,6 +109,7 @@ public void setAcceptedBy(String acceptedBy) { */ public AcceptTermsOfServiceRequest ipAddress(String ipAddress) { this.ipAddress = ipAddress; + isSetIpAddress = true; // mark as set return this; } @@ -116,6 +133,27 @@ public String getIpAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIpAddress(String ipAddress) { this.ipAddress = ipAddress; + isSetIpAddress = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AcceptTermsOfServiceRequest 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 AcceptTermsOfServiceRequest object is equal to o. */ @@ -157,6 +195,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 (isSetAcceptedBy) { + addIfNull(nulls, JSON_PROPERTY_ACCEPTED_BY, this.acceptedBy); + } + if (isSetIpAddress) { + addIfNull(nulls, JSON_PROPERTY_IP_ADDRESS, this.ipAddress); + } + + 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 AcceptTermsOfServiceRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java index ea3465c5d..3583d5831 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,19 +36,34 @@ public class AcceptTermsOfServiceResponse { public static final String JSON_PROPERTY_ACCEPTED_BY = "acceptedBy"; private String acceptedBy; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcceptedBy = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_IP_ADDRESS = "ipAddress"; private String ipAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIpAddress = 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_TERMS_OF_SERVICE_DOCUMENT_ID = "termsOfServiceDocumentId"; private String termsOfServiceDocumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTermsOfServiceDocumentId = false; + /** * The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * @@ -111,6 +128,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 AcceptTermsOfServiceResponse() {} /** @@ -121,6 +147,7 @@ public AcceptTermsOfServiceResponse() {} */ public AcceptTermsOfServiceResponse acceptedBy(String acceptedBy) { this.acceptedBy = acceptedBy; + isSetAcceptedBy = true; // mark as set return this; } @@ -144,6 +171,7 @@ public String getAcceptedBy() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcceptedBy(String acceptedBy) { this.acceptedBy = acceptedBy; + isSetAcceptedBy = true; // mark as set } /** @@ -154,6 +182,7 @@ public void setAcceptedBy(String acceptedBy) { */ public AcceptTermsOfServiceResponse id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -177,6 +206,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -187,6 +217,7 @@ public void setId(String id) { */ public AcceptTermsOfServiceResponse ipAddress(String ipAddress) { this.ipAddress = ipAddress; + isSetIpAddress = true; // mark as set return this; } @@ -210,6 +241,7 @@ public String getIpAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIpAddress(String ipAddress) { this.ipAddress = ipAddress; + isSetIpAddress = true; // mark as set } /** @@ -228,6 +260,7 @@ public void setIpAddress(String ipAddress) { */ public AcceptTermsOfServiceResponse language(String language) { this.language = language; + isSetLanguage = true; // mark as set return this; } @@ -267,6 +300,7 @@ public String getLanguage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLanguage(String language) { this.language = language; + isSetLanguage = true; // mark as set } /** @@ -277,6 +311,7 @@ public void setLanguage(String language) { */ public AcceptTermsOfServiceResponse termsOfServiceDocumentId(String termsOfServiceDocumentId) { this.termsOfServiceDocumentId = termsOfServiceDocumentId; + isSetTermsOfServiceDocumentId = true; // mark as set return this; } @@ -300,6 +335,7 @@ public String getTermsOfServiceDocumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTermsOfServiceDocumentId(String termsOfServiceDocumentId) { this.termsOfServiceDocumentId = termsOfServiceDocumentId; + isSetTermsOfServiceDocumentId = true; // mark as set } /** @@ -314,6 +350,7 @@ public void setTermsOfServiceDocumentId(String termsOfServiceDocumentId) { */ public AcceptTermsOfServiceResponse type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -345,6 +382,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 AcceptTermsOfServiceResponse 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 AcceptTermsOfServiceResponse object is equal to o. */ @@ -397,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 (isSetAcceptedBy) { + addIfNull(nulls, JSON_PROPERTY_ACCEPTED_BY, this.acceptedBy); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetIpAddress) { + addIfNull(nulls, JSON_PROPERTY_IP_ADDRESS, this.ipAddress); + } + if (isSetLanguage) { + addIfNull(nulls, JSON_PROPERTY_LANGUAGE, this.language); + } + if (isSetTermsOfServiceDocumentId) { + addIfNull(nulls, JSON_PROPERTY_TERMS_OF_SERVICE_DOCUMENT_ID, this.termsOfServiceDocumentId); + } + 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 AcceptTermsOfServiceResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AdditionalBankIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/AdditionalBankIdentification.java index 1c703d1ae..0af6760fb 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AdditionalBankIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AdditionalBankIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -30,6 +32,9 @@ public class AdditionalBankIdentification { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + /** * The type of additional bank identification, depending on the country. Possible values: * * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) @@ -89,6 +94,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 AdditionalBankIdentification() {} /** @@ -99,6 +113,7 @@ public AdditionalBankIdentification() {} */ public AdditionalBankIdentification code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -122,6 +137,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -150,6 +166,7 @@ public void setCode(String code) { */ public AdditionalBankIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -209,6 +226,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 AdditionalBankIdentification 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 AdditionalBankIdentification object is equal to o. */ @@ -250,6 +288,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 (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + 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 AdditionalBankIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Address.java b/src/main/java/com/adyen/model/legalentitymanagement/Address.java index 6049b7b1f..ff05dc840 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Address.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Address.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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_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; + public static final String JSON_PROPERTY_STREET2 = "street2"; private String street2; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStreet2 = 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() {} /** @@ -57,6 +83,7 @@ public Address() {} */ public Address city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -84,6 +111,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -96,6 +124,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 } /** @@ -137,6 +167,7 @@ public void setCountry(String country) { */ public Address postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -168,6 +199,7 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set } /** @@ -182,6 +214,7 @@ public void setPostalCode(String postalCode) { */ public Address stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set return this; } @@ -213,6 +246,7 @@ public String getStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set } /** @@ -225,6 +259,7 @@ public void setStateOrProvince(String stateOrProvince) { */ public Address street(String street) { this.street = street; + isSetStreet = true; // mark as set return this; } @@ -252,6 +287,7 @@ public String getStreet() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStreet(String street) { this.street = street; + isSetStreet = true; // mark as set } /** @@ -262,6 +298,7 @@ public void setStreet(String street) { */ public Address street2(String street2) { this.street2 = street2; + isSetStreet2 = true; // mark as set return this; } @@ -285,6 +322,27 @@ public String getStreet2() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStreet2(String street2) { this.street2 = street2; + isSetStreet2 = 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. */ @@ -334,6 +392,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 (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); + } + if (isSetStreet2) { + addIfNull(nulls, JSON_PROPERTY_STREET2, this.street2); + } + + 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/legalentitymanagement/Amount.java b/src/main/java/com/adyen/model/legalentitymanagement/Amount.java index 596ffa045..fc988629a 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Amount.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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() {} /** @@ -36,6 +50,7 @@ public Amount() {} */ public Amount currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCurrency(String currency) { */ public Amount value(Long value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -92,6 +109,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. */ @@ -133,6 +171,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/legalentitymanagement/Attachment.java b/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java index b2276ea01..5c68e0058 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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,20 +32,41 @@ public class Attachment { public static final String JSON_PROPERTY_CONTENT = "content"; private byte[] content; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContent = false; + public static final String JSON_PROPERTY_CONTENT_TYPE = "contentType"; @Deprecated // deprecated since Legal Entity Management API v1 private String contentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContentType = false; + public static final String JSON_PROPERTY_FILENAME = "filename"; @Deprecated // deprecated since Legal Entity Management API v1 private String filename; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFilename = false; + public static final String JSON_PROPERTY_PAGE_NAME = "pageName"; private String pageName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPageName = false; + public static final String JSON_PROPERTY_PAGE_TYPE = "pageType"; private String pageType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPageType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Attachment() {} /** @@ -54,6 +77,7 @@ public Attachment() {} */ public Attachment content(byte[] content) { this.content = content; + isSetContent = true; // mark as set return this; } @@ -77,6 +101,7 @@ public byte[] getContent() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContent(byte[] content) { this.content = content; + isSetContent = true; // mark as set } /** @@ -91,6 +116,7 @@ public void setContent(byte[] content) { @Deprecated // deprecated since Legal Entity Management API v1 public Attachment contentType(String contentType) { this.contentType = contentType; + isSetContentType = true; // mark as set return this; } @@ -122,6 +148,7 @@ public String getContentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContentType(String contentType) { this.contentType = contentType; + isSetContentType = true; // mark as set } /** @@ -134,6 +161,7 @@ public void setContentType(String contentType) { @Deprecated // deprecated since Legal Entity Management API v1 public Attachment filename(String filename) { this.filename = filename; + isSetFilename = true; // mark as set return this; } @@ -161,6 +189,7 @@ public String getFilename() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFilename(String filename) { this.filename = filename; + isSetFilename = true; // mark as set } /** @@ -171,6 +200,7 @@ public void setFilename(String filename) { */ public Attachment pageName(String pageName) { this.pageName = pageName; + isSetPageName = true; // mark as set return this; } @@ -194,6 +224,7 @@ public String getPageName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPageName(String pageName) { this.pageName = pageName; + isSetPageName = true; // mark as set } /** @@ -210,6 +241,7 @@ public void setPageName(String pageName) { */ public Attachment pageType(String pageType) { this.pageType = pageType; + isSetPageType = true; // mark as set return this; } @@ -245,6 +277,27 @@ public String getPageType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPageType(String pageType) { this.pageType = pageType; + isSetPageType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Attachment 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 Attachment object is equal to o. */ @@ -292,6 +345,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 (isSetContent) { + addIfNull(nulls, JSON_PROPERTY_CONTENT, this.content); + } + if (isSetContentType) { + addIfNull(nulls, JSON_PROPERTY_CONTENT_TYPE, this.contentType); + } + if (isSetFilename) { + addIfNull(nulls, JSON_PROPERTY_FILENAME, this.filename); + } + if (isSetPageName) { + addIfNull(nulls, JSON_PROPERTY_PAGE_NAME, this.pageName); + } + if (isSetPageType) { + addIfNull(nulls, JSON_PROPERTY_PAGE_TYPE, this.pageType); + } + + 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 Attachment given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java index ae8fa38b7..369df29ae 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -30,19 +32,40 @@ public class BankAccountInfo { public static final String JSON_PROPERTY_ACCOUNT_IDENTIFICATION = "accountIdentification"; private BankAccountInfoAccountIdentification accountIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountIdentification = false; + public static final String JSON_PROPERTY_ACCOUNT_TYPE = "accountType"; @Deprecated // deprecated since Legal Entity Management API v2 private String accountType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountType = 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_COUNTRY_CODE = "countryCode"; private String countryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryCode = false; + public static final String JSON_PROPERTY_TRUSTED_SOURCE = "trustedSource"; private Boolean trustedSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrustedSource = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BankAccountInfo() {} @JsonCreator @@ -60,6 +83,7 @@ public BankAccountInfo(@JsonProperty(JSON_PROPERTY_TRUSTED_SOURCE) Boolean trust public BankAccountInfo accountIdentification( BankAccountInfoAccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set return this; } @@ -83,6 +107,7 @@ public BankAccountInfoAccountIdentification getAccountIdentification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountIdentification(BankAccountInfoAccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set } /** @@ -95,6 +120,7 @@ public void setAccountIdentification(BankAccountInfoAccountIdentification accoun @Deprecated // deprecated since Legal Entity Management API v2 public BankAccountInfo accountType(String accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -122,6 +148,7 @@ public String getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(String accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -132,6 +159,7 @@ public void setAccountType(String accountType) { */ public BankAccountInfo bankName(String bankName) { this.bankName = bankName; + isSetBankName = true; // mark as set return this; } @@ -155,6 +183,7 @@ public String getBankName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankName(String bankName) { this.bankName = bankName; + isSetBankName = true; // mark as set } /** @@ -168,6 +197,7 @@ public void setBankName(String bankName) { */ public BankAccountInfo countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -197,6 +227,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -212,6 +243,26 @@ public Boolean getTrustedSource() { return trustedSource; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankAccountInfo 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 BankAccountInfo object is equal to o. */ @Override public boolean equals(Object o) { @@ -259,6 +310,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 (isSetAccountIdentification) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_IDENTIFICATION, this.accountIdentification); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetBankName) { + addIfNull(nulls, JSON_PROPERTY_BANK_NAME, this.bankName); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetTrustedSource) { + addIfNull(nulls, JSON_PROPERTY_TRUSTED_SOURCE, this.trustedSource); + } + + 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 BankAccountInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BirthData.java b/src/main/java/com/adyen/model/legalentitymanagement/BirthData.java index 2b1b469aa..fe11b8a87 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BirthData.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BirthData.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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 BirthData { public static final String JSON_PROPERTY_DATE_OF_BIRTH = "dateOfBirth"; private String dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BirthData() {} /** @@ -33,6 +44,7 @@ public BirthData() {} */ public BirthData dateOfBirth(String dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -56,6 +68,27 @@ public String getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(String dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BirthData 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 BirthData object is equal to o. */ @@ -95,6 +128,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 (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + + 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 BirthData given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java index 3fcb9864d..114f10faa 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -39,18 +41,33 @@ public class BusinessLine { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_INDUSTRY_CODE = "industryCode"; private String industryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIndustryCode = false; + public static final String JSON_PROPERTY_LEGAL_ENTITY_ID = "legalEntityId"; private String legalEntityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalEntityId = false; + public static final String JSON_PROPERTY_PROBLEMS = "problems"; private List problems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProblems = false; + public static final String JSON_PROPERTY_SALES_CHANNELS = "salesChannels"; private List salesChannels; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSalesChannels = false; + /** * The service for which you are creating the business line. Possible values: * * **paymentProcessing** * **issuing** * **banking** @@ -100,15 +117,33 @@ public static ServiceEnum fromValue(String value) { public static final String JSON_PROPERTY_SERVICE = "service"; private ServiceEnum service; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetService = false; + public static final String JSON_PROPERTY_SOURCE_OF_FUNDS = "sourceOfFunds"; private SourceOfFunds sourceOfFunds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSourceOfFunds = false; + public static final String JSON_PROPERTY_WEB_DATA = "webData"; private List webData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebData = false; + public static final String JSON_PROPERTY_WEB_DATA_EXEMPTION = "webDataExemption"; private WebDataExemption webDataExemption; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebDataExemption = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BusinessLine() {} @JsonCreator @@ -144,6 +179,7 @@ public String getId() { */ public BusinessLine industryCode(String industryCode) { this.industryCode = industryCode; + isSetIndustryCode = true; // mark as set return this; } @@ -183,6 +219,7 @@ public String getIndustryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIndustryCode(String industryCode) { this.industryCode = industryCode; + isSetIndustryCode = true; // mark as set } /** @@ -197,6 +234,7 @@ public void setIndustryCode(String industryCode) { */ public BusinessLine legalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set return this; } @@ -228,6 +266,7 @@ public String getLegalEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set } /** @@ -238,6 +277,7 @@ public void setLegalEntityId(String legalEntityId) { */ public BusinessLine problems(List problems) { this.problems = problems; + isSetProblems = true; // mark as set return this; } @@ -269,6 +309,7 @@ public List getProblems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProblems(List problems) { this.problems = problems; + isSetProblems = true; // mark as set } /** @@ -283,6 +324,7 @@ public void setProblems(List problems) { */ public BusinessLine salesChannels(List salesChannels) { this.salesChannels = salesChannels; + isSetSalesChannels = true; // mark as set return this; } @@ -322,6 +364,7 @@ public List getSalesChannels() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSalesChannels(List salesChannels) { this.salesChannels = salesChannels; + isSetSalesChannels = true; // mark as set } /** @@ -334,6 +377,7 @@ public void setSalesChannels(List salesChannels) { */ public BusinessLine service(ServiceEnum service) { this.service = service; + isSetService = true; // mark as set return this; } @@ -361,6 +405,7 @@ public ServiceEnum getService() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setService(ServiceEnum service) { this.service = service; + isSetService = true; // mark as set } /** @@ -371,6 +416,7 @@ public void setService(ServiceEnum service) { */ public BusinessLine sourceOfFunds(SourceOfFunds sourceOfFunds) { this.sourceOfFunds = sourceOfFunds; + isSetSourceOfFunds = true; // mark as set return this; } @@ -394,6 +440,7 @@ public SourceOfFunds getSourceOfFunds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSourceOfFunds(SourceOfFunds sourceOfFunds) { this.sourceOfFunds = sourceOfFunds; + isSetSourceOfFunds = true; // mark as set } /** @@ -408,6 +455,7 @@ public void setSourceOfFunds(SourceOfFunds sourceOfFunds) { */ public BusinessLine webData(List webData) { this.webData = webData; + isSetWebData = true; // mark as set return this; } @@ -447,6 +495,7 @@ public List getWebData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebData(List webData) { this.webData = webData; + isSetWebData = true; // mark as set } /** @@ -457,6 +506,7 @@ public void setWebData(List webData) { */ public BusinessLine webDataExemption(WebDataExemption webDataExemption) { this.webDataExemption = webDataExemption; + isSetWebDataExemption = true; // mark as set return this; } @@ -480,6 +530,27 @@ public WebDataExemption getWebDataExemption() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebDataExemption(WebDataExemption webDataExemption) { this.webDataExemption = webDataExemption; + isSetWebDataExemption = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BusinessLine 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 BusinessLine object is equal to o. */ @@ -544,6 +615,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetIndustryCode) { + addIfNull(nulls, JSON_PROPERTY_INDUSTRY_CODE, this.industryCode); + } + if (isSetLegalEntityId) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_ENTITY_ID, this.legalEntityId); + } + if (isSetProblems) { + addIfNull(nulls, JSON_PROPERTY_PROBLEMS, this.problems); + } + if (isSetSalesChannels) { + addIfNull(nulls, JSON_PROPERTY_SALES_CHANNELS, this.salesChannels); + } + if (isSetService) { + addIfNull(nulls, JSON_PROPERTY_SERVICE, this.service); + } + if (isSetSourceOfFunds) { + addIfNull(nulls, JSON_PROPERTY_SOURCE_OF_FUNDS, this.sourceOfFunds); + } + if (isSetWebData) { + addIfNull(nulls, JSON_PROPERTY_WEB_DATA, this.webData); + } + if (isSetWebDataExemption) { + addIfNull(nulls, JSON_PROPERTY_WEB_DATA_EXEMPTION, this.webDataExemption); + } + + 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 BusinessLine given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java index 22de08dd4..f22a13b0b 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,12 +39,21 @@ public class BusinessLineInfo { public static final String JSON_PROPERTY_INDUSTRY_CODE = "industryCode"; private String industryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIndustryCode = false; + public static final String JSON_PROPERTY_LEGAL_ENTITY_ID = "legalEntityId"; private String legalEntityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalEntityId = false; + public static final String JSON_PROPERTY_SALES_CHANNELS = "salesChannels"; private List salesChannels; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSalesChannels = false; + /** * The service for which you are creating the business line. Possible values: * * **paymentProcessing** * **issuing** * **banking** @@ -92,15 +103,33 @@ public static ServiceEnum fromValue(String value) { public static final String JSON_PROPERTY_SERVICE = "service"; private ServiceEnum service; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetService = false; + public static final String JSON_PROPERTY_SOURCE_OF_FUNDS = "sourceOfFunds"; private SourceOfFunds sourceOfFunds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSourceOfFunds = false; + public static final String JSON_PROPERTY_WEB_DATA = "webData"; private List webData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebData = false; + public static final String JSON_PROPERTY_WEB_DATA_EXEMPTION = "webDataExemption"; private WebDataExemption webDataExemption; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebDataExemption = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BusinessLineInfo() {} /** @@ -119,6 +148,7 @@ public BusinessLineInfo() {} */ public BusinessLineInfo industryCode(String industryCode) { this.industryCode = industryCode; + isSetIndustryCode = true; // mark as set return this; } @@ -158,6 +188,7 @@ public String getIndustryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIndustryCode(String industryCode) { this.industryCode = industryCode; + isSetIndustryCode = true; // mark as set } /** @@ -172,6 +203,7 @@ public void setIndustryCode(String industryCode) { */ public BusinessLineInfo legalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set return this; } @@ -203,6 +235,7 @@ public String getLegalEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set } /** @@ -217,6 +250,7 @@ public void setLegalEntityId(String legalEntityId) { */ public BusinessLineInfo salesChannels(List salesChannels) { this.salesChannels = salesChannels; + isSetSalesChannels = true; // mark as set return this; } @@ -256,6 +290,7 @@ public List getSalesChannels() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSalesChannels(List salesChannels) { this.salesChannels = salesChannels; + isSetSalesChannels = true; // mark as set } /** @@ -268,6 +303,7 @@ public void setSalesChannels(List salesChannels) { */ public BusinessLineInfo service(ServiceEnum service) { this.service = service; + isSetService = true; // mark as set return this; } @@ -295,6 +331,7 @@ public ServiceEnum getService() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setService(ServiceEnum service) { this.service = service; + isSetService = true; // mark as set } /** @@ -305,6 +342,7 @@ public void setService(ServiceEnum service) { */ public BusinessLineInfo sourceOfFunds(SourceOfFunds sourceOfFunds) { this.sourceOfFunds = sourceOfFunds; + isSetSourceOfFunds = true; // mark as set return this; } @@ -328,6 +366,7 @@ public SourceOfFunds getSourceOfFunds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSourceOfFunds(SourceOfFunds sourceOfFunds) { this.sourceOfFunds = sourceOfFunds; + isSetSourceOfFunds = true; // mark as set } /** @@ -342,6 +381,7 @@ public void setSourceOfFunds(SourceOfFunds sourceOfFunds) { */ public BusinessLineInfo webData(List webData) { this.webData = webData; + isSetWebData = true; // mark as set return this; } @@ -381,6 +421,7 @@ public List getWebData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebData(List webData) { this.webData = webData; + isSetWebData = true; // mark as set } /** @@ -391,6 +432,7 @@ public void setWebData(List webData) { */ public BusinessLineInfo webDataExemption(WebDataExemption webDataExemption) { this.webDataExemption = webDataExemption; + isSetWebDataExemption = true; // mark as set return this; } @@ -414,6 +456,27 @@ public WebDataExemption getWebDataExemption() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebDataExemption(WebDataExemption webDataExemption) { this.webDataExemption = webDataExemption; + isSetWebDataExemption = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BusinessLineInfo 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 BusinessLineInfo object is equal to o. */ @@ -472,6 +535,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetIndustryCode) { + addIfNull(nulls, JSON_PROPERTY_INDUSTRY_CODE, this.industryCode); + } + if (isSetLegalEntityId) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_ENTITY_ID, this.legalEntityId); + } + if (isSetSalesChannels) { + addIfNull(nulls, JSON_PROPERTY_SALES_CHANNELS, this.salesChannels); + } + if (isSetService) { + addIfNull(nulls, JSON_PROPERTY_SERVICE, this.service); + } + if (isSetSourceOfFunds) { + addIfNull(nulls, JSON_PROPERTY_SOURCE_OF_FUNDS, this.sourceOfFunds); + } + if (isSetWebData) { + addIfNull(nulls, JSON_PROPERTY_WEB_DATA, this.webData); + } + if (isSetWebDataExemption) { + addIfNull(nulls, JSON_PROPERTY_WEB_DATA_EXEMPTION, this.webDataExemption); + } + + 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 BusinessLineInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java index 71e5bac98..a591e1912 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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; @@ -31,18 +33,39 @@ public class BusinessLineInfoUpdate { public static final String JSON_PROPERTY_INDUSTRY_CODE = "industryCode"; private String industryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIndustryCode = false; + public static final String JSON_PROPERTY_SALES_CHANNELS = "salesChannels"; private List salesChannels; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSalesChannels = false; + public static final String JSON_PROPERTY_SOURCE_OF_FUNDS = "sourceOfFunds"; private SourceOfFunds sourceOfFunds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSourceOfFunds = false; + public static final String JSON_PROPERTY_WEB_DATA = "webData"; private List webData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebData = false; + public static final String JSON_PROPERTY_WEB_DATA_EXEMPTION = "webDataExemption"; private WebDataExemption webDataExemption; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebDataExemption = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BusinessLineInfoUpdate() {} /** @@ -55,6 +78,7 @@ public BusinessLineInfoUpdate() {} */ public BusinessLineInfoUpdate industryCode(String industryCode) { this.industryCode = industryCode; + isSetIndustryCode = true; // mark as set return this; } @@ -82,6 +106,7 @@ public String getIndustryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIndustryCode(String industryCode) { this.industryCode = industryCode; + isSetIndustryCode = true; // mark as set } /** @@ -96,6 +121,7 @@ public void setIndustryCode(String industryCode) { */ public BusinessLineInfoUpdate salesChannels(List salesChannels) { this.salesChannels = salesChannels; + isSetSalesChannels = true; // mark as set return this; } @@ -135,6 +161,7 @@ public List getSalesChannels() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSalesChannels(List salesChannels) { this.salesChannels = salesChannels; + isSetSalesChannels = true; // mark as set } /** @@ -145,6 +172,7 @@ public void setSalesChannels(List salesChannels) { */ public BusinessLineInfoUpdate sourceOfFunds(SourceOfFunds sourceOfFunds) { this.sourceOfFunds = sourceOfFunds; + isSetSourceOfFunds = true; // mark as set return this; } @@ -168,6 +196,7 @@ public SourceOfFunds getSourceOfFunds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSourceOfFunds(SourceOfFunds sourceOfFunds) { this.sourceOfFunds = sourceOfFunds; + isSetSourceOfFunds = true; // mark as set } /** @@ -182,6 +211,7 @@ public void setSourceOfFunds(SourceOfFunds sourceOfFunds) { */ public BusinessLineInfoUpdate webData(List webData) { this.webData = webData; + isSetWebData = true; // mark as set return this; } @@ -221,6 +251,7 @@ public List getWebData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebData(List webData) { this.webData = webData; + isSetWebData = true; // mark as set } /** @@ -231,6 +262,7 @@ public void setWebData(List webData) { */ public BusinessLineInfoUpdate webDataExemption(WebDataExemption webDataExemption) { this.webDataExemption = webDataExemption; + isSetWebDataExemption = true; // mark as set return this; } @@ -254,6 +286,27 @@ public WebDataExemption getWebDataExemption() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebDataExemption(WebDataExemption webDataExemption) { this.webDataExemption = webDataExemption; + isSetWebDataExemption = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BusinessLineInfoUpdate 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 BusinessLineInfoUpdate object is equal to o. */ @@ -301,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 (isSetIndustryCode) { + addIfNull(nulls, JSON_PROPERTY_INDUSTRY_CODE, this.industryCode); + } + if (isSetSalesChannels) { + addIfNull(nulls, JSON_PROPERTY_SALES_CHANNELS, this.salesChannels); + } + if (isSetSourceOfFunds) { + addIfNull(nulls, JSON_PROPERTY_SOURCE_OF_FUNDS, this.sourceOfFunds); + } + if (isSetWebData) { + addIfNull(nulls, JSON_PROPERTY_WEB_DATA, this.webData); + } + if (isSetWebDataExemption) { + addIfNull(nulls, JSON_PROPERTY_WEB_DATA_EXEMPTION, this.webDataExemption); + } + + 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 BusinessLineInfoUpdate given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java index 964d07076..1d5beeef7 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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,6 +27,15 @@ public class BusinessLines { public static final String JSON_PROPERTY_BUSINESS_LINES = "businessLines"; private List businessLines; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBusinessLines = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BusinessLines() {} /** @@ -35,6 +46,7 @@ public BusinessLines() {} */ public BusinessLines businessLines(List businessLines) { this.businessLines = businessLines; + isSetBusinessLines = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getBusinessLines() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBusinessLines(List businessLines) { this.businessLines = businessLines; + isSetBusinessLines = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BusinessLines 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 BusinessLines object is equal to o. */ @@ -105,6 +138,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 (isSetBusinessLines) { + addIfNull(nulls, JSON_PROPERTY_BUSINESS_LINES, this.businessLines); + } + + 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 BusinessLines given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/CALocalAccountIdentification.java index ca2da4544..b8883273b 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CALocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CALocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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 CALocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. */ @@ -79,12 +84,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_INSTITUTION_NUMBER = "institutionNumber"; private String institutionNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstitutionNumber = false; + public static final String JSON_PROPERTY_TRANSIT_NUMBER = "transitNumber"; private String transitNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransitNumber = false; + /** **caLocal** */ public enum TypeEnum { CALOCAL(String.valueOf("caLocal")); @@ -127,6 +141,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 CALocalAccountIdentification() {} /** @@ -137,6 +160,7 @@ public CALocalAccountIdentification() {} */ public CALocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -160,6 +184,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -171,6 +196,7 @@ public void setAccountNumber(String accountNumber) { */ public CALocalAccountIdentification accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -196,6 +222,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -206,6 +233,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public CALocalAccountIdentification institutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; + isSetInstitutionNumber = true; // mark as set return this; } @@ -229,6 +257,7 @@ public String getInstitutionNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstitutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; + isSetInstitutionNumber = true; // mark as set } /** @@ -239,6 +268,7 @@ public void setInstitutionNumber(String institutionNumber) { */ public CALocalAccountIdentification transitNumber(String transitNumber) { this.transitNumber = transitNumber; + isSetTransitNumber = true; // mark as set return this; } @@ -262,6 +292,7 @@ public String getTransitNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransitNumber(String transitNumber) { this.transitNumber = transitNumber; + isSetTransitNumber = true; // mark as set } /** @@ -272,6 +303,7 @@ public void setTransitNumber(String transitNumber) { */ public CALocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -295,6 +327,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 CALocalAccountIdentification 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 CALocalAccountIdentification object is equal to o. */ @@ -342,6 +395,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetInstitutionNumber) { + addIfNull(nulls, JSON_PROPERTY_INSTITUTION_NUMBER, this.institutionNumber); + } + if (isSetTransitNumber) { + addIfNull(nulls, JSON_PROPERTY_TRANSIT_NUMBER, this.transitNumber); + } + 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 CALocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/CZLocalAccountIdentification.java index 9047a76f1..6d75e432d 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CZLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,9 +33,15 @@ public class CZLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + /** **czLocal** */ public enum TypeEnum { CZLOCAL(String.valueOf("czLocal")); @@ -76,6 +84,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 CZLocalAccountIdentification() {} /** @@ -94,6 +111,7 @@ public CZLocalAccountIdentification() {} */ public CZLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -133,6 +151,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -143,6 +162,7 @@ public void setAccountNumber(String accountNumber) { */ public CZLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setBankCode(String bankCode) { */ public CZLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -199,6 +221,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 CZLocalAccountIdentification 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 CZLocalAccountIdentification object is equal to o. */ @@ -242,6 +285,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + 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 CZLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CalculatePciStatusRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/CalculatePciStatusRequest.java index e48c981cd..20d8e3a00 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CalculatePciStatusRequest.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CalculatePciStatusRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -74,6 +76,15 @@ public static AdditionalSalesChannelsEnum fromValue(String value) { public static final String JSON_PROPERTY_ADDITIONAL_SALES_CHANNELS = "additionalSalesChannels"; private List additionalSalesChannels; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalSalesChannels = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CalculatePciStatusRequest() {} /** @@ -93,6 +104,7 @@ public CalculatePciStatusRequest() {} public CalculatePciStatusRequest additionalSalesChannels( List additionalSalesChannels) { this.additionalSalesChannels = additionalSalesChannels; + isSetAdditionalSalesChannels = true; // mark as set return this; } @@ -142,6 +154,27 @@ public List getAdditionalSalesChannels() { public void setAdditionalSalesChannels( List additionalSalesChannels) { this.additionalSalesChannels = additionalSalesChannels; + isSetAdditionalSalesChannels = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CalculatePciStatusRequest 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 CalculatePciStatusRequest object is equal to o. */ @@ -184,6 +217,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 (isSetAdditionalSalesChannels) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_SALES_CHANNELS, this.additionalSalesChannels); + } + + 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 CalculatePciStatusRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CalculatePciStatusResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/CalculatePciStatusResponse.java index 93c5b81eb..7500ea4b7 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CalculatePciStatusResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CalculatePciStatusResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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 CalculatePciStatusResponse { public static final String JSON_PROPERTY_SIGNING_REQUIRED = "signingRequired"; private Boolean signingRequired; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSigningRequired = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CalculatePciStatusResponse() {} /** @@ -35,6 +46,7 @@ public CalculatePciStatusResponse() {} */ public CalculatePciStatusResponse signingRequired(Boolean signingRequired) { this.signingRequired = signingRequired; + isSetSigningRequired = true; // mark as set return this; } @@ -62,6 +74,27 @@ public Boolean getSigningRequired() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSigningRequired(Boolean signingRequired) { this.signingRequired = signingRequired; + isSetSigningRequired = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CalculatePciStatusResponse 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 CalculatePciStatusResponse object is equal to o. */ @@ -101,6 +134,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 (isSetSigningRequired) { + addIfNull(nulls, JSON_PROPERTY_SIGNING_REQUIRED, this.signingRequired); + } + + 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 CalculatePciStatusResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CalculateTermsOfServiceStatusResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/CalculateTermsOfServiceStatusResponse.java index 1c8166a25..7c06f3477 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CalculateTermsOfServiceStatusResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CalculateTermsOfServiceStatusResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -86,6 +88,15 @@ public static TermsOfServiceTypesEnum fromValue(String value) { public static final String JSON_PROPERTY_TERMS_OF_SERVICE_TYPES = "termsOfServiceTypes"; private List termsOfServiceTypes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTermsOfServiceTypes = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CalculateTermsOfServiceStatusResponse() {} /** @@ -100,6 +111,7 @@ public CalculateTermsOfServiceStatusResponse() {} public CalculateTermsOfServiceStatusResponse termsOfServiceTypes( List termsOfServiceTypes) { this.termsOfServiceTypes = termsOfServiceTypes; + isSetTermsOfServiceTypes = true; // mark as set return this; } @@ -136,6 +148,27 @@ public List getTermsOfServiceTypes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTermsOfServiceTypes(List termsOfServiceTypes) { this.termsOfServiceTypes = termsOfServiceTypes; + isSetTermsOfServiceTypes = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CalculateTermsOfServiceStatusResponse 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 CalculateTermsOfServiceStatusResponse object is equal to o. */ @@ -179,6 +212,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 (isSetTermsOfServiceTypes) { + addIfNull(nulls, JSON_PROPERTY_TERMS_OF_SERVICE_TYPES, this.termsOfServiceTypes); + } + + 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 CalculateTermsOfServiceStatusResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java index 1b1561f42..827e6dafa 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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,9 +30,21 @@ public class CapabilityProblem { public static final String JSON_PROPERTY_ENTITY = "entity"; private CapabilityProblemEntity entity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntity = false; + public static final String JSON_PROPERTY_VERIFICATION_ERRORS = "verificationErrors"; private List verificationErrors; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationErrors = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapabilityProblem() {} /** @@ -41,6 +55,7 @@ public CapabilityProblem() {} */ public CapabilityProblem entity(CapabilityProblemEntity entity) { this.entity = entity; + isSetEntity = true; // mark as set return this; } @@ -64,6 +79,7 @@ public CapabilityProblemEntity getEntity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntity(CapabilityProblemEntity entity) { this.entity = entity; + isSetEntity = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setEntity(CapabilityProblemEntity entity) { */ public CapabilityProblem verificationErrors(List verificationErrors) { this.verificationErrors = verificationErrors; + isSetVerificationErrors = true; // mark as set return this; } @@ -105,6 +122,27 @@ public List getVerificationErrors() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVerificationErrors(List verificationErrors) { this.verificationErrors = verificationErrors; + isSetVerificationErrors = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapabilityProblem 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 CapabilityProblem object is equal to o. */ @@ -146,6 +184,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 (isSetEntity) { + addIfNull(nulls, JSON_PROPERTY_ENTITY, this.entity); + } + if (isSetVerificationErrors) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_ERRORS, this.verificationErrors); + } + + 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 CapabilityProblem given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java index ad48ed04e..ca07a3278 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,12 +36,21 @@ public class CapabilityProblemEntity { public static final String JSON_PROPERTY_DOCUMENTS = "documents"; private List documents; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocuments = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_OWNER = "owner"; private CapabilityProblemEntityRecursive owner; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOwner = false; + /** Gets or Sets type */ public enum TypeEnum { BANKACCOUNT(String.valueOf("BankAccount")), @@ -88,6 +99,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 CapabilityProblemEntity() {} /** @@ -99,6 +119,7 @@ public CapabilityProblemEntity() {} */ public CapabilityProblemEntity documents(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set return this; } @@ -132,6 +153,7 @@ public List getDocuments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocuments(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set } /** @@ -142,6 +164,7 @@ public void setDocuments(List documents) { */ public CapabilityProblemEntity id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -165,6 +188,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -175,6 +199,7 @@ public void setId(String id) { */ public CapabilityProblemEntity owner(CapabilityProblemEntityRecursive owner) { this.owner = owner; + isSetOwner = true; // mark as set return this; } @@ -198,6 +223,7 @@ public CapabilityProblemEntityRecursive getOwner() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwner(CapabilityProblemEntityRecursive owner) { this.owner = owner; + isSetOwner = true; // mark as set } /** @@ -208,6 +234,7 @@ public void setOwner(CapabilityProblemEntityRecursive owner) { */ public CapabilityProblemEntity type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -231,6 +258,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 CapabilityProblemEntity 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 CapabilityProblemEntity object is equal to o. */ @@ -276,6 +324,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 (isSetDocuments) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENTS, this.documents); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetOwner) { + addIfNull(nulls, JSON_PROPERTY_OWNER, this.owner); + } + 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 CapabilityProblemEntity given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java index feffdc407..990a39040 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +37,15 @@ public class CapabilityProblemEntityRecursive { public static final String JSON_PROPERTY_DOCUMENTS = "documents"; private List documents; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocuments = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + /** Gets or Sets type */ public enum TypeEnum { BANKACCOUNT(String.valueOf("BankAccount")), @@ -86,6 +94,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 CapabilityProblemEntityRecursive() {} /** @@ -98,6 +115,7 @@ public CapabilityProblemEntityRecursive() {} */ public CapabilityProblemEntityRecursive documents(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set return this; } @@ -131,6 +149,7 @@ public List getDocuments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocuments(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set } /** @@ -142,6 +161,7 @@ public void setDocuments(List documents) { */ public CapabilityProblemEntityRecursive id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -165,6 +185,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setId(String id) { */ public CapabilityProblemEntityRecursive type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -199,6 +221,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 CapabilityProblemEntityRecursive 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 CapabilityProblemEntity-recursive object is equal to o. */ @@ -243,6 +286,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 (isSetDocuments) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENTS, this.documents); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + 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 CapabilityProblemEntityRecursive given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilitySettings.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilitySettings.java index bb1b4526b..c5dee8edd 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilitySettings.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilitySettings.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,9 +39,15 @@ public class CapabilitySettings { public static final String JSON_PROPERTY_AMOUNT_PER_INDUSTRY = "amountPerIndustry"; private Map amountPerIndustry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountPerIndustry = false; + public static final String JSON_PROPERTY_AUTHORIZED_CARD_USERS = "authorizedCardUsers"; private Boolean authorizedCardUsers; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorizedCardUsers = false; + /** Gets or Sets fundingSource */ public enum FundingSourceEnum { CREDIT(String.valueOf("credit")), @@ -86,6 +94,9 @@ public static FundingSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private List fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + /** The period when the rule conditions apply. */ public enum IntervalEnum { DAILY(String.valueOf("daily")), @@ -132,9 +143,21 @@ public static IntervalEnum fromValue(String value) { public static final String JSON_PROPERTY_INTERVAL = "interval"; private IntervalEnum interval; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInterval = false; + public static final String JSON_PROPERTY_MAX_AMOUNT = "maxAmount"; private Amount maxAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaxAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapabilitySettings() {} /** @@ -145,6 +168,7 @@ public CapabilitySettings() {} */ public CapabilitySettings amountPerIndustry(Map amountPerIndustry) { this.amountPerIndustry = amountPerIndustry; + isSetAmountPerIndustry = true; // mark as set return this; } @@ -176,6 +200,7 @@ public Map getAmountPerIndustry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountPerIndustry(Map amountPerIndustry) { this.amountPerIndustry = amountPerIndustry; + isSetAmountPerIndustry = true; // mark as set } /** @@ -186,6 +211,7 @@ public void setAmountPerIndustry(Map amountPerIndustry) { */ public CapabilitySettings authorizedCardUsers(Boolean authorizedCardUsers) { this.authorizedCardUsers = authorizedCardUsers; + isSetAuthorizedCardUsers = true; // mark as set return this; } @@ -209,6 +235,7 @@ public Boolean getAuthorizedCardUsers() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorizedCardUsers(Boolean authorizedCardUsers) { this.authorizedCardUsers = authorizedCardUsers; + isSetAuthorizedCardUsers = true; // mark as set } /** @@ -219,6 +246,7 @@ public void setAuthorizedCardUsers(Boolean authorizedCardUsers) { */ public CapabilitySettings fundingSource(List fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -250,6 +278,7 @@ public List getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(List fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -260,6 +289,7 @@ public void setFundingSource(List fundingSource) { */ public CapabilitySettings interval(IntervalEnum interval) { this.interval = interval; + isSetInterval = true; // mark as set return this; } @@ -283,6 +313,7 @@ public IntervalEnum getInterval() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInterval(IntervalEnum interval) { this.interval = interval; + isSetInterval = true; // mark as set } /** @@ -293,6 +324,7 @@ public void setInterval(IntervalEnum interval) { */ public CapabilitySettings maxAmount(Amount maxAmount) { this.maxAmount = maxAmount; + isSetMaxAmount = true; // mark as set return this; } @@ -316,6 +348,27 @@ public Amount getMaxAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaxAmount(Amount maxAmount) { this.maxAmount = maxAmount; + isSetMaxAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapabilitySettings 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 CapabilitySettings object is equal to o. */ @@ -365,6 +418,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 (isSetAmountPerIndustry) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_PER_INDUSTRY, this.amountPerIndustry); + } + if (isSetAuthorizedCardUsers) { + addIfNull(nulls, JSON_PROPERTY_AUTHORIZED_CARD_USERS, this.authorizedCardUsers); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetInterval) { + addIfNull(nulls, JSON_PROPERTY_INTERVAL, this.interval); + } + if (isSetMaxAmount) { + addIfNull(nulls, JSON_PROPERTY_MAX_AMOUNT, this.maxAmount); + } + + 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 CapabilitySettings given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CheckTaxElectronicDeliveryConsentResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/CheckTaxElectronicDeliveryConsentResponse.java index 1889ec8c7..ec7b3bbfd 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CheckTaxElectronicDeliveryConsentResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CheckTaxElectronicDeliveryConsentResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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 CheckTaxElectronicDeliveryConsentResponse { public static final String JSON_PROPERTY_US1099K = "US1099k"; private Boolean us1099k; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUs1099k = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckTaxElectronicDeliveryConsentResponse() {} /** @@ -34,6 +45,7 @@ public CheckTaxElectronicDeliveryConsentResponse() {} */ public CheckTaxElectronicDeliveryConsentResponse us1099k(Boolean us1099k) { this.us1099k = us1099k; + isSetUs1099k = true; // mark as set return this; } @@ -57,6 +69,27 @@ public Boolean getUs1099k() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUs1099k(Boolean us1099k) { this.us1099k = us1099k; + isSetUs1099k = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckTaxElectronicDeliveryConsentResponse 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 CheckTaxElectronicDeliveryConsentResponse object is equal to o. */ @@ -97,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 (isSetUs1099k) { + addIfNull(nulls, JSON_PROPERTY_US1099K, this.us1099k); + } + + 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 CheckTaxElectronicDeliveryConsentResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/DKLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/DKLocalAccountIdentification.java index c035efe5a..e37403c2d 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/DKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/DKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,9 +33,15 @@ public class DKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + /** **dkLocal** */ public enum TypeEnum { DKLOCAL(String.valueOf("dkLocal")); @@ -76,6 +84,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 DKLocalAccountIdentification() {} /** @@ -87,6 +104,7 @@ public DKLocalAccountIdentification() {} */ public DKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -112,6 +130,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -122,6 +141,7 @@ public void setAccountNumber(String accountNumber) { */ public DKLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -146,6 +166,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -156,6 +177,7 @@ public void setBankCode(String bankCode) { */ public DKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -179,6 +201,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 DKLocalAccountIdentification 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 DKLocalAccountIdentification object is equal to o. */ @@ -222,6 +265,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + 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 DKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/DataReviewConfirmationResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/DataReviewConfirmationResponse.java index f59fa2dc4..52a172199 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/DataReviewConfirmationResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/DataReviewConfirmationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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 DataReviewConfirmationResponse { public static final String JSON_PROPERTY_DATA_REVIEWED_AT = "dataReviewedAt"; private String dataReviewedAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDataReviewedAt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DataReviewConfirmationResponse() {} /** @@ -34,6 +45,7 @@ public DataReviewConfirmationResponse() {} */ public DataReviewConfirmationResponse dataReviewedAt(String dataReviewedAt) { this.dataReviewedAt = dataReviewedAt; + isSetDataReviewedAt = true; // mark as set return this; } @@ -57,6 +69,27 @@ public String getDataReviewedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDataReviewedAt(String dataReviewedAt) { this.dataReviewedAt = dataReviewedAt; + isSetDataReviewedAt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DataReviewConfirmationResponse 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 DataReviewConfirmationResponse object is equal to o. */ @@ -97,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 (isSetDataReviewedAt) { + addIfNull(nulls, JSON_PROPERTY_DATA_REVIEWED_AT, this.dataReviewedAt); + } + + 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 DataReviewConfirmationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Document.java b/src/main/java/com/adyen/model/legalentitymanagement/Document.java index 641e0580d..acfcf5f63 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Document.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Document.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -44,42 +46,78 @@ public class Document { public static final String JSON_PROPERTY_ATTACHMENT = "attachment"; private Attachment attachment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAttachment = false; + public static final String JSON_PROPERTY_ATTACHMENTS = "attachments"; private List attachments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAttachments = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_EXPIRY_DATE = "expiryDate"; @Deprecated // deprecated since Legal Entity Management API v1 private String expiryDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryDate = false; + public static final String JSON_PROPERTY_FILE_NAME = "fileName"; private String fileName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFileName = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_ISSUER_COUNTRY = "issuerCountry"; @Deprecated // deprecated since Legal Entity Management API v1 private String issuerCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuerCountry = false; + public static final String JSON_PROPERTY_ISSUER_STATE = "issuerState"; @Deprecated // deprecated since Legal Entity Management API v1 private String issuerState; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuerState = false; + public static final String JSON_PROPERTY_MODIFICATION_DATE = "modificationDate"; private OffsetDateTime modificationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationDate = 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_OWNER = "owner"; private OwnerEntity owner; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOwner = false; + /** * Type of document, used when providing an ID number or uploading a document. The possible values * depend on the legal entity type. * For **organization**, the `type` values can be @@ -174,6 +212,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 Document() {} @JsonCreator @@ -195,6 +242,7 @@ public Document( */ public Document attachment(Attachment attachment) { this.attachment = attachment; + isSetAttachment = true; // mark as set return this; } @@ -218,6 +266,7 @@ public Attachment getAttachment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAttachment(Attachment attachment) { this.attachment = attachment; + isSetAttachment = true; // mark as set } /** @@ -230,6 +279,7 @@ public void setAttachment(Attachment attachment) { */ public Document attachments(List attachments) { this.attachments = attachments; + isSetAttachments = true; // mark as set return this; } @@ -265,6 +315,7 @@ public List getAttachments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAttachments(List attachments) { this.attachments = attachments; + isSetAttachments = true; // mark as set } /** @@ -286,6 +337,7 @@ public OffsetDateTime getCreationDate() { */ public Document description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -309,6 +361,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -321,6 +374,7 @@ public void setDescription(String description) { @Deprecated // deprecated since Legal Entity Management API v1 public Document expiryDate(String expiryDate) { this.expiryDate = expiryDate; + isSetExpiryDate = true; // mark as set return this; } @@ -348,6 +402,7 @@ public String getExpiryDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryDate(String expiryDate) { this.expiryDate = expiryDate; + isSetExpiryDate = true; // mark as set } /** @@ -358,6 +413,7 @@ public void setExpiryDate(String expiryDate) { */ public Document fileName(String fileName) { this.fileName = fileName; + isSetFileName = true; // mark as set return this; } @@ -381,6 +437,7 @@ public String getFileName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFileName(String fileName) { this.fileName = fileName; + isSetFileName = true; // mark as set } /** @@ -407,6 +464,7 @@ public String getId() { @Deprecated // deprecated since Legal Entity Management API v1 public Document issuerCountry(String issuerCountry) { this.issuerCountry = issuerCountry; + isSetIssuerCountry = true; // mark as set return this; } @@ -440,6 +498,7 @@ public String getIssuerCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuerCountry(String issuerCountry) { this.issuerCountry = issuerCountry; + isSetIssuerCountry = true; // mark as set } /** @@ -452,6 +511,7 @@ public void setIssuerCountry(String issuerCountry) { @Deprecated // deprecated since Legal Entity Management API v1 public Document issuerState(String issuerState) { this.issuerState = issuerState; + isSetIssuerState = true; // mark as set return this; } @@ -479,6 +539,7 @@ public String getIssuerState() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuerState(String issuerState) { this.issuerState = issuerState; + isSetIssuerState = true; // mark as set } /** @@ -500,6 +561,7 @@ public OffsetDateTime getModificationDate() { */ public Document number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -523,6 +585,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -533,6 +596,7 @@ public void setNumber(String number) { */ public Document owner(OwnerEntity owner) { this.owner = owner; + isSetOwner = true; // mark as set return this; } @@ -556,6 +620,7 @@ public OwnerEntity getOwner() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwner(OwnerEntity owner) { this.owner = owner; + isSetOwner = true; // mark as set } /** @@ -591,6 +656,7 @@ public void setOwner(OwnerEntity owner) { */ public Document type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -664,6 +730,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 Document 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 Document object is equal to o. */ @@ -740,6 +827,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 (isSetAttachment) { + addIfNull(nulls, JSON_PROPERTY_ATTACHMENT, this.attachment); + } + if (isSetAttachments) { + addIfNull(nulls, JSON_PROPERTY_ATTACHMENTS, this.attachments); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetExpiryDate) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_DATE, this.expiryDate); + } + if (isSetFileName) { + addIfNull(nulls, JSON_PROPERTY_FILE_NAME, this.fileName); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetIssuerCountry) { + addIfNull(nulls, JSON_PROPERTY_ISSUER_COUNTRY, this.issuerCountry); + } + if (isSetIssuerState) { + addIfNull(nulls, JSON_PROPERTY_ISSUER_STATE, this.issuerState); + } + if (isSetModificationDate) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_DATE, this.modificationDate); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + if (isSetOwner) { + addIfNull(nulls, JSON_PROPERTY_OWNER, this.owner); + } + 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 Document given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/DocumentPage.java b/src/main/java/com/adyen/model/legalentitymanagement/DocumentPage.java index 0be981dee..d94044435 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/DocumentPage.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/DocumentPage.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,9 +33,15 @@ public class DocumentPage { public static final String JSON_PROPERTY_PAGE_NAME = "pageName"; private String pageName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPageName = false; + public static final String JSON_PROPERTY_PAGE_NUMBER = "pageNumber"; private Integer pageNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPageNumber = false; + /** Gets or Sets type */ public enum TypeEnum { BACK(String.valueOf("BACK")), @@ -80,6 +88,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 DocumentPage() {} /** @@ -90,6 +107,7 @@ public DocumentPage() {} */ public DocumentPage pageName(String pageName) { this.pageName = pageName; + isSetPageName = true; // mark as set return this; } @@ -113,6 +131,7 @@ public String getPageName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPageName(String pageName) { this.pageName = pageName; + isSetPageName = true; // mark as set } /** @@ -123,6 +142,7 @@ public void setPageName(String pageName) { */ public DocumentPage pageNumber(Integer pageNumber) { this.pageNumber = pageNumber; + isSetPageNumber = true; // mark as set return this; } @@ -146,6 +166,7 @@ public Integer getPageNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPageNumber(Integer pageNumber) { this.pageNumber = pageNumber; + isSetPageNumber = true; // mark as set } /** @@ -156,6 +177,7 @@ public void setPageNumber(Integer pageNumber) { */ public DocumentPage type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -179,6 +201,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 DocumentPage 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 DocumentPage object is equal to o. */ @@ -222,6 +265,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 (isSetPageName) { + addIfNull(nulls, JSON_PROPERTY_PAGE_NAME, this.pageName); + } + if (isSetPageNumber) { + addIfNull(nulls, JSON_PROPERTY_PAGE_NUMBER, this.pageNumber); + } + 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 DocumentPage given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/DocumentReference.java b/src/main/java/com/adyen/model/legalentitymanagement/DocumentReference.java index c333658b8..aafa8547c 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/DocumentReference.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/DocumentReference.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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,24 +36,51 @@ public class DocumentReference { public static final String JSON_PROPERTY_ACTIVE = "active"; private Boolean active; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetActive = 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_FILE_NAME = "fileName"; private String fileName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFileName = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_MODIFICATION_DATE = "modificationDate"; private OffsetDateTime modificationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationDate = false; + public static final String JSON_PROPERTY_PAGES = "pages"; private List pages; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPages = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 DocumentReference() {} /** @@ -62,6 +91,7 @@ public DocumentReference() {} */ public DocumentReference active(Boolean active) { this.active = active; + isSetActive = true; // mark as set return this; } @@ -85,6 +115,7 @@ public Boolean getActive() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setActive(Boolean active) { this.active = active; + isSetActive = true; // mark as set } /** @@ -95,6 +126,7 @@ public void setActive(Boolean active) { */ public DocumentReference description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -118,6 +150,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -128,6 +161,7 @@ public void setDescription(String description) { */ public DocumentReference fileName(String fileName) { this.fileName = fileName; + isSetFileName = true; // mark as set return this; } @@ -151,6 +185,7 @@ public String getFileName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFileName(String fileName) { this.fileName = fileName; + isSetFileName = true; // mark as set } /** @@ -161,6 +196,7 @@ public void setFileName(String fileName) { */ public DocumentReference id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -184,6 +220,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -194,6 +231,7 @@ public void setId(String id) { */ public DocumentReference modificationDate(OffsetDateTime modificationDate) { this.modificationDate = modificationDate; + isSetModificationDate = true; // mark as set return this; } @@ -217,6 +255,7 @@ public OffsetDateTime getModificationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationDate(OffsetDateTime modificationDate) { this.modificationDate = modificationDate; + isSetModificationDate = true; // mark as set } /** @@ -227,6 +266,7 @@ public void setModificationDate(OffsetDateTime modificationDate) { */ public DocumentReference pages(List pages) { this.pages = pages; + isSetPages = true; // mark as set return this; } @@ -258,6 +298,7 @@ public List getPages() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPages(List pages) { this.pages = pages; + isSetPages = true; // mark as set } /** @@ -268,6 +309,7 @@ public void setPages(List pages) { */ public DocumentReference type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -291,6 +333,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DocumentReference 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 DocumentReference object is equal to o. */ @@ -342,6 +405,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetActive) { + addIfNull(nulls, JSON_PROPERTY_ACTIVE, this.active); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetFileName) { + addIfNull(nulls, JSON_PROPERTY_FILE_NAME, this.fileName); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetModificationDate) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_DATE, this.modificationDate); + } + if (isSetPages) { + addIfNull(nulls, JSON_PROPERTY_PAGES, this.pages); + } + 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 DocumentReference given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/EntityReference.java b/src/main/java/com/adyen/model/legalentitymanagement/EntityReference.java index 89c9145c8..dcaa49253 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/EntityReference.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/EntityReference.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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 EntityReference { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public EntityReference() {} /** @@ -33,6 +44,7 @@ public EntityReference() {} */ public EntityReference id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -56,6 +68,27 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public EntityReference 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 EntityReference object is equal to o. */ @@ -95,6 +128,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + + 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 EntityReference given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/FinancialReport.java b/src/main/java/com/adyen/model/legalentitymanagement/FinancialReport.java index d5c8206fb..e3c6d034a 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/FinancialReport.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/FinancialReport.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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 FinancialReport { public static final String JSON_PROPERTY_ANNUAL_TURNOVER = "annualTurnover"; private String annualTurnover; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAnnualTurnover = false; + public static final String JSON_PROPERTY_BALANCE_SHEET_TOTAL = "balanceSheetTotal"; private String balanceSheetTotal; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceSheetTotal = false; + public static final String JSON_PROPERTY_CURRENCY_OF_FINANCIAL_DATA = "currencyOfFinancialData"; private String currencyOfFinancialData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrencyOfFinancialData = false; + public static final String JSON_PROPERTY_DATE_OF_FINANCIAL_DATA = "dateOfFinancialData"; private String dateOfFinancialData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfFinancialData = false; + public static final String JSON_PROPERTY_EMPLOYEE_COUNT = "employeeCount"; private String employeeCount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmployeeCount = false; + public static final String JSON_PROPERTY_NET_ASSETS = "netAssets"; private String netAssets; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetAssets = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public FinancialReport() {} /** @@ -55,6 +81,7 @@ public FinancialReport() {} */ public FinancialReport annualTurnover(String annualTurnover) { this.annualTurnover = annualTurnover; + isSetAnnualTurnover = true; // mark as set return this; } @@ -78,6 +105,7 @@ public String getAnnualTurnover() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAnnualTurnover(String annualTurnover) { this.annualTurnover = annualTurnover; + isSetAnnualTurnover = true; // mark as set } /** @@ -88,6 +116,7 @@ public void setAnnualTurnover(String annualTurnover) { */ public FinancialReport balanceSheetTotal(String balanceSheetTotal) { this.balanceSheetTotal = balanceSheetTotal; + isSetBalanceSheetTotal = true; // mark as set return this; } @@ -111,6 +140,7 @@ public String getBalanceSheetTotal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceSheetTotal(String balanceSheetTotal) { this.balanceSheetTotal = balanceSheetTotal; + isSetBalanceSheetTotal = true; // mark as set } /** @@ -122,6 +152,7 @@ public void setBalanceSheetTotal(String balanceSheetTotal) { */ public FinancialReport currencyOfFinancialData(String currencyOfFinancialData) { this.currencyOfFinancialData = currencyOfFinancialData; + isSetCurrencyOfFinancialData = true; // mark as set return this; } @@ -147,6 +178,7 @@ public String getCurrencyOfFinancialData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrencyOfFinancialData(String currencyOfFinancialData) { this.currencyOfFinancialData = currencyOfFinancialData; + isSetCurrencyOfFinancialData = true; // mark as set } /** @@ -157,6 +189,7 @@ public void setCurrencyOfFinancialData(String currencyOfFinancialData) { */ public FinancialReport dateOfFinancialData(String dateOfFinancialData) { this.dateOfFinancialData = dateOfFinancialData; + isSetDateOfFinancialData = true; // mark as set return this; } @@ -180,6 +213,7 @@ public String getDateOfFinancialData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfFinancialData(String dateOfFinancialData) { this.dateOfFinancialData = dateOfFinancialData; + isSetDateOfFinancialData = true; // mark as set } /** @@ -190,6 +224,7 @@ public void setDateOfFinancialData(String dateOfFinancialData) { */ public FinancialReport employeeCount(String employeeCount) { this.employeeCount = employeeCount; + isSetEmployeeCount = true; // mark as set return this; } @@ -213,6 +248,7 @@ public String getEmployeeCount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmployeeCount(String employeeCount) { this.employeeCount = employeeCount; + isSetEmployeeCount = true; // mark as set } /** @@ -223,6 +259,7 @@ public void setEmployeeCount(String employeeCount) { */ public FinancialReport netAssets(String netAssets) { this.netAssets = netAssets; + isSetNetAssets = true; // mark as set return this; } @@ -246,6 +283,27 @@ public String getNetAssets() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetAssets(String netAssets) { this.netAssets = netAssets; + isSetNetAssets = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FinancialReport 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 FinancialReport object is equal to o. */ @@ -305,6 +363,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 (isSetAnnualTurnover) { + addIfNull(nulls, JSON_PROPERTY_ANNUAL_TURNOVER, this.annualTurnover); + } + if (isSetBalanceSheetTotal) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_SHEET_TOTAL, this.balanceSheetTotal); + } + if (isSetCurrencyOfFinancialData) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY_OF_FINANCIAL_DATA, this.currencyOfFinancialData); + } + if (isSetDateOfFinancialData) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_FINANCIAL_DATA, this.dateOfFinancialData); + } + if (isSetEmployeeCount) { + addIfNull(nulls, JSON_PROPERTY_EMPLOYEE_COUNT, this.employeeCount); + } + if (isSetNetAssets) { + addIfNull(nulls, JSON_PROPERTY_NET_ASSETS, this.netAssets); + } + + 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 FinancialReport given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Financier.java b/src/main/java/com/adyen/model/legalentitymanagement/Financier.java index 3d965076f..ecf992d65 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Financier.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Financier.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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 Financier { 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_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; + public static final String JSON_PROPERTY_LOCATION = "location"; private String location; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLocation = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Financier() {} /** @@ -47,6 +67,7 @@ public Financier() {} */ public Financier amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -70,6 +91,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setAmount(Amount amount) { */ public Financier firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -103,6 +126,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setFirstName(String firstName) { */ public Financier lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -147,6 +173,7 @@ public void setLastName(String lastName) { */ public Financier location(String location) { this.location = location; + isSetLocation = true; // mark as set return this; } @@ -172,6 +199,27 @@ public String getLocation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLocation(String location) { this.location = location; + isSetLocation = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Financier 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 Financier object is equal to o. */ @@ -217,6 +265,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetLocation) { + addIfNull(nulls, JSON_PROPERTY_LOCATION, this.location); + } + + 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 Financier given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionRequest.java index e41a3a72d..3d09d84b6 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionRequest.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,9 +79,21 @@ public static AdditionalSalesChannelsEnum fromValue(String value) { public static final String JSON_PROPERTY_ADDITIONAL_SALES_CHANNELS = "additionalSalesChannels"; private List additionalSalesChannels; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalSalesChannels = false; + public static final String JSON_PROPERTY_LANGUAGE = "language"; private String language; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLanguage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public GeneratePciDescriptionRequest() {} /** @@ -100,6 +114,7 @@ public GeneratePciDescriptionRequest() {} public GeneratePciDescriptionRequest additionalSalesChannels( List additionalSalesChannels) { this.additionalSalesChannels = additionalSalesChannels; + isSetAdditionalSalesChannels = true; // mark as set return this; } @@ -149,6 +164,7 @@ public List getAdditionalSalesChannels() { public void setAdditionalSalesChannels( List additionalSalesChannels) { this.additionalSalesChannels = additionalSalesChannels; + isSetAdditionalSalesChannels = true; // mark as set } /** @@ -162,6 +178,7 @@ public void setAdditionalSalesChannels( */ public GeneratePciDescriptionRequest language(String language) { this.language = language; + isSetLanguage = true; // mark as set return this; } @@ -189,6 +206,27 @@ public String getLanguage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLanguage(String language) { this.language = language; + isSetLanguage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GeneratePciDescriptionRequest 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 GeneratePciDescriptionRequest object is equal to o. */ @@ -233,6 +271,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 (isSetAdditionalSalesChannels) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_SALES_CHANNELS, this.additionalSalesChannels); + } + if (isSetLanguage) { + addIfNull(nulls, JSON_PROPERTY_LANGUAGE, this.language); + } + + 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 GeneratePciDescriptionRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionResponse.java index 979857a89..c1b13c1d0 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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,12 +32,27 @@ public class GeneratePciDescriptionResponse { public static final String JSON_PROPERTY_CONTENT = "content"; private byte[] content; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContent = 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_PCI_TEMPLATE_REFERENCES = "pciTemplateReferences"; private List pciTemplateReferences; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPciTemplateReferences = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public GeneratePciDescriptionResponse() {} /** @@ -47,6 +64,7 @@ public GeneratePciDescriptionResponse() {} */ public GeneratePciDescriptionResponse content(byte[] content) { this.content = content; + isSetContent = true; // mark as set return this; } @@ -70,6 +88,7 @@ public byte[] getContent() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContent(byte[] content) { this.content = content; + isSetContent = true; // mark as set } /** @@ -84,6 +103,7 @@ public void setContent(byte[] content) { */ public GeneratePciDescriptionResponse language(String language) { this.language = language; + isSetLanguage = true; // mark as set return this; } @@ -113,6 +133,7 @@ public String getLanguage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLanguage(String language) { this.language = language; + isSetLanguage = true; // mark as set } /** @@ -126,6 +147,7 @@ public void setLanguage(String language) { */ public GeneratePciDescriptionResponse pciTemplateReferences(List pciTemplateReferences) { this.pciTemplateReferences = pciTemplateReferences; + isSetPciTemplateReferences = true; // mark as set return this; } @@ -162,6 +184,27 @@ public List getPciTemplateReferences() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPciTemplateReferences(List pciTemplateReferences) { this.pciTemplateReferences = pciTemplateReferences; + isSetPciTemplateReferences = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GeneratePciDescriptionResponse 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 GeneratePciDescriptionResponse object is equal to o. */ @@ -209,6 +252,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 (isSetContent) { + addIfNull(nulls, JSON_PROPERTY_CONTENT, this.content); + } + if (isSetLanguage) { + addIfNull(nulls, JSON_PROPERTY_LANGUAGE, this.language); + } + if (isSetPciTemplateReferences) { + addIfNull(nulls, JSON_PROPERTY_PCI_TEMPLATE_REFERENCES, this.pciTemplateReferences); + } + + 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 GeneratePciDescriptionResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetAcceptedTermsOfServiceDocumentResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetAcceptedTermsOfServiceDocumentResponse.java index c10bf6f77..192d8d850 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetAcceptedTermsOfServiceDocumentResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetAcceptedTermsOfServiceDocumentResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -32,13 +34,22 @@ public class GetAcceptedTermsOfServiceDocumentResponse { public static final String JSON_PROPERTY_DOCUMENT = "document"; private byte[] document; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocument = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_TERMS_OF_SERVICE_ACCEPTANCE_REFERENCE = "termsOfServiceAcceptanceReference"; private String termsOfServiceAcceptanceReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTermsOfServiceAcceptanceReference = false; + /** The format of the Terms of Service document. */ public enum TermsOfServiceDocumentFormatEnum { JSON(String.valueOf("JSON")), @@ -87,6 +98,15 @@ public static TermsOfServiceDocumentFormatEnum fromValue(String value) { "termsOfServiceDocumentFormat"; private TermsOfServiceDocumentFormatEnum termsOfServiceDocumentFormat; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTermsOfServiceDocumentFormat = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public GetAcceptedTermsOfServiceDocumentResponse() {} /** @@ -100,6 +120,7 @@ public GetAcceptedTermsOfServiceDocumentResponse() {} */ public GetAcceptedTermsOfServiceDocumentResponse document(byte[] document) { this.document = document; + isSetDocument = true; // mark as set return this; } @@ -127,6 +148,7 @@ public byte[] getDocument() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocument(byte[] document) { this.document = document; + isSetDocument = true; // mark as set } /** @@ -138,6 +160,7 @@ public void setDocument(byte[] document) { */ public GetAcceptedTermsOfServiceDocumentResponse id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -161,6 +184,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -174,6 +198,7 @@ public void setId(String id) { public GetAcceptedTermsOfServiceDocumentResponse termsOfServiceAcceptanceReference( String termsOfServiceAcceptanceReference) { this.termsOfServiceAcceptanceReference = termsOfServiceAcceptanceReference; + isSetTermsOfServiceAcceptanceReference = true; // mark as set return this; } @@ -199,6 +224,7 @@ public String getTermsOfServiceAcceptanceReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTermsOfServiceAcceptanceReference(String termsOfServiceAcceptanceReference) { this.termsOfServiceAcceptanceReference = termsOfServiceAcceptanceReference; + isSetTermsOfServiceAcceptanceReference = true; // mark as set } /** @@ -211,6 +237,7 @@ public void setTermsOfServiceAcceptanceReference(String termsOfServiceAcceptance public GetAcceptedTermsOfServiceDocumentResponse termsOfServiceDocumentFormat( TermsOfServiceDocumentFormatEnum termsOfServiceDocumentFormat) { this.termsOfServiceDocumentFormat = termsOfServiceDocumentFormat; + isSetTermsOfServiceDocumentFormat = true; // mark as set return this; } @@ -235,6 +262,27 @@ public TermsOfServiceDocumentFormatEnum getTermsOfServiceDocumentFormat() { public void setTermsOfServiceDocumentFormat( TermsOfServiceDocumentFormatEnum termsOfServiceDocumentFormat) { this.termsOfServiceDocumentFormat = termsOfServiceDocumentFormat; + isSetTermsOfServiceDocumentFormat = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GetAcceptedTermsOfServiceDocumentResponse 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 GetAcceptedTermsOfServiceDocumentResponse object is equal to o. */ @@ -293,6 +341,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 (isSetDocument) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENT, this.document); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetTermsOfServiceAcceptanceReference) { + addIfNull( + nulls, + JSON_PROPERTY_TERMS_OF_SERVICE_ACCEPTANCE_REFERENCE, + this.termsOfServiceAcceptanceReference); + } + if (isSetTermsOfServiceDocumentFormat) { + addIfNull( + nulls, JSON_PROPERTY_TERMS_OF_SERVICE_DOCUMENT_FORMAT, this.termsOfServiceDocumentFormat); + } + + 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 GetAcceptedTermsOfServiceDocumentResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java index a778e3105..072267673 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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,6 +27,15 @@ public class GetPciQuestionnaireInfosResponse { public static final String JSON_PROPERTY_DATA = "data"; private List data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public GetPciQuestionnaireInfosResponse() {} /** @@ -36,6 +47,7 @@ public GetPciQuestionnaireInfosResponse() {} */ public GetPciQuestionnaireInfosResponse data(List data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -67,6 +79,27 @@ public List getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(List data) { this.data = data; + isSetData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GetPciQuestionnaireInfosResponse 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 GetPciQuestionnaireInfosResponse object is equal to o. */ @@ -107,6 +140,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 (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + + 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 GetPciQuestionnaireInfosResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireResponse.java index 08af9d17e..40cd51eba 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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,15 +32,33 @@ public class GetPciQuestionnaireResponse { public static final String JSON_PROPERTY_CONTENT = "content"; private byte[] content; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContent = 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_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_VALID_UNTIL = "validUntil"; private OffsetDateTime validUntil; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValidUntil = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public GetPciQuestionnaireResponse() {} /** @@ -49,6 +69,7 @@ public GetPciQuestionnaireResponse() {} */ public GetPciQuestionnaireResponse content(byte[] content) { this.content = content; + isSetContent = true; // mark as set return this; } @@ -72,6 +93,7 @@ public byte[] getContent() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContent(byte[] content) { this.content = content; + isSetContent = true; // mark as set } /** @@ -84,6 +106,7 @@ public void setContent(byte[] content) { */ public GetPciQuestionnaireResponse createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -111,6 +134,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -121,6 +145,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public GetPciQuestionnaireResponse id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -144,6 +169,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -156,6 +182,7 @@ public void setId(String id) { */ public GetPciQuestionnaireResponse validUntil(OffsetDateTime validUntil) { this.validUntil = validUntil; + isSetValidUntil = true; // mark as set return this; } @@ -183,6 +210,27 @@ public OffsetDateTime getValidUntil() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValidUntil(OffsetDateTime validUntil) { this.validUntil = validUntil; + isSetValidUntil = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GetPciQuestionnaireResponse 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 GetPciQuestionnaireResponse object is equal to o. */ @@ -228,6 +276,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 (isSetContent) { + addIfNull(nulls, JSON_PROPERTY_CONTENT, this.content); + } + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetValidUntil) { + addIfNull(nulls, JSON_PROPERTY_VALID_UNTIL, this.validUntil); + } + + 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 GetPciQuestionnaireResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java index ff965a1b7..311b8a7e6 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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,6 +27,15 @@ public class GetTermsOfServiceAcceptanceInfosResponse { public static final String JSON_PROPERTY_DATA = "data"; private List data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public GetTermsOfServiceAcceptanceInfosResponse() {} /** @@ -36,6 +47,7 @@ public GetTermsOfServiceAcceptanceInfosResponse() {} */ public GetTermsOfServiceAcceptanceInfosResponse data(List data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -68,6 +80,27 @@ public List getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(List data) { this.data = data; + isSetData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GetTermsOfServiceAcceptanceInfosResponse 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 GetTermsOfServiceAcceptanceInfosResponse object is equal to o. */ @@ -108,6 +141,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 (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + + 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 GetTermsOfServiceAcceptanceInfosResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java index dcc5bd8fa..0ccb01209 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,10 +33,16 @@ public class GetTermsOfServiceDocumentRequest { 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_TERMS_OF_SERVICE_DOCUMENT_FORMAT = "termsOfServiceDocumentFormat"; private String termsOfServiceDocumentFormat; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTermsOfServiceDocumentFormat = false; + /** * The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * @@ -99,32 +107,42 @@ 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 GetTermsOfServiceDocumentRequest() {} /** * The language to be used for the Terms of Service document, specified by the two-letter [ISO - * 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible value: - * **en** for English. + * 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible values: + * **en** for English or **fr** for French. * * @param language The language to be used for the Terms of Service document, specified by the * two-letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language - * code. Possible value: **en** for English. + * code. Possible values: **en** for English or **fr** for French. * @return the current {@code GetTermsOfServiceDocumentRequest} instance, allowing for method * chaining */ public GetTermsOfServiceDocumentRequest language(String language) { this.language = language; + isSetLanguage = true; // mark as set return this; } /** * The language to be used for the Terms of Service document, specified by the two-letter [ISO - * 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible value: - * **en** for English. + * 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible values: + * **en** for English or **fr** for French. * * @return language The language to be used for the Terms of Service document, specified by the * two-letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language - * code. Possible value: **en** for English. + * code. Possible values: **en** for English or **fr** for French. */ @JsonProperty(JSON_PROPERTY_LANGUAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -134,17 +152,18 @@ public String getLanguage() { /** * The language to be used for the Terms of Service document, specified by the two-letter [ISO - * 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible value: - * **en** for English. + * 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. Possible values: + * **en** for English or **fr** for French. * * @param language The language to be used for the Terms of Service document, specified by the * two-letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language - * code. Possible value: **en** for English. + * code. Possible values: **en** for English or **fr** for French. */ @JsonProperty(JSON_PROPERTY_LANGUAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLanguage(String language) { this.language = language; + isSetLanguage = true; // mark as set } /** @@ -159,6 +178,7 @@ public void setLanguage(String language) { public GetTermsOfServiceDocumentRequest termsOfServiceDocumentFormat( String termsOfServiceDocumentFormat) { this.termsOfServiceDocumentFormat = termsOfServiceDocumentFormat; + isSetTermsOfServiceDocumentFormat = true; // mark as set return this; } @@ -186,6 +206,7 @@ public String getTermsOfServiceDocumentFormat() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTermsOfServiceDocumentFormat(String termsOfServiceDocumentFormat) { this.termsOfServiceDocumentFormat = termsOfServiceDocumentFormat; + isSetTermsOfServiceDocumentFormat = true; // mark as set } /** @@ -201,6 +222,7 @@ public void setTermsOfServiceDocumentFormat(String termsOfServiceDocumentFormat) */ public GetTermsOfServiceDocumentRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -232,6 +254,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 GetTermsOfServiceDocumentRequest 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 GetTermsOfServiceDocumentRequest object is equal to o. */ @@ -280,6 +323,37 @@ 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 (isSetLanguage) { + addIfNull(nulls, JSON_PROPERTY_LANGUAGE, this.language); + } + if (isSetTermsOfServiceDocumentFormat) { + addIfNull( + nulls, JSON_PROPERTY_TERMS_OF_SERVICE_DOCUMENT_FORMAT, this.termsOfServiceDocumentFormat); + } + 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 GetTermsOfServiceDocumentRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java index 212b2ba34..c6dd99694 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,20 +36,35 @@ public class GetTermsOfServiceDocumentResponse { public static final String JSON_PROPERTY_DOCUMENT = "document"; private byte[] document; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocument = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_LANGUAGE = "language"; private String language; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLanguage = false; + public static final String JSON_PROPERTY_TERMS_OF_SERVICE_DOCUMENT_FORMAT = "termsOfServiceDocumentFormat"; private String termsOfServiceDocumentFormat; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTermsOfServiceDocumentFormat = false; + public static final String JSON_PROPERTY_TERMS_OF_SERVICE_DOCUMENT_ID = "termsOfServiceDocumentId"; private String termsOfServiceDocumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTermsOfServiceDocumentId = false; + /** * The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * @@ -112,6 +129,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 GetTermsOfServiceDocumentResponse() {} /** @@ -123,6 +149,7 @@ public GetTermsOfServiceDocumentResponse() {} */ public GetTermsOfServiceDocumentResponse document(byte[] document) { this.document = document; + isSetDocument = true; // mark as set return this; } @@ -146,6 +173,7 @@ public byte[] getDocument() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocument(byte[] document) { this.document = document; + isSetDocument = true; // mark as set } /** @@ -157,6 +185,7 @@ public void setDocument(byte[] document) { */ public GetTermsOfServiceDocumentResponse id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -180,6 +209,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -199,6 +229,7 @@ public void setId(String id) { */ public GetTermsOfServiceDocumentResponse language(String language) { this.language = language; + isSetLanguage = true; // mark as set return this; } @@ -238,6 +269,7 @@ public String getLanguage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLanguage(String language) { this.language = language; + isSetLanguage = true; // mark as set } /** @@ -250,6 +282,7 @@ public void setLanguage(String language) { public GetTermsOfServiceDocumentResponse termsOfServiceDocumentFormat( String termsOfServiceDocumentFormat) { this.termsOfServiceDocumentFormat = termsOfServiceDocumentFormat; + isSetTermsOfServiceDocumentFormat = true; // mark as set return this; } @@ -273,6 +306,7 @@ public String getTermsOfServiceDocumentFormat() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTermsOfServiceDocumentFormat(String termsOfServiceDocumentFormat) { this.termsOfServiceDocumentFormat = termsOfServiceDocumentFormat; + isSetTermsOfServiceDocumentFormat = true; // mark as set } /** @@ -285,6 +319,7 @@ public void setTermsOfServiceDocumentFormat(String termsOfServiceDocumentFormat) public GetTermsOfServiceDocumentResponse termsOfServiceDocumentId( String termsOfServiceDocumentId) { this.termsOfServiceDocumentId = termsOfServiceDocumentId; + isSetTermsOfServiceDocumentId = true; // mark as set return this; } @@ -308,6 +343,7 @@ public String getTermsOfServiceDocumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTermsOfServiceDocumentId(String termsOfServiceDocumentId) { this.termsOfServiceDocumentId = termsOfServiceDocumentId; + isSetTermsOfServiceDocumentId = true; // mark as set } /** @@ -323,6 +359,7 @@ public void setTermsOfServiceDocumentId(String termsOfServiceDocumentId) { */ public GetTermsOfServiceDocumentResponse type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -354,6 +391,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 GetTermsOfServiceDocumentResponse 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 GetTermsOfServiceDocumentResponse object is equal to o. */ @@ -418,6 +476,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 (isSetDocument) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENT, this.document); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLanguage) { + addIfNull(nulls, JSON_PROPERTY_LANGUAGE, this.language); + } + if (isSetTermsOfServiceDocumentFormat) { + addIfNull( + nulls, JSON_PROPERTY_TERMS_OF_SERVICE_DOCUMENT_FORMAT, this.termsOfServiceDocumentFormat); + } + if (isSetTermsOfServiceDocumentId) { + addIfNull(nulls, JSON_PROPERTY_TERMS_OF_SERVICE_DOCUMENT_ID, this.termsOfServiceDocumentId); + } + 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 GetTermsOfServiceDocumentResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/HKLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/HKLocalAccountIdentification.java index 9dd2a4832..bf7e9464f 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/HKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/HKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,9 +33,15 @@ public class HKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_CLEARING_CODE = "clearingCode"; private String clearingCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClearingCode = false; + /** **hkLocal** */ public enum TypeEnum { HKLOCAL(String.valueOf("hkLocal")); @@ -76,6 +84,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 HKLocalAccountIdentification() {} /** @@ -88,6 +105,7 @@ public HKLocalAccountIdentification() {} */ public HKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -115,6 +133,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -125,6 +144,7 @@ public void setAccountNumber(String accountNumber) { */ public HKLocalAccountIdentification clearingCode(String clearingCode) { this.clearingCode = clearingCode; + isSetClearingCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getClearingCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClearingCode(String clearingCode) { this.clearingCode = clearingCode; + isSetClearingCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setClearingCode(String clearingCode) { */ public HKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,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 HKLocalAccountIdentification 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 HKLocalAccountIdentification object is equal to o. */ @@ -224,6 +267,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetClearingCode) { + addIfNull(nulls, JSON_PROPERTY_CLEARING_CODE, this.clearingCode); + } + 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 HKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/HULocalAccountIdentification.java index 30dfbcb9a..5d1059ed3 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/HULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/HULocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -30,6 +32,9 @@ public class HULocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **huLocal** */ public enum TypeEnum { HULOCAL(String.valueOf("huLocal")); @@ -72,6 +77,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 HULocalAccountIdentification() {} /** @@ -82,6 +96,7 @@ public HULocalAccountIdentification() {} */ public HULocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -105,6 +120,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -115,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public HULocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -138,6 +155,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 HULocalAccountIdentification 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 HULocalAccountIdentification object is equal to o. */ @@ -179,6 +217,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + 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 HULocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/IbanAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/IbanAccountIdentification.java index d8b04355c..3cb3f0703 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/IbanAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/IbanAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -30,6 +32,9 @@ public class IbanAccountIdentification { public static final String JSON_PROPERTY_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + /** **iban** */ public enum TypeEnum { IBAN(String.valueOf("iban")); @@ -72,6 +77,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 IbanAccountIdentification() {} /** @@ -84,6 +98,7 @@ public IbanAccountIdentification() {} */ public IbanAccountIdentification iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -111,6 +126,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -121,6 +137,7 @@ public void setIban(String iban) { */ public IbanAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -144,6 +161,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 IbanAccountIdentification 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 IbanAccountIdentification object is equal to o. */ @@ -185,6 +223,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 (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + 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 IbanAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java b/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java index dca3bc31f..db9e858c5 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,22 +37,40 @@ public class IdentificationData { public static final String JSON_PROPERTY_CARD_NUMBER = "cardNumber"; private String cardNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardNumber = 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_ISSUER_COUNTRY = "issuerCountry"; @Deprecated // deprecated since Legal Entity Management API v1 private String issuerCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuerCountry = false; + public static final String JSON_PROPERTY_ISSUER_STATE = "issuerState"; private String issuerState; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuerState = false; + public static final String JSON_PROPERTY_NATIONAL_ID_EXEMPT = "nationalIdExempt"; private Boolean nationalIdExempt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNationalIdExempt = false; + public static final String JSON_PROPERTY_NUMBER = "number"; private String number; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + /** * Type of identity data. For individuals, the following types are supported. See our [onboarding * guide](https://docs.adyen.com/platforms/onboard-users/onboarding-steps/?onboarding_type=custom) @@ -106,6 +126,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 IdentificationData() {} /** @@ -116,6 +145,7 @@ public IdentificationData() {} */ public IdentificationData cardNumber(String cardNumber) { this.cardNumber = cardNumber; + isSetCardNumber = true; // mark as set return this; } @@ -139,6 +169,7 @@ public String getCardNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardNumber(String cardNumber) { this.cardNumber = cardNumber; + isSetCardNumber = true; // mark as set } /** @@ -149,6 +180,7 @@ public void setCardNumber(String cardNumber) { */ public IdentificationData expiryDate(String expiryDate) { this.expiryDate = expiryDate; + isSetExpiryDate = true; // mark as set return this; } @@ -172,6 +204,7 @@ public String getExpiryDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryDate(String expiryDate) { this.expiryDate = expiryDate; + isSetExpiryDate = true; // mark as set } /** @@ -187,6 +220,7 @@ public void setExpiryDate(String expiryDate) { @Deprecated // deprecated since Legal Entity Management API v1 public IdentificationData issuerCountry(String issuerCountry) { this.issuerCountry = issuerCountry; + isSetIssuerCountry = true; // mark as set return this; } @@ -220,6 +254,7 @@ public String getIssuerCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuerCountry(String issuerCountry) { this.issuerCountry = issuerCountry; + isSetIssuerCountry = true; // mark as set } /** @@ -230,6 +265,7 @@ public void setIssuerCountry(String issuerCountry) { */ public IdentificationData issuerState(String issuerState) { this.issuerState = issuerState; + isSetIssuerState = true; // mark as set return this; } @@ -253,6 +289,7 @@ public String getIssuerState() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuerState(String issuerState) { this.issuerState = issuerState; + isSetIssuerState = true; // mark as set } /** @@ -266,6 +303,7 @@ public void setIssuerState(String issuerState) { */ public IdentificationData nationalIdExempt(Boolean nationalIdExempt) { this.nationalIdExempt = nationalIdExempt; + isSetNationalIdExempt = true; // mark as set return this; } @@ -295,6 +333,7 @@ public Boolean getNationalIdExempt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNationalIdExempt(Boolean nationalIdExempt) { this.nationalIdExempt = nationalIdExempt; + isSetNationalIdExempt = true; // mark as set } /** @@ -305,6 +344,7 @@ public void setNationalIdExempt(Boolean nationalIdExempt) { */ public IdentificationData number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -328,6 +368,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -349,6 +390,7 @@ public void setNumber(String number) { */ public IdentificationData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -394,6 +436,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 IdentificationData 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 IdentificationData object is equal to o. */ @@ -446,6 +509,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCardNumber) { + addIfNull(nulls, JSON_PROPERTY_CARD_NUMBER, this.cardNumber); + } + if (isSetExpiryDate) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_DATE, this.expiryDate); + } + if (isSetIssuerCountry) { + addIfNull(nulls, JSON_PROPERTY_ISSUER_COUNTRY, this.issuerCountry); + } + if (isSetIssuerState) { + addIfNull(nulls, JSON_PROPERTY_ISSUER_STATE, this.issuerState); + } + if (isSetNationalIdExempt) { + addIfNull(nulls, JSON_PROPERTY_NATIONAL_ID_EXEMPT, this.nationalIdExempt); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + 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 IdentificationData given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Individual.java b/src/main/java/com/adyen/model/legalentitymanagement/Individual.java index ac7d6e337..842070e21 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Individual.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Individual.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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; @@ -36,33 +38,69 @@ public class Individual { public static final String JSON_PROPERTY_BIRTH_DATA = "birthData"; private BirthData birthData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBirthData = false; + public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_IDENTIFICATION_DATA = "identificationData"; private IdentificationData identificationData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIdentificationData = false; + public static final String JSON_PROPERTY_NAME = "name"; private Name name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = 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_PHONE = "phone"; private PhoneNumber phone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhone = false; + public static final String JSON_PROPERTY_RESIDENTIAL_ADDRESS = "residentialAddress"; private Address residentialAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResidentialAddress = false; + public static final String JSON_PROPERTY_SUPPORT = "support"; private Support support; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSupport = false; + public static final String JSON_PROPERTY_TAX_INFORMATION = "taxInformation"; private List taxInformation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxInformation = false; + public static final String JSON_PROPERTY_WEB_DATA = "webData"; private WebData webData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Individual() {} /** @@ -73,6 +111,7 @@ public Individual() {} */ public Individual birthData(BirthData birthData) { this.birthData = birthData; + isSetBirthData = true; // mark as set return this; } @@ -96,6 +135,7 @@ public BirthData getBirthData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBirthData(BirthData birthData) { this.birthData = birthData; + isSetBirthData = true; // mark as set } /** @@ -106,6 +146,7 @@ public void setBirthData(BirthData birthData) { */ public Individual email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -129,6 +170,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -139,6 +181,7 @@ public void setEmail(String email) { */ public Individual identificationData(IdentificationData identificationData) { this.identificationData = identificationData; + isSetIdentificationData = true; // mark as set return this; } @@ -162,6 +205,7 @@ public IdentificationData getIdentificationData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIdentificationData(IdentificationData identificationData) { this.identificationData = identificationData; + isSetIdentificationData = true; // mark as set } /** @@ -172,6 +216,7 @@ public void setIdentificationData(IdentificationData identificationData) { */ public Individual name(Name name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -195,6 +240,7 @@ public Name getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(Name name) { this.name = name; + isSetName = true; // mark as set } /** @@ -205,6 +251,7 @@ public void setName(Name name) { */ public Individual nationality(String nationality) { this.nationality = nationality; + isSetNationality = true; // mark as set return this; } @@ -228,6 +275,7 @@ public String getNationality() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNationality(String nationality) { this.nationality = nationality; + isSetNationality = true; // mark as set } /** @@ -238,6 +286,7 @@ public void setNationality(String nationality) { */ public Individual phone(PhoneNumber phone) { this.phone = phone; + isSetPhone = true; // mark as set return this; } @@ -261,6 +310,7 @@ public PhoneNumber getPhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhone(PhoneNumber phone) { this.phone = phone; + isSetPhone = true; // mark as set } /** @@ -271,6 +321,7 @@ public void setPhone(PhoneNumber phone) { */ public Individual residentialAddress(Address residentialAddress) { this.residentialAddress = residentialAddress; + isSetResidentialAddress = true; // mark as set return this; } @@ -294,6 +345,7 @@ public Address getResidentialAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResidentialAddress(Address residentialAddress) { this.residentialAddress = residentialAddress; + isSetResidentialAddress = true; // mark as set } /** @@ -304,6 +356,7 @@ public void setResidentialAddress(Address residentialAddress) { */ public Individual support(Support support) { this.support = support; + isSetSupport = true; // mark as set return this; } @@ -327,6 +380,7 @@ public Support getSupport() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSupport(Support support) { this.support = support; + isSetSupport = true; // mark as set } /** @@ -337,6 +391,7 @@ public void setSupport(Support support) { */ public Individual taxInformation(List taxInformation) { this.taxInformation = taxInformation; + isSetTaxInformation = true; // mark as set return this; } @@ -368,6 +423,7 @@ public List getTaxInformation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxInformation(List taxInformation) { this.taxInformation = taxInformation; + isSetTaxInformation = true; // mark as set } /** @@ -378,6 +434,7 @@ public void setTaxInformation(List taxInformation) { */ public Individual webData(WebData webData) { this.webData = webData; + isSetWebData = true; // mark as set return this; } @@ -401,6 +458,27 @@ public WebData getWebData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebData(WebData webData) { this.webData = webData; + isSetWebData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Individual 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 Individual object is equal to o. */ @@ -468,6 +546,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 (isSetBirthData) { + addIfNull(nulls, JSON_PROPERTY_BIRTH_DATA, this.birthData); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetIdentificationData) { + addIfNull(nulls, JSON_PROPERTY_IDENTIFICATION_DATA, this.identificationData); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetNationality) { + addIfNull(nulls, JSON_PROPERTY_NATIONALITY, this.nationality); + } + if (isSetPhone) { + addIfNull(nulls, JSON_PROPERTY_PHONE, this.phone); + } + if (isSetResidentialAddress) { + addIfNull(nulls, JSON_PROPERTY_RESIDENTIAL_ADDRESS, this.residentialAddress); + } + if (isSetSupport) { + addIfNull(nulls, JSON_PROPERTY_SUPPORT, this.support); + } + if (isSetTaxInformation) { + addIfNull(nulls, JSON_PROPERTY_TAX_INFORMATION, this.taxInformation); + } + if (isSetWebData) { + addIfNull(nulls, JSON_PROPERTY_WEB_DATA, this.webData); + } + + 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 Individual given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java index 99bb60421..450ce07f7 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -48,41 +50,77 @@ public class LegalEntity { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private Map capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_DOCUMENT_DETAILS = "documentDetails"; private List documentDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocumentDetails = false; + public static final String JSON_PROPERTY_DOCUMENTS = "documents"; @Deprecated // deprecated since Legal Entity Management API v1: Use the `documentDetails` array // instead. private List documents; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocuments = false; + public static final String JSON_PROPERTY_ENTITY_ASSOCIATIONS = "entityAssociations"; private List entityAssociations; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityAssociations = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_INDIVIDUAL = "individual"; private Individual individual; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIndividual = false; + public static final String JSON_PROPERTY_ORGANIZATION = "organization"; private Organization organization; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrganization = false; + public static final String JSON_PROPERTY_PROBLEMS = "problems"; private List problems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProblems = 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_SOLE_PROPRIETORSHIP = "soleProprietorship"; private SoleProprietorship soleProprietorship; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSoleProprietorship = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENTS = "transferInstruments"; private List transferInstruments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstruments = false; + public static final String JSON_PROPERTY_TRUST = "trust"; private Trust trust; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrust = false; + /** * The type of legal entity. Possible values: **individual**, **organization**, * **soleProprietorship**, or **trust**. @@ -136,15 +174,33 @@ 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; + public static final String JSON_PROPERTY_UNINCORPORATED_PARTNERSHIP = "unincorporatedPartnership"; private UnincorporatedPartnership unincorporatedPartnership; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUnincorporatedPartnership = false; + public static final String JSON_PROPERTY_VERIFICATION_DEADLINES = "verificationDeadlines"; private List verificationDeadlines; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationDeadlines = false; + public static final String JSON_PROPERTY_VERIFICATION_PLAN = "verificationPlan"; private String verificationPlan; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationPlan = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public LegalEntity() {} @JsonCreator @@ -173,6 +229,7 @@ public LegalEntity( */ public LegalEntity capabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -214,6 +271,7 @@ public Map getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -224,6 +282,7 @@ public void setCapabilities(Map capabilities) { */ public LegalEntity documentDetails(List documentDetails) { this.documentDetails = documentDetails; + isSetDocumentDetails = true; // mark as set return this; } @@ -255,6 +314,7 @@ public List getDocumentDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocumentDetails(List documentDetails) { this.documentDetails = documentDetails; + isSetDocumentDetails = true; // mark as set } /** @@ -269,6 +329,7 @@ public void setDocumentDetails(List documentDetails) { // instead. public LegalEntity documents(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set return this; } @@ -308,6 +369,7 @@ public List getDocuments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocuments(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set } /** @@ -322,6 +384,7 @@ public void setDocuments(List documents) { */ public LegalEntity entityAssociations(List entityAssociations) { this.entityAssociations = entityAssociations; + isSetEntityAssociations = true; // mark as set return this; } @@ -361,6 +424,7 @@ public List getEntityAssociations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityAssociations(List entityAssociations) { this.entityAssociations = entityAssociations; + isSetEntityAssociations = true; // mark as set } /** @@ -382,6 +446,7 @@ public String getId() { */ public LegalEntity individual(Individual individual) { this.individual = individual; + isSetIndividual = true; // mark as set return this; } @@ -405,6 +470,7 @@ public Individual getIndividual() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIndividual(Individual individual) { this.individual = individual; + isSetIndividual = true; // mark as set } /** @@ -415,6 +481,7 @@ public void setIndividual(Individual individual) { */ public LegalEntity organization(Organization organization) { this.organization = organization; + isSetOrganization = true; // mark as set return this; } @@ -438,6 +505,7 @@ public Organization getOrganization() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrganization(Organization organization) { this.organization = organization; + isSetOrganization = true; // mark as set } /** @@ -448,6 +516,7 @@ public void setOrganization(Organization organization) { */ public LegalEntity problems(List problems) { this.problems = problems; + isSetProblems = true; // mark as set return this; } @@ -479,6 +548,7 @@ public List getProblems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProblems(List problems) { this.problems = problems; + isSetProblems = true; // mark as set } /** @@ -489,6 +559,7 @@ public void setProblems(List problems) { */ public LegalEntity reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -512,6 +583,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -522,6 +594,7 @@ public void setReference(String reference) { */ public LegalEntity soleProprietorship(SoleProprietorship soleProprietorship) { this.soleProprietorship = soleProprietorship; + isSetSoleProprietorship = true; // mark as set return this; } @@ -545,6 +618,7 @@ public SoleProprietorship getSoleProprietorship() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSoleProprietorship(SoleProprietorship soleProprietorship) { this.soleProprietorship = soleProprietorship; + isSetSoleProprietorship = true; // mark as set } /** @@ -566,6 +640,7 @@ public List getTransferInstruments() { */ public LegalEntity trust(Trust trust) { this.trust = trust; + isSetTrust = true; // mark as set return this; } @@ -589,6 +664,7 @@ public Trust getTrust() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrust(Trust trust) { this.trust = trust; + isSetTrust = true; // mark as set } /** @@ -601,6 +677,7 @@ public void setTrust(Trust trust) { */ public LegalEntity type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -628,6 +705,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -639,6 +717,7 @@ public void setType(TypeEnum type) { public LegalEntity unincorporatedPartnership( UnincorporatedPartnership unincorporatedPartnership) { this.unincorporatedPartnership = unincorporatedPartnership; + isSetUnincorporatedPartnership = true; // mark as set return this; } @@ -662,6 +741,7 @@ public UnincorporatedPartnership getUnincorporatedPartnership() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUnincorporatedPartnership(UnincorporatedPartnership unincorporatedPartnership) { this.unincorporatedPartnership = unincorporatedPartnership; + isSetUnincorporatedPartnership = true; // mark as set } /** @@ -689,6 +769,7 @@ public List getVerificationDeadlines() { */ public LegalEntity verificationPlan(String verificationPlan) { this.verificationPlan = verificationPlan; + isSetVerificationPlan = true; // mark as set return this; } @@ -720,6 +801,27 @@ public String getVerificationPlan() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVerificationPlan(String verificationPlan) { this.verificationPlan = verificationPlan; + isSetVerificationPlan = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LegalEntity 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 LegalEntity object is equal to o. */ @@ -811,6 +913,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 (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetDocumentDetails) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENT_DETAILS, this.documentDetails); + } + if (isSetDocuments) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENTS, this.documents); + } + if (isSetEntityAssociations) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_ASSOCIATIONS, this.entityAssociations); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetIndividual) { + addIfNull(nulls, JSON_PROPERTY_INDIVIDUAL, this.individual); + } + if (isSetOrganization) { + addIfNull(nulls, JSON_PROPERTY_ORGANIZATION, this.organization); + } + if (isSetProblems) { + addIfNull(nulls, JSON_PROPERTY_PROBLEMS, this.problems); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSoleProprietorship) { + addIfNull(nulls, JSON_PROPERTY_SOLE_PROPRIETORSHIP, this.soleProprietorship); + } + if (isSetTransferInstruments) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENTS, this.transferInstruments); + } + if (isSetTrust) { + addIfNull(nulls, JSON_PROPERTY_TRUST, this.trust); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUnincorporatedPartnership) { + addIfNull(nulls, JSON_PROPERTY_UNINCORPORATED_PARTNERSHIP, this.unincorporatedPartnership); + } + if (isSetVerificationDeadlines) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_DEADLINES, this.verificationDeadlines); + } + if (isSetVerificationPlan) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_PLAN, this.verificationPlan); + } + + 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 LegalEntity given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java index 71e30f72d..771292933 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -39,27 +41,51 @@ public class LegalEntityAssociation { public static final String JSON_PROPERTY_ASSOCIATOR_ID = "associatorId"; private String associatorId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAssociatorId = false; + public static final String JSON_PROPERTY_ENTITY_TYPE = "entityType"; private String entityType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityType = false; + public static final String JSON_PROPERTY_JOB_TITLE = "jobTitle"; private String jobTitle; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetJobTitle = false; + public static final String JSON_PROPERTY_LEGAL_ENTITY_ID = "legalEntityId"; private String legalEntityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalEntityId = 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_NOMINEE = "nominee"; private Boolean nominee; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNominee = false; + public static final String JSON_PROPERTY_RELATIONSHIP = "relationship"; private String relationship; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRelationship = false; + public static final String JSON_PROPERTY_SETTLOR_EXEMPTION_REASON = "settlorExemptionReason"; private List settlorExemptionReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSettlorExemptionReason = false; + /** * Defines the relationship of the legal entity to the current legal entity. Possible value for * individuals: **legalRepresentative**. Possible values for organizations: **director**, @@ -146,6 +172,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 LegalEntityAssociation() {} @JsonCreator @@ -197,6 +232,7 @@ public String getEntityType() { */ public LegalEntityAssociation jobTitle(String jobTitle) { this.jobTitle = jobTitle; + isSetJobTitle = true; // mark as set return this; } @@ -224,6 +260,7 @@ public String getJobTitle() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setJobTitle(String jobTitle) { this.jobTitle = jobTitle; + isSetJobTitle = true; // mark as set } /** @@ -236,6 +273,7 @@ public void setJobTitle(String jobTitle) { */ public LegalEntityAssociation legalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set return this; } @@ -263,6 +301,7 @@ public String getLegalEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set } /** @@ -294,6 +333,7 @@ public String getName() { */ public LegalEntityAssociation nominee(Boolean nominee) { this.nominee = nominee; + isSetNominee = true; // mark as set return this; } @@ -325,6 +365,7 @@ public Boolean getNominee() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNominee(Boolean nominee) { this.nominee = nominee; + isSetNominee = true; // mark as set } /** @@ -337,6 +378,7 @@ public void setNominee(Boolean nominee) { */ public LegalEntityAssociation relationship(String relationship) { this.relationship = relationship; + isSetRelationship = true; // mark as set return this; } @@ -364,6 +406,7 @@ public String getRelationship() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRelationship(String relationship) { this.relationship = relationship; + isSetRelationship = true; // mark as set } /** @@ -378,6 +421,7 @@ public void setRelationship(String relationship) { */ public LegalEntityAssociation settlorExemptionReason(List settlorExemptionReason) { this.settlorExemptionReason = settlorExemptionReason; + isSetSettlorExemptionReason = true; // mark as set return this; } @@ -417,6 +461,7 @@ public List getSettlorExemptionReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSettlorExemptionReason(List settlorExemptionReason) { this.settlorExemptionReason = settlorExemptionReason; + isSetSettlorExemptionReason = true; // mark as set } /** @@ -444,6 +489,7 @@ public void setSettlorExemptionReason(List settlorExemptionReason) { */ public LegalEntityAssociation type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -501,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 LegalEntityAssociation 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 LegalEntityAssociation object is equal to o. */ @@ -568,6 +635,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 (isSetAssociatorId) { + addIfNull(nulls, JSON_PROPERTY_ASSOCIATOR_ID, this.associatorId); + } + if (isSetEntityType) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_TYPE, this.entityType); + } + if (isSetJobTitle) { + addIfNull(nulls, JSON_PROPERTY_JOB_TITLE, this.jobTitle); + } + if (isSetLegalEntityId) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_ENTITY_ID, this.legalEntityId); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetNominee) { + addIfNull(nulls, JSON_PROPERTY_NOMINEE, this.nominee); + } + if (isSetRelationship) { + addIfNull(nulls, JSON_PROPERTY_RELATIONSHIP, this.relationship); + } + if (isSetSettlorExemptionReason) { + addIfNull(nulls, JSON_PROPERTY_SETTLOR_EXEMPTION_REASON, this.settlorExemptionReason); + } + 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 LegalEntityAssociation given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityCapability.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityCapability.java index 94ac3e8db..3dcd13991 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityCapability.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityCapability.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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 LegalEntityCapability { public static final String JSON_PROPERTY_ALLOWED = "allowed"; private Boolean allowed; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowed = false; + /** * The capability level that is allowed for the legal entity. Possible values: **notApplicable**, * **low**, **medium**, **high**. @@ -88,12 +93,21 @@ public static AllowedLevelEnum fromValue(String value) { public static final String JSON_PROPERTY_ALLOWED_LEVEL = "allowedLevel"; private AllowedLevelEnum allowedLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedLevel = false; + public static final String JSON_PROPERTY_ALLOWED_SETTINGS = "allowedSettings"; private CapabilitySettings allowedSettings; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedSettings = false; + public static final String JSON_PROPERTY_REQUESTED = "requested"; private Boolean requested; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequested = false; + /** * The requested level of the capability. Some capabilities, such as those used in [card * issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different @@ -147,15 +161,33 @@ public static RequestedLevelEnum fromValue(String value) { public static final String JSON_PROPERTY_REQUESTED_LEVEL = "requestedLevel"; private RequestedLevelEnum requestedLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedLevel = false; + public static final String JSON_PROPERTY_REQUESTED_SETTINGS = "requestedSettings"; private CapabilitySettings requestedSettings; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedSettings = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENTS = "transferInstruments"; private List transferInstruments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstruments = false; + public static final String JSON_PROPERTY_VERIFICATION_STATUS = "verificationStatus"; private String verificationStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public LegalEntityCapability() {} @JsonCreator @@ -210,6 +242,7 @@ public AllowedLevelEnum getAllowedLevel() { */ public LegalEntityCapability allowedSettings(CapabilitySettings allowedSettings) { this.allowedSettings = allowedSettings; + isSetAllowedSettings = true; // mark as set return this; } @@ -233,6 +266,7 @@ public CapabilitySettings getAllowedSettings() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowedSettings(CapabilitySettings allowedSettings) { this.allowedSettings = allowedSettings; + isSetAllowedSettings = true; // mark as set } /** @@ -274,6 +308,7 @@ public RequestedLevelEnum getRequestedLevel() { */ public LegalEntityCapability requestedSettings(CapabilitySettings requestedSettings) { this.requestedSettings = requestedSettings; + isSetRequestedSettings = true; // mark as set return this; } @@ -297,6 +332,7 @@ public CapabilitySettings getRequestedSettings() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestedSettings(CapabilitySettings requestedSettings) { this.requestedSettings = requestedSettings; + isSetRequestedSettings = true; // mark as set } /** @@ -330,6 +366,26 @@ public String getVerificationStatus() { return verificationStatus; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LegalEntityCapability 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 LegalEntityCapability object is equal to o. */ @Override public boolean equals(Object o) { @@ -391,6 +447,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 (isSetAllowed) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED, this.allowed); + } + if (isSetAllowedLevel) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_LEVEL, this.allowedLevel); + } + if (isSetAllowedSettings) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_SETTINGS, this.allowedSettings); + } + if (isSetRequested) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED, this.requested); + } + if (isSetRequestedLevel) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED_LEVEL, this.requestedLevel); + } + if (isSetRequestedSettings) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED_SETTINGS, this.requestedSettings); + } + if (isSetTransferInstruments) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENTS, this.transferInstruments); + } + if (isSetVerificationStatus) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_STATUS, this.verificationStatus); + } + + 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 LegalEntityCapability given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java index a6824b0df..758ebaa29 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,24 +44,45 @@ public class LegalEntityInfo { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private Map capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_ENTITY_ASSOCIATIONS = "entityAssociations"; private List entityAssociations; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityAssociations = false; + public static final String JSON_PROPERTY_INDIVIDUAL = "individual"; private Individual individual; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIndividual = false; + public static final String JSON_PROPERTY_ORGANIZATION = "organization"; private Organization organization; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrganization = 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_SOLE_PROPRIETORSHIP = "soleProprietorship"; private SoleProprietorship soleProprietorship; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSoleProprietorship = false; + public static final String JSON_PROPERTY_TRUST = "trust"; private Trust trust; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrust = false; + /** * The type of legal entity. Possible values: **individual**, **organization**, * **soleProprietorship**, or **trust**. @@ -113,12 +136,27 @@ 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; + public static final String JSON_PROPERTY_UNINCORPORATED_PARTNERSHIP = "unincorporatedPartnership"; private UnincorporatedPartnership unincorporatedPartnership; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUnincorporatedPartnership = false; + public static final String JSON_PROPERTY_VERIFICATION_PLAN = "verificationPlan"; private String verificationPlan; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationPlan = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public LegalEntityInfo() {} /** @@ -134,6 +172,7 @@ public LegalEntityInfo() {} */ public LegalEntityInfo capabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -175,6 +214,7 @@ public Map getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -189,6 +229,7 @@ public void setCapabilities(Map capabilities) { */ public LegalEntityInfo entityAssociations(List entityAssociations) { this.entityAssociations = entityAssociations; + isSetEntityAssociations = true; // mark as set return this; } @@ -228,6 +269,7 @@ public List getEntityAssociations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityAssociations(List entityAssociations) { this.entityAssociations = entityAssociations; + isSetEntityAssociations = true; // mark as set } /** @@ -238,6 +280,7 @@ public void setEntityAssociations(List entityAssociation */ public LegalEntityInfo individual(Individual individual) { this.individual = individual; + isSetIndividual = true; // mark as set return this; } @@ -261,6 +304,7 @@ public Individual getIndividual() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIndividual(Individual individual) { this.individual = individual; + isSetIndividual = true; // mark as set } /** @@ -271,6 +315,7 @@ public void setIndividual(Individual individual) { */ public LegalEntityInfo organization(Organization organization) { this.organization = organization; + isSetOrganization = true; // mark as set return this; } @@ -294,6 +339,7 @@ public Organization getOrganization() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrganization(Organization organization) { this.organization = organization; + isSetOrganization = true; // mark as set } /** @@ -304,6 +350,7 @@ public void setOrganization(Organization organization) { */ public LegalEntityInfo reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -327,6 +374,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -337,6 +385,7 @@ public void setReference(String reference) { */ public LegalEntityInfo soleProprietorship(SoleProprietorship soleProprietorship) { this.soleProprietorship = soleProprietorship; + isSetSoleProprietorship = true; // mark as set return this; } @@ -360,6 +409,7 @@ public SoleProprietorship getSoleProprietorship() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSoleProprietorship(SoleProprietorship soleProprietorship) { this.soleProprietorship = soleProprietorship; + isSetSoleProprietorship = true; // mark as set } /** @@ -370,6 +420,7 @@ public void setSoleProprietorship(SoleProprietorship soleProprietorship) { */ public LegalEntityInfo trust(Trust trust) { this.trust = trust; + isSetTrust = true; // mark as set return this; } @@ -393,6 +444,7 @@ public Trust getTrust() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrust(Trust trust) { this.trust = trust; + isSetTrust = true; // mark as set } /** @@ -405,6 +457,7 @@ public void setTrust(Trust trust) { */ public LegalEntityInfo type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -432,6 +485,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -443,6 +497,7 @@ public void setType(TypeEnum type) { public LegalEntityInfo unincorporatedPartnership( UnincorporatedPartnership unincorporatedPartnership) { this.unincorporatedPartnership = unincorporatedPartnership; + isSetUnincorporatedPartnership = true; // mark as set return this; } @@ -466,6 +521,7 @@ public UnincorporatedPartnership getUnincorporatedPartnership() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUnincorporatedPartnership(UnincorporatedPartnership unincorporatedPartnership) { this.unincorporatedPartnership = unincorporatedPartnership; + isSetUnincorporatedPartnership = true; // mark as set } /** @@ -480,6 +536,7 @@ public void setUnincorporatedPartnership(UnincorporatedPartnership unincorporate */ public LegalEntityInfo verificationPlan(String verificationPlan) { this.verificationPlan = verificationPlan; + isSetVerificationPlan = true; // mark as set return this; } @@ -511,6 +568,27 @@ public String getVerificationPlan() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVerificationPlan(String verificationPlan) { this.verificationPlan = verificationPlan; + isSetVerificationPlan = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LegalEntityInfo 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 LegalEntityInfo object is equal to o. */ @@ -580,6 +658,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 (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetEntityAssociations) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_ASSOCIATIONS, this.entityAssociations); + } + if (isSetIndividual) { + addIfNull(nulls, JSON_PROPERTY_INDIVIDUAL, this.individual); + } + if (isSetOrganization) { + addIfNull(nulls, JSON_PROPERTY_ORGANIZATION, this.organization); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSoleProprietorship) { + addIfNull(nulls, JSON_PROPERTY_SOLE_PROPRIETORSHIP, this.soleProprietorship); + } + if (isSetTrust) { + addIfNull(nulls, JSON_PROPERTY_TRUST, this.trust); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUnincorporatedPartnership) { + addIfNull(nulls, JSON_PROPERTY_UNINCORPORATED_PARTNERSHIP, this.unincorporatedPartnership); + } + if (isSetVerificationPlan) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_PLAN, this.verificationPlan); + } + + 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 LegalEntityInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java index 12114bffd..c4a1e3c3c 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,24 +44,45 @@ public class LegalEntityInfoRequiredType { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private Map capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_ENTITY_ASSOCIATIONS = "entityAssociations"; private List entityAssociations; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityAssociations = false; + public static final String JSON_PROPERTY_INDIVIDUAL = "individual"; private Individual individual; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIndividual = false; + public static final String JSON_PROPERTY_ORGANIZATION = "organization"; private Organization organization; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrganization = 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_SOLE_PROPRIETORSHIP = "soleProprietorship"; private SoleProprietorship soleProprietorship; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSoleProprietorship = false; + public static final String JSON_PROPERTY_TRUST = "trust"; private Trust trust; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrust = false; + /** * The type of legal entity. Possible values: **individual**, **organization**, * **soleProprietorship**, or **trust**. @@ -113,12 +136,27 @@ 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; + public static final String JSON_PROPERTY_UNINCORPORATED_PARTNERSHIP = "unincorporatedPartnership"; private UnincorporatedPartnership unincorporatedPartnership; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUnincorporatedPartnership = false; + public static final String JSON_PROPERTY_VERIFICATION_PLAN = "verificationPlan"; private String verificationPlan; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationPlan = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public LegalEntityInfoRequiredType() {} /** @@ -134,6 +172,7 @@ public LegalEntityInfoRequiredType() {} */ public LegalEntityInfoRequiredType capabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -176,6 +215,7 @@ public Map getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -191,6 +231,7 @@ public void setCapabilities(Map capabilities) { public LegalEntityInfoRequiredType entityAssociations( List entityAssociations) { this.entityAssociations = entityAssociations; + isSetEntityAssociations = true; // mark as set return this; } @@ -231,6 +272,7 @@ public List getEntityAssociations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityAssociations(List entityAssociations) { this.entityAssociations = entityAssociations; + isSetEntityAssociations = true; // mark as set } /** @@ -241,6 +283,7 @@ public void setEntityAssociations(List entityAssociation */ public LegalEntityInfoRequiredType individual(Individual individual) { this.individual = individual; + isSetIndividual = true; // mark as set return this; } @@ -264,6 +307,7 @@ public Individual getIndividual() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIndividual(Individual individual) { this.individual = individual; + isSetIndividual = true; // mark as set } /** @@ -274,6 +318,7 @@ public void setIndividual(Individual individual) { */ public LegalEntityInfoRequiredType organization(Organization organization) { this.organization = organization; + isSetOrganization = true; // mark as set return this; } @@ -297,6 +342,7 @@ public Organization getOrganization() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrganization(Organization organization) { this.organization = organization; + isSetOrganization = true; // mark as set } /** @@ -307,6 +353,7 @@ public void setOrganization(Organization organization) { */ public LegalEntityInfoRequiredType reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -330,6 +377,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -340,6 +388,7 @@ public void setReference(String reference) { */ public LegalEntityInfoRequiredType soleProprietorship(SoleProprietorship soleProprietorship) { this.soleProprietorship = soleProprietorship; + isSetSoleProprietorship = true; // mark as set return this; } @@ -363,6 +412,7 @@ public SoleProprietorship getSoleProprietorship() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSoleProprietorship(SoleProprietorship soleProprietorship) { this.soleProprietorship = soleProprietorship; + isSetSoleProprietorship = true; // mark as set } /** @@ -373,6 +423,7 @@ public void setSoleProprietorship(SoleProprietorship soleProprietorship) { */ public LegalEntityInfoRequiredType trust(Trust trust) { this.trust = trust; + isSetTrust = true; // mark as set return this; } @@ -396,6 +447,7 @@ public Trust getTrust() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrust(Trust trust) { this.trust = trust; + isSetTrust = true; // mark as set } /** @@ -408,6 +460,7 @@ public void setTrust(Trust trust) { */ public LegalEntityInfoRequiredType type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -435,6 +488,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -446,6 +500,7 @@ public void setType(TypeEnum type) { public LegalEntityInfoRequiredType unincorporatedPartnership( UnincorporatedPartnership unincorporatedPartnership) { this.unincorporatedPartnership = unincorporatedPartnership; + isSetUnincorporatedPartnership = true; // mark as set return this; } @@ -469,6 +524,7 @@ public UnincorporatedPartnership getUnincorporatedPartnership() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUnincorporatedPartnership(UnincorporatedPartnership unincorporatedPartnership) { this.unincorporatedPartnership = unincorporatedPartnership; + isSetUnincorporatedPartnership = true; // mark as set } /** @@ -483,6 +539,7 @@ public void setUnincorporatedPartnership(UnincorporatedPartnership unincorporate */ public LegalEntityInfoRequiredType verificationPlan(String verificationPlan) { this.verificationPlan = verificationPlan; + isSetVerificationPlan = true; // mark as set return this; } @@ -514,6 +571,27 @@ public String getVerificationPlan() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVerificationPlan(String verificationPlan) { this.verificationPlan = verificationPlan; + isSetVerificationPlan = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LegalEntityInfoRequiredType 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 LegalEntityInfoRequiredType object is equal to o. */ @@ -584,6 +662,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 (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetEntityAssociations) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_ASSOCIATIONS, this.entityAssociations); + } + if (isSetIndividual) { + addIfNull(nulls, JSON_PROPERTY_INDIVIDUAL, this.individual); + } + if (isSetOrganization) { + addIfNull(nulls, JSON_PROPERTY_ORGANIZATION, this.organization); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSoleProprietorship) { + addIfNull(nulls, JSON_PROPERTY_SOLE_PROPRIETORSHIP, this.soleProprietorship); + } + if (isSetTrust) { + addIfNull(nulls, JSON_PROPERTY_TRUST, this.trust); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUnincorporatedPartnership) { + addIfNull(nulls, JSON_PROPERTY_UNINCORPORATED_PARTNERSHIP, this.unincorporatedPartnership); + } + if (isSetVerificationPlan) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_PLAN, this.verificationPlan); + } + + 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 LegalEntityInfoRequiredType given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/NOLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/NOLocalAccountIdentification.java index edd3fab80..033bca5a3 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/NOLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/NOLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -30,6 +32,9 @@ public class NOLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **noLocal** */ public enum TypeEnum { NOLOCAL(String.valueOf("noLocal")); @@ -72,6 +77,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 NOLocalAccountIdentification() {} /** @@ -82,6 +96,7 @@ public NOLocalAccountIdentification() {} */ public NOLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -105,6 +120,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -115,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public NOLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -138,6 +155,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 NOLocalAccountIdentification 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 NOLocalAccountIdentification object is equal to o. */ @@ -179,6 +217,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + 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 NOLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/NZLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/NZLocalAccountIdentification.java index ef1470f02..aaecb4aa3 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/NZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/NZLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -30,6 +32,9 @@ public class NZLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **nzLocal** */ public enum TypeEnum { NZLOCAL(String.valueOf("nzLocal")); @@ -72,6 +77,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 NZLocalAccountIdentification() {} /** @@ -86,6 +100,7 @@ public NZLocalAccountIdentification() {} */ public NZLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +132,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +143,7 @@ public void setAccountNumber(String accountNumber) { */ public NZLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -150,6 +167,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 NZLocalAccountIdentification 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 NZLocalAccountIdentification object is equal to o. */ @@ -191,6 +229,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + 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 NZLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Name.java b/src/main/java/com/adyen/model/legalentitymanagement/Name.java index a9cad3e03..aff9de177 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Name.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Name.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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 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_INFIX = "infix"; private String infix; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInfix = 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() {} /** @@ -43,6 +60,7 @@ public Name() {} */ public Name firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setFirstName(String firstName) { */ public Name infix(String infix) { this.infix = infix; + isSetInfix = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getInfix() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInfix(String infix) { this.infix = infix; + isSetInfix = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setInfix(String infix) { */ public Name lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -132,6 +154,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. */ @@ -175,6 +218,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 (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetInfix) { + addIfNull(nulls, JSON_PROPERTY_INFIX, this.infix); + } + 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/legalentitymanagement/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/NumberAndBicAccountIdentification.java index 63e2e5840..2fc519eb7 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/NumberAndBicAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/NumberAndBicAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -32,13 +34,22 @@ public class NumberAndBicAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION = "additionalBankIdentification"; private AdditionalBankIdentification additionalBankIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalBankIdentification = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + /** **numberAndBic** */ public enum TypeEnum { NUMBERANDBIC(String.valueOf("numberAndBic")); @@ -81,6 +92,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 NumberAndBicAccountIdentification() {} /** @@ -94,6 +114,7 @@ public NumberAndBicAccountIdentification() {} */ public NumberAndBicAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -121,6 +142,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -133,6 +155,7 @@ public void setAccountNumber(String accountNumber) { public NumberAndBicAccountIdentification additionalBankIdentification( AdditionalBankIdentification additionalBankIdentification) { this.additionalBankIdentification = additionalBankIdentification; + isSetAdditionalBankIdentification = true; // mark as set return this; } @@ -157,6 +180,7 @@ public AdditionalBankIdentification getAdditionalBankIdentification() { public void setAdditionalBankIdentification( AdditionalBankIdentification additionalBankIdentification) { this.additionalBankIdentification = additionalBankIdentification; + isSetAdditionalBankIdentification = true; // mark as set } /** @@ -168,6 +192,7 @@ public void setAdditionalBankIdentification( */ public NumberAndBicAccountIdentification bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -191,6 +216,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -202,6 +228,7 @@ public void setBic(String bic) { */ public NumberAndBicAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -225,6 +252,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 NumberAndBicAccountIdentification 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 NumberAndBicAccountIdentification object is equal to o. */ @@ -275,6 +323,40 @@ 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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAdditionalBankIdentification) { + addIfNull( + nulls, JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION, this.additionalBankIdentification); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + 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 NumberAndBicAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLink.java b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLink.java index c54dc8e86..ce8f4c65a 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLink.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLink.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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 OnboardingLink { public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public OnboardingLink() {} /** @@ -37,6 +48,7 @@ public OnboardingLink() {} */ public OnboardingLink url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -68,6 +80,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public OnboardingLink 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 OnboardingLink object is equal to o. */ @@ -107,6 +140,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 (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + 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 OnboardingLink given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkInfo.java index ff6c0f3ad..97643a940 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkInfo.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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 OnboardingLinkInfo { 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_REDIRECT_URL = "redirectUrl"; private String redirectUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectUrl = false; + public static final String JSON_PROPERTY_SETTINGS = "settings"; private OnboardingLinkSettings settings; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSettings = false; + public static final String JSON_PROPERTY_THEME_ID = "themeId"; private String themeId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThemeId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public OnboardingLinkInfo() {} /** @@ -62,6 +82,7 @@ public OnboardingLinkInfo() {} */ public OnboardingLinkInfo locale(String locale) { this.locale = locale; + isSetLocale = true; // mark as set return this; } @@ -115,6 +136,7 @@ public String getLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLocale(String locale) { this.locale = locale; + isSetLocale = true; // mark as set } /** @@ -125,6 +147,7 @@ public void setLocale(String locale) { */ public OnboardingLinkInfo redirectUrl(String redirectUrl) { this.redirectUrl = redirectUrl; + isSetRedirectUrl = true; // mark as set return this; } @@ -148,6 +171,7 @@ public String getRedirectUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectUrl(String redirectUrl) { this.redirectUrl = redirectUrl; + isSetRedirectUrl = true; // mark as set } /** @@ -158,6 +182,7 @@ public void setRedirectUrl(String redirectUrl) { */ public OnboardingLinkInfo settings(OnboardingLinkSettings settings) { this.settings = settings; + isSetSettings = true; // mark as set return this; } @@ -181,6 +206,7 @@ public OnboardingLinkSettings getSettings() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSettings(OnboardingLinkSettings settings) { this.settings = settings; + isSetSettings = true; // mark as set } /** @@ -191,6 +217,7 @@ public void setSettings(OnboardingLinkSettings settings) { */ public OnboardingLinkInfo themeId(String themeId) { this.themeId = themeId; + isSetThemeId = true; // mark as set return this; } @@ -214,6 +241,27 @@ public String getThemeId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThemeId(String themeId) { this.themeId = themeId; + isSetThemeId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public OnboardingLinkInfo 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 OnboardingLinkInfo object is equal to o. */ @@ -259,6 +307,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 (isSetLocale) { + addIfNull(nulls, JSON_PROPERTY_LOCALE, this.locale); + } + if (isSetRedirectUrl) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_URL, this.redirectUrl); + } + if (isSetSettings) { + addIfNull(nulls, JSON_PROPERTY_SETTINGS, this.settings); + } + if (isSetThemeId) { + addIfNull(nulls, JSON_PROPERTY_THEME_ID, this.themeId); + } + + 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 OnboardingLinkInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkSettings.java b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkSettings.java index bfe216bc9..d78d63a61 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkSettings.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkSettings.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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,60 +45,117 @@ public class OnboardingLinkSettings { public static final String JSON_PROPERTY_ACCEPTED_COUNTRIES = "acceptedCountries"; private List acceptedCountries; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcceptedCountries = false; + public static final String JSON_PROPERTY_ALLOW_BANK_ACCOUNT_FORMAT_SELECTION = "allowBankAccountFormatSelection"; private Boolean allowBankAccountFormatSelection; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowBankAccountFormatSelection = false; + public static final String JSON_PROPERTY_ALLOW_DEBUG_UI = "allowDebugUi"; private Boolean allowDebugUi; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowDebugUi = false; + public static final String JSON_PROPERTY_ALLOW_INTRA_REGION_CROSS_BORDER_PAYOUT = "allowIntraRegionCrossBorderPayout"; private Boolean allowIntraRegionCrossBorderPayout; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowIntraRegionCrossBorderPayout = false; + public static final String JSON_PROPERTY_CHANGE_LEGAL_ENTITY_TYPE = "changeLegalEntityType"; private Boolean changeLegalEntityType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChangeLegalEntityType = false; + public static final String JSON_PROPERTY_EDIT_PREFILLED_COUNTRY = "editPrefilledCountry"; private Boolean editPrefilledCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEditPrefilledCountry = false; + public static final String JSON_PROPERTY_ENFORCE_LEGAL_AGE = "enforceLegalAge"; private Boolean enforceLegalAge; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnforceLegalAge = false; + public static final String JSON_PROPERTY_HIDE_ONBOARDING_INTRODUCTION_INDIVIDUAL = "hideOnboardingIntroductionIndividual"; private Boolean hideOnboardingIntroductionIndividual; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHideOnboardingIntroductionIndividual = false; + public static final String JSON_PROPERTY_HIDE_ONBOARDING_INTRODUCTION_ORGANIZATION = "hideOnboardingIntroductionOrganization"; private Boolean hideOnboardingIntroductionOrganization; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHideOnboardingIntroductionOrganization = false; + public static final String JSON_PROPERTY_HIDE_ONBOARDING_INTRODUCTION_SOLE_PROPRIETOR = "hideOnboardingIntroductionSoleProprietor"; private Boolean hideOnboardingIntroductionSoleProprietor; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHideOnboardingIntroductionSoleProprietor = false; + public static final String JSON_PROPERTY_HIDE_ONBOARDING_INTRODUCTION_TRUST = "hideOnboardingIntroductionTrust"; private Boolean hideOnboardingIntroductionTrust; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHideOnboardingIntroductionTrust = false; + public static final String JSON_PROPERTY_INSTANT_BANK_VERIFICATION = "instantBankVerification"; private Boolean instantBankVerification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstantBankVerification = false; + public static final String JSON_PROPERTY_REQUIRE_PCI_SIGN_ECOM_MOTO = "requirePciSignEcomMoto"; private Boolean requirePciSignEcomMoto; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequirePciSignEcomMoto = false; + public static final String JSON_PROPERTY_REQUIRE_PCI_SIGN_ECOMMERCE = "requirePciSignEcommerce"; private Boolean requirePciSignEcommerce; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequirePciSignEcommerce = false; + public static final String JSON_PROPERTY_REQUIRE_PCI_SIGN_POS = "requirePciSignPos"; private Boolean requirePciSignPos; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequirePciSignPos = false; + public static final String JSON_PROPERTY_REQUIRE_PCI_SIGN_POS_MOTO = "requirePciSignPosMoto"; private Boolean requirePciSignPosMoto; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequirePciSignPosMoto = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_LIMIT = "transferInstrumentLimit"; private Integer transferInstrumentLimit; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentLimit = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public OnboardingLinkSettings() {} /** @@ -115,6 +174,7 @@ public OnboardingLinkSettings() {} */ public OnboardingLinkSettings acceptedCountries(List acceptedCountries) { this.acceptedCountries = acceptedCountries; + isSetAcceptedCountries = true; // mark as set return this; } @@ -162,6 +222,7 @@ public List getAcceptedCountries() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcceptedCountries(List acceptedCountries) { this.acceptedCountries = acceptedCountries; + isSetAcceptedCountries = true; // mark as set } /** @@ -175,6 +236,7 @@ public void setAcceptedCountries(List acceptedCountries) { public OnboardingLinkSettings allowBankAccountFormatSelection( Boolean allowBankAccountFormatSelection) { this.allowBankAccountFormatSelection = allowBankAccountFormatSelection; + isSetAllowBankAccountFormatSelection = true; // mark as set return this; } @@ -202,6 +264,7 @@ public Boolean getAllowBankAccountFormatSelection() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowBankAccountFormatSelection(Boolean allowBankAccountFormatSelection) { this.allowBankAccountFormatSelection = allowBankAccountFormatSelection; + isSetAllowBankAccountFormatSelection = true; // mark as set } /** @@ -216,6 +279,7 @@ public void setAllowBankAccountFormatSelection(Boolean allowBankAccountFormatSel */ public OnboardingLinkSettings allowDebugUi(Boolean allowDebugUi) { this.allowDebugUi = allowDebugUi; + isSetAllowDebugUi = true; // mark as set return this; } @@ -247,6 +311,7 @@ public Boolean getAllowDebugUi() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowDebugUi(Boolean allowDebugUi) { this.allowDebugUi = allowDebugUi; + isSetAllowDebugUi = true; // mark as set } /** @@ -261,6 +326,7 @@ public void setAllowDebugUi(Boolean allowDebugUi) { public OnboardingLinkSettings allowIntraRegionCrossBorderPayout( Boolean allowIntraRegionCrossBorderPayout) { this.allowIntraRegionCrossBorderPayout = allowIntraRegionCrossBorderPayout; + isSetAllowIntraRegionCrossBorderPayout = true; // mark as set return this; } @@ -290,6 +356,7 @@ public Boolean getAllowIntraRegionCrossBorderPayout() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowIntraRegionCrossBorderPayout(Boolean allowIntraRegionCrossBorderPayout) { this.allowIntraRegionCrossBorderPayout = allowIntraRegionCrossBorderPayout; + isSetAllowIntraRegionCrossBorderPayout = true; // mark as set } /** @@ -301,6 +368,7 @@ public void setAllowIntraRegionCrossBorderPayout(Boolean allowIntraRegionCrossBo */ public OnboardingLinkSettings changeLegalEntityType(Boolean changeLegalEntityType) { this.changeLegalEntityType = changeLegalEntityType; + isSetChangeLegalEntityType = true; // mark as set return this; } @@ -326,6 +394,7 @@ public Boolean getChangeLegalEntityType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChangeLegalEntityType(Boolean changeLegalEntityType) { this.changeLegalEntityType = changeLegalEntityType; + isSetChangeLegalEntityType = true; // mark as set } /** @@ -339,6 +408,7 @@ public void setChangeLegalEntityType(Boolean changeLegalEntityType) { */ public OnboardingLinkSettings editPrefilledCountry(Boolean editPrefilledCountry) { this.editPrefilledCountry = editPrefilledCountry; + isSetEditPrefilledCountry = true; // mark as set return this; } @@ -368,6 +438,7 @@ public Boolean getEditPrefilledCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEditPrefilledCountry(Boolean editPrefilledCountry) { this.editPrefilledCountry = editPrefilledCountry; + isSetEditPrefilledCountry = true; // mark as set } /** @@ -379,6 +450,7 @@ public void setEditPrefilledCountry(Boolean editPrefilledCountry) { */ public OnboardingLinkSettings enforceLegalAge(Boolean enforceLegalAge) { this.enforceLegalAge = enforceLegalAge; + isSetEnforceLegalAge = true; // mark as set return this; } @@ -404,6 +476,7 @@ public Boolean getEnforceLegalAge() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnforceLegalAge(Boolean enforceLegalAge) { this.enforceLegalAge = enforceLegalAge; + isSetEnforceLegalAge = true; // mark as set } /** @@ -420,6 +493,7 @@ public void setEnforceLegalAge(Boolean enforceLegalAge) { public OnboardingLinkSettings hideOnboardingIntroductionIndividual( Boolean hideOnboardingIntroductionIndividual) { this.hideOnboardingIntroductionIndividual = hideOnboardingIntroductionIndividual; + isSetHideOnboardingIntroductionIndividual = true; // mark as set return this; } @@ -454,6 +528,7 @@ public Boolean getHideOnboardingIntroductionIndividual() { public void setHideOnboardingIntroductionIndividual( Boolean hideOnboardingIntroductionIndividual) { this.hideOnboardingIntroductionIndividual = hideOnboardingIntroductionIndividual; + isSetHideOnboardingIntroductionIndividual = true; // mark as set } /** @@ -470,6 +545,7 @@ public void setHideOnboardingIntroductionIndividual( public OnboardingLinkSettings hideOnboardingIntroductionOrganization( Boolean hideOnboardingIntroductionOrganization) { this.hideOnboardingIntroductionOrganization = hideOnboardingIntroductionOrganization; + isSetHideOnboardingIntroductionOrganization = true; // mark as set return this; } @@ -504,6 +580,7 @@ public Boolean getHideOnboardingIntroductionOrganization() { public void setHideOnboardingIntroductionOrganization( Boolean hideOnboardingIntroductionOrganization) { this.hideOnboardingIntroductionOrganization = hideOnboardingIntroductionOrganization; + isSetHideOnboardingIntroductionOrganization = true; // mark as set } /** @@ -520,6 +597,7 @@ public void setHideOnboardingIntroductionOrganization( public OnboardingLinkSettings hideOnboardingIntroductionSoleProprietor( Boolean hideOnboardingIntroductionSoleProprietor) { this.hideOnboardingIntroductionSoleProprietor = hideOnboardingIntroductionSoleProprietor; + isSetHideOnboardingIntroductionSoleProprietor = true; // mark as set return this; } @@ -554,6 +632,7 @@ public Boolean getHideOnboardingIntroductionSoleProprietor() { public void setHideOnboardingIntroductionSoleProprietor( Boolean hideOnboardingIntroductionSoleProprietor) { this.hideOnboardingIntroductionSoleProprietor = hideOnboardingIntroductionSoleProprietor; + isSetHideOnboardingIntroductionSoleProprietor = true; // mark as set } /** @@ -570,6 +649,7 @@ public void setHideOnboardingIntroductionSoleProprietor( public OnboardingLinkSettings hideOnboardingIntroductionTrust( Boolean hideOnboardingIntroductionTrust) { this.hideOnboardingIntroductionTrust = hideOnboardingIntroductionTrust; + isSetHideOnboardingIntroductionTrust = true; // mark as set return this; } @@ -603,6 +683,7 @@ public Boolean getHideOnboardingIntroductionTrust() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHideOnboardingIntroductionTrust(Boolean hideOnboardingIntroductionTrust) { this.hideOnboardingIntroductionTrust = hideOnboardingIntroductionTrust; + isSetHideOnboardingIntroductionTrust = true; // mark as set } /** @@ -615,6 +696,7 @@ public void setHideOnboardingIntroductionTrust(Boolean hideOnboardingIntroductio */ public OnboardingLinkSettings instantBankVerification(Boolean instantBankVerification) { this.instantBankVerification = instantBankVerification; + isSetInstantBankVerification = true; // mark as set return this; } @@ -642,6 +724,7 @@ public Boolean getInstantBankVerification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstantBankVerification(Boolean instantBankVerification) { this.instantBankVerification = instantBankVerification; + isSetInstantBankVerification = true; // mark as set } /** @@ -654,6 +737,7 @@ public void setInstantBankVerification(Boolean instantBankVerification) { */ public OnboardingLinkSettings requirePciSignEcomMoto(Boolean requirePciSignEcomMoto) { this.requirePciSignEcomMoto = requirePciSignEcomMoto; + isSetRequirePciSignEcomMoto = true; // mark as set return this; } @@ -681,6 +765,7 @@ public Boolean getRequirePciSignEcomMoto() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequirePciSignEcomMoto(Boolean requirePciSignEcomMoto) { this.requirePciSignEcomMoto = requirePciSignEcomMoto; + isSetRequirePciSignEcomMoto = true; // mark as set } /** @@ -693,6 +778,7 @@ public void setRequirePciSignEcomMoto(Boolean requirePciSignEcomMoto) { */ public OnboardingLinkSettings requirePciSignEcommerce(Boolean requirePciSignEcommerce) { this.requirePciSignEcommerce = requirePciSignEcommerce; + isSetRequirePciSignEcommerce = true; // mark as set return this; } @@ -720,6 +806,7 @@ public Boolean getRequirePciSignEcommerce() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequirePciSignEcommerce(Boolean requirePciSignEcommerce) { this.requirePciSignEcommerce = requirePciSignEcommerce; + isSetRequirePciSignEcommerce = true; // mark as set } /** @@ -732,6 +819,7 @@ public void setRequirePciSignEcommerce(Boolean requirePciSignEcommerce) { */ public OnboardingLinkSettings requirePciSignPos(Boolean requirePciSignPos) { this.requirePciSignPos = requirePciSignPos; + isSetRequirePciSignPos = true; // mark as set return this; } @@ -759,6 +847,7 @@ public Boolean getRequirePciSignPos() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequirePciSignPos(Boolean requirePciSignPos) { this.requirePciSignPos = requirePciSignPos; + isSetRequirePciSignPos = true; // mark as set } /** @@ -771,6 +860,7 @@ public void setRequirePciSignPos(Boolean requirePciSignPos) { */ public OnboardingLinkSettings requirePciSignPosMoto(Boolean requirePciSignPosMoto) { this.requirePciSignPosMoto = requirePciSignPosMoto; + isSetRequirePciSignPosMoto = true; // mark as set return this; } @@ -798,6 +888,7 @@ public Boolean getRequirePciSignPosMoto() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequirePciSignPosMoto(Boolean requirePciSignPosMoto) { this.requirePciSignPosMoto = requirePciSignPosMoto; + isSetRequirePciSignPosMoto = true; // mark as set } /** @@ -808,6 +899,7 @@ public void setRequirePciSignPosMoto(Boolean requirePciSignPosMoto) { */ public OnboardingLinkSettings transferInstrumentLimit(Integer transferInstrumentLimit) { this.transferInstrumentLimit = transferInstrumentLimit; + isSetTransferInstrumentLimit = true; // mark as set return this; } @@ -831,6 +923,27 @@ public Integer getTransferInstrumentLimit() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentLimit(Integer transferInstrumentLimit) { this.transferInstrumentLimit = transferInstrumentLimit; + isSetTransferInstrumentLimit = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public OnboardingLinkSettings 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 OnboardingLinkSettings object is equal to o. */ @@ -961,6 +1074,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 (isSetAcceptedCountries) { + addIfNull(nulls, JSON_PROPERTY_ACCEPTED_COUNTRIES, this.acceptedCountries); + } + if (isSetAllowBankAccountFormatSelection) { + addIfNull( + nulls, + JSON_PROPERTY_ALLOW_BANK_ACCOUNT_FORMAT_SELECTION, + this.allowBankAccountFormatSelection); + } + if (isSetAllowDebugUi) { + addIfNull(nulls, JSON_PROPERTY_ALLOW_DEBUG_UI, this.allowDebugUi); + } + if (isSetAllowIntraRegionCrossBorderPayout) { + addIfNull( + nulls, + JSON_PROPERTY_ALLOW_INTRA_REGION_CROSS_BORDER_PAYOUT, + this.allowIntraRegionCrossBorderPayout); + } + if (isSetChangeLegalEntityType) { + addIfNull(nulls, JSON_PROPERTY_CHANGE_LEGAL_ENTITY_TYPE, this.changeLegalEntityType); + } + if (isSetEditPrefilledCountry) { + addIfNull(nulls, JSON_PROPERTY_EDIT_PREFILLED_COUNTRY, this.editPrefilledCountry); + } + if (isSetEnforceLegalAge) { + addIfNull(nulls, JSON_PROPERTY_ENFORCE_LEGAL_AGE, this.enforceLegalAge); + } + if (isSetHideOnboardingIntroductionIndividual) { + addIfNull( + nulls, + JSON_PROPERTY_HIDE_ONBOARDING_INTRODUCTION_INDIVIDUAL, + this.hideOnboardingIntroductionIndividual); + } + if (isSetHideOnboardingIntroductionOrganization) { + addIfNull( + nulls, + JSON_PROPERTY_HIDE_ONBOARDING_INTRODUCTION_ORGANIZATION, + this.hideOnboardingIntroductionOrganization); + } + if (isSetHideOnboardingIntroductionSoleProprietor) { + addIfNull( + nulls, + JSON_PROPERTY_HIDE_ONBOARDING_INTRODUCTION_SOLE_PROPRIETOR, + this.hideOnboardingIntroductionSoleProprietor); + } + if (isSetHideOnboardingIntroductionTrust) { + addIfNull( + nulls, + JSON_PROPERTY_HIDE_ONBOARDING_INTRODUCTION_TRUST, + this.hideOnboardingIntroductionTrust); + } + if (isSetInstantBankVerification) { + addIfNull(nulls, JSON_PROPERTY_INSTANT_BANK_VERIFICATION, this.instantBankVerification); + } + if (isSetRequirePciSignEcomMoto) { + addIfNull(nulls, JSON_PROPERTY_REQUIRE_PCI_SIGN_ECOM_MOTO, this.requirePciSignEcomMoto); + } + if (isSetRequirePciSignEcommerce) { + addIfNull(nulls, JSON_PROPERTY_REQUIRE_PCI_SIGN_ECOMMERCE, this.requirePciSignEcommerce); + } + if (isSetRequirePciSignPos) { + addIfNull(nulls, JSON_PROPERTY_REQUIRE_PCI_SIGN_POS, this.requirePciSignPos); + } + if (isSetRequirePciSignPosMoto) { + addIfNull(nulls, JSON_PROPERTY_REQUIRE_PCI_SIGN_POS_MOTO, this.requirePciSignPosMoto); + } + if (isSetTransferInstrumentLimit) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_LIMIT, this.transferInstrumentLimit); + } + + 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 OnboardingLinkSettings given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingTheme.java b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingTheme.java index 781832987..e38f6164d 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingTheme.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingTheme.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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,18 +34,39 @@ public class OnboardingTheme { 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_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PROPERTIES = "properties"; private Map properties; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProperties = false; + public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt"; private OffsetDateTime updatedAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUpdatedAt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public OnboardingTheme() {} /** @@ -54,6 +77,7 @@ public OnboardingTheme() {} */ public OnboardingTheme createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -77,6 +101,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -87,6 +112,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public OnboardingTheme description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -110,6 +136,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -120,6 +147,7 @@ public void setDescription(String description) { */ public OnboardingTheme id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -143,6 +171,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -153,6 +182,7 @@ public void setId(String id) { */ public OnboardingTheme properties(Map properties) { this.properties = properties; + isSetProperties = true; // mark as set return this; } @@ -184,6 +214,7 @@ public Map getProperties() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProperties(Map properties) { this.properties = properties; + isSetProperties = true; // mark as set } /** @@ -194,6 +225,7 @@ public void setProperties(Map properties) { */ public OnboardingTheme updatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; + isSetUpdatedAt = true; // mark as set return this; } @@ -217,6 +249,27 @@ public OffsetDateTime getUpdatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUpdatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; + isSetUpdatedAt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public OnboardingTheme 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 OnboardingTheme object is equal to o. */ @@ -264,6 +317,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 (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetProperties) { + addIfNull(nulls, JSON_PROPERTY_PROPERTIES, this.properties); + } + if (isSetUpdatedAt) { + addIfNull(nulls, JSON_PROPERTY_UPDATED_AT, this.updatedAt); + } + + 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 OnboardingTheme given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java index c678da743..22f4a3115 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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,12 +31,27 @@ public class OnboardingThemes { public static final String JSON_PROPERTY_NEXT = "next"; private String next; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNext = false; + public static final String JSON_PROPERTY_PREVIOUS = "previous"; private String previous; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrevious = false; + public static final String JSON_PROPERTY_THEMES = "themes"; private List themes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThemes = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public OnboardingThemes() {} /** @@ -45,6 +62,7 @@ public OnboardingThemes() {} */ public OnboardingThemes next(String next) { this.next = next; + isSetNext = true; // mark as set return this; } @@ -68,6 +86,7 @@ public String getNext() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNext(String next) { this.next = next; + isSetNext = true; // mark as set } /** @@ -78,6 +97,7 @@ public void setNext(String next) { */ public OnboardingThemes previous(String previous) { this.previous = previous; + isSetPrevious = true; // mark as set return this; } @@ -101,6 +121,7 @@ public String getPrevious() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrevious(String previous) { this.previous = previous; + isSetPrevious = true; // mark as set } /** @@ -111,6 +132,7 @@ public void setPrevious(String previous) { */ public OnboardingThemes themes(List themes) { this.themes = themes; + isSetThemes = true; // mark as set return this; } @@ -142,6 +164,27 @@ public List getThemes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThemes(List themes) { this.themes = themes; + isSetThemes = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public OnboardingThemes 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 OnboardingThemes object is equal to o. */ @@ -185,6 +228,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 (isSetNext) { + addIfNull(nulls, JSON_PROPERTY_NEXT, this.next); + } + if (isSetPrevious) { + addIfNull(nulls, JSON_PROPERTY_PREVIOUS, this.previous); + } + if (isSetThemes) { + addIfNull(nulls, JSON_PROPERTY_THEMES, this.themes); + } + + 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 OnboardingThemes given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Organization.java b/src/main/java/com/adyen/model/legalentitymanagement/Organization.java index 4f93d385e..d708ed645 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Organization.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Organization.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -58,38 +60,71 @@ public class Organization { public static final String JSON_PROPERTY_COUNTRY_OF_GOVERNING_LAW = "countryOfGoverningLaw"; private String countryOfGoverningLaw; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryOfGoverningLaw = false; + public static final String JSON_PROPERTY_DATE_OF_INCORPORATION = "dateOfIncorporation"; private String dateOfIncorporation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfIncorporation = false; + public static final String JSON_PROPERTY_DATE_OF_INITIATION_OF_LEGAL_PROCEEDING = "dateOfInitiationOfLegalProceeding"; private String dateOfInitiationOfLegalProceeding; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfInitiationOfLegalProceeding = 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_DOING_BUSINESS_AS = "doingBusinessAs"; private String doingBusinessAs; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDoingBusinessAs = false; + public static final String JSON_PROPERTY_DOING_BUSINESS_AS_ABSENT = "doingBusinessAsAbsent"; private Boolean doingBusinessAsAbsent; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDoingBusinessAsAbsent = false; + public static final String JSON_PROPERTY_ECONOMIC_SECTOR = "economicSector"; private String economicSector; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEconomicSector = false; + public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_FINANCIAL_REPORTS = "financialReports"; private List financialReports; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFinancialReports = false; + public static final String JSON_PROPERTY_GLOBAL_LEGAL_ENTITY_IDENTIFIER = "globalLegalEntityIdentifier"; private String globalLegalEntityIdentifier; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGlobalLegalEntityIdentifier = false; + public static final String JSON_PROPERTY_HEAD_OFFICE_INDICATOR = "headOfficeIndicator"; private Boolean headOfficeIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHeadOfficeIndicator = false; + /** The institutional sector the organization operates within. */ public enum InstitutionalSectorEnum { NONFINANCIALCORPORATION(String.valueOf("nonFinancialCorporation")), @@ -166,27 +201,51 @@ public static InstitutionalSectorEnum fromValue(String value) { public static final String JSON_PROPERTY_INSTITUTIONAL_SECTOR = "institutionalSector"; private InstitutionalSectorEnum institutionalSector; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstitutionalSector = false; + public static final String JSON_PROPERTY_LEGAL_FORM = "legalForm"; private String legalForm; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalForm = false; + public static final String JSON_PROPERTY_LEGAL_NAME = "legalName"; private String legalName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalName = false; + public static final String JSON_PROPERTY_PHONE = "phone"; private PhoneNumber phone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhone = false; + public static final String JSON_PROPERTY_PRINCIPAL_PLACE_OF_BUSINESS = "principalPlaceOfBusiness"; private Address principalPlaceOfBusiness; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrincipalPlaceOfBusiness = false; + public static final String JSON_PROPERTY_REGISTERED_ADDRESS = "registeredAddress"; private Address registeredAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRegisteredAddress = false; + public static final String JSON_PROPERTY_REGISTRATION_NUMBER = "registrationNumber"; private String registrationNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRegistrationNumber = false; + public static final String JSON_PROPERTY_REGISTRATION_NUMBER_ABSENT = "registrationNumberAbsent"; private Boolean registrationNumberAbsent; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRegistrationNumberAbsent = false; + /** * The status of any current or past legal action taken against the legal entity. Possible values: * **noLegalActionsTaken**, **underJudicialAdministration**, **bankruptcyInsolvency**, @@ -240,19 +299,34 @@ public static StatusOfLegalProceedingEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS_OF_LEGAL_PROCEEDING = "statusOfLegalProceeding"; private StatusOfLegalProceedingEnum statusOfLegalProceeding; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatusOfLegalProceeding = false; + public static final String JSON_PROPERTY_STOCK_DATA = "stockData"; private StockData stockData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStockData = false; + public static final String JSON_PROPERTY_SUPPORT = "support"; private Support support; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSupport = false; + public static final String JSON_PROPERTY_TAX_INFORMATION = "taxInformation"; private List taxInformation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxInformation = false; + public static final String JSON_PROPERTY_TAX_REPORTING_CLASSIFICATION = "taxReportingClassification"; private TaxReportingClassification taxReportingClassification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxReportingClassification = false; + /** * Type of organization. Possible values: **associationIncorporated**, * **governmentalOrganization**, **listedPublicCompany**, **nonProfit**, @@ -309,6 +383,9 @@ 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; + /** * The reason the organization has not provided a VAT number. Possible values: * **industryExemption**, **belowTaxThreshold**. @@ -356,12 +433,27 @@ public static VatAbsenceReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_VAT_ABSENCE_REASON = "vatAbsenceReason"; private VatAbsenceReasonEnum vatAbsenceReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVatAbsenceReason = false; + public static final String JSON_PROPERTY_VAT_NUMBER = "vatNumber"; private String vatNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVatNumber = false; + public static final String JSON_PROPERTY_WEB_DATA = "webData"; private WebData webData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Organization() {} /** @@ -375,6 +467,7 @@ public Organization() {} */ public Organization countryOfGoverningLaw(String countryOfGoverningLaw) { this.countryOfGoverningLaw = countryOfGoverningLaw; + isSetCountryOfGoverningLaw = true; // mark as set return this; } @@ -404,6 +497,7 @@ public String getCountryOfGoverningLaw() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryOfGoverningLaw(String countryOfGoverningLaw) { this.countryOfGoverningLaw = countryOfGoverningLaw; + isSetCountryOfGoverningLaw = true; // mark as set } /** @@ -415,6 +509,7 @@ public void setCountryOfGoverningLaw(String countryOfGoverningLaw) { */ public Organization dateOfIncorporation(String dateOfIncorporation) { this.dateOfIncorporation = dateOfIncorporation; + isSetDateOfIncorporation = true; // mark as set return this; } @@ -440,6 +535,7 @@ public String getDateOfIncorporation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfIncorporation(String dateOfIncorporation) { this.dateOfIncorporation = dateOfIncorporation; + isSetDateOfIncorporation = true; // mark as set } /** @@ -456,6 +552,7 @@ public void setDateOfIncorporation(String dateOfIncorporation) { */ public Organization dateOfInitiationOfLegalProceeding(String dateOfInitiationOfLegalProceeding) { this.dateOfInitiationOfLegalProceeding = dateOfInitiationOfLegalProceeding; + isSetDateOfInitiationOfLegalProceeding = true; // mark as set return this; } @@ -491,6 +588,7 @@ public String getDateOfInitiationOfLegalProceeding() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfInitiationOfLegalProceeding(String dateOfInitiationOfLegalProceeding) { this.dateOfInitiationOfLegalProceeding = dateOfInitiationOfLegalProceeding; + isSetDateOfInitiationOfLegalProceeding = true; // mark as set } /** @@ -501,6 +599,7 @@ public void setDateOfInitiationOfLegalProceeding(String dateOfInitiationOfLegalP */ public Organization description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -524,6 +623,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -535,6 +635,7 @@ public void setDescription(String description) { */ public Organization doingBusinessAs(String doingBusinessAs) { this.doingBusinessAs = doingBusinessAs; + isSetDoingBusinessAs = true; // mark as set return this; } @@ -560,6 +661,7 @@ public String getDoingBusinessAs() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDoingBusinessAs(String doingBusinessAs) { this.doingBusinessAs = doingBusinessAs; + isSetDoingBusinessAs = true; // mark as set } /** @@ -572,6 +674,7 @@ public void setDoingBusinessAs(String doingBusinessAs) { */ public Organization doingBusinessAsAbsent(Boolean doingBusinessAsAbsent) { this.doingBusinessAsAbsent = doingBusinessAsAbsent; + isSetDoingBusinessAsAbsent = true; // mark as set return this; } @@ -599,6 +702,7 @@ public Boolean getDoingBusinessAsAbsent() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDoingBusinessAsAbsent(Boolean doingBusinessAsAbsent) { this.doingBusinessAsAbsent = doingBusinessAsAbsent; + isSetDoingBusinessAsAbsent = true; // mark as set } /** @@ -615,6 +719,7 @@ public void setDoingBusinessAsAbsent(Boolean doingBusinessAsAbsent) { */ public Organization economicSector(String economicSector) { this.economicSector = economicSector; + isSetEconomicSector = true; // mark as set return this; } @@ -650,6 +755,7 @@ public String getEconomicSector() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEconomicSector(String economicSector) { this.economicSector = economicSector; + isSetEconomicSector = true; // mark as set } /** @@ -660,6 +766,7 @@ public void setEconomicSector(String economicSector) { */ public Organization email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -683,6 +790,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -693,6 +801,7 @@ public void setEmail(String email) { */ public Organization financialReports(List financialReports) { this.financialReports = financialReports; + isSetFinancialReports = true; // mark as set return this; } @@ -724,6 +833,7 @@ public List getFinancialReports() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFinancialReports(List financialReports) { this.financialReports = financialReports; + isSetFinancialReports = true; // mark as set } /** @@ -734,6 +844,7 @@ public void setFinancialReports(List financialReports) { */ public Organization globalLegalEntityIdentifier(String globalLegalEntityIdentifier) { this.globalLegalEntityIdentifier = globalLegalEntityIdentifier; + isSetGlobalLegalEntityIdentifier = true; // mark as set return this; } @@ -757,6 +868,7 @@ public String getGlobalLegalEntityIdentifier() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGlobalLegalEntityIdentifier(String globalLegalEntityIdentifier) { this.globalLegalEntityIdentifier = globalLegalEntityIdentifier; + isSetGlobalLegalEntityIdentifier = true; // mark as set } /** @@ -768,6 +880,7 @@ public void setGlobalLegalEntityIdentifier(String globalLegalEntityIdentifier) { */ public Organization headOfficeIndicator(Boolean headOfficeIndicator) { this.headOfficeIndicator = headOfficeIndicator; + isSetHeadOfficeIndicator = true; // mark as set return this; } @@ -793,6 +906,7 @@ public Boolean getHeadOfficeIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHeadOfficeIndicator(Boolean headOfficeIndicator) { this.headOfficeIndicator = headOfficeIndicator; + isSetHeadOfficeIndicator = true; // mark as set } /** @@ -803,6 +917,7 @@ public void setHeadOfficeIndicator(Boolean headOfficeIndicator) { */ public Organization institutionalSector(InstitutionalSectorEnum institutionalSector) { this.institutionalSector = institutionalSector; + isSetInstitutionalSector = true; // mark as set return this; } @@ -826,6 +941,7 @@ public InstitutionalSectorEnum getInstitutionalSector() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstitutionalSector(InstitutionalSectorEnum institutionalSector) { this.institutionalSector = institutionalSector; + isSetInstitutionalSector = true; // mark as set } /** @@ -838,6 +954,7 @@ public void setInstitutionalSector(InstitutionalSectorEnum institutionalSector) */ public Organization legalForm(String legalForm) { this.legalForm = legalForm; + isSetLegalForm = true; // mark as set return this; } @@ -865,6 +982,7 @@ public String getLegalForm() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalForm(String legalForm) { this.legalForm = legalForm; + isSetLegalForm = true; // mark as set } /** @@ -875,6 +993,7 @@ public void setLegalForm(String legalForm) { */ public Organization legalName(String legalName) { this.legalName = legalName; + isSetLegalName = true; // mark as set return this; } @@ -898,6 +1017,7 @@ public String getLegalName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalName(String legalName) { this.legalName = legalName; + isSetLegalName = true; // mark as set } /** @@ -908,6 +1028,7 @@ public void setLegalName(String legalName) { */ public Organization phone(PhoneNumber phone) { this.phone = phone; + isSetPhone = true; // mark as set return this; } @@ -931,6 +1052,7 @@ public PhoneNumber getPhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhone(PhoneNumber phone) { this.phone = phone; + isSetPhone = true; // mark as set } /** @@ -941,6 +1063,7 @@ public void setPhone(PhoneNumber phone) { */ public Organization principalPlaceOfBusiness(Address principalPlaceOfBusiness) { this.principalPlaceOfBusiness = principalPlaceOfBusiness; + isSetPrincipalPlaceOfBusiness = true; // mark as set return this; } @@ -964,6 +1087,7 @@ public Address getPrincipalPlaceOfBusiness() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrincipalPlaceOfBusiness(Address principalPlaceOfBusiness) { this.principalPlaceOfBusiness = principalPlaceOfBusiness; + isSetPrincipalPlaceOfBusiness = true; // mark as set } /** @@ -974,6 +1098,7 @@ public void setPrincipalPlaceOfBusiness(Address principalPlaceOfBusiness) { */ public Organization registeredAddress(Address registeredAddress) { this.registeredAddress = registeredAddress; + isSetRegisteredAddress = true; // mark as set return this; } @@ -997,6 +1122,7 @@ public Address getRegisteredAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRegisteredAddress(Address registeredAddress) { this.registeredAddress = registeredAddress; + isSetRegisteredAddress = true; // mark as set } /** @@ -1007,6 +1133,7 @@ public void setRegisteredAddress(Address registeredAddress) { */ public Organization registrationNumber(String registrationNumber) { this.registrationNumber = registrationNumber; + isSetRegistrationNumber = true; // mark as set return this; } @@ -1030,6 +1157,7 @@ public String getRegistrationNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRegistrationNumber(String registrationNumber) { this.registrationNumber = registrationNumber; + isSetRegistrationNumber = true; // mark as set } /** @@ -1044,6 +1172,7 @@ public void setRegistrationNumber(String registrationNumber) { */ public Organization registrationNumberAbsent(Boolean registrationNumberAbsent) { this.registrationNumberAbsent = registrationNumberAbsent; + isSetRegistrationNumberAbsent = true; // mark as set return this; } @@ -1075,6 +1204,7 @@ public Boolean getRegistrationNumberAbsent() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRegistrationNumberAbsent(Boolean registrationNumberAbsent) { this.registrationNumberAbsent = registrationNumberAbsent; + isSetRegistrationNumberAbsent = true; // mark as set } /** @@ -1092,6 +1222,7 @@ public void setRegistrationNumberAbsent(Boolean registrationNumberAbsent) { */ public Organization statusOfLegalProceeding(StatusOfLegalProceedingEnum statusOfLegalProceeding) { this.statusOfLegalProceeding = statusOfLegalProceeding; + isSetStatusOfLegalProceeding = true; // mark as set return this; } @@ -1129,6 +1260,7 @@ public StatusOfLegalProceedingEnum getStatusOfLegalProceeding() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusOfLegalProceeding(StatusOfLegalProceedingEnum statusOfLegalProceeding) { this.statusOfLegalProceeding = statusOfLegalProceeding; + isSetStatusOfLegalProceeding = true; // mark as set } /** @@ -1139,6 +1271,7 @@ public void setStatusOfLegalProceeding(StatusOfLegalProceedingEnum statusOfLegal */ public Organization stockData(StockData stockData) { this.stockData = stockData; + isSetStockData = true; // mark as set return this; } @@ -1162,6 +1295,7 @@ public StockData getStockData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStockData(StockData stockData) { this.stockData = stockData; + isSetStockData = true; // mark as set } /** @@ -1172,6 +1306,7 @@ public void setStockData(StockData stockData) { */ public Organization support(Support support) { this.support = support; + isSetSupport = true; // mark as set return this; } @@ -1195,6 +1330,7 @@ public Support getSupport() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSupport(Support support) { this.support = support; + isSetSupport = true; // mark as set } /** @@ -1205,6 +1341,7 @@ public void setSupport(Support support) { */ public Organization taxInformation(List taxInformation) { this.taxInformation = taxInformation; + isSetTaxInformation = true; // mark as set return this; } @@ -1236,6 +1373,7 @@ public List getTaxInformation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxInformation(List taxInformation) { this.taxInformation = taxInformation; + isSetTaxInformation = true; // mark as set } /** @@ -1247,6 +1385,7 @@ public void setTaxInformation(List taxInformation) { public Organization taxReportingClassification( TaxReportingClassification taxReportingClassification) { this.taxReportingClassification = taxReportingClassification; + isSetTaxReportingClassification = true; // mark as set return this; } @@ -1270,6 +1409,7 @@ public TaxReportingClassification getTaxReportingClassification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxReportingClassification(TaxReportingClassification taxReportingClassification) { this.taxReportingClassification = taxReportingClassification; + isSetTaxReportingClassification = true; // mark as set } /** @@ -1284,6 +1424,7 @@ public void setTaxReportingClassification(TaxReportingClassification taxReportin */ public Organization type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1315,6 +1456,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -1327,6 +1469,7 @@ public void setType(TypeEnum type) { */ public Organization vatAbsenceReason(VatAbsenceReasonEnum vatAbsenceReason) { this.vatAbsenceReason = vatAbsenceReason; + isSetVatAbsenceReason = true; // mark as set return this; } @@ -1354,6 +1497,7 @@ public VatAbsenceReasonEnum getVatAbsenceReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVatAbsenceReason(VatAbsenceReasonEnum vatAbsenceReason) { this.vatAbsenceReason = vatAbsenceReason; + isSetVatAbsenceReason = true; // mark as set } /** @@ -1364,6 +1508,7 @@ public void setVatAbsenceReason(VatAbsenceReasonEnum vatAbsenceReason) { */ public Organization vatNumber(String vatNumber) { this.vatNumber = vatNumber; + isSetVatNumber = true; // mark as set return this; } @@ -1387,6 +1532,7 @@ public String getVatNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVatNumber(String vatNumber) { this.vatNumber = vatNumber; + isSetVatNumber = true; // mark as set } /** @@ -1397,6 +1543,7 @@ public void setVatNumber(String vatNumber) { */ public Organization webData(WebData webData) { this.webData = webData; + isSetWebData = true; // mark as set return this; } @@ -1420,6 +1567,27 @@ public WebData getWebData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebData(WebData webData) { this.webData = webData; + isSetWebData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Organization 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 Organization object is equal to o. */ @@ -1565,6 +1733,115 @@ 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 (isSetCountryOfGoverningLaw) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_OF_GOVERNING_LAW, this.countryOfGoverningLaw); + } + if (isSetDateOfIncorporation) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_INCORPORATION, this.dateOfIncorporation); + } + if (isSetDateOfInitiationOfLegalProceeding) { + addIfNull( + nulls, + JSON_PROPERTY_DATE_OF_INITIATION_OF_LEGAL_PROCEEDING, + this.dateOfInitiationOfLegalProceeding); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetDoingBusinessAs) { + addIfNull(nulls, JSON_PROPERTY_DOING_BUSINESS_AS, this.doingBusinessAs); + } + if (isSetDoingBusinessAsAbsent) { + addIfNull(nulls, JSON_PROPERTY_DOING_BUSINESS_AS_ABSENT, this.doingBusinessAsAbsent); + } + if (isSetEconomicSector) { + addIfNull(nulls, JSON_PROPERTY_ECONOMIC_SECTOR, this.economicSector); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetFinancialReports) { + addIfNull(nulls, JSON_PROPERTY_FINANCIAL_REPORTS, this.financialReports); + } + if (isSetGlobalLegalEntityIdentifier) { + addIfNull( + nulls, JSON_PROPERTY_GLOBAL_LEGAL_ENTITY_IDENTIFIER, this.globalLegalEntityIdentifier); + } + if (isSetHeadOfficeIndicator) { + addIfNull(nulls, JSON_PROPERTY_HEAD_OFFICE_INDICATOR, this.headOfficeIndicator); + } + if (isSetInstitutionalSector) { + addIfNull(nulls, JSON_PROPERTY_INSTITUTIONAL_SECTOR, this.institutionalSector); + } + if (isSetLegalForm) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_FORM, this.legalForm); + } + if (isSetLegalName) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_NAME, this.legalName); + } + if (isSetPhone) { + addIfNull(nulls, JSON_PROPERTY_PHONE, this.phone); + } + if (isSetPrincipalPlaceOfBusiness) { + addIfNull(nulls, JSON_PROPERTY_PRINCIPAL_PLACE_OF_BUSINESS, this.principalPlaceOfBusiness); + } + if (isSetRegisteredAddress) { + addIfNull(nulls, JSON_PROPERTY_REGISTERED_ADDRESS, this.registeredAddress); + } + if (isSetRegistrationNumber) { + addIfNull(nulls, JSON_PROPERTY_REGISTRATION_NUMBER, this.registrationNumber); + } + if (isSetRegistrationNumberAbsent) { + addIfNull(nulls, JSON_PROPERTY_REGISTRATION_NUMBER_ABSENT, this.registrationNumberAbsent); + } + if (isSetStatusOfLegalProceeding) { + addIfNull(nulls, JSON_PROPERTY_STATUS_OF_LEGAL_PROCEEDING, this.statusOfLegalProceeding); + } + if (isSetStockData) { + addIfNull(nulls, JSON_PROPERTY_STOCK_DATA, this.stockData); + } + if (isSetSupport) { + addIfNull(nulls, JSON_PROPERTY_SUPPORT, this.support); + } + if (isSetTaxInformation) { + addIfNull(nulls, JSON_PROPERTY_TAX_INFORMATION, this.taxInformation); + } + if (isSetTaxReportingClassification) { + addIfNull(nulls, JSON_PROPERTY_TAX_REPORTING_CLASSIFICATION, this.taxReportingClassification); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetVatAbsenceReason) { + addIfNull(nulls, JSON_PROPERTY_VAT_ABSENCE_REASON, this.vatAbsenceReason); + } + if (isSetVatNumber) { + addIfNull(nulls, JSON_PROPERTY_VAT_NUMBER, this.vatNumber); + } + if (isSetWebData) { + addIfNull(nulls, JSON_PROPERTY_WEB_DATA, this.webData); + } + + 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 Organization given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OwnerEntity.java b/src/main/java/com/adyen/model/legalentitymanagement/OwnerEntity.java index bc581911e..9c896d968 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OwnerEntity.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OwnerEntity.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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 OwnerEntity { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 OwnerEntity() {} /** @@ -44,6 +58,7 @@ public OwnerEntity() {} */ public OwnerEntity id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -83,6 +98,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -94,6 +110,7 @@ public void setId(String id) { */ public OwnerEntity type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -119,6 +136,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public OwnerEntity 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 OwnerEntity object is equal to o. */ @@ -159,6 +197,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + 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 OwnerEntity given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/PLLocalAccountIdentification.java index 290b33b4c..f0451a3dd 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/PLLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/PLLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -30,6 +32,9 @@ public class PLLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **plLocal** */ public enum TypeEnum { PLLOCAL(String.valueOf("plLocal")); @@ -72,6 +77,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 PLLocalAccountIdentification() {} /** @@ -86,6 +100,7 @@ public PLLocalAccountIdentification() {} */ public PLLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +132,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +143,7 @@ public void setAccountNumber(String accountNumber) { */ public PLLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -150,6 +167,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 PLLocalAccountIdentification 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 PLLocalAccountIdentification object is equal to o. */ @@ -191,6 +229,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + 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 PLLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PciDocumentInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/PciDocumentInfo.java index 33d6250fc..b8948af5e 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/PciDocumentInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/PciDocumentInfo.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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,12 +30,27 @@ public class PciDocumentInfo { 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_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_VALID_UNTIL = "validUntil"; private OffsetDateTime validUntil; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValidUntil = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PciDocumentInfo() {} /** @@ -46,6 +63,7 @@ public PciDocumentInfo() {} */ public PciDocumentInfo createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -73,6 +91,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -83,6 +102,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public PciDocumentInfo id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -106,6 +126,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -118,6 +139,7 @@ public void setId(String id) { */ public PciDocumentInfo validUntil(OffsetDateTime validUntil) { this.validUntil = validUntil; + isSetValidUntil = true; // mark as set return this; } @@ -145,6 +167,27 @@ public OffsetDateTime getValidUntil() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValidUntil(OffsetDateTime validUntil) { this.validUntil = validUntil; + isSetValidUntil = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PciDocumentInfo 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 PciDocumentInfo object is equal to o. */ @@ -188,6 +231,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 (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetValidUntil) { + addIfNull(nulls, JSON_PROPERTY_VALID_UNTIL, this.validUntil); + } + + 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 PciDocumentInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PciSigningRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/PciSigningRequest.java index 616cd164a..5377a8593 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/PciSigningRequest.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/PciSigningRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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,9 +30,21 @@ public class PciSigningRequest { public static final String JSON_PROPERTY_PCI_TEMPLATE_REFERENCES = "pciTemplateReferences"; private List pciTemplateReferences; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPciTemplateReferences = false; + public static final String JSON_PROPERTY_SIGNED_BY = "signedBy"; private String signedBy; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSignedBy = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PciSigningRequest() {} /** @@ -42,6 +56,7 @@ public PciSigningRequest() {} */ public PciSigningRequest pciTemplateReferences(List pciTemplateReferences) { this.pciTemplateReferences = pciTemplateReferences; + isSetPciTemplateReferences = true; // mark as set return this; } @@ -75,6 +90,7 @@ public List getPciTemplateReferences() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPciTemplateReferences(List pciTemplateReferences) { this.pciTemplateReferences = pciTemplateReferences; + isSetPciTemplateReferences = true; // mark as set } /** @@ -89,6 +105,7 @@ public void setPciTemplateReferences(List pciTemplateReferences) { */ public PciSigningRequest signedBy(String signedBy) { this.signedBy = signedBy; + isSetSignedBy = true; // mark as set return this; } @@ -120,6 +137,27 @@ public String getSignedBy() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSignedBy(String signedBy) { this.signedBy = signedBy; + isSetSignedBy = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PciSigningRequest 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 PciSigningRequest object is equal to o. */ @@ -163,6 +201,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 (isSetPciTemplateReferences) { + addIfNull(nulls, JSON_PROPERTY_PCI_TEMPLATE_REFERENCES, this.pciTemplateReferences); + } + if (isSetSignedBy) { + addIfNull(nulls, JSON_PROPERTY_SIGNED_BY, this.signedBy); + } + + 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 PciSigningRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PciSigningResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/PciSigningResponse.java index 05fe655e4..450818261 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/PciSigningResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/PciSigningResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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,9 +30,21 @@ public class PciSigningResponse { public static final String JSON_PROPERTY_PCI_QUESTIONNAIRE_IDS = "pciQuestionnaireIds"; private List pciQuestionnaireIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPciQuestionnaireIds = false; + public static final String JSON_PROPERTY_SIGNED_BY = "signedBy"; private String signedBy; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSignedBy = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PciSigningResponse() {} /** @@ -41,6 +55,7 @@ public PciSigningResponse() {} */ public PciSigningResponse pciQuestionnaireIds(List pciQuestionnaireIds) { this.pciQuestionnaireIds = pciQuestionnaireIds; + isSetPciQuestionnaireIds = true; // mark as set return this; } @@ -72,6 +87,7 @@ public List getPciQuestionnaireIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPciQuestionnaireIds(List pciQuestionnaireIds) { this.pciQuestionnaireIds = pciQuestionnaireIds; + isSetPciQuestionnaireIds = true; // mark as set } /** @@ -86,6 +102,7 @@ public void setPciQuestionnaireIds(List pciQuestionnaireIds) { */ public PciSigningResponse signedBy(String signedBy) { this.signedBy = signedBy; + isSetSignedBy = true; // mark as set return this; } @@ -117,6 +134,27 @@ public String getSignedBy() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSignedBy(String signedBy) { this.signedBy = signedBy; + isSetSignedBy = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PciSigningResponse 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 PciSigningResponse object is equal to o. */ @@ -160,6 +198,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 (isSetPciQuestionnaireIds) { + addIfNull(nulls, JSON_PROPERTY_PCI_QUESTIONNAIRE_IDS, this.pciQuestionnaireIds); + } + if (isSetSignedBy) { + addIfNull(nulls, JSON_PROPERTY_SIGNED_BY, this.signedBy); + } + + 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 PciSigningResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PhoneNumber.java b/src/main/java/com/adyen/model/legalentitymanagement/PhoneNumber.java index e5651f163..e56dfea6c 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/PhoneNumber.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/PhoneNumber.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -28,12 +30,27 @@ public class PhoneNumber { 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_PHONE_COUNTRY_CODE = "phoneCountryCode"; private String phoneCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneCountryCode = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 PhoneNumber() {} @JsonCreator @@ -50,6 +67,7 @@ public PhoneNumber(@JsonProperty(JSON_PROPERTY_PHONE_COUNTRY_CODE) String phoneC */ public PhoneNumber number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -73,6 +91,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -101,6 +120,7 @@ public String getPhoneCountryCode() { */ public PhoneNumber type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -126,6 +146,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PhoneNumber 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 PhoneNumber object is equal to o. */ @@ -169,6 +210,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 (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + if (isSetPhoneCountryCode) { + addIfNull(nulls, JSON_PROPERTY_PHONE_COUNTRY_CODE, this.phoneCountryCode); + } + 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 PhoneNumber given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/RemediatingAction.java b/src/main/java/com/adyen/model/legalentitymanagement/RemediatingAction.java index e30b3f765..96d3264a6 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/RemediatingAction.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/RemediatingAction.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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 RemediatingAction { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RemediatingAction() {} /** @@ -36,6 +50,7 @@ public RemediatingAction() {} */ public RemediatingAction code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCode(String code) { */ public RemediatingAction message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RemediatingAction 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 RemediatingAction object is equal to o. */ @@ -133,6 +171,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 (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + + 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 RemediatingAction given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/SELocalAccountIdentification.java index d547f4ee6..3565b6677 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SELocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SELocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,9 +33,15 @@ public class SELocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_CLEARING_NUMBER = "clearingNumber"; private String clearingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClearingNumber = false; + /** **seLocal** */ public enum TypeEnum { SELOCAL(String.valueOf("seLocal")); @@ -76,6 +84,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 SELocalAccountIdentification() {} /** @@ -90,6 +107,7 @@ public SELocalAccountIdentification() {} */ public SELocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -121,6 +139,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -135,6 +154,7 @@ public void setAccountNumber(String accountNumber) { */ public SELocalAccountIdentification clearingNumber(String clearingNumber) { this.clearingNumber = clearingNumber; + isSetClearingNumber = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getClearingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClearingNumber(String clearingNumber) { this.clearingNumber = clearingNumber; + isSetClearingNumber = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setClearingNumber(String clearingNumber) { */ public SELocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -199,6 +221,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 SELocalAccountIdentification 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 SELocalAccountIdentification object is equal to o. */ @@ -242,6 +285,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetClearingNumber) { + addIfNull(nulls, JSON_PROPERTY_CLEARING_NUMBER, this.clearingNumber); + } + 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 SELocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SGLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/SGLocalAccountIdentification.java index 009c65787..149e98d4e 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SGLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SGLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,9 +33,15 @@ public class SGLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + /** **sgLocal** */ public enum TypeEnum { SGLOCAL(String.valueOf("sgLocal")); @@ -76,6 +84,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 SGLocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public SGLocalAccountIdentification() {} */ public SGLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -119,6 +138,7 @@ public void setAccountNumber(String accountNumber) { */ public SGLocalAccountIdentification bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -142,6 +162,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -152,6 +173,7 @@ public void setBic(String bic) { */ public SGLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -175,6 +197,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 SGLocalAccountIdentification 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 SGLocalAccountIdentification object is equal to o. */ @@ -218,6 +261,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + 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 SGLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/ServiceError.java b/src/main/java/com/adyen/model/legalentitymanagement/ServiceError.java index 0b92f30c6..6ec941657 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/ServiceError.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/ServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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 ServiceError { 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() {} /** @@ -51,6 +74,7 @@ public ServiceError() {} */ public ServiceError errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -74,6 +98,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setErrorCode(String errorCode) { */ public ServiceError errorType(String errorType) { this.errorType = errorType; + isSetErrorType = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getErrorType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorType(String errorType) { this.errorType = errorType; + isSetErrorType = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setErrorType(String errorType) { */ public ServiceError message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -140,6 +168,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setMessage(String message) { */ public ServiceError pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -173,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 } /** @@ -183,6 +214,7 @@ public void setPspReference(String pspReference) { */ public ServiceError status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -206,6 +238,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. */ @@ -253,6 +306,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 (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/legalentitymanagement/SetTaxElectronicDeliveryConsentRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/SetTaxElectronicDeliveryConsentRequest.java index 63742df89..c743febb9 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SetTaxElectronicDeliveryConsentRequest.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SetTaxElectronicDeliveryConsentRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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 SetTaxElectronicDeliveryConsentRequest { public static final String JSON_PROPERTY_US1099K = "US1099k"; private Boolean us1099k; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUs1099k = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SetTaxElectronicDeliveryConsentRequest() {} /** @@ -34,6 +45,7 @@ public SetTaxElectronicDeliveryConsentRequest() {} */ public SetTaxElectronicDeliveryConsentRequest us1099k(Boolean us1099k) { this.us1099k = us1099k; + isSetUs1099k = true; // mark as set return this; } @@ -57,6 +69,27 @@ public Boolean getUs1099k() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUs1099k(Boolean us1099k) { this.us1099k = us1099k; + isSetUs1099k = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SetTaxElectronicDeliveryConsentRequest 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 SetTaxElectronicDeliveryConsentRequest object is equal to o. */ @@ -97,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 (isSetUs1099k) { + addIfNull(nulls, JSON_PROPERTY_US1099K, this.us1099k); + } + + 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 SetTaxElectronicDeliveryConsentRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SoleProprietorship.java b/src/main/java/com/adyen/model/legalentitymanagement/SoleProprietorship.java index e9471588f..6a5bcc399 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SoleProprietorship.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SoleProprietorship.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,36 +45,69 @@ public class SoleProprietorship { public static final String JSON_PROPERTY_COUNTRY_OF_GOVERNING_LAW = "countryOfGoverningLaw"; private String countryOfGoverningLaw; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryOfGoverningLaw = false; + public static final String JSON_PROPERTY_DATE_OF_INCORPORATION = "dateOfIncorporation"; private String dateOfIncorporation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfIncorporation = false; + public static final String JSON_PROPERTY_DOING_BUSINESS_AS = "doingBusinessAs"; private String doingBusinessAs; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDoingBusinessAs = false; + public static final String JSON_PROPERTY_DOING_BUSINESS_AS_ABSENT = "doingBusinessAsAbsent"; private Boolean doingBusinessAsAbsent; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDoingBusinessAsAbsent = false; + public static final String JSON_PROPERTY_FINANCIAL_REPORTS = "financialReports"; private List financialReports; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFinancialReports = 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_PRINCIPAL_PLACE_OF_BUSINESS = "principalPlaceOfBusiness"; private Address principalPlaceOfBusiness; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrincipalPlaceOfBusiness = false; + public static final String JSON_PROPERTY_REGISTERED_ADDRESS = "registeredAddress"; private Address registeredAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRegisteredAddress = false; + public static final String JSON_PROPERTY_REGISTRATION_NUMBER = "registrationNumber"; private String registrationNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRegistrationNumber = false; + public static final String JSON_PROPERTY_TAX_ABSENT = "taxAbsent"; private Boolean taxAbsent; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxAbsent = false; + public static final String JSON_PROPERTY_TAX_INFORMATION = "taxInformation"; private List taxInformation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxInformation = false; + /** * The reason for not providing a VAT number. Possible values: **industryExemption**, * **belowTaxThreshold**. @@ -120,9 +155,21 @@ public static VatAbsenceReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_VAT_ABSENCE_REASON = "vatAbsenceReason"; private VatAbsenceReasonEnum vatAbsenceReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVatAbsenceReason = false; + public static final String JSON_PROPERTY_VAT_NUMBER = "vatNumber"; private String vatNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVatNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SoleProprietorship() {} /** @@ -136,6 +183,7 @@ public SoleProprietorship() {} */ public SoleProprietorship countryOfGoverningLaw(String countryOfGoverningLaw) { this.countryOfGoverningLaw = countryOfGoverningLaw; + isSetCountryOfGoverningLaw = true; // mark as set return this; } @@ -165,6 +213,7 @@ public String getCountryOfGoverningLaw() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryOfGoverningLaw(String countryOfGoverningLaw) { this.countryOfGoverningLaw = countryOfGoverningLaw; + isSetCountryOfGoverningLaw = true; // mark as set } /** @@ -176,6 +225,7 @@ public void setCountryOfGoverningLaw(String countryOfGoverningLaw) { */ public SoleProprietorship dateOfIncorporation(String dateOfIncorporation) { this.dateOfIncorporation = dateOfIncorporation; + isSetDateOfIncorporation = true; // mark as set return this; } @@ -201,6 +251,7 @@ public String getDateOfIncorporation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfIncorporation(String dateOfIncorporation) { this.dateOfIncorporation = dateOfIncorporation; + isSetDateOfIncorporation = true; // mark as set } /** @@ -211,6 +262,7 @@ public void setDateOfIncorporation(String dateOfIncorporation) { */ public SoleProprietorship doingBusinessAs(String doingBusinessAs) { this.doingBusinessAs = doingBusinessAs; + isSetDoingBusinessAs = true; // mark as set return this; } @@ -234,6 +286,7 @@ public String getDoingBusinessAs() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDoingBusinessAs(String doingBusinessAs) { this.doingBusinessAs = doingBusinessAs; + isSetDoingBusinessAs = true; // mark as set } /** @@ -246,6 +299,7 @@ public void setDoingBusinessAs(String doingBusinessAs) { */ public SoleProprietorship doingBusinessAsAbsent(Boolean doingBusinessAsAbsent) { this.doingBusinessAsAbsent = doingBusinessAsAbsent; + isSetDoingBusinessAsAbsent = true; // mark as set return this; } @@ -273,6 +327,7 @@ public Boolean getDoingBusinessAsAbsent() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDoingBusinessAsAbsent(Boolean doingBusinessAsAbsent) { this.doingBusinessAsAbsent = doingBusinessAsAbsent; + isSetDoingBusinessAsAbsent = true; // mark as set } /** @@ -283,6 +338,7 @@ public void setDoingBusinessAsAbsent(Boolean doingBusinessAsAbsent) { */ public SoleProprietorship financialReports(List financialReports) { this.financialReports = financialReports; + isSetFinancialReports = true; // mark as set return this; } @@ -314,6 +370,7 @@ public List getFinancialReports() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFinancialReports(List financialReports) { this.financialReports = financialReports; + isSetFinancialReports = true; // mark as set } /** @@ -324,6 +381,7 @@ public void setFinancialReports(List financialReports) { */ public SoleProprietorship name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -347,6 +405,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -357,6 +416,7 @@ public void setName(String name) { */ public SoleProprietorship principalPlaceOfBusiness(Address principalPlaceOfBusiness) { this.principalPlaceOfBusiness = principalPlaceOfBusiness; + isSetPrincipalPlaceOfBusiness = true; // mark as set return this; } @@ -380,6 +440,7 @@ public Address getPrincipalPlaceOfBusiness() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrincipalPlaceOfBusiness(Address principalPlaceOfBusiness) { this.principalPlaceOfBusiness = principalPlaceOfBusiness; + isSetPrincipalPlaceOfBusiness = true; // mark as set } /** @@ -390,6 +451,7 @@ public void setPrincipalPlaceOfBusiness(Address principalPlaceOfBusiness) { */ public SoleProprietorship registeredAddress(Address registeredAddress) { this.registeredAddress = registeredAddress; + isSetRegisteredAddress = true; // mark as set return this; } @@ -413,6 +475,7 @@ public Address getRegisteredAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRegisteredAddress(Address registeredAddress) { this.registeredAddress = registeredAddress; + isSetRegisteredAddress = true; // mark as set } /** @@ -423,6 +486,7 @@ public void setRegisteredAddress(Address registeredAddress) { */ public SoleProprietorship registrationNumber(String registrationNumber) { this.registrationNumber = registrationNumber; + isSetRegistrationNumber = true; // mark as set return this; } @@ -446,6 +510,7 @@ public String getRegistrationNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRegistrationNumber(String registrationNumber) { this.registrationNumber = registrationNumber; + isSetRegistrationNumber = true; // mark as set } /** @@ -456,6 +521,7 @@ public void setRegistrationNumber(String registrationNumber) { */ public SoleProprietorship taxAbsent(Boolean taxAbsent) { this.taxAbsent = taxAbsent; + isSetTaxAbsent = true; // mark as set return this; } @@ -479,6 +545,7 @@ public Boolean getTaxAbsent() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxAbsent(Boolean taxAbsent) { this.taxAbsent = taxAbsent; + isSetTaxAbsent = true; // mark as set } /** @@ -489,6 +556,7 @@ public void setTaxAbsent(Boolean taxAbsent) { */ public SoleProprietorship taxInformation(List taxInformation) { this.taxInformation = taxInformation; + isSetTaxInformation = true; // mark as set return this; } @@ -520,6 +588,7 @@ public List getTaxInformation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxInformation(List taxInformation) { this.taxInformation = taxInformation; + isSetTaxInformation = true; // mark as set } /** @@ -532,6 +601,7 @@ public void setTaxInformation(List taxInformation) { */ public SoleProprietorship vatAbsenceReason(VatAbsenceReasonEnum vatAbsenceReason) { this.vatAbsenceReason = vatAbsenceReason; + isSetVatAbsenceReason = true; // mark as set return this; } @@ -559,6 +629,7 @@ public VatAbsenceReasonEnum getVatAbsenceReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVatAbsenceReason(VatAbsenceReasonEnum vatAbsenceReason) { this.vatAbsenceReason = vatAbsenceReason; + isSetVatAbsenceReason = true; // mark as set } /** @@ -569,6 +640,7 @@ public void setVatAbsenceReason(VatAbsenceReasonEnum vatAbsenceReason) { */ public SoleProprietorship vatNumber(String vatNumber) { this.vatNumber = vatNumber; + isSetVatNumber = true; // mark as set return this; } @@ -592,6 +664,27 @@ public String getVatNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVatNumber(String vatNumber) { this.vatNumber = vatNumber; + isSetVatNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SoleProprietorship 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 SoleProprietorship object is equal to o. */ @@ -677,6 +770,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 (isSetCountryOfGoverningLaw) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_OF_GOVERNING_LAW, this.countryOfGoverningLaw); + } + if (isSetDateOfIncorporation) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_INCORPORATION, this.dateOfIncorporation); + } + if (isSetDoingBusinessAs) { + addIfNull(nulls, JSON_PROPERTY_DOING_BUSINESS_AS, this.doingBusinessAs); + } + if (isSetDoingBusinessAsAbsent) { + addIfNull(nulls, JSON_PROPERTY_DOING_BUSINESS_AS_ABSENT, this.doingBusinessAsAbsent); + } + if (isSetFinancialReports) { + addIfNull(nulls, JSON_PROPERTY_FINANCIAL_REPORTS, this.financialReports); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPrincipalPlaceOfBusiness) { + addIfNull(nulls, JSON_PROPERTY_PRINCIPAL_PLACE_OF_BUSINESS, this.principalPlaceOfBusiness); + } + if (isSetRegisteredAddress) { + addIfNull(nulls, JSON_PROPERTY_REGISTERED_ADDRESS, this.registeredAddress); + } + if (isSetRegistrationNumber) { + addIfNull(nulls, JSON_PROPERTY_REGISTRATION_NUMBER, this.registrationNumber); + } + if (isSetTaxAbsent) { + addIfNull(nulls, JSON_PROPERTY_TAX_ABSENT, this.taxAbsent); + } + if (isSetTaxInformation) { + addIfNull(nulls, JSON_PROPERTY_TAX_INFORMATION, this.taxInformation); + } + if (isSetVatAbsenceReason) { + addIfNull(nulls, JSON_PROPERTY_VAT_ABSENCE_REASON, this.vatAbsenceReason); + } + if (isSetVatNumber) { + addIfNull(nulls, JSON_PROPERTY_VAT_NUMBER, this.vatNumber); + } + + 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 SoleProprietorship given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java b/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java index 1e893f935..31b604acd 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -44,36 +46,69 @@ public class SourceOfFunds { public static final String JSON_PROPERTY_ADYEN_PROCESSED_FUNDS = "adyenProcessedFunds"; private Boolean adyenProcessedFunds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdyenProcessedFunds = 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_ASSET_MONTHS_HELD = "assetMonthsHeld"; private Integer assetMonthsHeld; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAssetMonthsHeld = false; + public static final String JSON_PROPERTY_CRYPTOCURRENCY_EXCHANGE = "cryptocurrencyExchange"; private String cryptocurrencyExchange; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCryptocurrencyExchange = false; + public static final String JSON_PROPERTY_DATE_OF_FUNDS_RECEIVED = "dateOfFundsReceived"; private LocalDate dateOfFundsReceived; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfFundsReceived = false; + public static final String JSON_PROPERTY_DATE_OF_SOURCE_EVENT = "dateOfSourceEvent"; private LocalDate dateOfSourceEvent; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfSourceEvent = 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_FINANCIERS = "financiers"; private List financiers; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFinanciers = false; + public static final String JSON_PROPERTY_ORIGINATOR_LEGAL_ENTITY_ID = "originatorLegalEntityId"; private String originatorLegalEntityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginatorLegalEntityId = false; + public static final String JSON_PROPERTY_PURPOSE = "purpose"; private String purpose; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPurpose = false; + public static final String JSON_PROPERTY_RELATIONSHIP = "relationship"; private String relationship; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRelationship = false; + /** * The type of the source of funds. Possible values: * **business** * **employment** * * **donations** * **inheritance** * **financialAid** * **rentalIncome** * **dividendIncome** * @@ -149,9 +184,21 @@ 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; + public static final String JSON_PROPERTY_WEBSITE = "website"; private String website; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebsite = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SourceOfFunds() {} /** @@ -164,6 +211,7 @@ public SourceOfFunds() {} */ public SourceOfFunds adyenProcessedFunds(Boolean adyenProcessedFunds) { this.adyenProcessedFunds = adyenProcessedFunds; + isSetAdyenProcessedFunds = true; // mark as set return this; } @@ -191,6 +239,7 @@ public Boolean getAdyenProcessedFunds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdyenProcessedFunds(Boolean adyenProcessedFunds) { this.adyenProcessedFunds = adyenProcessedFunds; + isSetAdyenProcessedFunds = true; // mark as set } /** @@ -201,6 +250,7 @@ public void setAdyenProcessedFunds(Boolean adyenProcessedFunds) { */ public SourceOfFunds amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -224,6 +274,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -238,6 +289,7 @@ public void setAmount(Amount amount) { */ public SourceOfFunds assetMonthsHeld(Integer assetMonthsHeld) { this.assetMonthsHeld = assetMonthsHeld; + isSetAssetMonthsHeld = true; // mark as set return this; } @@ -269,6 +321,7 @@ public Integer getAssetMonthsHeld() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAssetMonthsHeld(Integer assetMonthsHeld) { this.assetMonthsHeld = assetMonthsHeld; + isSetAssetMonthsHeld = true; // mark as set } /** @@ -281,6 +334,7 @@ public void setAssetMonthsHeld(Integer assetMonthsHeld) { */ public SourceOfFunds cryptocurrencyExchange(String cryptocurrencyExchange) { this.cryptocurrencyExchange = cryptocurrencyExchange; + isSetCryptocurrencyExchange = true; // mark as set return this; } @@ -308,6 +362,7 @@ public String getCryptocurrencyExchange() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCryptocurrencyExchange(String cryptocurrencyExchange) { this.cryptocurrencyExchange = cryptocurrencyExchange; + isSetCryptocurrencyExchange = true; // mark as set } /** @@ -320,6 +375,7 @@ public void setCryptocurrencyExchange(String cryptocurrencyExchange) { */ public SourceOfFunds dateOfFundsReceived(LocalDate dateOfFundsReceived) { this.dateOfFundsReceived = dateOfFundsReceived; + isSetDateOfFundsReceived = true; // mark as set return this; } @@ -347,6 +403,7 @@ public LocalDate getDateOfFundsReceived() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfFundsReceived(LocalDate dateOfFundsReceived) { this.dateOfFundsReceived = dateOfFundsReceived; + isSetDateOfFundsReceived = true; // mark as set } /** @@ -363,6 +420,7 @@ public void setDateOfFundsReceived(LocalDate dateOfFundsReceived) { */ public SourceOfFunds dateOfSourceEvent(LocalDate dateOfSourceEvent) { this.dateOfSourceEvent = dateOfSourceEvent; + isSetDateOfSourceEvent = true; // mark as set return this; } @@ -399,6 +457,7 @@ public LocalDate getDateOfSourceEvent() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfSourceEvent(LocalDate dateOfSourceEvent) { this.dateOfSourceEvent = dateOfSourceEvent; + isSetDateOfSourceEvent = true; // mark as set } /** @@ -417,6 +476,7 @@ public void setDateOfSourceEvent(LocalDate dateOfSourceEvent) { */ public SourceOfFunds description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -456,6 +516,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -467,6 +528,7 @@ public void setDescription(String description) { */ public SourceOfFunds financiers(List financiers) { this.financiers = financiers; + isSetFinanciers = true; // mark as set return this; } @@ -500,6 +562,7 @@ public List getFinanciers() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFinanciers(List financiers) { this.financiers = financiers; + isSetFinanciers = true; // mark as set } /** @@ -517,6 +580,7 @@ public void setFinanciers(List financiers) { */ public SourceOfFunds originatorLegalEntityId(String originatorLegalEntityId) { this.originatorLegalEntityId = originatorLegalEntityId; + isSetOriginatorLegalEntityId = true; // mark as set return this; } @@ -554,6 +618,7 @@ public String getOriginatorLegalEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginatorLegalEntityId(String originatorLegalEntityId) { this.originatorLegalEntityId = originatorLegalEntityId; + isSetOriginatorLegalEntityId = true; // mark as set } /** @@ -565,6 +630,7 @@ public void setOriginatorLegalEntityId(String originatorLegalEntityId) { */ public SourceOfFunds purpose(String purpose) { this.purpose = purpose; + isSetPurpose = true; // mark as set return this; } @@ -590,6 +656,7 @@ public String getPurpose() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPurpose(String purpose) { this.purpose = purpose; + isSetPurpose = true; // mark as set } /** @@ -602,6 +669,7 @@ public void setPurpose(String purpose) { */ public SourceOfFunds relationship(String relationship) { this.relationship = relationship; + isSetRelationship = true; // mark as set return this; } @@ -629,6 +697,7 @@ public String getRelationship() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRelationship(String relationship) { this.relationship = relationship; + isSetRelationship = true; // mark as set } /** @@ -645,6 +714,7 @@ public void setRelationship(String relationship) { */ public SourceOfFunds type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -681,6 +751,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -695,6 +766,7 @@ public void setType(TypeEnum type) { */ public SourceOfFunds website(String website) { this.website = website; + isSetWebsite = true; // mark as set return this; } @@ -726,6 +798,27 @@ public String getWebsite() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebsite(String website) { this.website = website; + isSetWebsite = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SourceOfFunds 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 SourceOfFunds object is equal to o. */ @@ -810,6 +903,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 (isSetAdyenProcessedFunds) { + addIfNull(nulls, JSON_PROPERTY_ADYEN_PROCESSED_FUNDS, this.adyenProcessedFunds); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetAssetMonthsHeld) { + addIfNull(nulls, JSON_PROPERTY_ASSET_MONTHS_HELD, this.assetMonthsHeld); + } + if (isSetCryptocurrencyExchange) { + addIfNull(nulls, JSON_PROPERTY_CRYPTOCURRENCY_EXCHANGE, this.cryptocurrencyExchange); + } + if (isSetDateOfFundsReceived) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_FUNDS_RECEIVED, this.dateOfFundsReceived); + } + if (isSetDateOfSourceEvent) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_SOURCE_EVENT, this.dateOfSourceEvent); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetFinanciers) { + addIfNull(nulls, JSON_PROPERTY_FINANCIERS, this.financiers); + } + if (isSetOriginatorLegalEntityId) { + addIfNull(nulls, JSON_PROPERTY_ORIGINATOR_LEGAL_ENTITY_ID, this.originatorLegalEntityId); + } + if (isSetPurpose) { + addIfNull(nulls, JSON_PROPERTY_PURPOSE, this.purpose); + } + if (isSetRelationship) { + addIfNull(nulls, JSON_PROPERTY_RELATIONSHIP, this.relationship); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetWebsite) { + addIfNull(nulls, JSON_PROPERTY_WEBSITE, this.website); + } + + 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 SourceOfFunds given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/StockData.java b/src/main/java/com/adyen/model/legalentitymanagement/StockData.java index aa4ebcde6..b0e8c9a55 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/StockData.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/StockData.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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 StockData { public static final String JSON_PROPERTY_MARKET_IDENTIFIER = "marketIdentifier"; private String marketIdentifier; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMarketIdentifier = false; + public static final String JSON_PROPERTY_STOCK_NUMBER = "stockNumber"; private String stockNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStockNumber = false; + public static final String JSON_PROPERTY_TICKER_SYMBOL = "tickerSymbol"; private String tickerSymbol; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTickerSymbol = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StockData() {} /** @@ -46,6 +63,7 @@ public StockData() {} */ public StockData marketIdentifier(String marketIdentifier) { this.marketIdentifier = marketIdentifier; + isSetMarketIdentifier = true; // mark as set return this; } @@ -75,6 +93,7 @@ public String getMarketIdentifier() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMarketIdentifier(String marketIdentifier) { this.marketIdentifier = marketIdentifier; + isSetMarketIdentifier = true; // mark as set } /** @@ -87,6 +106,7 @@ public void setMarketIdentifier(String marketIdentifier) { */ public StockData stockNumber(String stockNumber) { this.stockNumber = stockNumber; + isSetStockNumber = true; // mark as set return this; } @@ -114,6 +134,7 @@ public String getStockNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStockNumber(String stockNumber) { this.stockNumber = stockNumber; + isSetStockNumber = true; // mark as set } /** @@ -124,6 +145,7 @@ public void setStockNumber(String stockNumber) { */ public StockData tickerSymbol(String tickerSymbol) { this.tickerSymbol = tickerSymbol; + isSetTickerSymbol = true; // mark as set return this; } @@ -147,6 +169,27 @@ public String getTickerSymbol() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTickerSymbol(String tickerSymbol) { this.tickerSymbol = tickerSymbol; + isSetTickerSymbol = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StockData 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 StockData object is equal to o. */ @@ -190,6 +233,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 (isSetMarketIdentifier) { + addIfNull(nulls, JSON_PROPERTY_MARKET_IDENTIFIER, this.marketIdentifier); + } + if (isSetStockNumber) { + addIfNull(nulls, JSON_PROPERTY_STOCK_NUMBER, this.stockNumber); + } + if (isSetTickerSymbol) { + addIfNull(nulls, JSON_PROPERTY_TICKER_SYMBOL, this.tickerSymbol); + } + + 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 StockData given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Support.java b/src/main/java/com/adyen/model/legalentitymanagement/Support.java index 6c2b2fadd..dc424f3ee 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Support.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Support.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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 Support { public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_PHONE = "phone"; private PhoneNumber phone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Support() {} /** @@ -36,6 +50,7 @@ public Support() {} */ public Support email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setEmail(String email) { */ public Support phone(PhoneNumber phone) { this.phone = phone; + isSetPhone = true; // mark as set return this; } @@ -92,6 +109,27 @@ public PhoneNumber getPhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhone(PhoneNumber phone) { this.phone = phone; + isSetPhone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Support 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 Support object is equal to o. */ @@ -132,6 +170,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 (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetPhone) { + addIfNull(nulls, JSON_PROPERTY_PHONE, this.phone); + } + + 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 Support given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SupportingEntityCapability.java b/src/main/java/com/adyen/model/legalentitymanagement/SupportingEntityCapability.java index 01b8f4a26..6d07139ca 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SupportingEntityCapability.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SupportingEntityCapability.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -29,15 +31,33 @@ public class SupportingEntityCapability { public static final String JSON_PROPERTY_ALLOWED = "allowed"; private Boolean allowed; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowed = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REQUESTED = "requested"; private Boolean requested; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequested = false; + public static final String JSON_PROPERTY_VERIFICATION_STATUS = "verificationStatus"; private String verificationStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SupportingEntityCapability() {} @JsonCreator @@ -112,6 +132,26 @@ public String getVerificationStatus() { return verificationStatus; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SupportingEntityCapability 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 SupportingEntityCapability object is equal to o. */ @Override public boolean equals(Object o) { @@ -155,6 +195,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 (isSetAllowed) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED, this.allowed); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetRequested) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED, this.requested); + } + if (isSetVerificationStatus) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_STATUS, this.verificationStatus); + } + + 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 SupportingEntityCapability given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TaxInformation.java b/src/main/java/com/adyen/model/legalentitymanagement/TaxInformation.java index c1c4c9f18..47501935f 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TaxInformation.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TaxInformation.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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 TaxInformation { 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_NUMBER = "number"; private String number; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + public static final String JSON_PROPERTY_NUMBER_ABSENT = "numberAbsent"; private Boolean numberAbsent; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumberAbsent = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 TaxInformation() {} /** @@ -49,6 +69,7 @@ public TaxInformation() {} */ public TaxInformation country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -76,6 +97,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -86,6 +108,7 @@ public void setCountry(String country) { */ public TaxInformation number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -109,6 +132,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -121,6 +145,7 @@ public void setNumber(String number) { */ public TaxInformation numberAbsent(Boolean numberAbsent) { this.numberAbsent = numberAbsent; + isSetNumberAbsent = true; // mark as set return this; } @@ -148,6 +173,7 @@ public Boolean getNumberAbsent() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumberAbsent(Boolean numberAbsent) { this.numberAbsent = numberAbsent; + isSetNumberAbsent = true; // mark as set } /** @@ -162,6 +188,7 @@ public void setNumberAbsent(Boolean numberAbsent) { */ public TaxInformation type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -193,6 +220,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TaxInformation 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 TaxInformation object is equal to o. */ @@ -238,6 +286,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 (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + if (isSetNumberAbsent) { + addIfNull(nulls, JSON_PROPERTY_NUMBER_ABSENT, this.numberAbsent); + } + 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 TaxInformation given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TaxReportingClassification.java b/src/main/java/com/adyen/model/legalentitymanagement/TaxReportingClassification.java index 328684316..73b97307f 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TaxReportingClassification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TaxReportingClassification.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -85,10 +87,16 @@ public static BusinessTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_BUSINESS_TYPE = "businessType"; private BusinessTypeEnum businessType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBusinessType = false; + public static final String JSON_PROPERTY_FINANCIAL_INSTITUTION_NUMBER = "financialInstitutionNumber"; private String financialInstitutionNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFinancialInstitutionNumber = false; + /** * The organization's main source of income. Only required if `businessType` is * **other**. Possible values: **businessOperation**, **realEstateSales**, @@ -143,6 +151,9 @@ public static MainSourceOfIncomeEnum fromValue(String value) { public static final String JSON_PROPERTY_MAIN_SOURCE_OF_INCOME = "mainSourceOfIncome"; private MainSourceOfIncomeEnum mainSourceOfIncome; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMainSourceOfIncome = false; + /** * The tax reporting classification type. Possible values: **nonFinancialNonReportable**, * **financialNonReportable**, **nonFinancialActive**, **nonFinancialPassive**. @@ -194,6 +205,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 TaxReportingClassification() {} /** @@ -208,6 +228,7 @@ public TaxReportingClassification() {} */ public TaxReportingClassification businessType(BusinessTypeEnum businessType) { this.businessType = businessType; + isSetBusinessType = true; // mark as set return this; } @@ -239,6 +260,7 @@ public BusinessTypeEnum getBusinessType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBusinessType(BusinessTypeEnum businessType) { this.businessType = businessType; + isSetBusinessType = true; // mark as set } /** @@ -253,6 +275,7 @@ public void setBusinessType(BusinessTypeEnum businessType) { */ public TaxReportingClassification financialInstitutionNumber(String financialInstitutionNumber) { this.financialInstitutionNumber = financialInstitutionNumber; + isSetFinancialInstitutionNumber = true; // mark as set return this; } @@ -284,6 +307,7 @@ public String getFinancialInstitutionNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFinancialInstitutionNumber(String financialInstitutionNumber) { this.financialInstitutionNumber = financialInstitutionNumber; + isSetFinancialInstitutionNumber = true; // mark as set } /** @@ -298,6 +322,7 @@ public void setFinancialInstitutionNumber(String financialInstitutionNumber) { */ public TaxReportingClassification mainSourceOfIncome(MainSourceOfIncomeEnum mainSourceOfIncome) { this.mainSourceOfIncome = mainSourceOfIncome; + isSetMainSourceOfIncome = true; // mark as set return this; } @@ -329,6 +354,7 @@ public MainSourceOfIncomeEnum getMainSourceOfIncome() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMainSourceOfIncome(MainSourceOfIncomeEnum mainSourceOfIncome) { this.mainSourceOfIncome = mainSourceOfIncome; + isSetMainSourceOfIncome = true; // mark as set } /** @@ -342,6 +368,7 @@ public void setMainSourceOfIncome(MainSourceOfIncomeEnum mainSourceOfIncome) { */ public TaxReportingClassification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -371,6 +398,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 TaxReportingClassification 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 TaxReportingClassification object is equal to o. */ @@ -419,6 +467,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 (isSetBusinessType) { + addIfNull(nulls, JSON_PROPERTY_BUSINESS_TYPE, this.businessType); + } + if (isSetFinancialInstitutionNumber) { + addIfNull(nulls, JSON_PROPERTY_FINANCIAL_INSTITUTION_NUMBER, this.financialInstitutionNumber); + } + if (isSetMainSourceOfIncome) { + addIfNull(nulls, JSON_PROPERTY_MAIN_SOURCE_OF_INCOME, this.mainSourceOfIncome); + } + 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 TaxReportingClassification given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java index db9858742..06232bd6e 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,15 +37,27 @@ public class TermsOfServiceAcceptanceInfo { public static final String JSON_PROPERTY_ACCEPTED_BY = "acceptedBy"; private String acceptedBy; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcceptedBy = false; + public static final String JSON_PROPERTY_ACCEPTED_FOR = "acceptedFor"; private String acceptedFor; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcceptedFor = 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_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + /** * The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * @@ -108,9 +122,21 @@ 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; + public static final String JSON_PROPERTY_VALID_TO = "validTo"; private OffsetDateTime validTo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValidTo = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TermsOfServiceAcceptanceInfo() {} /** @@ -121,6 +147,7 @@ public TermsOfServiceAcceptanceInfo() {} */ public TermsOfServiceAcceptanceInfo acceptedBy(String acceptedBy) { this.acceptedBy = acceptedBy; + isSetAcceptedBy = true; // mark as set return this; } @@ -144,6 +171,7 @@ public String getAcceptedBy() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcceptedBy(String acceptedBy) { this.acceptedBy = acceptedBy; + isSetAcceptedBy = true; // mark as set } /** @@ -155,6 +183,7 @@ public void setAcceptedBy(String acceptedBy) { */ public TermsOfServiceAcceptanceInfo acceptedFor(String acceptedFor) { this.acceptedFor = acceptedFor; + isSetAcceptedFor = true; // mark as set return this; } @@ -180,6 +209,7 @@ public String getAcceptedFor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcceptedFor(String acceptedFor) { this.acceptedFor = acceptedFor; + isSetAcceptedFor = true; // mark as set } /** @@ -192,6 +222,7 @@ public void setAcceptedFor(String acceptedFor) { */ public TermsOfServiceAcceptanceInfo createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -219,6 +250,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -229,6 +261,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public TermsOfServiceAcceptanceInfo id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -252,6 +285,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -266,6 +300,7 @@ public void setId(String id) { */ public TermsOfServiceAcceptanceInfo type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -297,6 +332,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -309,6 +345,7 @@ public void setType(TypeEnum type) { */ public TermsOfServiceAcceptanceInfo validTo(OffsetDateTime validTo) { this.validTo = validTo; + isSetValidTo = true; // mark as set return this; } @@ -336,6 +373,27 @@ public OffsetDateTime getValidTo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValidTo(OffsetDateTime validTo) { this.validTo = validTo; + isSetValidTo = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TermsOfServiceAcceptanceInfo 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 TermsOfServiceAcceptanceInfo object is equal to o. */ @@ -385,6 +443,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 (isSetAcceptedBy) { + addIfNull(nulls, JSON_PROPERTY_ACCEPTED_BY, this.acceptedBy); + } + if (isSetAcceptedFor) { + addIfNull(nulls, JSON_PROPERTY_ACCEPTED_FOR, this.acceptedFor); + } + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetValidTo) { + addIfNull(nulls, JSON_PROPERTY_VALID_TO, this.validTo); + } + + 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 TermsOfServiceAcceptanceInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java index 5779cd0eb..7b0319678 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -39,21 +41,39 @@ public class TransferInstrument { public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountInfo bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = false; + public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private Map capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_DOCUMENT_DETAILS = "documentDetails"; private List documentDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocumentDetails = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_LEGAL_ENTITY_ID = "legalEntityId"; private String legalEntityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalEntityId = false; + public static final String JSON_PROPERTY_PROBLEMS = "problems"; private List problems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProblems = false; + /** The type of transfer instrument. Possible value: **bankAccount**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("bankAccount")), @@ -98,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 TransferInstrument() {} @JsonCreator @@ -114,6 +143,7 @@ public TransferInstrument(@JsonProperty(JSON_PROPERTY_ID) String id) { */ public TransferInstrument bankAccount(BankAccountInfo bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -137,6 +167,7 @@ public BankAccountInfo getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountInfo bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -147,6 +178,7 @@ public void setBankAccount(BankAccountInfo bankAccount) { */ public TransferInstrument capabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -179,6 +211,7 @@ public Map getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -189,6 +222,7 @@ public void setCapabilities(Map capabilities */ public TransferInstrument documentDetails(List documentDetails) { this.documentDetails = documentDetails; + isSetDocumentDetails = true; // mark as set return this; } @@ -220,6 +254,7 @@ public List getDocumentDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocumentDetails(List documentDetails) { this.documentDetails = documentDetails; + isSetDocumentDetails = true; // mark as set } /** @@ -245,6 +280,7 @@ public String getId() { */ public TransferInstrument legalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set return this; } @@ -276,6 +312,7 @@ public String getLegalEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set } /** @@ -286,6 +323,7 @@ public void setLegalEntityId(String legalEntityId) { */ public TransferInstrument problems(List problems) { this.problems = problems; + isSetProblems = true; // mark as set return this; } @@ -317,6 +355,7 @@ public List getProblems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProblems(List problems) { this.problems = problems; + isSetProblems = true; // mark as set } /** @@ -327,6 +366,7 @@ public void setProblems(List problems) { */ public TransferInstrument type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -350,6 +390,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 TransferInstrument 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 TransferInstrument object is equal to o. */ @@ -402,6 +463,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetDocumentDetails) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENT_DETAILS, this.documentDetails); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLegalEntityId) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_ENTITY_ID, this.legalEntityId); + } + if (isSetProblems) { + addIfNull(nulls, JSON_PROPERTY_PROBLEMS, this.problems); + } + 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 TransferInstrument given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentInfo.java index 0b1f20926..434deb384 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,9 +33,15 @@ public class TransferInstrumentInfo { public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountInfo bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = false; + public static final String JSON_PROPERTY_LEGAL_ENTITY_ID = "legalEntityId"; private String legalEntityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalEntityId = false; + /** The type of transfer instrument. Possible value: **bankAccount**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("bankAccount")), @@ -78,6 +86,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 TransferInstrumentInfo() {} /** @@ -88,6 +105,7 @@ public TransferInstrumentInfo() {} */ public TransferInstrumentInfo bankAccount(BankAccountInfo bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -111,6 +129,7 @@ public BankAccountInfo getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountInfo bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -125,6 +144,7 @@ public void setBankAccount(BankAccountInfo bankAccount) { */ public TransferInstrumentInfo legalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set return this; } @@ -156,6 +176,7 @@ public String getLegalEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set } /** @@ -166,6 +187,7 @@ public void setLegalEntityId(String legalEntityId) { */ public TransferInstrumentInfo type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -189,6 +211,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 TransferInstrumentInfo 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 TransferInstrumentInfo object is equal to o. */ @@ -232,6 +275,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 (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetLegalEntityId) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_ENTITY_ID, this.legalEntityId); + } + 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 TransferInstrumentInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java index 9a9a0aa8b..e39a64f29 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -29,15 +31,33 @@ public class TransferInstrumentReference { public static final String JSON_PROPERTY_ACCOUNT_IDENTIFIER = "accountIdentifier"; private String accountIdentifier; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountIdentifier = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REAL_LAST_FOUR = "realLastFour"; private String realLastFour; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRealLastFour = false; + public static final String JSON_PROPERTY_TRUSTED_SOURCE = "trustedSource"; private Boolean trustedSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrustedSource = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferInstrumentReference() {} @JsonCreator @@ -55,6 +75,7 @@ public TransferInstrumentReference( */ public TransferInstrumentReference accountIdentifier(String accountIdentifier) { this.accountIdentifier = accountIdentifier; + isSetAccountIdentifier = true; // mark as set return this; } @@ -78,6 +99,7 @@ public String getAccountIdentifier() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountIdentifier(String accountIdentifier) { this.accountIdentifier = accountIdentifier; + isSetAccountIdentifier = true; // mark as set } /** @@ -88,6 +110,7 @@ public void setAccountIdentifier(String accountIdentifier) { */ public TransferInstrumentReference id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -111,6 +134,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -129,6 +153,7 @@ public void setId(String id) { */ public TransferInstrumentReference realLastFour(String realLastFour) { this.realLastFour = realLastFour; + isSetRealLastFour = true; // mark as set return this; } @@ -168,6 +193,7 @@ public String getRealLastFour() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRealLastFour(String realLastFour) { this.realLastFour = realLastFour; + isSetRealLastFour = true; // mark as set } /** @@ -183,6 +209,26 @@ public Boolean getTrustedSource() { return trustedSource; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferInstrumentReference 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 TransferInstrumentReference object is equal to o. */ @Override public boolean equals(Object o) { @@ -226,6 +272,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 (isSetAccountIdentifier) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_IDENTIFIER, this.accountIdentifier); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetRealLastFour) { + addIfNull(nulls, JSON_PROPERTY_REAL_LAST_FOUR, this.realLastFour); + } + if (isSetTrustedSource) { + addIfNull(nulls, JSON_PROPERTY_TRUSTED_SOURCE, this.trustedSource); + } + + 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 TransferInstrumentReference given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Trust.java b/src/main/java/com/adyen/model/legalentitymanagement/Trust.java index a3e7b58fc..8056c1626 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Trust.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Trust.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -44,33 +46,63 @@ public class Trust { public static final String JSON_PROPERTY_COUNTRY_OF_GOVERNING_LAW = "countryOfGoverningLaw"; private String countryOfGoverningLaw; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryOfGoverningLaw = false; + public static final String JSON_PROPERTY_DATE_OF_INCORPORATION = "dateOfIncorporation"; private String dateOfIncorporation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfIncorporation = 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_DOING_BUSINESS_AS = "doingBusinessAs"; private String doingBusinessAs; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDoingBusinessAs = false; + public static final String JSON_PROPERTY_DOING_BUSINESS_AS_ABSENT = "doingBusinessAsAbsent"; private Boolean doingBusinessAsAbsent; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDoingBusinessAsAbsent = 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_PRINCIPAL_PLACE_OF_BUSINESS = "principalPlaceOfBusiness"; private Address principalPlaceOfBusiness; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrincipalPlaceOfBusiness = false; + public static final String JSON_PROPERTY_REGISTERED_ADDRESS = "registeredAddress"; private Address registeredAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRegisteredAddress = false; + public static final String JSON_PROPERTY_REGISTRATION_NUMBER = "registrationNumber"; private String registrationNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRegistrationNumber = false; + public static final String JSON_PROPERTY_TAX_INFORMATION = "taxInformation"; private List taxInformation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxInformation = false; + /** * Type of trust. See possible values for trusts in * [Australia](https://docs.adyen.com/platforms/verification-requirements/?tab=trust_3_4#trust-types-in-australia) @@ -154,9 +186,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; + public static final String JSON_PROPERTY_UNDEFINED_BENEFICIARY_INFO = "undefinedBeneficiaryInfo"; private List undefinedBeneficiaryInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUndefinedBeneficiaryInfo = false; + /** * The reason for not providing a VAT number. Possible values: **industryExemption**, * **belowTaxThreshold**. @@ -204,9 +242,21 @@ public static VatAbsenceReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_VAT_ABSENCE_REASON = "vatAbsenceReason"; private VatAbsenceReasonEnum vatAbsenceReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVatAbsenceReason = false; + public static final String JSON_PROPERTY_VAT_NUMBER = "vatNumber"; private String vatNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVatNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Trust() {} /** @@ -220,6 +270,7 @@ public Trust() {} */ public Trust countryOfGoverningLaw(String countryOfGoverningLaw) { this.countryOfGoverningLaw = countryOfGoverningLaw; + isSetCountryOfGoverningLaw = true; // mark as set return this; } @@ -249,6 +300,7 @@ public String getCountryOfGoverningLaw() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryOfGoverningLaw(String countryOfGoverningLaw) { this.countryOfGoverningLaw = countryOfGoverningLaw; + isSetCountryOfGoverningLaw = true; // mark as set } /** @@ -260,6 +312,7 @@ public void setCountryOfGoverningLaw(String countryOfGoverningLaw) { */ public Trust dateOfIncorporation(String dateOfIncorporation) { this.dateOfIncorporation = dateOfIncorporation; + isSetDateOfIncorporation = true; // mark as set return this; } @@ -285,6 +338,7 @@ public String getDateOfIncorporation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfIncorporation(String dateOfIncorporation) { this.dateOfIncorporation = dateOfIncorporation; + isSetDateOfIncorporation = true; // mark as set } /** @@ -296,6 +350,7 @@ public void setDateOfIncorporation(String dateOfIncorporation) { */ public Trust description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -321,6 +376,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -331,6 +387,7 @@ public void setDescription(String description) { */ public Trust doingBusinessAs(String doingBusinessAs) { this.doingBusinessAs = doingBusinessAs; + isSetDoingBusinessAs = true; // mark as set return this; } @@ -354,6 +411,7 @@ public String getDoingBusinessAs() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDoingBusinessAs(String doingBusinessAs) { this.doingBusinessAs = doingBusinessAs; + isSetDoingBusinessAs = true; // mark as set } /** @@ -366,6 +424,7 @@ public void setDoingBusinessAs(String doingBusinessAs) { */ public Trust doingBusinessAsAbsent(Boolean doingBusinessAsAbsent) { this.doingBusinessAsAbsent = doingBusinessAsAbsent; + isSetDoingBusinessAsAbsent = true; // mark as set return this; } @@ -393,6 +452,7 @@ public Boolean getDoingBusinessAsAbsent() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDoingBusinessAsAbsent(Boolean doingBusinessAsAbsent) { this.doingBusinessAsAbsent = doingBusinessAsAbsent; + isSetDoingBusinessAsAbsent = true; // mark as set } /** @@ -403,6 +463,7 @@ public void setDoingBusinessAsAbsent(Boolean doingBusinessAsAbsent) { */ public Trust name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -426,6 +487,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -436,6 +498,7 @@ public void setName(String name) { */ public Trust principalPlaceOfBusiness(Address principalPlaceOfBusiness) { this.principalPlaceOfBusiness = principalPlaceOfBusiness; + isSetPrincipalPlaceOfBusiness = true; // mark as set return this; } @@ -459,6 +522,7 @@ public Address getPrincipalPlaceOfBusiness() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrincipalPlaceOfBusiness(Address principalPlaceOfBusiness) { this.principalPlaceOfBusiness = principalPlaceOfBusiness; + isSetPrincipalPlaceOfBusiness = true; // mark as set } /** @@ -469,6 +533,7 @@ public void setPrincipalPlaceOfBusiness(Address principalPlaceOfBusiness) { */ public Trust registeredAddress(Address registeredAddress) { this.registeredAddress = registeredAddress; + isSetRegisteredAddress = true; // mark as set return this; } @@ -492,6 +557,7 @@ public Address getRegisteredAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRegisteredAddress(Address registeredAddress) { this.registeredAddress = registeredAddress; + isSetRegisteredAddress = true; // mark as set } /** @@ -502,6 +568,7 @@ public void setRegisteredAddress(Address registeredAddress) { */ public Trust registrationNumber(String registrationNumber) { this.registrationNumber = registrationNumber; + isSetRegistrationNumber = true; // mark as set return this; } @@ -525,6 +592,7 @@ public String getRegistrationNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRegistrationNumber(String registrationNumber) { this.registrationNumber = registrationNumber; + isSetRegistrationNumber = true; // mark as set } /** @@ -535,6 +603,7 @@ public void setRegistrationNumber(String registrationNumber) { */ public Trust taxInformation(List taxInformation) { this.taxInformation = taxInformation; + isSetTaxInformation = true; // mark as set return this; } @@ -566,6 +635,7 @@ public List getTaxInformation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxInformation(List taxInformation) { this.taxInformation = taxInformation; + isSetTaxInformation = true; // mark as set } /** @@ -582,6 +652,7 @@ public void setTaxInformation(List taxInformation) { */ public Trust type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -617,6 +688,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -627,6 +699,7 @@ public void setType(TypeEnum type) { */ public Trust undefinedBeneficiaryInfo(List undefinedBeneficiaryInfo) { this.undefinedBeneficiaryInfo = undefinedBeneficiaryInfo; + isSetUndefinedBeneficiaryInfo = true; // mark as set return this; } @@ -658,6 +731,7 @@ public List getUndefinedBeneficiaryInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUndefinedBeneficiaryInfo(List undefinedBeneficiaryInfo) { this.undefinedBeneficiaryInfo = undefinedBeneficiaryInfo; + isSetUndefinedBeneficiaryInfo = true; // mark as set } /** @@ -670,6 +744,7 @@ public void setUndefinedBeneficiaryInfo(List undefinedBene */ public Trust vatAbsenceReason(VatAbsenceReasonEnum vatAbsenceReason) { this.vatAbsenceReason = vatAbsenceReason; + isSetVatAbsenceReason = true; // mark as set return this; } @@ -697,6 +772,7 @@ public VatAbsenceReasonEnum getVatAbsenceReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVatAbsenceReason(VatAbsenceReasonEnum vatAbsenceReason) { this.vatAbsenceReason = vatAbsenceReason; + isSetVatAbsenceReason = true; // mark as set } /** @@ -707,6 +783,7 @@ public void setVatAbsenceReason(VatAbsenceReasonEnum vatAbsenceReason) { */ public Trust vatNumber(String vatNumber) { this.vatNumber = vatNumber; + isSetVatNumber = true; // mark as set return this; } @@ -730,6 +807,27 @@ public String getVatNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVatNumber(String vatNumber) { this.vatNumber = vatNumber; + isSetVatNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Trust 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 Trust object is equal to o. */ @@ -819,6 +917,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 (isSetCountryOfGoverningLaw) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_OF_GOVERNING_LAW, this.countryOfGoverningLaw); + } + if (isSetDateOfIncorporation) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_INCORPORATION, this.dateOfIncorporation); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetDoingBusinessAs) { + addIfNull(nulls, JSON_PROPERTY_DOING_BUSINESS_AS, this.doingBusinessAs); + } + if (isSetDoingBusinessAsAbsent) { + addIfNull(nulls, JSON_PROPERTY_DOING_BUSINESS_AS_ABSENT, this.doingBusinessAsAbsent); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPrincipalPlaceOfBusiness) { + addIfNull(nulls, JSON_PROPERTY_PRINCIPAL_PLACE_OF_BUSINESS, this.principalPlaceOfBusiness); + } + if (isSetRegisteredAddress) { + addIfNull(nulls, JSON_PROPERTY_REGISTERED_ADDRESS, this.registeredAddress); + } + if (isSetRegistrationNumber) { + addIfNull(nulls, JSON_PROPERTY_REGISTRATION_NUMBER, this.registrationNumber); + } + if (isSetTaxInformation) { + addIfNull(nulls, JSON_PROPERTY_TAX_INFORMATION, this.taxInformation); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUndefinedBeneficiaryInfo) { + addIfNull(nulls, JSON_PROPERTY_UNDEFINED_BENEFICIARY_INFO, this.undefinedBeneficiaryInfo); + } + if (isSetVatAbsenceReason) { + addIfNull(nulls, JSON_PROPERTY_VAT_ABSENCE_REASON, this.vatAbsenceReason); + } + if (isSetVatNumber) { + addIfNull(nulls, JSON_PROPERTY_VAT_NUMBER, this.vatNumber); + } + + 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 Trust given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/UKLocalAccountIdentification.java index e8b5f0acb..1881b3383 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/UKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/UKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,9 +33,15 @@ public class UKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_SORT_CODE = "sortCode"; private String sortCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSortCode = false; + /** **ukLocal** */ public enum TypeEnum { UKLOCAL(String.valueOf("ukLocal")); @@ -76,6 +84,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 UKLocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public UKLocalAccountIdentification() {} */ public UKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -121,6 +140,7 @@ public void setAccountNumber(String accountNumber) { */ public UKLocalAccountIdentification sortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getSortCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setSortCode(String sortCode) { */ public UKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,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 UKLocalAccountIdentification 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 UKLocalAccountIdentification object is equal to o. */ @@ -224,6 +267,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetSortCode) { + addIfNull(nulls, JSON_PROPERTY_SORT_CODE, this.sortCode); + } + 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 UKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/USLocalAccountIdentification.java index 7c6801f27..8ea6f2cbc 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/USLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/USLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -32,6 +34,9 @@ public class USLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. */ @@ -78,9 +83,15 @@ 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_ROUTING_NUMBER = "routingNumber"; private String routingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRoutingNumber = false; + /** **usLocal** */ public enum TypeEnum { USLOCAL(String.valueOf("usLocal")); @@ -123,6 +134,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 USLocalAccountIdentification() {} /** @@ -133,6 +153,7 @@ public USLocalAccountIdentification() {} */ public USLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -156,6 +177,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -167,6 +189,7 @@ public void setAccountNumber(String accountNumber) { */ public USLocalAccountIdentification accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -192,6 +215,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -205,6 +229,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public USLocalAccountIdentification routingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set return this; } @@ -234,6 +259,7 @@ public String getRoutingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRoutingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set } /** @@ -244,6 +270,7 @@ public void setRoutingNumber(String routingNumber) { */ public USLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -267,6 +294,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 USLocalAccountIdentification 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 USLocalAccountIdentification object is equal to o. */ @@ -312,6 +360,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetRoutingNumber) { + addIfNull(nulls, JSON_PROPERTY_ROUTING_NUMBER, this.routingNumber); + } + 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 USLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/UndefinedBeneficiary.java b/src/main/java/com/adyen/model/legalentitymanagement/UndefinedBeneficiary.java index c9e32f7f7..89b293c3e 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/UndefinedBeneficiary.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/UndefinedBeneficiary.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -27,9 +29,21 @@ public class UndefinedBeneficiary { 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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UndefinedBeneficiary() {} @JsonCreator @@ -46,6 +60,7 @@ public UndefinedBeneficiary(@JsonProperty(JSON_PROPERTY_REFERENCE) String refere */ public UndefinedBeneficiary description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -69,6 +84,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -82,6 +98,26 @@ public String getReference() { return reference; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UndefinedBeneficiary 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 UndefinedBeneficiary object is equal to o. */ @Override public boolean equals(Object o) { @@ -121,6 +157,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + 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 UndefinedBeneficiary given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/UnincorporatedPartnership.java b/src/main/java/com/adyen/model/legalentitymanagement/UnincorporatedPartnership.java index d74a32ff6..799c99dfe 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/UnincorporatedPartnership.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/UnincorporatedPartnership.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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,33 +45,63 @@ public class UnincorporatedPartnership { public static final String JSON_PROPERTY_COUNTRY_OF_GOVERNING_LAW = "countryOfGoverningLaw"; private String countryOfGoverningLaw; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryOfGoverningLaw = false; + public static final String JSON_PROPERTY_DATE_OF_INCORPORATION = "dateOfIncorporation"; private String dateOfIncorporation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfIncorporation = 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_DOING_BUSINESS_AS = "doingBusinessAs"; private String doingBusinessAs; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDoingBusinessAs = false; + public static final String JSON_PROPERTY_DOING_BUSINESS_AS_ABSENT = "doingBusinessAsAbsent"; private Boolean doingBusinessAsAbsent; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDoingBusinessAsAbsent = 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_PRINCIPAL_PLACE_OF_BUSINESS = "principalPlaceOfBusiness"; private Address principalPlaceOfBusiness; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrincipalPlaceOfBusiness = false; + public static final String JSON_PROPERTY_REGISTERED_ADDRESS = "registeredAddress"; private Address registeredAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRegisteredAddress = false; + public static final String JSON_PROPERTY_REGISTRATION_NUMBER = "registrationNumber"; private String registrationNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRegistrationNumber = false; + public static final String JSON_PROPERTY_TAX_INFORMATION = "taxInformation"; private List taxInformation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxInformation = false; + /** * Type of Partnership. Possible values: * **limitedPartnership** * **generalPartnership** * * **familyPartnership** * **commercialPartnership** * **publicPartnership** * @@ -174,6 +206,9 @@ 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; + /** * The reason for not providing a VAT number. Possible values: **industryExemption**, * **belowTaxThreshold**. @@ -221,9 +256,21 @@ public static VatAbsenceReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_VAT_ABSENCE_REASON = "vatAbsenceReason"; private VatAbsenceReasonEnum vatAbsenceReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVatAbsenceReason = false; + public static final String JSON_PROPERTY_VAT_NUMBER = "vatNumber"; private String vatNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVatNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UnincorporatedPartnership() {} @JsonCreator @@ -243,6 +290,7 @@ public UnincorporatedPartnership(@JsonProperty(JSON_PROPERTY_TYPE) TypeEnum type */ public UnincorporatedPartnership countryOfGoverningLaw(String countryOfGoverningLaw) { this.countryOfGoverningLaw = countryOfGoverningLaw; + isSetCountryOfGoverningLaw = true; // mark as set return this; } @@ -272,6 +320,7 @@ public String getCountryOfGoverningLaw() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryOfGoverningLaw(String countryOfGoverningLaw) { this.countryOfGoverningLaw = countryOfGoverningLaw; + isSetCountryOfGoverningLaw = true; // mark as set } /** @@ -283,6 +332,7 @@ public void setCountryOfGoverningLaw(String countryOfGoverningLaw) { */ public UnincorporatedPartnership dateOfIncorporation(String dateOfIncorporation) { this.dateOfIncorporation = dateOfIncorporation; + isSetDateOfIncorporation = true; // mark as set return this; } @@ -308,6 +358,7 @@ public String getDateOfIncorporation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfIncorporation(String dateOfIncorporation) { this.dateOfIncorporation = dateOfIncorporation; + isSetDateOfIncorporation = true; // mark as set } /** @@ -318,6 +369,7 @@ public void setDateOfIncorporation(String dateOfIncorporation) { */ public UnincorporatedPartnership description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -341,6 +393,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -351,6 +404,7 @@ public void setDescription(String description) { */ public UnincorporatedPartnership doingBusinessAs(String doingBusinessAs) { this.doingBusinessAs = doingBusinessAs; + isSetDoingBusinessAs = true; // mark as set return this; } @@ -374,6 +428,7 @@ public String getDoingBusinessAs() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDoingBusinessAs(String doingBusinessAs) { this.doingBusinessAs = doingBusinessAs; + isSetDoingBusinessAs = true; // mark as set } /** @@ -386,6 +441,7 @@ public void setDoingBusinessAs(String doingBusinessAs) { */ public UnincorporatedPartnership doingBusinessAsAbsent(Boolean doingBusinessAsAbsent) { this.doingBusinessAsAbsent = doingBusinessAsAbsent; + isSetDoingBusinessAsAbsent = true; // mark as set return this; } @@ -413,6 +469,7 @@ public Boolean getDoingBusinessAsAbsent() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDoingBusinessAsAbsent(Boolean doingBusinessAsAbsent) { this.doingBusinessAsAbsent = doingBusinessAsAbsent; + isSetDoingBusinessAsAbsent = true; // mark as set } /** @@ -423,6 +480,7 @@ public void setDoingBusinessAsAbsent(Boolean doingBusinessAsAbsent) { */ public UnincorporatedPartnership name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -446,6 +504,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -456,6 +515,7 @@ public void setName(String name) { */ public UnincorporatedPartnership principalPlaceOfBusiness(Address principalPlaceOfBusiness) { this.principalPlaceOfBusiness = principalPlaceOfBusiness; + isSetPrincipalPlaceOfBusiness = true; // mark as set return this; } @@ -479,6 +539,7 @@ public Address getPrincipalPlaceOfBusiness() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrincipalPlaceOfBusiness(Address principalPlaceOfBusiness) { this.principalPlaceOfBusiness = principalPlaceOfBusiness; + isSetPrincipalPlaceOfBusiness = true; // mark as set } /** @@ -489,6 +550,7 @@ public void setPrincipalPlaceOfBusiness(Address principalPlaceOfBusiness) { */ public UnincorporatedPartnership registeredAddress(Address registeredAddress) { this.registeredAddress = registeredAddress; + isSetRegisteredAddress = true; // mark as set return this; } @@ -512,6 +574,7 @@ public Address getRegisteredAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRegisteredAddress(Address registeredAddress) { this.registeredAddress = registeredAddress; + isSetRegisteredAddress = true; // mark as set } /** @@ -522,6 +585,7 @@ public void setRegisteredAddress(Address registeredAddress) { */ public UnincorporatedPartnership registrationNumber(String registrationNumber) { this.registrationNumber = registrationNumber; + isSetRegistrationNumber = true; // mark as set return this; } @@ -545,6 +609,7 @@ public String getRegistrationNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRegistrationNumber(String registrationNumber) { this.registrationNumber = registrationNumber; + isSetRegistrationNumber = true; // mark as set } /** @@ -555,6 +620,7 @@ public void setRegistrationNumber(String registrationNumber) { */ public UnincorporatedPartnership taxInformation(List taxInformation) { this.taxInformation = taxInformation; + isSetTaxInformation = true; // mark as set return this; } @@ -586,6 +652,7 @@ public List getTaxInformation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxInformation(List taxInformation) { this.taxInformation = taxInformation; + isSetTaxInformation = true; // mark as set } /** @@ -621,6 +688,7 @@ public TypeEnum getType() { */ public UnincorporatedPartnership vatAbsenceReason(VatAbsenceReasonEnum vatAbsenceReason) { this.vatAbsenceReason = vatAbsenceReason; + isSetVatAbsenceReason = true; // mark as set return this; } @@ -648,6 +716,7 @@ public VatAbsenceReasonEnum getVatAbsenceReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVatAbsenceReason(VatAbsenceReasonEnum vatAbsenceReason) { this.vatAbsenceReason = vatAbsenceReason; + isSetVatAbsenceReason = true; // mark as set } /** @@ -658,6 +727,7 @@ public void setVatAbsenceReason(VatAbsenceReasonEnum vatAbsenceReason) { */ public UnincorporatedPartnership vatNumber(String vatNumber) { this.vatNumber = vatNumber; + isSetVatNumber = true; // mark as set return this; } @@ -681,6 +751,27 @@ public String getVatNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVatNumber(String vatNumber) { this.vatNumber = vatNumber; + isSetVatNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UnincorporatedPartnership 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 UnincorporatedPartnership object is equal to o. */ @@ -768,6 +859,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 (isSetCountryOfGoverningLaw) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_OF_GOVERNING_LAW, this.countryOfGoverningLaw); + } + if (isSetDateOfIncorporation) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_INCORPORATION, this.dateOfIncorporation); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetDoingBusinessAs) { + addIfNull(nulls, JSON_PROPERTY_DOING_BUSINESS_AS, this.doingBusinessAs); + } + if (isSetDoingBusinessAsAbsent) { + addIfNull(nulls, JSON_PROPERTY_DOING_BUSINESS_AS_ABSENT, this.doingBusinessAsAbsent); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPrincipalPlaceOfBusiness) { + addIfNull(nulls, JSON_PROPERTY_PRINCIPAL_PLACE_OF_BUSINESS, this.principalPlaceOfBusiness); + } + if (isSetRegisteredAddress) { + addIfNull(nulls, JSON_PROPERTY_REGISTERED_ADDRESS, this.registeredAddress); + } + if (isSetRegistrationNumber) { + addIfNull(nulls, JSON_PROPERTY_REGISTRATION_NUMBER, this.registrationNumber); + } + if (isSetTaxInformation) { + addIfNull(nulls, JSON_PROPERTY_TAX_INFORMATION, this.taxInformation); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetVatAbsenceReason) { + addIfNull(nulls, JSON_PROPERTY_VAT_ABSENCE_REASON, this.vatAbsenceReason); + } + if (isSetVatNumber) { + addIfNull(nulls, JSON_PROPERTY_VAT_NUMBER, this.vatNumber); + } + + 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 UnincorporatedPartnership given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/VerificationDeadline.java b/src/main/java/com/adyen/model/legalentitymanagement/VerificationDeadline.java index 2516c86a4..c71427f4c 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/VerificationDeadline.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/VerificationDeadline.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -192,12 +194,27 @@ public static CapabilitiesEnum fromValue(String value) { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private List capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_ENTITY_IDS = "entityIds"; private List entityIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityIds = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private OffsetDateTime expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public VerificationDeadline() {} @JsonCreator @@ -247,6 +264,26 @@ public OffsetDateTime getExpiresAt() { return expiresAt; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public VerificationDeadline 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 VerificationDeadline object is equal to o. */ @Override public boolean equals(Object o) { @@ -288,6 +325,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 (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetEntityIds) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_IDS, this.entityIds); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + + 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 VerificationDeadline given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java b/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java index 8a5184179..16a886908 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -195,18 +197,33 @@ public static CapabilitiesEnum fromValue(String value) { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private List capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = 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_REMEDIATING_ACTIONS = "remediatingActions"; private List remediatingActions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemediatingActions = false; + public static final String JSON_PROPERTY_SUB_ERRORS = "subErrors"; private List subErrors; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubErrors = false; + /** * The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * * **rejected** * **dataReview** @@ -260,6 +277,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 VerificationError() {} /** @@ -275,6 +301,7 @@ public VerificationError() {} */ public VerificationError capabilities(List capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -316,6 +343,7 @@ public List getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(List capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -326,6 +354,7 @@ public void setCapabilities(List capabilities) { */ public VerificationError code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -349,6 +378,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -359,6 +389,7 @@ public void setCode(String code) { */ public VerificationError message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -382,6 +413,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -392,6 +424,7 @@ public void setMessage(String message) { */ public VerificationError remediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set return this; } @@ -423,6 +456,7 @@ public List getRemediatingActions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set } /** @@ -434,6 +468,7 @@ public void setRemediatingActions(List remediatingActions) { */ public VerificationError subErrors(List subErrors) { this.subErrors = subErrors; + isSetSubErrors = true; // mark as set return this; } @@ -467,6 +502,7 @@ public List getSubErrors() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubErrors(List subErrors) { this.subErrors = subErrors; + isSetSubErrors = true; // mark as set } /** @@ -479,6 +515,7 @@ public void setSubErrors(List subErrors) { */ public VerificationError type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -506,6 +543,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 VerificationError 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 VerificationError object is equal to o. */ @@ -555,6 +613,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 (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetRemediatingActions) { + addIfNull(nulls, JSON_PROPERTY_REMEDIATING_ACTIONS, this.remediatingActions); + } + if (isSetSubErrors) { + addIfNull(nulls, JSON_PROPERTY_SUB_ERRORS, this.subErrors); + } + 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 VerificationError given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java index e8af134a6..6e7db4a0d 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -196,12 +198,21 @@ public static CapabilitiesEnum fromValue(String value) { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private List capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + /** * The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * * **rejected** * **dataReview** @@ -255,9 +266,21 @@ 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; + public static final String JSON_PROPERTY_REMEDIATING_ACTIONS = "remediatingActions"; private List remediatingActions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemediatingActions = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public VerificationErrorRecursive() {} /** @@ -273,6 +296,7 @@ public VerificationErrorRecursive() {} */ public VerificationErrorRecursive capabilities(List capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -314,6 +338,7 @@ public List getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(List capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -324,6 +349,7 @@ public void setCapabilities(List capabilities) { */ public VerificationErrorRecursive code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -347,6 +373,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -357,6 +384,7 @@ public void setCode(String code) { */ public VerificationErrorRecursive message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -380,6 +408,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -392,6 +421,7 @@ public void setMessage(String message) { */ public VerificationErrorRecursive type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -419,6 +449,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -429,6 +460,7 @@ public void setType(TypeEnum type) { */ public VerificationErrorRecursive remediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set return this; } @@ -461,6 +493,27 @@ public List getRemediatingActions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public VerificationErrorRecursive 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 VerificationError-recursive object is equal to o. */ @@ -508,6 +561,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 (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetRemediatingActions) { + addIfNull(nulls, JSON_PROPERTY_REMEDIATING_ACTIONS, this.remediatingActions); + } + + 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 VerificationErrorRecursive given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java index ef653a88c..52e3c0e1d 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java @@ -11,6 +11,8 @@ package com.adyen.model.legalentitymanagement; +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,6 +27,15 @@ public class VerificationErrors { public static final String JSON_PROPERTY_PROBLEMS = "problems"; private List problems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProblems = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public VerificationErrors() {} /** @@ -35,6 +46,7 @@ public VerificationErrors() {} */ public VerificationErrors problems(List problems) { this.problems = problems; + isSetProblems = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getProblems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProblems(List problems) { this.problems = problems; + isSetProblems = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public VerificationErrors 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 VerificationErrors object is equal to o. */ @@ -105,6 +138,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 (isSetProblems) { + addIfNull(nulls, JSON_PROPERTY_PROBLEMS, this.problems); + } + + 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 VerificationErrors given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/WebData.java b/src/main/java/com/adyen/model/legalentitymanagement/WebData.java index 39cffec8e..01a147296 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/WebData.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/WebData.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -24,9 +26,21 @@ public class WebData { public static final String JSON_PROPERTY_WEB_ADDRESS = "webAddress"; private String webAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebAddress = false; + public static final String JSON_PROPERTY_WEB_ADDRESS_ID = "webAddressId"; private String webAddressId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWebAddressId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public WebData() {} @JsonCreator @@ -43,6 +57,7 @@ public WebData(@JsonProperty(JSON_PROPERTY_WEB_ADDRESS_ID) String webAddressId) */ public WebData webAddress(String webAddress) { this.webAddress = webAddress; + isSetWebAddress = true; // mark as set return this; } @@ -66,6 +81,7 @@ public String getWebAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebAddress(String webAddress) { this.webAddress = webAddress; + isSetWebAddress = true; // mark as set } /** @@ -79,6 +95,26 @@ public String getWebAddressId() { return webAddressId; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public WebData 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 WebData object is equal to o. */ @Override public boolean equals(Object o) { @@ -118,6 +154,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 (isSetWebAddress) { + addIfNull(nulls, JSON_PROPERTY_WEB_ADDRESS, this.webAddress); + } + if (isSetWebAddressId) { + addIfNull(nulls, JSON_PROPERTY_WEB_ADDRESS_ID, this.webAddressId); + } + + 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 WebData given an JSON string * diff --git a/src/main/java/com/adyen/model/legalentitymanagement/WebDataExemption.java b/src/main/java/com/adyen/model/legalentitymanagement/WebDataExemption.java index 033ff17f5..120ee5a7f 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/WebDataExemption.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/WebDataExemption.java @@ -11,7 +11,9 @@ package com.adyen.model.legalentitymanagement; +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; @@ -68,6 +70,15 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public WebDataExemption() {} /** @@ -79,6 +90,7 @@ public WebDataExemption() {} */ public WebDataExemption reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -104,6 +116,27 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public WebDataExemption 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 WebDataExemption object is equal to o. */ @@ -143,6 +176,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 (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + + 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 WebDataExemption given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/AccountCapabilityData.java b/src/main/java/com/adyen/model/managementwebhooks/AccountCapabilityData.java index 861debf56..001fe6069 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/AccountCapabilityData.java +++ b/src/main/java/com/adyen/model/managementwebhooks/AccountCapabilityData.java @@ -11,6 +11,8 @@ package com.adyen.model.managementwebhooks; +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,27 +37,57 @@ public class AccountCapabilityData { public static final String JSON_PROPERTY_ALLOWED = "allowed"; private Boolean allowed; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowed = false; + public static final String JSON_PROPERTY_ALLOWED_LEVEL = "allowedLevel"; private String allowedLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedLevel = false; + public static final String JSON_PROPERTY_CAPABILITY = "capability"; private String capability; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapability = false; + public static final String JSON_PROPERTY_PROBLEMS = "problems"; private List problems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProblems = false; + public static final String JSON_PROPERTY_REQUESTED = "requested"; private Boolean requested; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequested = false; + public static final String JSON_PROPERTY_REQUESTED_LEVEL = "requestedLevel"; private String requestedLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedLevel = false; + public static final String JSON_PROPERTY_VERIFICATION_DEADLINE = "verificationDeadline"; private OffsetDateTime verificationDeadline; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationDeadline = false; + public static final String JSON_PROPERTY_VERIFICATION_STATUS = "verificationStatus"; private String verificationStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountCapabilityData() {} /** @@ -68,6 +100,7 @@ public AccountCapabilityData() {} */ public AccountCapabilityData allowed(Boolean allowed) { this.allowed = allowed; + isSetAllowed = true; // mark as set return this; } @@ -95,6 +128,7 @@ public Boolean getAllowed() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowed(Boolean allowed) { this.allowed = allowed; + isSetAllowed = true; // mark as set } /** @@ -109,6 +143,7 @@ public void setAllowed(Boolean allowed) { */ public AccountCapabilityData allowedLevel(String allowedLevel) { this.allowedLevel = allowedLevel; + isSetAllowedLevel = true; // mark as set return this; } @@ -140,6 +175,7 @@ public String getAllowedLevel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowedLevel(String allowedLevel) { this.allowedLevel = allowedLevel; + isSetAllowedLevel = true; // mark as set } /** @@ -150,6 +186,7 @@ public void setAllowedLevel(String allowedLevel) { */ public AccountCapabilityData capability(String capability) { this.capability = capability; + isSetCapability = true; // mark as set return this; } @@ -173,6 +210,7 @@ public String getCapability() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapability(String capability) { this.capability = capability; + isSetCapability = true; // mark as set } /** @@ -185,6 +223,7 @@ public void setCapability(String capability) { */ public AccountCapabilityData problems(List problems) { this.problems = problems; + isSetProblems = true; // mark as set return this; } @@ -220,6 +259,7 @@ public List getProblems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProblems(List problems) { this.problems = problems; + isSetProblems = true; // mark as set } /** @@ -230,6 +270,7 @@ public void setProblems(List problems) { */ public AccountCapabilityData requested(Boolean requested) { this.requested = requested; + isSetRequested = true; // mark as set return this; } @@ -253,6 +294,7 @@ public Boolean getRequested() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequested(Boolean requested) { this.requested = requested; + isSetRequested = true; // mark as set } /** @@ -268,6 +310,7 @@ public void setRequested(Boolean requested) { */ public AccountCapabilityData requestedLevel(String requestedLevel) { this.requestedLevel = requestedLevel; + isSetRequestedLevel = true; // mark as set return this; } @@ -301,6 +344,7 @@ public String getRequestedLevel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestedLevel(String requestedLevel) { this.requestedLevel = requestedLevel; + isSetRequestedLevel = true; // mark as set } /** @@ -313,6 +357,7 @@ public void setRequestedLevel(String requestedLevel) { */ public AccountCapabilityData verificationDeadline(OffsetDateTime verificationDeadline) { this.verificationDeadline = verificationDeadline; + isSetVerificationDeadline = true; // mark as set return this; } @@ -340,6 +385,7 @@ public OffsetDateTime getVerificationDeadline() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVerificationDeadline(OffsetDateTime verificationDeadline) { this.verificationDeadline = verificationDeadline; + isSetVerificationDeadline = true; // mark as set } /** @@ -358,6 +404,7 @@ public void setVerificationDeadline(OffsetDateTime verificationDeadline) { */ public AccountCapabilityData verificationStatus(String verificationStatus) { this.verificationStatus = verificationStatus; + isSetVerificationStatus = true; // mark as set return this; } @@ -397,6 +444,27 @@ public String getVerificationStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVerificationStatus(String verificationStatus) { this.verificationStatus = verificationStatus; + isSetVerificationStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountCapabilityData 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 AccountCapabilityData object is equal to o. */ @@ -460,6 +528,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 (isSetAllowed) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED, this.allowed); + } + if (isSetAllowedLevel) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_LEVEL, this.allowedLevel); + } + if (isSetCapability) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITY, this.capability); + } + if (isSetProblems) { + addIfNull(nulls, JSON_PROPERTY_PROBLEMS, this.problems); + } + if (isSetRequested) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED, this.requested); + } + if (isSetRequestedLevel) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED_LEVEL, this.requestedLevel); + } + if (isSetVerificationDeadline) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_DEADLINE, this.verificationDeadline); + } + if (isSetVerificationStatus) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_STATUS, this.verificationStatus); + } + + 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 AccountCapabilityData given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/AccountCreateNotificationData.java b/src/main/java/com/adyen/model/managementwebhooks/AccountCreateNotificationData.java index d6a12689c..b3ceff420 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/AccountCreateNotificationData.java +++ b/src/main/java/com/adyen/model/managementwebhooks/AccountCreateNotificationData.java @@ -11,6 +11,8 @@ package com.adyen.model.managementwebhooks; +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; @@ -31,18 +33,39 @@ public class AccountCreateNotificationData { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private Map capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_COMPANY_ID = "companyId"; private String companyId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCompanyId = false; + public static final String JSON_PROPERTY_LEGAL_ENTITY_ID = "legalEntityId"; private String legalEntityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalEntityId = false; + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + public static final String JSON_PROPERTY_STATUS = "status"; private String 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 AccountCreateNotificationData() {} /** @@ -61,6 +84,7 @@ public AccountCreateNotificationData() {} public AccountCreateNotificationData capabilities( Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -105,6 +129,7 @@ public Map getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -116,6 +141,7 @@ public void setCapabilities(Map capabilities) { */ public AccountCreateNotificationData companyId(String companyId) { this.companyId = companyId; + isSetCompanyId = true; // mark as set return this; } @@ -139,6 +165,7 @@ public String getCompanyId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCompanyId(String companyId) { this.companyId = companyId; + isSetCompanyId = true; // mark as set } /** @@ -152,6 +179,7 @@ public void setCompanyId(String companyId) { */ public AccountCreateNotificationData legalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set return this; } @@ -179,6 +207,7 @@ public String getLegalEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set } /** @@ -190,6 +219,7 @@ public void setLegalEntityId(String legalEntityId) { */ public AccountCreateNotificationData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -213,6 +243,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -242,6 +273,7 @@ public void setMerchantId(String merchantId) { */ public AccountCreateNotificationData status(String status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -301,6 +333,27 @@ public String getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(String status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountCreateNotificationData 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 AccountCreateNotificationData object is equal to o. */ @@ -348,6 +401,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 (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetCompanyId) { + addIfNull(nulls, JSON_PROPERTY_COMPANY_ID, this.companyId); + } + if (isSetLegalEntityId) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_ENTITY_ID, this.legalEntityId); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + 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 AccountCreateNotificationData given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/AccountNotificationResponse.java b/src/main/java/com/adyen/model/managementwebhooks/AccountNotificationResponse.java index 8528fe458..8e9deca26 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/AccountNotificationResponse.java +++ b/src/main/java/com/adyen/model/managementwebhooks/AccountNotificationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.managementwebhooks; +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 AccountNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountNotificationResponse() {} /** @@ -35,6 +46,7 @@ public AccountNotificationResponse() {} */ public AccountNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -62,6 +74,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountNotificationResponse 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 AccountNotificationResponse object is equal to o. */ @@ -104,6 +137,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AccountNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/AccountUpdateNotificationData.java b/src/main/java/com/adyen/model/managementwebhooks/AccountUpdateNotificationData.java index 2a9512303..d4b985b58 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/AccountUpdateNotificationData.java +++ b/src/main/java/com/adyen/model/managementwebhooks/AccountUpdateNotificationData.java @@ -11,6 +11,8 @@ package com.adyen.model.managementwebhooks; +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,15 +32,33 @@ public class AccountUpdateNotificationData { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private Map capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_LEGAL_ENTITY_ID = "legalEntityId"; private String legalEntityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalEntityId = false; + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + public static final String JSON_PROPERTY_STATUS = "status"; private String 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 AccountUpdateNotificationData() {} /** @@ -59,6 +79,7 @@ public AccountUpdateNotificationData() {} public AccountUpdateNotificationData capabilities( Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -107,6 +128,7 @@ public Map getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -120,6 +142,7 @@ public void setCapabilities(Map capabilities) { */ public AccountUpdateNotificationData legalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set return this; } @@ -147,6 +170,7 @@ public String getLegalEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set } /** @@ -158,6 +182,7 @@ public void setLegalEntityId(String legalEntityId) { */ public AccountUpdateNotificationData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -181,6 +206,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -210,6 +236,7 @@ public void setMerchantId(String merchantId) { */ public AccountUpdateNotificationData status(String status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -269,6 +296,27 @@ public String getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(String status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountUpdateNotificationData 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 AccountUpdateNotificationData object is equal to o. */ @@ -314,6 +362,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 (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetLegalEntityId) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_ENTITY_ID, this.legalEntityId); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + 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 AccountUpdateNotificationData given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/CapabilityProblem.java b/src/main/java/com/adyen/model/managementwebhooks/CapabilityProblem.java index 8f27a0397..266e233fd 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/CapabilityProblem.java +++ b/src/main/java/com/adyen/model/managementwebhooks/CapabilityProblem.java @@ -11,6 +11,8 @@ package com.adyen.model.managementwebhooks; +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,9 +30,21 @@ public class CapabilityProblem { public static final String JSON_PROPERTY_ENTITY = "entity"; private CapabilityProblemEntity entity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntity = false; + public static final String JSON_PROPERTY_VERIFICATION_ERRORS = "verificationErrors"; private List verificationErrors; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationErrors = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapabilityProblem() {} /** @@ -41,6 +55,7 @@ public CapabilityProblem() {} */ public CapabilityProblem entity(CapabilityProblemEntity entity) { this.entity = entity; + isSetEntity = true; // mark as set return this; } @@ -64,6 +79,7 @@ public CapabilityProblemEntity getEntity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntity(CapabilityProblemEntity entity) { this.entity = entity; + isSetEntity = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setEntity(CapabilityProblemEntity entity) { */ public CapabilityProblem verificationErrors(List verificationErrors) { this.verificationErrors = verificationErrors; + isSetVerificationErrors = true; // mark as set return this; } @@ -105,6 +122,27 @@ public List getVerificationErrors() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVerificationErrors(List verificationErrors) { this.verificationErrors = verificationErrors; + isSetVerificationErrors = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapabilityProblem 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 CapabilityProblem object is equal to o. */ @@ -146,6 +184,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 (isSetEntity) { + addIfNull(nulls, JSON_PROPERTY_ENTITY, this.entity); + } + if (isSetVerificationErrors) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_ERRORS, this.verificationErrors); + } + + 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 CapabilityProblem given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/CapabilityProblemEntity.java b/src/main/java/com/adyen/model/managementwebhooks/CapabilityProblemEntity.java index 919708775..0c9457bc6 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/CapabilityProblemEntity.java +++ b/src/main/java/com/adyen/model/managementwebhooks/CapabilityProblemEntity.java @@ -11,7 +11,9 @@ package com.adyen.model.managementwebhooks; +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,12 +36,21 @@ public class CapabilityProblemEntity { public static final String JSON_PROPERTY_DOCUMENTS = "documents"; private List documents; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocuments = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_OWNER = "owner"; private CapabilityProblemEntityRecursive owner; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOwner = false; + /** The type of entity. Possible values: **LegalEntity**, **BankAccount**, or **Document**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("BankAccount")), @@ -86,6 +97,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 CapabilityProblemEntity() {} /** @@ -98,6 +118,7 @@ public CapabilityProblemEntity() {} */ public CapabilityProblemEntity documents(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set return this; } @@ -133,6 +154,7 @@ public List getDocuments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocuments(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set } /** @@ -143,6 +165,7 @@ public void setDocuments(List documents) { */ public CapabilityProblemEntity id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -166,6 +189,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -176,6 +200,7 @@ public void setId(String id) { */ public CapabilityProblemEntity owner(CapabilityProblemEntityRecursive owner) { this.owner = owner; + isSetOwner = true; // mark as set return this; } @@ -199,6 +224,7 @@ public CapabilityProblemEntityRecursive getOwner() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwner(CapabilityProblemEntityRecursive owner) { this.owner = owner; + isSetOwner = true; // mark as set } /** @@ -210,6 +236,7 @@ public void setOwner(CapabilityProblemEntityRecursive owner) { */ public CapabilityProblemEntity type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -235,6 +262,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 CapabilityProblemEntity 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 CapabilityProblemEntity object is equal to o. */ @@ -280,6 +328,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 (isSetDocuments) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENTS, this.documents); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetOwner) { + addIfNull(nulls, JSON_PROPERTY_OWNER, this.owner); + } + 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 CapabilityProblemEntity given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/CapabilityProblemEntityRecursive.java b/src/main/java/com/adyen/model/managementwebhooks/CapabilityProblemEntityRecursive.java index ae32f3409..036950694 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/CapabilityProblemEntityRecursive.java +++ b/src/main/java/com/adyen/model/managementwebhooks/CapabilityProblemEntityRecursive.java @@ -11,7 +11,9 @@ package com.adyen.model.managementwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +37,15 @@ public class CapabilityProblemEntityRecursive { public static final String JSON_PROPERTY_DOCUMENTS = "documents"; private List documents; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocuments = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + /** The type of entity. Possible values: **LegalEntity**, **BankAccount**, or **Document**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("BankAccount")), @@ -84,6 +92,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 CapabilityProblemEntityRecursive() {} /** @@ -97,6 +114,7 @@ public CapabilityProblemEntityRecursive() {} */ public CapabilityProblemEntityRecursive documents(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set return this; } @@ -132,6 +150,7 @@ public List getDocuments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocuments(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set } /** @@ -143,6 +162,7 @@ public void setDocuments(List documents) { */ public CapabilityProblemEntityRecursive id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -178,6 +199,7 @@ public void setId(String id) { */ public CapabilityProblemEntityRecursive type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -203,6 +225,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 CapabilityProblemEntityRecursive 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 CapabilityProblemEntity-recursive object is equal to o. */ @@ -247,6 +290,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 (isSetDocuments) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENTS, this.documents); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + 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 CapabilityProblemEntityRecursive given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/MerchantCreatedNotificationRequest.java b/src/main/java/com/adyen/model/managementwebhooks/MerchantCreatedNotificationRequest.java index aa8536e88..85be4808c 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/MerchantCreatedNotificationRequest.java +++ b/src/main/java/com/adyen/model/managementwebhooks/MerchantCreatedNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.managementwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class MerchantCreatedNotificationRequest { 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_DATA = "data"; private AccountCreateNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + /** Type of notification. */ public enum TypeEnum { MERCHANT_CREATED(String.valueOf("merchant.created")); @@ -81,6 +92,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 MerchantCreatedNotificationRequest() {} /** @@ -92,6 +112,7 @@ public MerchantCreatedNotificationRequest() {} */ public MerchantCreatedNotificationRequest createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -115,6 +136,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -126,6 +148,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public MerchantCreatedNotificationRequest data(AccountCreateNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -149,6 +172,7 @@ public AccountCreateNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(AccountCreateNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -161,6 +185,7 @@ public void setData(AccountCreateNotificationData data) { */ public MerchantCreatedNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -186,6 +211,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -197,6 +223,7 @@ public void setEnvironment(String environment) { */ public MerchantCreatedNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -220,6 +247,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 MerchantCreatedNotificationRequest 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 MerchantCreatedNotificationRequest object is equal to o. */ @@ -266,6 +314,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 (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + 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 MerchantCreatedNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/MerchantUpdatedNotificationRequest.java b/src/main/java/com/adyen/model/managementwebhooks/MerchantUpdatedNotificationRequest.java index 0e8404f70..8d3c6f534 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/MerchantUpdatedNotificationRequest.java +++ b/src/main/java/com/adyen/model/managementwebhooks/MerchantUpdatedNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.managementwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class MerchantUpdatedNotificationRequest { 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_DATA = "data"; private AccountUpdateNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + /** Type of notification. */ public enum TypeEnum { MERCHANT_UPDATED(String.valueOf("merchant.updated")); @@ -81,6 +92,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 MerchantUpdatedNotificationRequest() {} /** @@ -92,6 +112,7 @@ public MerchantUpdatedNotificationRequest() {} */ public MerchantUpdatedNotificationRequest createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -115,6 +136,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -126,6 +148,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public MerchantUpdatedNotificationRequest data(AccountUpdateNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -149,6 +172,7 @@ public AccountUpdateNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(AccountUpdateNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -161,6 +185,7 @@ public void setData(AccountUpdateNotificationData data) { */ public MerchantUpdatedNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -186,6 +211,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -197,6 +223,7 @@ public void setEnvironment(String environment) { */ public MerchantUpdatedNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -220,6 +247,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 MerchantUpdatedNotificationRequest 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 MerchantUpdatedNotificationRequest object is equal to o. */ @@ -266,6 +314,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 (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + 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 MerchantUpdatedNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/MidServiceNotificationData.java b/src/main/java/com/adyen/model/managementwebhooks/MidServiceNotificationData.java index ed4003593..1b65f5baf 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/MidServiceNotificationData.java +++ b/src/main/java/com/adyen/model/managementwebhooks/MidServiceNotificationData.java @@ -11,7 +11,9 @@ package com.adyen.model.managementwebhooks; +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,18 +39,33 @@ public class MidServiceNotificationData { public static final String JSON_PROPERTY_ALLOWED = "allowed"; private Boolean allowed; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowed = false; + public static final String JSON_PROPERTY_ENABLED = "enabled"; private Boolean enabled; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnabled = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = 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 request to add a payment method. Possible values: * **success**: the payment * method was added. * **failure**: the request failed. * **capabilityPending**: the @@ -103,12 +120,21 @@ 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_STORE_ID = "storeId"; private String storeId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoreId = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + /** * Payment method status. Possible values: * **valid** * **pending** * **invalid** * **rejected** */ @@ -159,6 +185,15 @@ public static VerificationStatusEnum fromValue(String value) { public static final String JSON_PROPERTY_VERIFICATION_STATUS = "verificationStatus"; private VerificationStatusEnum verificationStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MidServiceNotificationData() {} /** @@ -171,6 +206,7 @@ public MidServiceNotificationData() {} */ public MidServiceNotificationData allowed(Boolean allowed) { this.allowed = allowed; + isSetAllowed = true; // mark as set return this; } @@ -198,6 +234,7 @@ public Boolean getAllowed() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowed(Boolean allowed) { this.allowed = allowed; + isSetAllowed = true; // mark as set } /** @@ -209,6 +246,7 @@ public void setAllowed(Boolean allowed) { */ public MidServiceNotificationData enabled(Boolean enabled) { this.enabled = enabled; + isSetEnabled = true; // mark as set return this; } @@ -234,6 +272,7 @@ public Boolean getEnabled() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnabled(Boolean enabled) { this.enabled = enabled; + isSetEnabled = true; // mark as set } /** @@ -244,6 +283,7 @@ public void setEnabled(Boolean enabled) { */ public MidServiceNotificationData id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -267,6 +307,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -277,6 +318,7 @@ public void setId(String id) { */ public MidServiceNotificationData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -300,6 +342,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -310,6 +353,7 @@ public void setMerchantId(String merchantId) { */ public MidServiceNotificationData reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -333,6 +377,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -347,6 +392,7 @@ public void setReference(String reference) { */ public MidServiceNotificationData status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -378,6 +424,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -392,6 +439,7 @@ public void setStatus(StatusEnum status) { */ public MidServiceNotificationData storeId(String storeId) { this.storeId = storeId; + isSetStoreId = true; // mark as set return this; } @@ -423,6 +471,7 @@ public String getStoreId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoreId(String storeId) { this.storeId = storeId; + isSetStoreId = true; // mark as set } /** @@ -435,6 +484,7 @@ public void setStoreId(String storeId) { */ public MidServiceNotificationData type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -462,6 +512,7 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set } /** @@ -473,6 +524,7 @@ public void setType(String type) { */ public MidServiceNotificationData verificationStatus(VerificationStatusEnum verificationStatus) { this.verificationStatus = verificationStatus; + isSetVerificationStatus = true; // mark as set return this; } @@ -498,6 +550,27 @@ public VerificationStatusEnum getVerificationStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVerificationStatus(VerificationStatusEnum verificationStatus) { this.verificationStatus = verificationStatus; + isSetVerificationStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MidServiceNotificationData 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 MidServiceNotificationData object is equal to o. */ @@ -554,6 +627,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 (isSetAllowed) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED, this.allowed); + } + if (isSetEnabled) { + addIfNull(nulls, JSON_PROPERTY_ENABLED, this.enabled); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetStoreId) { + addIfNull(nulls, JSON_PROPERTY_STORE_ID, this.storeId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetVerificationStatus) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_STATUS, this.verificationStatus); + } + + 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 MidServiceNotificationData given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodCreatedNotificationRequest.java b/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodCreatedNotificationRequest.java index 280047e23..7d30fe9c5 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodCreatedNotificationRequest.java +++ b/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodCreatedNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.managementwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class PaymentMethodCreatedNotificationRequest { 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_DATA = "data"; private MidServiceNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + /** Type of notification. */ public enum TypeEnum { PAYMENTMETHOD_CREATED(String.valueOf("paymentMethod.created")); @@ -81,6 +92,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 PaymentMethodCreatedNotificationRequest() {} /** @@ -92,6 +112,7 @@ public PaymentMethodCreatedNotificationRequest() {} */ public PaymentMethodCreatedNotificationRequest createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -115,6 +136,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -126,6 +148,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public PaymentMethodCreatedNotificationRequest data(MidServiceNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -149,6 +172,7 @@ public MidServiceNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(MidServiceNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -161,6 +185,7 @@ public void setData(MidServiceNotificationData data) { */ public PaymentMethodCreatedNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -186,6 +211,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -197,6 +223,7 @@ public void setEnvironment(String environment) { */ public PaymentMethodCreatedNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -220,6 +247,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 PaymentMethodCreatedNotificationRequest 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 PaymentMethodCreatedNotificationRequest object is equal to o. */ @@ -266,6 +314,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 (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + 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 PaymentMethodCreatedNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodNotificationResponse.java b/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodNotificationResponse.java index 05eadf327..ef0352eac 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodNotificationResponse.java +++ b/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodNotificationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.managementwebhooks; +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 PaymentMethodNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentMethodNotificationResponse() {} /** @@ -36,6 +47,7 @@ public PaymentMethodNotificationResponse() {} */ public PaymentMethodNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentMethodNotificationResponse 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 PaymentMethodNotificationResponse object is equal to o. */ @@ -106,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentMethodNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodRequestRemovedNotificationRequest.java b/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodRequestRemovedNotificationRequest.java index 3b5017488..e7b90dccd 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodRequestRemovedNotificationRequest.java +++ b/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodRequestRemovedNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.managementwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class PaymentMethodRequestRemovedNotificationRequest { 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_DATA = "data"; private MidServiceNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + /** Type of notification. */ public enum TypeEnum { PAYMENTMETHODREQUEST_REMOVED(String.valueOf("paymentMethodRequest.removed")); @@ -81,6 +92,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 PaymentMethodRequestRemovedNotificationRequest() {} /** @@ -92,6 +112,7 @@ public PaymentMethodRequestRemovedNotificationRequest() {} */ public PaymentMethodRequestRemovedNotificationRequest createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -115,6 +136,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -126,6 +148,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public PaymentMethodRequestRemovedNotificationRequest data(MidServiceNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -149,6 +172,7 @@ public MidServiceNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(MidServiceNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -161,6 +185,7 @@ public void setData(MidServiceNotificationData data) { */ public PaymentMethodRequestRemovedNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -186,6 +211,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -197,6 +223,7 @@ public void setEnvironment(String environment) { */ public PaymentMethodRequestRemovedNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -220,6 +247,28 @@ 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 PaymentMethodRequestRemovedNotificationRequest 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 PaymentMethodRequestRemovedNotificationRequest object is equal to o. */ @@ -267,6 +316,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 (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + 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 PaymentMethodRequestRemovedNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodScheduledForRemovalNotificationRequest.java b/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodScheduledForRemovalNotificationRequest.java index 938a6b65d..15f29a5d7 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodScheduledForRemovalNotificationRequest.java +++ b/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodScheduledForRemovalNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.managementwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class PaymentMethodScheduledForRemovalNotificationRequest { 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_DATA = "data"; private MidServiceNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + /** Type of notification. */ public enum TypeEnum { PAYMENTMETHODREQUEST_SCHEDULEDFORREMOVAL( @@ -82,6 +93,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentMethodScheduledForRemovalNotificationRequest() {} /** @@ -93,6 +113,7 @@ public PaymentMethodScheduledForRemovalNotificationRequest() {} */ public PaymentMethodScheduledForRemovalNotificationRequest createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -116,6 +137,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -127,6 +149,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public PaymentMethodScheduledForRemovalNotificationRequest data(MidServiceNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -150,6 +173,7 @@ public MidServiceNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(MidServiceNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -162,6 +186,7 @@ public void setData(MidServiceNotificationData data) { */ public PaymentMethodScheduledForRemovalNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -187,6 +212,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -198,6 +224,7 @@ public void setEnvironment(String environment) { */ public PaymentMethodScheduledForRemovalNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -221,6 +248,28 @@ 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 PaymentMethodScheduledForRemovalNotificationRequest 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; } /** @@ -272,6 +321,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 (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + 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 PaymentMethodScheduledForRemovalNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/RemediatingAction.java b/src/main/java/com/adyen/model/managementwebhooks/RemediatingAction.java index 87ac426e5..c01df6674 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/RemediatingAction.java +++ b/src/main/java/com/adyen/model/managementwebhooks/RemediatingAction.java @@ -11,6 +11,8 @@ package com.adyen.model.managementwebhooks; +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 RemediatingAction { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RemediatingAction() {} /** @@ -36,6 +50,7 @@ public RemediatingAction() {} */ public RemediatingAction code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCode(String code) { */ public RemediatingAction message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RemediatingAction 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 RemediatingAction object is equal to o. */ @@ -133,6 +171,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 (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + + 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 RemediatingAction given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/TerminalAssignmentNotificationRequest.java b/src/main/java/com/adyen/model/managementwebhooks/TerminalAssignmentNotificationRequest.java index cc29279e2..2aff066d0 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/TerminalAssignmentNotificationRequest.java +++ b/src/main/java/com/adyen/model/managementwebhooks/TerminalAssignmentNotificationRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.managementwebhooks; +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 TerminalAssignmentNotificationRequest { public static final String JSON_PROPERTY_ASSIGNED_TO_ACCOUNT = "assignedToAccount"; private String assignedToAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAssignedToAccount = false; + public static final String JSON_PROPERTY_ASSIGNED_TO_STORE = "assignedToStore"; private String assignedToStore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAssignedToStore = false; + public static final String JSON_PROPERTY_ASSIGNED_TO_STORE_ID = "assignedToStoreId"; private String assignedToStoreId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAssignedToStoreId = false; + public static final String JSON_PROPERTY_EVENT_DATE = "eventDate"; private String eventDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEventDate = 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_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 TerminalAssignmentNotificationRequest() {} /** @@ -57,6 +83,7 @@ public TerminalAssignmentNotificationRequest() {} */ public TerminalAssignmentNotificationRequest assignedToAccount(String assignedToAccount) { this.assignedToAccount = assignedToAccount; + isSetAssignedToAccount = true; // mark as set return this; } @@ -82,6 +109,7 @@ public String getAssignedToAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAssignedToAccount(String assignedToAccount) { this.assignedToAccount = assignedToAccount; + isSetAssignedToAccount = true; // mark as set } /** @@ -95,6 +123,7 @@ public void setAssignedToAccount(String assignedToAccount) { */ public TerminalAssignmentNotificationRequest assignedToStore(String assignedToStore) { this.assignedToStore = assignedToStore; + isSetAssignedToStore = true; // mark as set return this; } @@ -122,6 +151,7 @@ public String getAssignedToStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAssignedToStore(String assignedToStore) { this.assignedToStore = assignedToStore; + isSetAssignedToStore = true; // mark as set } /** @@ -133,6 +163,7 @@ public void setAssignedToStore(String assignedToStore) { */ public TerminalAssignmentNotificationRequest assignedToStoreId(String assignedToStoreId) { this.assignedToStoreId = assignedToStoreId; + isSetAssignedToStoreId = true; // mark as set return this; } @@ -156,6 +187,7 @@ public String getAssignedToStoreId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAssignedToStoreId(String assignedToStoreId) { this.assignedToStoreId = assignedToStoreId; + isSetAssignedToStoreId = true; // mark as set } /** @@ -167,6 +199,7 @@ public void setAssignedToStoreId(String assignedToStoreId) { */ public TerminalAssignmentNotificationRequest eventDate(String eventDate) { this.eventDate = eventDate; + isSetEventDate = true; // mark as set return this; } @@ -190,6 +223,7 @@ public String getEventDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEventDate(String eventDate) { this.eventDate = eventDate; + isSetEventDate = true; // mark as set } /** @@ -201,6 +235,7 @@ public void setEventDate(String eventDate) { */ public TerminalAssignmentNotificationRequest pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -224,6 +259,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -235,6 +271,7 @@ public void setPspReference(String pspReference) { */ public TerminalAssignmentNotificationRequest uniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set return this; } @@ -258,6 +295,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 TerminalAssignmentNotificationRequest 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 TerminalAssignmentNotificationRequest object is equal to o. */ @@ -318,6 +376,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 (isSetAssignedToAccount) { + addIfNull(nulls, JSON_PROPERTY_ASSIGNED_TO_ACCOUNT, this.assignedToAccount); + } + if (isSetAssignedToStore) { + addIfNull(nulls, JSON_PROPERTY_ASSIGNED_TO_STORE, this.assignedToStore); + } + if (isSetAssignedToStoreId) { + addIfNull(nulls, JSON_PROPERTY_ASSIGNED_TO_STORE_ID, this.assignedToStoreId); + } + if (isSetEventDate) { + addIfNull(nulls, JSON_PROPERTY_EVENT_DATE, this.eventDate); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + 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 TerminalAssignmentNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/TerminalAssignmentNotificationResponse.java b/src/main/java/com/adyen/model/managementwebhooks/TerminalAssignmentNotificationResponse.java index bc39a097b..ab92e9410 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/TerminalAssignmentNotificationResponse.java +++ b/src/main/java/com/adyen/model/managementwebhooks/TerminalAssignmentNotificationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.managementwebhooks; +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 TerminalAssignmentNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TerminalAssignmentNotificationResponse() {} /** @@ -36,6 +47,7 @@ public TerminalAssignmentNotificationResponse() {} */ public TerminalAssignmentNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TerminalAssignmentNotificationResponse 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 TerminalAssignmentNotificationResponse object is equal to o. */ @@ -106,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TerminalAssignmentNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingData.java b/src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingData.java index debf480d9..ecfcdba78 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingData.java +++ b/src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingData.java @@ -11,6 +11,8 @@ package com.adyen.model.managementwebhooks; +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 TerminalBoardingData { public static final String JSON_PROPERTY_COMPANY_ID = "companyId"; private String companyId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCompanyId = false; + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + public static final String JSON_PROPERTY_STORE_ID = "storeId"; private String storeId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoreId = 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 TerminalBoardingData() {} /** @@ -47,6 +67,7 @@ public TerminalBoardingData() {} */ public TerminalBoardingData companyId(String companyId) { this.companyId = companyId; + isSetCompanyId = true; // mark as set return this; } @@ -70,6 +91,7 @@ public String getCompanyId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCompanyId(String companyId) { this.companyId = companyId; + isSetCompanyId = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setCompanyId(String companyId) { */ public TerminalBoardingData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -103,6 +126,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setMerchantId(String merchantId) { */ public TerminalBoardingData storeId(String storeId) { this.storeId = storeId; + isSetStoreId = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getStoreId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoreId(String storeId) { this.storeId = storeId; + isSetStoreId = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setStoreId(String storeId) { */ public TerminalBoardingData uniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set return this; } @@ -169,6 +196,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 TerminalBoardingData 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 TerminalBoardingData object is equal to o. */ @@ -214,6 +262,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCompanyId) { + addIfNull(nulls, JSON_PROPERTY_COMPANY_ID, this.companyId); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + if (isSetStoreId) { + addIfNull(nulls, JSON_PROPERTY_STORE_ID, this.storeId); + } + 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 TerminalBoardingData given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingNotificationRequest.java b/src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingNotificationRequest.java index f7920493e..b227e60ac 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingNotificationRequest.java +++ b/src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.managementwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class TerminalBoardingNotificationRequest { 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_DATA = "data"; private TerminalBoardingData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + /** Type of notification. */ public enum TypeEnum { TERMINALBOARDING_TRIGGERED(String.valueOf("terminalBoarding.triggered")); @@ -81,6 +92,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 TerminalBoardingNotificationRequest() {} /** @@ -92,6 +112,7 @@ public TerminalBoardingNotificationRequest() {} */ public TerminalBoardingNotificationRequest createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -115,6 +136,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -126,6 +148,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public TerminalBoardingNotificationRequest data(TerminalBoardingData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -149,6 +172,7 @@ public TerminalBoardingData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(TerminalBoardingData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -161,6 +185,7 @@ public void setData(TerminalBoardingData data) { */ public TerminalBoardingNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -186,6 +211,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -197,6 +223,7 @@ public void setEnvironment(String environment) { */ public TerminalBoardingNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -220,6 +247,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 TerminalBoardingNotificationRequest 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 TerminalBoardingNotificationRequest object is equal to o. */ @@ -266,6 +314,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 (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + 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 TerminalBoardingNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingNotificationResponse.java b/src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingNotificationResponse.java index 1b06bf9a1..ff38fe1f6 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingNotificationResponse.java +++ b/src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingNotificationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.managementwebhooks; +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 TerminalBoardingNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TerminalBoardingNotificationResponse() {} /** @@ -36,6 +47,7 @@ public TerminalBoardingNotificationResponse() {} */ public TerminalBoardingNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TerminalBoardingNotificationResponse 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 TerminalBoardingNotificationResponse object is equal to o. */ @@ -106,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TerminalBoardingNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsData.java b/src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsData.java index 3e8624a86..5b4f3b530 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsData.java +++ b/src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsData.java @@ -11,7 +11,9 @@ package com.adyen.model.managementwebhooks; +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 TerminalSettingsData { public static final String JSON_PROPERTY_COMPANY_ID = "companyId"; private String companyId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCompanyId = false; + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + public static final String JSON_PROPERTY_STORE_ID = "storeId"; private String storeId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoreId = 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; + /** * Indicates whether the terminal settings were updated using the Customer Area or the Management * API. @@ -90,9 +104,21 @@ public static UpdateSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_UPDATE_SOURCE = "updateSource"; private UpdateSourceEnum updateSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUpdateSource = false; + public static final String JSON_PROPERTY_USER = "user"; private String user; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUser = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TerminalSettingsData() {} /** @@ -103,6 +129,7 @@ public TerminalSettingsData() {} */ public TerminalSettingsData companyId(String companyId) { this.companyId = companyId; + isSetCompanyId = true; // mark as set return this; } @@ -126,6 +153,7 @@ public String getCompanyId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCompanyId(String companyId) { this.companyId = companyId; + isSetCompanyId = true; // mark as set } /** @@ -136,6 +164,7 @@ public void setCompanyId(String companyId) { */ public TerminalSettingsData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -159,6 +188,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -169,6 +199,7 @@ public void setMerchantId(String merchantId) { */ public TerminalSettingsData storeId(String storeId) { this.storeId = storeId; + isSetStoreId = true; // mark as set return this; } @@ -192,6 +223,7 @@ public String getStoreId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoreId(String storeId) { this.storeId = storeId; + isSetStoreId = true; // mark as set } /** @@ -202,6 +234,7 @@ public void setStoreId(String storeId) { */ public TerminalSettingsData terminalId(String terminalId) { this.terminalId = terminalId; + isSetTerminalId = true; // mark as set return this; } @@ -225,6 +258,7 @@ public String getTerminalId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTerminalId(String terminalId) { this.terminalId = terminalId; + isSetTerminalId = true; // mark as set } /** @@ -237,6 +271,7 @@ public void setTerminalId(String terminalId) { */ public TerminalSettingsData updateSource(UpdateSourceEnum updateSource) { this.updateSource = updateSource; + isSetUpdateSource = true; // mark as set return this; } @@ -264,6 +299,7 @@ public UpdateSourceEnum getUpdateSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUpdateSource(UpdateSourceEnum updateSource) { this.updateSource = updateSource; + isSetUpdateSource = true; // mark as set } /** @@ -275,6 +311,7 @@ public void setUpdateSource(UpdateSourceEnum updateSource) { */ public TerminalSettingsData user(String user) { this.user = user; + isSetUser = true; // mark as set return this; } @@ -300,6 +337,27 @@ public String getUser() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUser(String user) { this.user = user; + isSetUser = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TerminalSettingsData 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 TerminalSettingsData object is equal to o. */ @@ -349,6 +407,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 (isSetCompanyId) { + addIfNull(nulls, JSON_PROPERTY_COMPANY_ID, this.companyId); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + if (isSetStoreId) { + addIfNull(nulls, JSON_PROPERTY_STORE_ID, this.storeId); + } + if (isSetTerminalId) { + addIfNull(nulls, JSON_PROPERTY_TERMINAL_ID, this.terminalId); + } + if (isSetUpdateSource) { + addIfNull(nulls, JSON_PROPERTY_UPDATE_SOURCE, this.updateSource); + } + if (isSetUser) { + addIfNull(nulls, JSON_PROPERTY_USER, this.user); + } + + 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 TerminalSettingsData given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsNotificationRequest.java b/src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsNotificationRequest.java index 6f7892534..29d250406 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsNotificationRequest.java +++ b/src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.managementwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class TerminalSettingsNotificationRequest { 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_DATA = "data"; private TerminalSettingsData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + /** Type of notification. */ public enum TypeEnum { TERMINALSETTINGS_MODIFIED(String.valueOf("terminalSettings.modified")); @@ -81,6 +92,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 TerminalSettingsNotificationRequest() {} /** @@ -92,6 +112,7 @@ public TerminalSettingsNotificationRequest() {} */ public TerminalSettingsNotificationRequest createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -115,6 +136,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -126,6 +148,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public TerminalSettingsNotificationRequest data(TerminalSettingsData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -149,6 +172,7 @@ public TerminalSettingsData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(TerminalSettingsData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -161,6 +185,7 @@ public void setData(TerminalSettingsData data) { */ public TerminalSettingsNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -186,6 +211,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -197,6 +223,7 @@ public void setEnvironment(String environment) { */ public TerminalSettingsNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -220,6 +247,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 TerminalSettingsNotificationRequest 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 TerminalSettingsNotificationRequest object is equal to o. */ @@ -266,6 +314,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 (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + 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 TerminalSettingsNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsNotificationResponse.java b/src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsNotificationResponse.java index 4cb54c453..38b20c0eb 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsNotificationResponse.java +++ b/src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsNotificationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.managementwebhooks; +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 TerminalSettingsNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TerminalSettingsNotificationResponse() {} /** @@ -36,6 +47,7 @@ public TerminalSettingsNotificationResponse() {} */ public TerminalSettingsNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TerminalSettingsNotificationResponse 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 TerminalSettingsNotificationResponse object is equal to o. */ @@ -106,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TerminalSettingsNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/VerificationError.java b/src/main/java/com/adyen/model/managementwebhooks/VerificationError.java index c86fd02bd..1bc5d4259 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/VerificationError.java +++ b/src/main/java/com/adyen/model/managementwebhooks/VerificationError.java @@ -11,7 +11,9 @@ package com.adyen.model.managementwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,15 +37,27 @@ public class VerificationError { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = 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_REMEDIATING_ACTIONS = "remediatingActions"; private List remediatingActions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemediatingActions = false; + public static final String JSON_PROPERTY_SUB_ERRORS = "subErrors"; private List subErrors; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubErrors = false; + /** * The type of verification error. Possible values: **invalidInput**, **dataMissing**, and * **pendingStatus**. @@ -95,6 +109,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 VerificationError() {} /** @@ -105,6 +128,7 @@ public VerificationError() {} */ public VerificationError code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -128,6 +152,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -138,6 +163,7 @@ public void setCode(String code) { */ public VerificationError message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -161,6 +187,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -171,6 +198,7 @@ public void setMessage(String message) { */ public VerificationError remediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set return this; } @@ -202,6 +230,7 @@ public List getRemediatingActions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set } /** @@ -212,6 +241,7 @@ public void setRemediatingActions(List remediatingActions) { */ public VerificationError subErrors(List subErrors) { this.subErrors = subErrors; + isSetSubErrors = true; // mark as set return this; } @@ -243,6 +273,7 @@ public List getSubErrors() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubErrors(List subErrors) { this.subErrors = subErrors; + isSetSubErrors = true; // mark as set } /** @@ -255,6 +286,7 @@ public void setSubErrors(List subErrors) { */ public VerificationError type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -282,6 +314,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 VerificationError 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 VerificationError object is equal to o. */ @@ -329,6 +382,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 (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetRemediatingActions) { + addIfNull(nulls, JSON_PROPERTY_REMEDIATING_ACTIONS, this.remediatingActions); + } + if (isSetSubErrors) { + addIfNull(nulls, JSON_PROPERTY_SUB_ERRORS, this.subErrors); + } + 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 VerificationError given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/VerificationErrorRecursive.java b/src/main/java/com/adyen/model/managementwebhooks/VerificationErrorRecursive.java index 68c11ba2c..e280fb057 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/VerificationErrorRecursive.java +++ b/src/main/java/com/adyen/model/managementwebhooks/VerificationErrorRecursive.java @@ -11,7 +11,9 @@ package com.adyen.model.managementwebhooks; +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; @@ -36,9 +38,15 @@ public class VerificationErrorRecursive { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + /** * The type of verification error. Possible values: **invalidInput**, **dataMissing**, and * **pendingStatus**. @@ -90,9 +98,21 @@ 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; + public static final String JSON_PROPERTY_REMEDIATING_ACTIONS = "remediatingActions"; private List remediatingActions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemediatingActions = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public VerificationErrorRecursive() {} /** @@ -103,6 +123,7 @@ public VerificationErrorRecursive() {} */ public VerificationErrorRecursive code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -126,6 +147,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -136,6 +158,7 @@ public void setCode(String code) { */ public VerificationErrorRecursive message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -159,6 +182,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -171,6 +195,7 @@ public void setMessage(String message) { */ public VerificationErrorRecursive type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -198,6 +223,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -208,6 +234,7 @@ public void setType(TypeEnum type) { */ public VerificationErrorRecursive remediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set return this; } @@ -240,6 +267,27 @@ public List getRemediatingActions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public VerificationErrorRecursive 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 VerificationError-recursive object is equal to o. */ @@ -285,6 +333,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 (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetRemediatingActions) { + addIfNull(nulls, JSON_PROPERTY_REMEDIATING_ACTIONS, this.remediatingActions); + } + + 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 VerificationErrorRecursive given an JSON string * diff --git a/src/main/java/com/adyen/model/negativebalancewarningwebhooks/Amount.java b/src/main/java/com/adyen/model/negativebalancewarningwebhooks/Amount.java index 24a355339..a11eb49b6 100644 --- a/src/main/java/com/adyen/model/negativebalancewarningwebhooks/Amount.java +++ b/src/main/java/com/adyen/model/negativebalancewarningwebhooks/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.negativebalancewarningwebhooks; +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. */ @@ -145,6 +189,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/negativebalancewarningwebhooks/NegativeBalanceCompensationWarningNotificationData.java b/src/main/java/com/adyen/model/negativebalancewarningwebhooks/NegativeBalanceCompensationWarningNotificationData.java index db92ccaea..a68ca3e48 100644 --- a/src/main/java/com/adyen/model/negativebalancewarningwebhooks/NegativeBalanceCompensationWarningNotificationData.java +++ b/src/main/java/com/adyen/model/negativebalancewarningwebhooks/NegativeBalanceCompensationWarningNotificationData.java @@ -11,6 +11,8 @@ package com.adyen.model.negativebalancewarningwebhooks; +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,27 +35,57 @@ public class NegativeBalanceCompensationWarningNotificationData { public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; private ResourceReference accountHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_LIABLE_BALANCE_ACCOUNT_ID = "liableBalanceAccountId"; private String liableBalanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLiableBalanceAccountId = false; + public static final String JSON_PROPERTY_NEGATIVE_BALANCE_SINCE = "negativeBalanceSince"; private OffsetDateTime negativeBalanceSince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNegativeBalanceSince = false; + public static final String JSON_PROPERTY_SCHEDULED_COMPENSATION_AT = "scheduledCompensationAt"; private OffsetDateTime scheduledCompensationAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScheduledCompensationAt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NegativeBalanceCompensationWarningNotificationData() {} /** @@ -66,6 +98,7 @@ public NegativeBalanceCompensationWarningNotificationData() {} public NegativeBalanceCompensationWarningNotificationData accountHolder( ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -89,6 +122,7 @@ public ResourceReference getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set } /** @@ -100,6 +134,7 @@ public void setAccountHolder(ResourceReference accountHolder) { */ public NegativeBalanceCompensationWarningNotificationData amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -123,6 +158,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -135,6 +171,7 @@ public void setAmount(Amount amount) { public NegativeBalanceCompensationWarningNotificationData balancePlatform( String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -158,6 +195,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -172,6 +210,7 @@ public void setBalancePlatform(String balancePlatform) { public NegativeBalanceCompensationWarningNotificationData creationDate( OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -199,6 +238,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -210,6 +250,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public NegativeBalanceCompensationWarningNotificationData id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -233,6 +274,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -247,6 +289,7 @@ public void setId(String id) { public NegativeBalanceCompensationWarningNotificationData liableBalanceAccountId( String liableBalanceAccountId) { this.liableBalanceAccountId = liableBalanceAccountId; + isSetLiableBalanceAccountId = true; // mark as set return this; } @@ -274,6 +317,7 @@ public String getLiableBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLiableBalanceAccountId(String liableBalanceAccountId) { this.liableBalanceAccountId = liableBalanceAccountId; + isSetLiableBalanceAccountId = true; // mark as set } /** @@ -286,6 +330,7 @@ public void setLiableBalanceAccountId(String liableBalanceAccountId) { public NegativeBalanceCompensationWarningNotificationData negativeBalanceSince( OffsetDateTime negativeBalanceSince) { this.negativeBalanceSince = negativeBalanceSince; + isSetNegativeBalanceSince = true; // mark as set return this; } @@ -309,6 +354,7 @@ public OffsetDateTime getNegativeBalanceSince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNegativeBalanceSince(OffsetDateTime negativeBalanceSince) { this.negativeBalanceSince = negativeBalanceSince; + isSetNegativeBalanceSince = true; // mark as set } /** @@ -322,6 +368,7 @@ public void setNegativeBalanceSince(OffsetDateTime negativeBalanceSince) { public NegativeBalanceCompensationWarningNotificationData scheduledCompensationAt( OffsetDateTime scheduledCompensationAt) { this.scheduledCompensationAt = scheduledCompensationAt; + isSetScheduledCompensationAt = true; // mark as set return this; } @@ -347,6 +394,28 @@ public OffsetDateTime getScheduledCompensationAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScheduledCompensationAt(OffsetDateTime scheduledCompensationAt) { this.scheduledCompensationAt = scheduledCompensationAt; + isSetScheduledCompensationAt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NegativeBalanceCompensationWarningNotificationData 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; } /** @@ -428,6 +497,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 (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLiableBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_LIABLE_BALANCE_ACCOUNT_ID, this.liableBalanceAccountId); + } + if (isSetNegativeBalanceSince) { + addIfNull(nulls, JSON_PROPERTY_NEGATIVE_BALANCE_SINCE, this.negativeBalanceSince); + } + if (isSetScheduledCompensationAt) { + addIfNull(nulls, JSON_PROPERTY_SCHEDULED_COMPENSATION_AT, this.scheduledCompensationAt); + } + + 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 NegativeBalanceCompensationWarningNotificationData given an JSON string * diff --git a/src/main/java/com/adyen/model/negativebalancewarningwebhooks/NegativeBalanceCompensationWarningNotificationRequest.java b/src/main/java/com/adyen/model/negativebalancewarningwebhooks/NegativeBalanceCompensationWarningNotificationRequest.java index 2add2d2cf..d208147ed 100644 --- a/src/main/java/com/adyen/model/negativebalancewarningwebhooks/NegativeBalanceCompensationWarningNotificationRequest.java +++ b/src/main/java/com/adyen/model/negativebalancewarningwebhooks/NegativeBalanceCompensationWarningNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.negativebalancewarningwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class NegativeBalanceCompensationWarningNotificationRequest { public static final String JSON_PROPERTY_DATA = "data"; private NegativeBalanceCompensationWarningNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + /** Type of webhook. */ public enum TypeEnum { BALANCEPLATFORM_NEGATIVEBALANCECOMPENSATIONWARNING_SCHEDULED( @@ -82,6 +93,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NegativeBalanceCompensationWarningNotificationRequest() {} /** @@ -94,6 +114,7 @@ public NegativeBalanceCompensationWarningNotificationRequest() {} public NegativeBalanceCompensationWarningNotificationRequest data( NegativeBalanceCompensationWarningNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -117,6 +138,7 @@ public NegativeBalanceCompensationWarningNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(NegativeBalanceCompensationWarningNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -129,6 +151,7 @@ public void setData(NegativeBalanceCompensationWarningNotificationData data) { */ public NegativeBalanceCompensationWarningNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -154,6 +177,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -165,6 +189,7 @@ public void setEnvironment(String environment) { */ public NegativeBalanceCompensationWarningNotificationRequest timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set return this; } @@ -188,6 +213,7 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set } /** @@ -199,6 +225,7 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public NegativeBalanceCompensationWarningNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -222,6 +249,28 @@ 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 NegativeBalanceCompensationWarningNotificationRequest 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; } /** @@ -273,6 +322,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of NegativeBalanceCompensationWarningNotificationRequest given an JSON * string diff --git a/src/main/java/com/adyen/model/negativebalancewarningwebhooks/Resource.java b/src/main/java/com/adyen/model/negativebalancewarningwebhooks/Resource.java index 5e4717104..bf57cf880 100644 --- a/src/main/java/com/adyen/model/negativebalancewarningwebhooks/Resource.java +++ b/src/main/java/com/adyen/model/negativebalancewarningwebhooks/Resource.java @@ -11,6 +11,8 @@ package com.adyen.model.negativebalancewarningwebhooks; +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,12 +30,27 @@ public class Resource { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Resource() {} /** @@ -44,6 +61,7 @@ public Resource() {} */ public Resource balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -67,6 +85,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -79,6 +98,7 @@ public void setBalancePlatform(String balancePlatform) { */ public Resource creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -106,6 +126,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -116,6 +137,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public Resource id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -139,6 +161,27 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Resource 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 Resource object is equal to o. */ @@ -182,6 +225,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 (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + + 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 Resource given an JSON string * diff --git a/src/main/java/com/adyen/model/negativebalancewarningwebhooks/ResourceReference.java b/src/main/java/com/adyen/model/negativebalancewarningwebhooks/ResourceReference.java index 1cb999a8c..3d4819cd0 100644 --- a/src/main/java/com/adyen/model/negativebalancewarningwebhooks/ResourceReference.java +++ b/src/main/java/com/adyen/model/negativebalancewarningwebhooks/ResourceReference.java @@ -11,6 +11,8 @@ package com.adyen.model.negativebalancewarningwebhooks; +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 ResourceReference { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResourceReference() {} /** @@ -43,6 +60,7 @@ public ResourceReference() {} */ public ResourceReference description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setDescription(String description) { */ public ResourceReference id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setId(String id) { */ public ResourceReference 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 ResourceReference includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResourceReference object is equal to o. */ @@ -175,6 +218,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResourceReference given an JSON string * diff --git a/src/main/java/com/adyen/model/payment/AccountInfo.java b/src/main/java/com/adyen/model/payment/AccountInfo.java index 4b204b5ba..c423f8e79 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. */ @@ -1246,6 +1369,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..308f38576 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. */ @@ -1211,6 +1319,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..a5fe2b1f6 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. */ @@ -522,6 +580,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..35dc65e11 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. */ @@ -1632,6 +1805,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..78b3bd88f 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. */ @@ -1257,6 +1400,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..5f80ddcb2 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. */ @@ -1392,6 +1525,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..fd5dab91e 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. */ @@ -1160,6 +1273,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..20b72099d 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. */ @@ -945,6 +1058,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..123061181 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. */ @@ -112,6 +145,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..d6a2e7b28 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. */ @@ -1000,6 +1118,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..4b3780a95 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. */ @@ -118,6 +151,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..4c599d6bc 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. */ @@ -405,6 +473,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..baf5e730f 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. */ @@ -266,6 +309,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..467302938 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. */ @@ -1107,6 +1240,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..f2d95f5f5 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. */ @@ -724,6 +827,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..489712df9 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. */ @@ -752,6 +840,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..85cfe1349 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. */ @@ -536,6 +609,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..0f3c65a79 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. */ @@ -302,6 +360,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..8fdd9e581 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. */ @@ -325,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 (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..c7164e70b 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. */ @@ -571,6 +654,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..f7ed54be1 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. */ @@ -145,6 +189,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..83c0ea712 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. */ @@ -303,6 +361,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..354bc549d 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. */ @@ -139,6 +177,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..86f65d2b2 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. */ @@ -136,6 +174,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..7b5c140e4 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. */ @@ -487,6 +560,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..79461d79f 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. */ @@ -448,6 +521,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..c924cbe10 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. */ @@ -469,6 +542,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..5dd55faa0 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. */ @@ -528,6 +606,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..7e9c4f989 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. */ @@ -568,6 +651,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..a9fbe802f 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. */ @@ -431,6 +499,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..931b99a1a 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. */ @@ -133,6 +171,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..2012f03d9 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. */ @@ -246,6 +284,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..d4b6820c1 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. */ @@ -312,6 +370,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..8c8b11e28 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. */ @@ -175,6 +218,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..333987745 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. */ @@ -539,6 +627,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..a7b9f09a9 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. */ @@ -175,6 +218,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..8f8a84b46 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. */ @@ -95,6 +128,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..129fe92e8 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. */ @@ -143,6 +181,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..b2d5ec291 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. */ @@ -542,6 +625,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..8c3109eeb 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. */ @@ -306,6 +364,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..2af992c00 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. */ @@ -296,6 +339,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..b01f08380 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. */ @@ -623,6 +696,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..2e35aa90a 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. */ @@ -175,6 +218,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..172d3bf55 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. */ @@ -812,6 +910,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..86368264f 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. */ @@ -259,6 +302,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..1720265d9 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. */ @@ -133,6 +171,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..a129290c9 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. */ @@ -3020,6 +3318,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..33eb08d23 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. */ @@ -2566,6 +2819,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..4858017ca 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. */ @@ -2562,6 +2815,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..2068d6fb9 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. */ @@ -849,6 +932,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..928af9f6e 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. */ @@ -132,6 +170,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..428ab7a4c 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. */ @@ -251,6 +294,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..4c720da03 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. */ @@ -435,6 +488,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..b27a2952b 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. */ @@ -568,6 +651,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..899e96c8a 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. */ @@ -296,6 +349,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..8624b7d6e 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. */ @@ -342,6 +400,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..0a977ddd4 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. */ @@ -576,6 +649,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..983fdf5f1 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. */ @@ -3277,6 +3620,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..4728442cb 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. */ @@ -159,6 +197,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..07304e9a4 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. */ @@ -707,6 +795,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..7d477b9f5 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. */ @@ -197,6 +240,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..d5e590997 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. */ @@ -119,6 +152,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..b06fa9691 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. */ @@ -273,6 +321,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..5a4e19c59 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. */ @@ -95,6 +128,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..79ad1e91f 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. */ @@ -214,6 +262,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (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..5287642fb 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. */ @@ -375,6 +433,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..1bafb18f4 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. */ @@ -311,6 +369,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..c57f581a2 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. */ @@ -175,6 +218,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..d9653cb9a 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. */ @@ -564,6 +617,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..8fcf73c78 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. */ @@ -151,6 +189,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..fc4a3bcc6 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. */ @@ -295,6 +348,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..d2b93109a 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. */ @@ -525,6 +603,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..70528a4c0 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. */ @@ -305,6 +363,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..ae3adcd06 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. */ @@ -2272,6 +2495,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..0f6cfe704 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. */ @@ -875,6 +973,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..13e7bdd10 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. */ @@ -139,6 +177,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..c36ae4c26 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. */ @@ -95,6 +128,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..5cdf7f9c8 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. */ @@ -302,6 +345,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..393efc95d 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. */ @@ -336,6 +384,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..b67e7babb 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. */ @@ -761,6 +849,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..0db4d2c88 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. */ @@ -571,6 +654,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/paymentsapp/BoardingTokenRequest.java b/src/main/java/com/adyen/model/paymentsapp/BoardingTokenRequest.java index 88789430f..91347616d 100644 --- a/src/main/java/com/adyen/model/paymentsapp/BoardingTokenRequest.java +++ b/src/main/java/com/adyen/model/paymentsapp/BoardingTokenRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.paymentsapp; +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 BoardingTokenRequest { public static final String JSON_PROPERTY_BOARDING_REQUEST_TOKEN = "boardingRequestToken"; private String boardingRequestToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBoardingRequestToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BoardingTokenRequest() {} /** @@ -33,6 +44,7 @@ public BoardingTokenRequest() {} */ public BoardingTokenRequest boardingRequestToken(String boardingRequestToken) { this.boardingRequestToken = boardingRequestToken; + isSetBoardingRequestToken = true; // mark as set return this; } @@ -56,6 +68,27 @@ public String getBoardingRequestToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBoardingRequestToken(String boardingRequestToken) { this.boardingRequestToken = boardingRequestToken; + isSetBoardingRequestToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BoardingTokenRequest 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 BoardingTokenRequest object is equal to o. */ @@ -97,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 (isSetBoardingRequestToken) { + addIfNull(nulls, JSON_PROPERTY_BOARDING_REQUEST_TOKEN, this.boardingRequestToken); + } + + 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 BoardingTokenRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/paymentsapp/BoardingTokenResponse.java b/src/main/java/com/adyen/model/paymentsapp/BoardingTokenResponse.java index c9514b7bb..c3f2ba978 100644 --- a/src/main/java/com/adyen/model/paymentsapp/BoardingTokenResponse.java +++ b/src/main/java/com/adyen/model/paymentsapp/BoardingTokenResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.paymentsapp; +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 BoardingTokenResponse { public static final String JSON_PROPERTY_BOARDING_TOKEN = "boardingToken"; private String boardingToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBoardingToken = false; + public static final String JSON_PROPERTY_INSTALLATION_ID = "installationId"; private String installationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallationId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BoardingTokenResponse() {} /** @@ -39,6 +53,7 @@ public BoardingTokenResponse() {} */ public BoardingTokenResponse boardingToken(String boardingToken) { this.boardingToken = boardingToken; + isSetBoardingToken = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getBoardingToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBoardingToken(String boardingToken) { this.boardingToken = boardingToken; + isSetBoardingToken = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setBoardingToken(String boardingToken) { */ public BoardingTokenResponse installationId(String installationId) { this.installationId = installationId; + isSetInstallationId = true; // mark as set return this; } @@ -95,6 +112,27 @@ public String getInstallationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallationId(String installationId) { this.installationId = installationId; + isSetInstallationId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BoardingTokenResponse 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 BoardingTokenResponse object is equal to o. */ @@ -136,6 +174,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 (isSetBoardingToken) { + addIfNull(nulls, JSON_PROPERTY_BOARDING_TOKEN, this.boardingToken); + } + if (isSetInstallationId) { + addIfNull(nulls, JSON_PROPERTY_INSTALLATION_ID, this.installationId); + } + + 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 BoardingTokenResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/paymentsapp/DefaultErrorResponseEntity.java b/src/main/java/com/adyen/model/paymentsapp/DefaultErrorResponseEntity.java index b213ca95a..9c04ecd35 100644 --- a/src/main/java/com/adyen/model/paymentsapp/DefaultErrorResponseEntity.java +++ b/src/main/java/com/adyen/model/paymentsapp/DefaultErrorResponseEntity.java @@ -11,6 +11,8 @@ package com.adyen.model.paymentsapp; +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,27 +36,57 @@ public class DefaultErrorResponseEntity { public static final String JSON_PROPERTY_DETAIL = "detail"; private String detail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetail = 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_INSTANCE = "instance"; private String instance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstance = false; + public static final String JSON_PROPERTY_INVALID_FIELDS = "invalidFields"; private List invalidFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInvalidFields = false; + public static final String JSON_PROPERTY_REQUEST_ID = "requestId"; private String requestId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestId = false; + public static final String JSON_PROPERTY_STATUS = "status"; private Integer status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TITLE = "title"; private String title; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTitle = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 DefaultErrorResponseEntity() {} /** @@ -65,6 +97,7 @@ public DefaultErrorResponseEntity() {} */ public DefaultErrorResponseEntity detail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set return this; } @@ -88,6 +121,7 @@ public String getDetail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set } /** @@ -98,6 +132,7 @@ public void setDetail(String detail) { */ public DefaultErrorResponseEntity errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -121,6 +156,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -131,6 +167,7 @@ public void setErrorCode(String errorCode) { */ public DefaultErrorResponseEntity instance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set return this; } @@ -154,6 +191,7 @@ public String getInstance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set } /** @@ -164,6 +202,7 @@ public void setInstance(String instance) { */ public DefaultErrorResponseEntity invalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set return this; } @@ -195,6 +234,7 @@ public List getInvalidFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInvalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set } /** @@ -205,6 +245,7 @@ public void setInvalidFields(List invalidFields) { */ public DefaultErrorResponseEntity requestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set return this; } @@ -228,6 +269,7 @@ public String getRequestId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set } /** @@ -238,6 +280,7 @@ public void setRequestId(String requestId) { */ public DefaultErrorResponseEntity status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -261,6 +304,7 @@ public Integer getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(Integer status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -271,6 +315,7 @@ public void setStatus(Integer status) { */ public DefaultErrorResponseEntity title(String title) { this.title = title; + isSetTitle = true; // mark as set return this; } @@ -294,6 +339,7 @@ public String getTitle() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTitle(String title) { this.title = title; + isSetTitle = true; // mark as set } /** @@ -306,6 +352,7 @@ public void setTitle(String title) { */ public DefaultErrorResponseEntity type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -333,6 +380,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DefaultErrorResponseEntity 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 DefaultErrorResponseEntity object is equal to o. */ @@ -386,6 +454,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 (isSetDetail) { + addIfNull(nulls, JSON_PROPERTY_DETAIL, this.detail); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetInstance) { + addIfNull(nulls, JSON_PROPERTY_INSTANCE, this.instance); + } + if (isSetInvalidFields) { + addIfNull(nulls, JSON_PROPERTY_INVALID_FIELDS, this.invalidFields); + } + if (isSetRequestId) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_ID, this.requestId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTitle) { + addIfNull(nulls, JSON_PROPERTY_TITLE, this.title); + } + 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 DefaultErrorResponseEntity given an JSON string * diff --git a/src/main/java/com/adyen/model/paymentsapp/InvalidField.java b/src/main/java/com/adyen/model/paymentsapp/InvalidField.java index f7e34ab3e..aed6a739c 100644 --- a/src/main/java/com/adyen/model/paymentsapp/InvalidField.java +++ b/src/main/java/com/adyen/model/paymentsapp/InvalidField.java @@ -11,6 +11,8 @@ package com.adyen.model.paymentsapp; +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 InvalidField { 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_VALUE = "value"; private String value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public InvalidField() {} /** @@ -43,6 +60,7 @@ public InvalidField() {} */ public InvalidField name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setName(String name) { */ public InvalidField value(String value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(String value) { this.value = value; + isSetValue = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setValue(String value) { */ public InvalidField message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InvalidField 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 InvalidField object is equal to o. */ @@ -175,6 +218,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 (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + + 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 InvalidField given an JSON string * diff --git a/src/main/java/com/adyen/model/paymentsapp/PaymentsAppDto.java b/src/main/java/com/adyen/model/paymentsapp/PaymentsAppDto.java index ea0bb7998..4ec19b3a2 100644 --- a/src/main/java/com/adyen/model/paymentsapp/PaymentsAppDto.java +++ b/src/main/java/com/adyen/model/paymentsapp/PaymentsAppDto.java @@ -11,6 +11,8 @@ package com.adyen.model.paymentsapp; +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 PaymentsAppDto { public static final String JSON_PROPERTY_INSTALLATION_ID = "installationId"; private String installationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallationId = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT_CODE = "merchantAccountCode"; private String merchantAccountCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccountCode = false; + public static final String JSON_PROPERTY_MERCHANT_STORE_CODE = "merchantStoreCode"; private String merchantStoreCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantStoreCode = false; + public static final String JSON_PROPERTY_STATUS = "status"; private String 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 PaymentsAppDto() {} /** @@ -47,6 +67,7 @@ public PaymentsAppDto() {} */ public PaymentsAppDto installationId(String installationId) { this.installationId = installationId; + isSetInstallationId = true; // mark as set return this; } @@ -70,6 +91,7 @@ public String getInstallationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallationId(String installationId) { this.installationId = installationId; + isSetInstallationId = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setInstallationId(String installationId) { */ public PaymentsAppDto merchantAccountCode(String merchantAccountCode) { this.merchantAccountCode = merchantAccountCode; + isSetMerchantAccountCode = true; // mark as set return this; } @@ -103,6 +126,7 @@ public String getMerchantAccountCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccountCode(String merchantAccountCode) { this.merchantAccountCode = merchantAccountCode; + isSetMerchantAccountCode = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setMerchantAccountCode(String merchantAccountCode) { */ public PaymentsAppDto merchantStoreCode(String merchantStoreCode) { this.merchantStoreCode = merchantStoreCode; + isSetMerchantStoreCode = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getMerchantStoreCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantStoreCode(String merchantStoreCode) { this.merchantStoreCode = merchantStoreCode; + isSetMerchantStoreCode = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setMerchantStoreCode(String merchantStoreCode) { */ public PaymentsAppDto status(String status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -169,6 +196,27 @@ public String getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(String status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentsAppDto 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 PaymentsAppDto object is equal to o. */ @@ -216,6 +264,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 (isSetInstallationId) { + addIfNull(nulls, JSON_PROPERTY_INSTALLATION_ID, this.installationId); + } + if (isSetMerchantAccountCode) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT_CODE, this.merchantAccountCode); + } + if (isSetMerchantStoreCode) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_STORE_CODE, this.merchantStoreCode); + } + 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 PaymentsAppDto given an JSON string * diff --git a/src/main/java/com/adyen/model/paymentsapp/PaymentsAppResponse.java b/src/main/java/com/adyen/model/paymentsapp/PaymentsAppResponse.java index f8183ad62..746afa674 100644 --- a/src/main/java/com/adyen/model/paymentsapp/PaymentsAppResponse.java +++ b/src/main/java/com/adyen/model/paymentsapp/PaymentsAppResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.paymentsapp; +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,6 +27,15 @@ public class PaymentsAppResponse { public static final String JSON_PROPERTY_PAYMENTS_APPS = "paymentsApps"; private List paymentsApps; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentsApps = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentsAppResponse() {} /** @@ -35,6 +46,7 @@ public PaymentsAppResponse() {} */ public PaymentsAppResponse paymentsApps(List paymentsApps) { this.paymentsApps = paymentsApps; + isSetPaymentsApps = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getPaymentsApps() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentsApps(List paymentsApps) { this.paymentsApps = paymentsApps; + isSetPaymentsApps = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentsAppResponse 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 PaymentsAppResponse object is equal to o. */ @@ -105,6 +138,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 (isSetPaymentsApps) { + addIfNull(nulls, JSON_PROPERTY_PAYMENTS_APPS, this.paymentsApps); + } + + 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 PaymentsAppResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/payout/Address.java b/src/main/java/com/adyen/model/payout/Address.java index 57c638c02..37e4b9e68 100644 --- a/src/main/java/com/adyen/model/payout/Address.java +++ b/src/main/java/com/adyen/model/payout/Address.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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. */ @@ -325,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 (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/payout/Amount.java b/src/main/java/com/adyen/model/payout/Amount.java index 9b35667a3..fa09e0518 100644 --- a/src/main/java/com/adyen/model/payout/Amount.java +++ b/src/main/java/com/adyen/model/payout/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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. */ @@ -145,6 +189,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/payout/BankAccount.java b/src/main/java/com/adyen/model/payout/BankAccount.java index 9e2204d72..50f688ac4 100644 --- a/src/main/java/com/adyen/model/payout/BankAccount.java +++ b/src/main/java/com/adyen/model/payout/BankAccount.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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. */ @@ -487,6 +560,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/payout/Card.java b/src/main/java/com/adyen/model/payout/Card.java index 9965a64e1..7c6ad2f64 100644 --- a/src/main/java/com/adyen/model/payout/Card.java +++ b/src/main/java/com/adyen/model/payout/Card.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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. */ @@ -431,6 +499,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/payout/FraudCheckResult.java b/src/main/java/com/adyen/model/payout/FraudCheckResult.java index 2327be705..596046b35 100644 --- a/src/main/java/com/adyen/model/payout/FraudCheckResult.java +++ b/src/main/java/com/adyen/model/payout/FraudCheckResult.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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. */ @@ -175,6 +218,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/payout/FraudCheckResultWrapper.java b/src/main/java/com/adyen/model/payout/FraudCheckResultWrapper.java index a40ffae55..b0879f8f2 100644 --- a/src/main/java/com/adyen/model/payout/FraudCheckResultWrapper.java +++ b/src/main/java/com/adyen/model/payout/FraudCheckResultWrapper.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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. */ @@ -95,6 +128,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/payout/FraudResult.java b/src/main/java/com/adyen/model/payout/FraudResult.java index c66734f24..9ca595bc5 100644 --- a/src/main/java/com/adyen/model/payout/FraudResult.java +++ b/src/main/java/com/adyen/model/payout/FraudResult.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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. */ @@ -143,6 +181,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/payout/FundSource.java b/src/main/java/com/adyen/model/payout/FundSource.java index a137e29b1..33fc5848e 100644 --- a/src/main/java/com/adyen/model/payout/FundSource.java +++ b/src/main/java/com/adyen/model/payout/FundSource.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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. */ @@ -306,6 +364,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/payout/ModifyRequest.java b/src/main/java/com/adyen/model/payout/ModifyRequest.java index bff1fcc72..6d932dfc2 100644 --- a/src/main/java/com/adyen/model/payout/ModifyRequest.java +++ b/src/main/java/com/adyen/model/payout/ModifyRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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,12 +31,27 @@ public class ModifyRequest { 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_ORIGINAL_REFERENCE = "originalReference"; private String originalReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ModifyRequest() {} /** @@ -46,6 +63,7 @@ public ModifyRequest() {} */ public ModifyRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -79,6 +97,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -90,6 +109,7 @@ public void setAdditionalData(Map additionalData) { */ public ModifyRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -115,6 +135,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -126,6 +147,7 @@ public void setMerchantAccount(String merchantAccount) { */ public ModifyRequest originalReference(String originalReference) { this.originalReference = originalReference; + isSetOriginalReference = true; // mark as set return this; } @@ -151,6 +173,27 @@ public String getOriginalReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalReference(String originalReference) { this.originalReference = originalReference; + isSetOriginalReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ModifyRequest 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 ModifyRequest object is equal to o. */ @@ -194,6 +237,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 (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetOriginalReference) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_REFERENCE, this.originalReference); + } + + 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 ModifyRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/payout/ModifyResponse.java b/src/main/java/com/adyen/model/payout/ModifyResponse.java index efd08e102..aa3702e91 100644 --- a/src/main/java/com/adyen/model/payout/ModifyResponse.java +++ b/src/main/java/com/adyen/model/payout/ModifyResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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,12 +31,27 @@ public class ModifyResponse { 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; + public static final String JSON_PROPERTY_RESPONSE = "response"; private String 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 ModifyResponse() {} /** @@ -46,6 +63,7 @@ public ModifyResponse() {} */ public ModifyResponse additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -79,6 +97,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -91,6 +110,7 @@ public void setAdditionalData(Map additionalData) { */ public ModifyResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -118,6 +138,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -132,6 +153,7 @@ public void setPspReference(String pspReference) { */ public ModifyResponse response(String response) { this.response = response; + isSetResponse = true; // mark as set return this; } @@ -163,6 +185,27 @@ public String getResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResponse(String response) { this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ModifyResponse 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 ModifyResponse object is equal to o. */ @@ -206,6 +249,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 ModifyResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/payout/Name.java b/src/main/java/com/adyen/model/payout/Name.java index f323570df..b40036b2b 100644 --- a/src/main/java/com/adyen/model/payout/Name.java +++ b/src/main/java/com/adyen/model/payout/Name.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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. */ @@ -133,6 +171,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/payout/PayoutRequest.java b/src/main/java/com/adyen/model/payout/PayoutRequest.java index 87741f8be..5f8d3a4c0 100644 --- a/src/main/java/com/adyen/model/payout/PayoutRequest.java +++ b/src/main/java/com/adyen/model/payout/PayoutRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.payout; +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,34 +44,64 @@ public class PayoutRequest { 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_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_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_SOURCE = "fundSource"; private FundSource fundSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundSource = 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_RECURRING = "recurring"; private Recurring recurring; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurring = 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_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; + /** * 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 @@ -130,15 +162,33 @@ 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_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_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 PayoutRequest() {} /** @@ -149,6 +199,7 @@ public PayoutRequest() {} */ public PayoutRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -172,6 +223,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -182,6 +234,7 @@ public void setAmount(Amount amount) { */ public PayoutRequest billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -205,6 +258,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -215,6 +269,7 @@ public void setBillingAddress(Address billingAddress) { */ public PayoutRequest card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -238,6 +293,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -250,6 +306,7 @@ public void setCard(Card card) { */ public PayoutRequest fraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set return this; } @@ -277,6 +334,7 @@ public Integer getFraudOffset() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set } /** @@ -287,6 +345,7 @@ public void setFraudOffset(Integer fraudOffset) { */ public PayoutRequest fundSource(FundSource fundSource) { this.fundSource = fundSource; + isSetFundSource = true; // mark as set return this; } @@ -310,6 +369,7 @@ public FundSource getFundSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundSource(FundSource fundSource) { this.fundSource = fundSource; + isSetFundSource = true; // mark as set } /** @@ -321,6 +381,7 @@ public void setFundSource(FundSource fundSource) { */ public PayoutRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -346,6 +407,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -356,6 +418,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PayoutRequest recurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set return this; } @@ -379,6 +442,7 @@ public Recurring getRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set } /** @@ -395,6 +459,7 @@ public void setRecurring(Recurring recurring) { */ public PayoutRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -430,6 +495,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -443,6 +509,7 @@ public void setReference(String reference) { */ public PayoutRequest selectedRecurringDetailReference(String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set return this; } @@ -472,6 +539,7 @@ public String getSelectedRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelectedRecurringDetailReference(String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set } /** @@ -486,6 +554,7 @@ public void setSelectedRecurringDetailReference(String selectedRecurringDetailRe */ public PayoutRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -517,6 +586,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -548,6 +618,7 @@ public void setShopperEmail(String shopperEmail) { */ public PayoutRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -613,6 +684,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -623,6 +695,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public PayoutRequest shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -646,6 +719,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -662,6 +736,7 @@ public void setShopperName(Name shopperName) { */ public PayoutRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -697,6 +772,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -715,6 +791,7 @@ public void setShopperReference(String shopperReference) { */ public PayoutRequest telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -754,6 +831,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 PayoutRequest 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 PayoutRequest object is equal to o. */ @@ -836,6 +934,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetFraudOffset) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_OFFSET, this.fraudOffset); + } + if (isSetFundSource) { + addIfNull(nulls, JSON_PROPERTY_FUND_SOURCE, this.fundSource); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetRecurring) { + addIfNull(nulls, JSON_PROPERTY_RECURRING, this.recurring); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSelectedRecurringDetailReference) { + addIfNull( + nulls, + JSON_PROPERTY_SELECTED_RECURRING_DETAIL_REFERENCE, + this.selectedRecurringDetailReference); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperInteraction) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION, this.shopperInteraction); + } + if (isSetShopperName) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_NAME, this.shopperName); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + 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 PayoutRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/payout/PayoutResponse.java b/src/main/java/com/adyen/model/payout/PayoutResponse.java index 682ede14b..19279724c 100644 --- a/src/main/java/com/adyen/model/payout/PayoutResponse.java +++ b/src/main/java/com/adyen/model/payout/PayoutResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.payout; +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 PayoutResponse { 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 PayoutResponse() {} /** @@ -177,6 +218,7 @@ public PayoutResponse() {} */ public PayoutResponse 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 PayoutResponse 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 PayoutResponse 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 PayoutResponse 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 PayoutResponse 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 PayoutResponse 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 PayoutResponse 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 PayoutResponse 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 PayoutResponse 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 PayoutResponse 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 PayoutResponse 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 PayoutResponse 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 PayoutResponse object is equal to o. */ @@ -849,6 +932,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 PayoutResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/payout/Recurring.java b/src/main/java/com/adyen/model/payout/Recurring.java index 990345d93..4224bff97 100644 --- a/src/main/java/com/adyen/model/payout/Recurring.java +++ b/src/main/java/com/adyen/model/payout/Recurring.java @@ -11,7 +11,9 @@ package com.adyen.model.payout; +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. */ @@ -435,6 +488,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/payout/ResponseAdditionalData3DSecure.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalData3DSecure.java index ad9346eb0..18eec3945 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalData3DSecure.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalData3DSecure.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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. */ @@ -296,6 +349,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/payout/ResponseAdditionalDataBillingAddress.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataBillingAddress.java index 6dab239e9..ed0ec0dea 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataBillingAddress.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataBillingAddress.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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. */ @@ -342,6 +400,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/payout/ResponseAdditionalDataCard.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCard.java index 74ac88c78..1e5ee3697 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCard.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCard.java @@ -11,7 +11,9 @@ package com.adyen.model.payout; +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. */ @@ -576,6 +649,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/payout/ResponseAdditionalDataCommon.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCommon.java index 4e4b94550..1253032d9 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCommon.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCommon.java @@ -11,7 +11,9 @@ package com.adyen.model.payout; +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 Payout 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 Payout 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 Payout 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. */ @@ -3277,6 +3620,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/payout/ResponseAdditionalDataDomesticError.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataDomesticError.java index 048a526e7..9dabb429e 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataDomesticError.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataDomesticError.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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. */ @@ -159,6 +197,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/payout/ResponseAdditionalDataInstallments.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataInstallments.java index c9c7745c4..8227217e8 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataInstallments.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataInstallments.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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. */ @@ -707,6 +795,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/payout/ResponseAdditionalDataNetworkTokens.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataNetworkTokens.java index 57da253e6..f09f87939 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataNetworkTokens.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataNetworkTokens.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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. */ @@ -197,6 +240,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/payout/ResponseAdditionalDataOpi.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataOpi.java index 093cda90f..5c0f81a2b 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataOpi.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataOpi.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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. */ @@ -119,6 +152,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/payout/ResponseAdditionalDataSepa.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataSepa.java index 3c69b1166..ba337f74f 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataSepa.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataSepa.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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; @@ -21,6 +23,7 @@ @JsonPropertyOrder({ ResponseAdditionalDataSepa.JSON_PROPERTY_SEPADIRECTDEBIT_DATE_OF_SIGNATURE, ResponseAdditionalDataSepa.JSON_PROPERTY_SEPADIRECTDEBIT_MANDATE_ID, + ResponseAdditionalDataSepa.JSON_PROPERTY_SEPADIRECTDEBIT_SEPADIRECTDEBIT_DUE_DATE, ResponseAdditionalDataSepa.JSON_PROPERTY_SEPADIRECTDEBIT_SEQUENCE_TYPE }) public class ResponseAdditionalDataSepa { @@ -28,13 +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() {} /** @@ -46,6 +71,7 @@ public ResponseAdditionalDataSepa() {} public ResponseAdditionalDataSepa sepadirectdebitDateOfSignature( String sepadirectdebitDateOfSignature) { this.sepadirectdebitDateOfSignature = sepadirectdebitDateOfSignature; + isSetSepadirectdebitDateOfSignature = true; // mark as set return this; } @@ -69,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 } /** @@ -80,6 +107,7 @@ public void setSepadirectdebitDateOfSignature(String sepadirectdebitDateOfSignat */ public ResponseAdditionalDataSepa sepadirectdebitMandateId(String sepadirectdebitMandateId) { this.sepadirectdebitMandateId = sepadirectdebitMandateId; + isSetSepadirectdebitMandateId = true; // mark as set return this; } @@ -105,6 +133,47 @@ public String getSepadirectdebitMandateId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSepadirectdebitMandateId(String sepadirectdebitMandateId) { this.sepadirectdebitMandateId = sepadirectdebitMandateId; + isSetSepadirectdebitMandateId = true; // mark as set + } + + /** + * The date that the the shopper's bank account is charged. + * + * @param sepadirectdebitSepadirectdebitDueDate The date that the the shopper's bank account + * is charged. + * @return the current {@code ResponseAdditionalDataSepa} instance, allowing for method chaining + */ + public ResponseAdditionalDataSepa sepadirectdebitSepadirectdebitDueDate( + String sepadirectdebitSepadirectdebitDueDate) { + this.sepadirectdebitSepadirectdebitDueDate = sepadirectdebitSepadirectdebitDueDate; + isSetSepadirectdebitSepadirectdebitDueDate = true; // mark as set + return this; + } + + /** + * The date that the the shopper's bank account is charged. + * + * @return sepadirectdebitSepadirectdebitDueDate The date that the the shopper's bank account + * is charged. + */ + @JsonProperty(JSON_PROPERTY_SEPADIRECTDEBIT_SEPADIRECTDEBIT_DUE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSepadirectdebitSepadirectdebitDueDate() { + return sepadirectdebitSepadirectdebitDueDate; + } + + /** + * The date that the the shopper's bank account is charged. + * + * @param sepadirectdebitSepadirectdebitDueDate The date that the the shopper's bank account + * is charged. + */ + @JsonProperty(JSON_PROPERTY_SEPADIRECTDEBIT_SEPADIRECTDEBIT_DUE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSepadirectdebitSepadirectdebitDueDate( + String sepadirectdebitSepadirectdebitDueDate) { + this.sepadirectdebitSepadirectdebitDueDate = sepadirectdebitSepadirectdebitDueDate; + isSetSepadirectdebitSepadirectdebitDueDate = true; // mark as set } /** @@ -125,6 +194,7 @@ public void setSepadirectdebitMandateId(String sepadirectdebitMandateId) { public ResponseAdditionalDataSepa sepadirectdebitSequenceType( String sepadirectdebitSequenceType) { this.sepadirectdebitSequenceType = sepadirectdebitSequenceType; + isSetSepadirectdebitSequenceType = true; // mark as set return this; } @@ -166,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. */ @@ -183,6 +274,9 @@ public boolean equals(Object o) { responseAdditionalDataSepa.sepadirectdebitDateOfSignature) && Objects.equals( this.sepadirectdebitMandateId, responseAdditionalDataSepa.sepadirectdebitMandateId) + && Objects.equals( + this.sepadirectdebitSepadirectdebitDueDate, + responseAdditionalDataSepa.sepadirectdebitSepadirectdebitDueDate) && Objects.equals( this.sepadirectdebitSequenceType, responseAdditionalDataSepa.sepadirectdebitSequenceType); @@ -191,7 +285,10 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - sepadirectdebitDateOfSignature, sepadirectdebitMandateId, sepadirectdebitSequenceType); + sepadirectdebitDateOfSignature, + sepadirectdebitMandateId, + sepadirectdebitSepadirectdebitDueDate, + sepadirectdebitSequenceType); } @Override @@ -204,6 +301,9 @@ public String toString() { sb.append(" sepadirectdebitMandateId: ") .append(toIndentedString(sepadirectdebitMandateId)) .append("\n"); + sb.append(" sepadirectdebitSepadirectdebitDueDate: ") + .append(toIndentedString(sepadirectdebitSepadirectdebitDueDate)) + .append("\n"); sb.append(" sepadirectdebitSequenceType: ") .append(toIndentedString(sepadirectdebitSequenceType)) .append("\n"); @@ -221,6 +321,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/payout/ResponseAdditionalDataSwish.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataSwish.java index e09fa00ba..32bbb2f75 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataSwish.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataSwish.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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. */ @@ -95,6 +128,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/payout/ServiceError.java b/src/main/java/com/adyen/model/payout/ServiceError.java index 8568af83c..900b614e1 100644 --- a/src/main/java/com/adyen/model/payout/ServiceError.java +++ b/src/main/java/com/adyen/model/payout/ServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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. */ @@ -311,6 +369,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/payout/StoreDetailAndSubmitRequest.java b/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitRequest.java index dfb7bac9b..cda02a1a2 100644 --- a/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitRequest.java +++ b/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.payout; +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,21 +52,39 @@ public class StoreDetailAndSubmitRequest { 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_BANK = "bank"; private BankAccount bank; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBank = 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_DATE_OF_BIRTH = "dateOfBirth"; private LocalDate dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + /** The type of the entity the payout is processed for. */ public enum EntityTypeEnum { NATURALPERSON(String.valueOf("NaturalPerson")), @@ -109,42 +129,87 @@ 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_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = 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_RECURRING = "recurring"; private Recurring recurring; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurring = 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_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_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_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 StoreDetailAndSubmitRequest() {} /** @@ -156,6 +221,7 @@ public StoreDetailAndSubmitRequest() {} */ public StoreDetailAndSubmitRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -189,6 +255,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -199,6 +266,7 @@ public void setAdditionalData(Map additionalData) { */ public StoreDetailAndSubmitRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -222,6 +290,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -232,6 +301,7 @@ public void setAmount(Amount amount) { */ public StoreDetailAndSubmitRequest bank(BankAccount bank) { this.bank = bank; + isSetBank = true; // mark as set return this; } @@ -255,6 +325,7 @@ public BankAccount getBank() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBank(BankAccount bank) { this.bank = bank; + isSetBank = true; // mark as set } /** @@ -265,6 +336,7 @@ public void setBank(BankAccount bank) { */ public StoreDetailAndSubmitRequest billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -288,6 +360,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -298,6 +371,7 @@ public void setBillingAddress(Address billingAddress) { */ public StoreDetailAndSubmitRequest card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -321,6 +395,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -335,6 +410,7 @@ public void setCard(Card card) { */ public StoreDetailAndSubmitRequest dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -366,6 +442,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -376,6 +453,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public StoreDetailAndSubmitRequest entityType(EntityTypeEnum entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set return this; } @@ -399,6 +477,7 @@ public EntityTypeEnum getEntityType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityType(EntityTypeEnum entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set } /** @@ -411,6 +490,7 @@ public void setEntityType(EntityTypeEnum entityType) { */ public StoreDetailAndSubmitRequest fraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set return this; } @@ -438,6 +518,7 @@ public Integer getFraudOffset() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set } /** @@ -449,6 +530,7 @@ public void setFraudOffset(Integer fraudOffset) { */ public StoreDetailAndSubmitRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -474,6 +556,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -486,6 +569,7 @@ public void setMerchantAccount(String merchantAccount) { */ public StoreDetailAndSubmitRequest nationality(String nationality) { this.nationality = nationality; + isSetNationality = true; // mark as set return this; } @@ -513,6 +597,7 @@ public String getNationality() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNationality(String nationality) { this.nationality = nationality; + isSetNationality = true; // mark as set } /** @@ -523,6 +608,7 @@ public void setNationality(String nationality) { */ public StoreDetailAndSubmitRequest recurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set return this; } @@ -546,6 +632,7 @@ public Recurring getRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set } /** @@ -560,6 +647,7 @@ public void setRecurring(Recurring recurring) { */ public StoreDetailAndSubmitRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -591,6 +679,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -603,6 +692,7 @@ public void setReference(String reference) { */ public StoreDetailAndSubmitRequest selectedBrand(String selectedBrand) { this.selectedBrand = selectedBrand; + isSetSelectedBrand = true; // mark as set return this; } @@ -630,6 +720,7 @@ public String getSelectedBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelectedBrand(String selectedBrand) { this.selectedBrand = selectedBrand; + isSetSelectedBrand = true; // mark as set } /** @@ -640,6 +731,7 @@ public void setSelectedBrand(String selectedBrand) { */ public StoreDetailAndSubmitRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -663,6 +755,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -673,6 +766,7 @@ public void setShopperEmail(String shopperEmail) { */ public StoreDetailAndSubmitRequest shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -696,6 +790,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -706,6 +801,7 @@ public void setShopperName(Name shopperName) { */ public StoreDetailAndSubmitRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -729,6 +825,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -741,6 +838,7 @@ public void setShopperReference(String shopperReference) { */ public StoreDetailAndSubmitRequest shopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set return this; } @@ -768,6 +866,7 @@ public String getShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set } /** @@ -778,6 +877,7 @@ public void setShopperStatement(String shopperStatement) { */ public StoreDetailAndSubmitRequest socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -801,6 +901,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -811,6 +912,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public StoreDetailAndSubmitRequest telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -834,6 +936,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 StoreDetailAndSubmitRequest 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 StoreDetailAndSubmitRequest object is equal to o. */ @@ -931,6 +1054,84 @@ 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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBank) { + addIfNull(nulls, JSON_PROPERTY_BANK, this.bank); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetEntityType) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_TYPE, this.entityType); + } + if (isSetFraudOffset) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_OFFSET, this.fraudOffset); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetNationality) { + addIfNull(nulls, JSON_PROPERTY_NATIONALITY, this.nationality); + } + if (isSetRecurring) { + addIfNull(nulls, JSON_PROPERTY_RECURRING, this.recurring); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSelectedBrand) { + addIfNull(nulls, JSON_PROPERTY_SELECTED_BRAND, this.selectedBrand); + } + 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 (isSetShopperStatement) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_STATEMENT, this.shopperStatement); + } + if (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + 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 StoreDetailAndSubmitRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitResponse.java b/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitResponse.java index 930d3027d..4e2944f41 100644 --- a/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitResponse.java +++ b/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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,15 +32,33 @@ public class StoreDetailAndSubmitResponse { 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; + public static final String JSON_PROPERTY_REFUSAL_REASON = "refusalReason"; private String refusalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRefusalReason = false; + public static final String JSON_PROPERTY_RESULT_CODE = "resultCode"; private String 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 StoreDetailAndSubmitResponse() {} /** @@ -50,6 +70,7 @@ public StoreDetailAndSubmitResponse() {} */ public StoreDetailAndSubmitResponse additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -83,6 +104,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -93,6 +115,7 @@ public void setAdditionalData(Map additionalData) { */ public StoreDetailAndSubmitResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -116,6 +139,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -126,6 +150,7 @@ public void setPspReference(String pspReference) { */ public StoreDetailAndSubmitResponse refusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set return this; } @@ -149,6 +174,7 @@ public String getRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set } /** @@ -161,6 +187,7 @@ public void setRefusalReason(String refusalReason) { */ public StoreDetailAndSubmitResponse resultCode(String resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -188,6 +215,27 @@ public String getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(String resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoreDetailAndSubmitResponse 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 StoreDetailAndSubmitResponse object is equal to o. */ @@ -233,6 +281,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 (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + 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 StoreDetailAndSubmitResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/payout/StoreDetailRequest.java b/src/main/java/com/adyen/model/payout/StoreDetailRequest.java index 49902cce2..cb7fc6bd9 100644 --- a/src/main/java/com/adyen/model/payout/StoreDetailRequest.java +++ b/src/main/java/com/adyen/model/payout/StoreDetailRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.payout; +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; @@ -47,18 +49,33 @@ public class StoreDetailRequest { 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_BANK = "bank"; private BankAccount bank; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBank = 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_DATE_OF_BIRTH = "dateOfBirth"; private LocalDate dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + /** The type of the entity the payout is processed for. */ public enum EntityTypeEnum { NATURALPERSON(String.valueOf("NaturalPerson")), @@ -103,36 +120,75 @@ 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_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = 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_RECURRING = "recurring"; private Recurring recurring; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurring = 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_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_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_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 StoreDetailRequest() {} /** @@ -144,6 +200,7 @@ public StoreDetailRequest() {} */ public StoreDetailRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -177,6 +234,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -187,6 +245,7 @@ public void setAdditionalData(Map additionalData) { */ public StoreDetailRequest bank(BankAccount bank) { this.bank = bank; + isSetBank = true; // mark as set return this; } @@ -210,6 +269,7 @@ public BankAccount getBank() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBank(BankAccount bank) { this.bank = bank; + isSetBank = true; // mark as set } /** @@ -220,6 +280,7 @@ public void setBank(BankAccount bank) { */ public StoreDetailRequest billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -243,6 +304,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -253,6 +315,7 @@ public void setBillingAddress(Address billingAddress) { */ public StoreDetailRequest card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -276,6 +339,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -290,6 +354,7 @@ public void setCard(Card card) { */ public StoreDetailRequest dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -321,6 +386,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -331,6 +397,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public StoreDetailRequest entityType(EntityTypeEnum entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set return this; } @@ -354,6 +421,7 @@ public EntityTypeEnum getEntityType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityType(EntityTypeEnum entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set } /** @@ -366,6 +434,7 @@ public void setEntityType(EntityTypeEnum entityType) { */ public StoreDetailRequest fraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set return this; } @@ -393,6 +462,7 @@ public Integer getFraudOffset() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set } /** @@ -404,6 +474,7 @@ public void setFraudOffset(Integer fraudOffset) { */ public StoreDetailRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -429,6 +500,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -441,6 +513,7 @@ public void setMerchantAccount(String merchantAccount) { */ public StoreDetailRequest nationality(String nationality) { this.nationality = nationality; + isSetNationality = true; // mark as set return this; } @@ -468,6 +541,7 @@ public String getNationality() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNationality(String nationality) { this.nationality = nationality; + isSetNationality = true; // mark as set } /** @@ -478,6 +552,7 @@ public void setNationality(String nationality) { */ public StoreDetailRequest recurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set return this; } @@ -501,6 +576,7 @@ public Recurring getRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set } /** @@ -513,6 +589,7 @@ public void setRecurring(Recurring recurring) { */ public StoreDetailRequest selectedBrand(String selectedBrand) { this.selectedBrand = selectedBrand; + isSetSelectedBrand = true; // mark as set return this; } @@ -540,6 +617,7 @@ public String getSelectedBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelectedBrand(String selectedBrand) { this.selectedBrand = selectedBrand; + isSetSelectedBrand = true; // mark as set } /** @@ -550,6 +628,7 @@ public void setSelectedBrand(String selectedBrand) { */ public StoreDetailRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -573,6 +652,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -583,6 +663,7 @@ public void setShopperEmail(String shopperEmail) { */ public StoreDetailRequest shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -606,6 +687,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -616,6 +698,7 @@ public void setShopperName(Name shopperName) { */ public StoreDetailRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -639,6 +722,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -649,6 +733,7 @@ public void setShopperReference(String shopperReference) { */ public StoreDetailRequest socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -672,6 +757,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -682,6 +768,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public StoreDetailRequest telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -705,6 +792,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 StoreDetailRequest 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 StoreDetailRequest object is equal to o. */ @@ -792,6 +900,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 (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetBank) { + addIfNull(nulls, JSON_PROPERTY_BANK, this.bank); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetEntityType) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_TYPE, this.entityType); + } + if (isSetFraudOffset) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_OFFSET, this.fraudOffset); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetNationality) { + addIfNull(nulls, JSON_PROPERTY_NATIONALITY, this.nationality); + } + if (isSetRecurring) { + addIfNull(nulls, JSON_PROPERTY_RECURRING, this.recurring); + } + if (isSetSelectedBrand) { + addIfNull(nulls, JSON_PROPERTY_SELECTED_BRAND, this.selectedBrand); + } + 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 (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + 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 StoreDetailRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/payout/StoreDetailResponse.java b/src/main/java/com/adyen/model/payout/StoreDetailResponse.java index 613623c40..79ddaf3ec 100644 --- a/src/main/java/com/adyen/model/payout/StoreDetailResponse.java +++ b/src/main/java/com/adyen/model/payout/StoreDetailResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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,15 +32,33 @@ public class StoreDetailResponse { 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; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_RESULT_CODE = "resultCode"; private String 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 StoreDetailResponse() {} /** @@ -50,6 +70,7 @@ public StoreDetailResponse() {} */ public StoreDetailResponse additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -83,6 +104,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -93,6 +115,7 @@ public void setAdditionalData(Map additionalData) { */ public StoreDetailResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -116,6 +139,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -126,6 +150,7 @@ public void setPspReference(String pspReference) { */ public StoreDetailResponse recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -150,6 +175,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -162,6 +188,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public StoreDetailResponse resultCode(String resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -189,6 +216,27 @@ public String getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(String resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoreDetailResponse 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 StoreDetailResponse object is equal to o. */ @@ -237,6 +285,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 (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + 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 StoreDetailResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/payout/SubmitRequest.java b/src/main/java/com/adyen/model/payout/SubmitRequest.java index 1a16f7af9..bd27dcad3 100644 --- a/src/main/java/com/adyen/model/payout/SubmitRequest.java +++ b/src/main/java/com/adyen/model/payout/SubmitRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.payout; +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; @@ -46,12 +48,21 @@ public class SubmitRequest { 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_DATE_OF_BIRTH = "dateOfBirth"; private LocalDate dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + /** * The type of the entity the payout is processed for. Allowed values: * NaturalPerson * Company * > This field is required to update the existing `entityType` that is associated @@ -100,40 +111,82 @@ 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_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = 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_RECURRING = "recurring"; private Recurring recurring; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurring = 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_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_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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SubmitRequest() {} /** @@ -145,6 +198,7 @@ public SubmitRequest() {} */ public SubmitRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -178,6 +232,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -188,6 +243,7 @@ public void setAdditionalData(Map additionalData) { */ public SubmitRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -211,6 +267,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -227,6 +284,7 @@ public void setAmount(Amount amount) { */ public SubmitRequest dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -262,6 +320,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -276,6 +335,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public SubmitRequest entityType(EntityTypeEnum entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set return this; } @@ -307,6 +367,7 @@ public EntityTypeEnum getEntityType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityType(EntityTypeEnum entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set } /** @@ -319,6 +380,7 @@ public void setEntityType(EntityTypeEnum entityType) { */ public SubmitRequest fraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set return this; } @@ -346,6 +408,7 @@ public Integer getFraudOffset() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set } /** @@ -357,6 +420,7 @@ public void setFraudOffset(Integer fraudOffset) { */ public SubmitRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -382,6 +446,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -396,6 +461,7 @@ public void setMerchantAccount(String merchantAccount) { */ public SubmitRequest nationality(String nationality) { this.nationality = nationality; + isSetNationality = true; // mark as set return this; } @@ -427,6 +493,7 @@ public String getNationality() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNationality(String nationality) { this.nationality = nationality; + isSetNationality = true; // mark as set } /** @@ -437,6 +504,7 @@ public void setNationality(String nationality) { */ public SubmitRequest recurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set return this; } @@ -460,6 +528,7 @@ public Recurring getRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set } /** @@ -474,6 +543,7 @@ public void setRecurring(Recurring recurring) { */ public SubmitRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -505,6 +575,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -518,6 +589,7 @@ public void setReference(String reference) { */ public SubmitRequest selectedRecurringDetailReference(String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set return this; } @@ -547,6 +619,7 @@ public String getSelectedRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelectedRecurringDetailReference(String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set } /** @@ -557,6 +630,7 @@ public void setSelectedRecurringDetailReference(String selectedRecurringDetailRe */ public SubmitRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -580,6 +654,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -590,6 +665,7 @@ public void setShopperEmail(String shopperEmail) { */ public SubmitRequest shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -613,6 +689,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -623,6 +700,7 @@ public void setShopperName(Name shopperName) { */ public SubmitRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -646,6 +724,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -658,6 +737,7 @@ public void setShopperReference(String shopperReference) { */ public SubmitRequest shopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set return this; } @@ -685,6 +765,7 @@ public String getShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set } /** @@ -695,6 +776,7 @@ public void setShopperStatement(String shopperStatement) { */ public SubmitRequest socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -718,6 +800,27 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SubmitRequest 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 SubmitRequest object is equal to o. */ @@ -805,6 +908,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 (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetEntityType) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_TYPE, this.entityType); + } + if (isSetFraudOffset) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_OFFSET, this.fraudOffset); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetNationality) { + addIfNull(nulls, JSON_PROPERTY_NATIONALITY, this.nationality); + } + if (isSetRecurring) { + addIfNull(nulls, JSON_PROPERTY_RECURRING, this.recurring); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + 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 (isSetShopperStatement) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_STATEMENT, this.shopperStatement); + } + if (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + + 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 SubmitRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/payout/SubmitResponse.java b/src/main/java/com/adyen/model/payout/SubmitResponse.java index 5283e7e2a..77689283e 100644 --- a/src/main/java/com/adyen/model/payout/SubmitResponse.java +++ b/src/main/java/com/adyen/model/payout/SubmitResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.payout; +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,15 +32,33 @@ public class SubmitResponse { 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; + public static final String JSON_PROPERTY_REFUSAL_REASON = "refusalReason"; private String refusalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRefusalReason = false; + public static final String JSON_PROPERTY_RESULT_CODE = "resultCode"; private String 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 SubmitResponse() {} /** @@ -50,6 +70,7 @@ public SubmitResponse() {} */ public SubmitResponse additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -83,6 +104,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -93,6 +115,7 @@ public void setAdditionalData(Map additionalData) { */ public SubmitResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -116,6 +139,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -126,6 +150,7 @@ public void setPspReference(String pspReference) { */ public SubmitResponse refusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set return this; } @@ -149,6 +174,7 @@ public String getRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set } /** @@ -161,6 +187,7 @@ public void setRefusalReason(String refusalReason) { */ public SubmitResponse resultCode(String resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -189,6 +216,27 @@ public String getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(String resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SubmitResponse 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 SubmitResponse object is equal to o. */ @@ -234,6 +282,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 (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + 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 SubmitResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/posmobile/CreateSessionRequest.java b/src/main/java/com/adyen/model/posmobile/CreateSessionRequest.java index fbf8b1a21..d07caec6c 100644 --- a/src/main/java/com/adyen/model/posmobile/CreateSessionRequest.java +++ b/src/main/java/com/adyen/model/posmobile/CreateSessionRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.posmobile; +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 CreateSessionRequest { 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_SETUP_TOKEN = "setupToken"; private String setupToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSetupToken = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CreateSessionRequest() {} /** @@ -43,6 +60,7 @@ public CreateSessionRequest() {} */ public CreateSessionRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -85,6 +104,7 @@ public void setMerchantAccount(String merchantAccount) { */ public CreateSessionRequest setupToken(String setupToken) { this.setupToken = setupToken; + isSetSetupToken = true; // mark as set return this; } @@ -126,6 +146,7 @@ public String getSetupToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSetupToken(String setupToken) { this.setupToken = setupToken; + isSetSetupToken = true; // mark as set } /** @@ -136,6 +157,7 @@ public void setSetupToken(String setupToken) { */ public CreateSessionRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -159,6 +181,27 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CreateSessionRequest 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 CreateSessionRequest object is equal to o. */ @@ -202,6 +245,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 (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetSetupToken) { + addIfNull(nulls, JSON_PROPERTY_SETUP_TOKEN, this.setupToken); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + + 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 CreateSessionRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/posmobile/CreateSessionResponse.java b/src/main/java/com/adyen/model/posmobile/CreateSessionResponse.java index c1dadc10f..e5def87bd 100644 --- a/src/main/java/com/adyen/model/posmobile/CreateSessionResponse.java +++ b/src/main/java/com/adyen/model/posmobile/CreateSessionResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.posmobile; +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 CreateSessionResponse { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_INSTALLATION_ID = "installationId"; private String installationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallationId = 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_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CreateSessionResponse() {} /** @@ -51,6 +74,7 @@ public CreateSessionResponse() {} */ public CreateSessionResponse id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -74,6 +98,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -90,6 +115,7 @@ public void setId(String id) { */ public CreateSessionResponse installationId(String installationId) { this.installationId = installationId; + isSetInstallationId = true; // mark as set return this; } @@ -125,6 +151,7 @@ public String getInstallationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallationId(String installationId) { this.installationId = installationId; + isSetInstallationId = true; // mark as set } /** @@ -135,6 +162,7 @@ public void setInstallationId(String installationId) { */ public CreateSessionResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -158,6 +186,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -170,6 +199,7 @@ public void setMerchantAccount(String merchantAccount) { */ public CreateSessionResponse sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -197,6 +227,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -207,6 +238,7 @@ public void setSdkData(String sdkData) { */ public CreateSessionResponse store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -230,6 +262,27 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CreateSessionResponse 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 CreateSessionResponse object is equal to o. */ @@ -277,6 +330,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetInstallationId) { + addIfNull(nulls, JSON_PROPERTY_INSTALLATION_ID, this.installationId); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + + 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 CreateSessionResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/recurring/Address.java b/src/main/java/com/adyen/model/recurring/Address.java index ed451b229..3d228b2f6 100644 --- a/src/main/java/com/adyen/model/recurring/Address.java +++ b/src/main/java/com/adyen/model/recurring/Address.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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. */ @@ -325,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 (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/recurring/Amount.java b/src/main/java/com/adyen/model/recurring/Amount.java index 717372349..6ae745c9f 100644 --- a/src/main/java/com/adyen/model/recurring/Amount.java +++ b/src/main/java/com/adyen/model/recurring/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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. */ @@ -145,6 +189,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/recurring/BankAccount.java b/src/main/java/com/adyen/model/recurring/BankAccount.java index 78456adaf..e89e74b97 100644 --- a/src/main/java/com/adyen/model/recurring/BankAccount.java +++ b/src/main/java/com/adyen/model/recurring/BankAccount.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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. */ @@ -487,6 +560,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/recurring/Card.java b/src/main/java/com/adyen/model/recurring/Card.java index 6230d58d6..e66234c4f 100644 --- a/src/main/java/com/adyen/model/recurring/Card.java +++ b/src/main/java/com/adyen/model/recurring/Card.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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. */ @@ -431,6 +499,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/recurring/CreatePermitRequest.java b/src/main/java/com/adyen/model/recurring/CreatePermitRequest.java index f66a074ba..8e7c876ca 100644 --- a/src/main/java/com/adyen/model/recurring/CreatePermitRequest.java +++ b/src/main/java/com/adyen/model/recurring/CreatePermitRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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,15 +32,33 @@ public class CreatePermitRequest { 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_PERMITS = "permits"; private List permits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPermits = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = 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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CreatePermitRequest() {} /** @@ -50,6 +70,7 @@ public CreatePermitRequest() {} */ public CreatePermitRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -75,6 +96,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -85,6 +107,7 @@ public void setMerchantAccount(String merchantAccount) { */ public CreatePermitRequest permits(List permits) { this.permits = permits; + isSetPermits = true; // mark as set return this; } @@ -116,6 +139,7 @@ public List getPermits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPermits(List permits) { this.permits = permits; + isSetPermits = true; // mark as set } /** @@ -126,6 +150,7 @@ public void setPermits(List permits) { */ public CreatePermitRequest recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -149,6 +174,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -160,6 +186,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public CreatePermitRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -185,6 +212,27 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CreatePermitRequest 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 CreatePermitRequest object is equal to o. */ @@ -233,6 +281,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 (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPermits) { + addIfNull(nulls, JSON_PROPERTY_PERMITS, this.permits); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + + 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 CreatePermitRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/recurring/CreatePermitResult.java b/src/main/java/com/adyen/model/recurring/CreatePermitResult.java index 9f7bddc93..18c276667 100644 --- a/src/main/java/com/adyen/model/recurring/CreatePermitResult.java +++ b/src/main/java/com/adyen/model/recurring/CreatePermitResult.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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,9 +30,21 @@ public class CreatePermitResult { public static final String JSON_PROPERTY_PERMIT_RESULT_LIST = "permitResultList"; private List permitResultList; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPermitResultList = 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 CreatePermitResult() {} /** @@ -41,6 +55,7 @@ public CreatePermitResult() {} */ public CreatePermitResult permitResultList(List permitResultList) { this.permitResultList = permitResultList; + isSetPermitResultList = true; // mark as set return this; } @@ -72,6 +87,7 @@ public List getPermitResultList() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPermitResultList(List permitResultList) { this.permitResultList = permitResultList; + isSetPermitResultList = true; // mark as set } /** @@ -84,6 +100,7 @@ public void setPermitResultList(List permitResultList) { */ public CreatePermitResult pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -111,6 +128,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 CreatePermitResult 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 CreatePermitResult object is equal to o. */ @@ -152,6 +190,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 (isSetPermitResultList) { + addIfNull(nulls, JSON_PROPERTY_PERMIT_RESULT_LIST, this.permitResultList); + } + 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 CreatePermitResult given an JSON string * diff --git a/src/main/java/com/adyen/model/recurring/DisablePermitRequest.java b/src/main/java/com/adyen/model/recurring/DisablePermitRequest.java index 8e6830aa3..82ff0847f 100644 --- a/src/main/java/com/adyen/model/recurring/DisablePermitRequest.java +++ b/src/main/java/com/adyen/model/recurring/DisablePermitRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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 DisablePermitRequest { 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_TOKEN = "token"; private String token; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DisablePermitRequest() {} /** @@ -40,6 +54,7 @@ public DisablePermitRequest() {} */ public DisablePermitRequest 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 DisablePermitRequest token(String token) { this.token = token; + isSetToken = true; // mark as set return this; } @@ -98,6 +115,27 @@ public String getToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setToken(String token) { this.token = token; + isSetToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DisablePermitRequest 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 DisablePermitRequest object is equal to o. */ @@ -139,6 +177,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 (isSetToken) { + addIfNull(nulls, JSON_PROPERTY_TOKEN, this.token); + } + + 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 DisablePermitRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/recurring/DisablePermitResult.java b/src/main/java/com/adyen/model/recurring/DisablePermitResult.java index ed445bf9c..918a23302 100644 --- a/src/main/java/com/adyen/model/recurring/DisablePermitResult.java +++ b/src/main/java/com/adyen/model/recurring/DisablePermitResult.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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 DisablePermitResult { 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 String 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 DisablePermitResult() {} /** @@ -41,6 +55,7 @@ public DisablePermitResult() {} */ public DisablePermitResult pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -68,6 +83,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -78,6 +94,7 @@ public void setPspReference(String pspReference) { */ public DisablePermitResult status(String status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -101,6 +118,27 @@ public String getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(String status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DisablePermitResult 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 DisablePermitResult object is equal to o. */ @@ -142,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 (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 DisablePermitResult given an JSON string * diff --git a/src/main/java/com/adyen/model/recurring/DisableRequest.java b/src/main/java/com/adyen/model/recurring/DisableRequest.java index d7a11b774..db2c1ea83 100644 --- a/src/main/java/com/adyen/model/recurring/DisableRequest.java +++ b/src/main/java/com/adyen/model/recurring/DisableRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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 DisableRequest { public static final String JSON_PROPERTY_CONTRACT = "contract"; private String contract; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContract = 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_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = 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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DisableRequest() {} /** @@ -51,6 +71,7 @@ public DisableRequest() {} */ public DisableRequest contract(String contract) { this.contract = contract; + isSetContract = true; // mark as set return this; } @@ -82,6 +103,7 @@ public String getContract() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContract(String contract) { this.contract = contract; + isSetContract = true; // mark as set } /** @@ -93,6 +115,7 @@ public void setContract(String contract) { */ public DisableRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -118,6 +141,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -132,6 +156,7 @@ public void setMerchantAccount(String merchantAccount) { */ public DisableRequest recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -163,6 +188,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -176,6 +202,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public DisableRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -205,6 +232,27 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DisableRequest 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 DisableRequest object is equal to o. */ @@ -252,6 +300,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 (isSetContract) { + addIfNull(nulls, JSON_PROPERTY_CONTRACT, this.contract); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + + 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 DisableRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/recurring/DisableResult.java b/src/main/java/com/adyen/model/recurring/DisableResult.java index 6736e22c0..268401928 100644 --- a/src/main/java/com/adyen/model/recurring/DisableResult.java +++ b/src/main/java/com/adyen/model/recurring/DisableResult.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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 DisableResult { public static final String JSON_PROPERTY_RESPONSE = "response"; private String 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 DisableResult() {} /** @@ -35,6 +46,7 @@ public DisableResult() {} */ public DisableResult response(String response) { this.response = response; + isSetResponse = true; // mark as set return this; } @@ -62,6 +74,27 @@ public String getResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResponse(String response) { this.response = response; + isSetResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DisableResult 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 DisableResult object is equal to o. */ @@ -101,6 +134,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 (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 DisableResult given an JSON string * diff --git a/src/main/java/com/adyen/model/recurring/Name.java b/src/main/java/com/adyen/model/recurring/Name.java index 7d5173efc..7d6a6db40 100644 --- a/src/main/java/com/adyen/model/recurring/Name.java +++ b/src/main/java/com/adyen/model/recurring/Name.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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. */ @@ -133,6 +171,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/recurring/NotifyShopperRequest.java b/src/main/java/com/adyen/model/recurring/NotifyShopperRequest.java index f08569e1f..6692a3e65 100644 --- a/src/main/java/com/adyen/model/recurring/NotifyShopperRequest.java +++ b/src/main/java/com/adyen/model/recurring/NotifyShopperRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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 NotifyShopperRequest { 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_BILLING_DATE = "billingDate"; private String billingDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingDate = false; + public static final String JSON_PROPERTY_BILLING_SEQUENCE_NUMBER = "billingSequenceNumber"; private String billingSequenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingSequenceNumber = false; + public static final String JSON_PROPERTY_DISPLAYED_REFERENCE = "displayedReference"; private String displayedReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisplayedReference = 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_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = 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_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NotifyShopperRequest() {} /** @@ -67,6 +102,7 @@ public NotifyShopperRequest() {} */ public NotifyShopperRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -90,6 +126,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -101,6 +138,7 @@ public void setAmount(Amount amount) { */ public NotifyShopperRequest billingDate(String billingDate) { this.billingDate = billingDate; + isSetBillingDate = true; // mark as set return this; } @@ -126,6 +164,7 @@ public String getBillingDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingDate(String billingDate) { this.billingDate = billingDate; + isSetBillingDate = true; // mark as set } /** @@ -137,6 +176,7 @@ public void setBillingDate(String billingDate) { */ public NotifyShopperRequest billingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set return this; } @@ -162,6 +202,7 @@ public String getBillingSequenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set } /** @@ -174,6 +215,7 @@ public void setBillingSequenceNumber(String billingSequenceNumber) { */ public NotifyShopperRequest displayedReference(String displayedReference) { this.displayedReference = displayedReference; + isSetDisplayedReference = true; // mark as set return this; } @@ -201,6 +243,7 @@ public String getDisplayedReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDisplayedReference(String displayedReference) { this.displayedReference = displayedReference; + isSetDisplayedReference = true; // mark as set } /** @@ -212,6 +255,7 @@ public void setDisplayedReference(String displayedReference) { */ public NotifyShopperRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -237,6 +281,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -249,6 +294,7 @@ public void setMerchantAccount(String merchantAccount) { */ public NotifyShopperRequest recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -276,6 +322,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -287,6 +334,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public NotifyShopperRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -312,6 +360,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -325,6 +374,7 @@ public void setReference(String reference) { */ public NotifyShopperRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -354,6 +404,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -366,6 +417,7 @@ public void setShopperReference(String shopperReference) { */ public NotifyShopperRequest storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -393,6 +445,27 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NotifyShopperRequest 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 NotifyShopperRequest object is equal to o. */ @@ -464,6 +537,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 (isSetBillingDate) { + addIfNull(nulls, JSON_PROPERTY_BILLING_DATE, this.billingDate); + } + if (isSetBillingSequenceNumber) { + addIfNull(nulls, JSON_PROPERTY_BILLING_SEQUENCE_NUMBER, this.billingSequenceNumber); + } + if (isSetDisplayedReference) { + addIfNull(nulls, JSON_PROPERTY_DISPLAYED_REFERENCE, this.displayedReference); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + + 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 NotifyShopperRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/recurring/NotifyShopperResult.java b/src/main/java/com/adyen/model/recurring/NotifyShopperResult.java index e32d50467..f141cb44c 100644 --- a/src/main/java/com/adyen/model/recurring/NotifyShopperResult.java +++ b/src/main/java/com/adyen/model/recurring/NotifyShopperResult.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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; @@ -31,25 +33,52 @@ public class NotifyShopperResult { public static final String JSON_PROPERTY_DISPLAYED_REFERENCE = "displayedReference"; private String displayedReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisplayedReference = 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_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_RESULT_CODE = "resultCode"; private String resultCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResultCode = false; + public static final String JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE = "shopperNotificationReference"; private String shopperNotificationReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperNotificationReference = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NotifyShopperResult() {} /** @@ -60,6 +89,7 @@ public NotifyShopperResult() {} */ public NotifyShopperResult displayedReference(String displayedReference) { this.displayedReference = displayedReference; + isSetDisplayedReference = true; // mark as set return this; } @@ -83,6 +113,7 @@ public String getDisplayedReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDisplayedReference(String displayedReference) { this.displayedReference = displayedReference; + isSetDisplayedReference = true; // mark as set } /** @@ -93,6 +124,7 @@ public void setDisplayedReference(String displayedReference) { */ public NotifyShopperResult message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -116,6 +148,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -126,6 +159,7 @@ public void setMessage(String message) { */ public NotifyShopperResult pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -149,6 +183,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -159,6 +194,7 @@ public void setPspReference(String pspReference) { */ public NotifyShopperResult reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -182,6 +218,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -192,6 +229,7 @@ public void setReference(String reference) { */ public NotifyShopperResult resultCode(String resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -215,6 +253,7 @@ public String getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(String resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set } /** @@ -225,6 +264,7 @@ public void setResultCode(String resultCode) { */ public NotifyShopperResult shopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set return this; } @@ -248,6 +288,7 @@ public String getShopperNotificationReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set } /** @@ -259,6 +300,7 @@ public void setShopperNotificationReference(String shopperNotificationReference) */ public NotifyShopperResult storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -284,6 +326,27 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NotifyShopperResult 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 NotifyShopperResult object is equal to o. */ @@ -347,6 +410,49 @@ 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 (isSetDisplayedReference) { + addIfNull(nulls, JSON_PROPERTY_DISPLAYED_REFERENCE, this.displayedReference); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetResultCode) { + addIfNull(nulls, JSON_PROPERTY_RESULT_CODE, this.resultCode); + } + if (isSetShopperNotificationReference) { + addIfNull( + nulls, JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE, this.shopperNotificationReference); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + + 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 NotifyShopperResult given an JSON string * diff --git a/src/main/java/com/adyen/model/recurring/Permit.java b/src/main/java/com/adyen/model/recurring/Permit.java index b8eeed1f8..60b5e27f8 100644 --- a/src/main/java/com/adyen/model/recurring/Permit.java +++ b/src/main/java/com/adyen/model/recurring/Permit.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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,18 +32,39 @@ public class Permit { public static final String JSON_PROPERTY_PARTNER_ID = "partnerId"; private String partnerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPartnerId = false; + public static final String JSON_PROPERTY_PROFILE_REFERENCE = "profileReference"; private String profileReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProfileReference = false; + public static final String JSON_PROPERTY_RESTRICTION = "restriction"; private PermitRestriction restriction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRestriction = false; + public static final String JSON_PROPERTY_RESULT_KEY = "resultKey"; private String resultKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResultKey = false; + public static final String JSON_PROPERTY_VALID_TILL_DATE = "validTillDate"; private OffsetDateTime validTillDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValidTillDate = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Permit() {} /** @@ -52,6 +75,7 @@ public Permit() {} */ public Permit partnerId(String partnerId) { this.partnerId = partnerId; + isSetPartnerId = true; // mark as set return this; } @@ -75,6 +99,7 @@ public String getPartnerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPartnerId(String partnerId) { this.partnerId = partnerId; + isSetPartnerId = true; // mark as set } /** @@ -86,6 +111,7 @@ public void setPartnerId(String partnerId) { */ public Permit profileReference(String profileReference) { this.profileReference = profileReference; + isSetProfileReference = true; // mark as set return this; } @@ -111,6 +137,7 @@ public String getProfileReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProfileReference(String profileReference) { this.profileReference = profileReference; + isSetProfileReference = true; // mark as set } /** @@ -121,6 +148,7 @@ public void setProfileReference(String profileReference) { */ public Permit restriction(PermitRestriction restriction) { this.restriction = restriction; + isSetRestriction = true; // mark as set return this; } @@ -144,6 +172,7 @@ public PermitRestriction getRestriction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRestriction(PermitRestriction restriction) { this.restriction = restriction; + isSetRestriction = true; // mark as set } /** @@ -154,6 +183,7 @@ public void setRestriction(PermitRestriction restriction) { */ public Permit resultKey(String resultKey) { this.resultKey = resultKey; + isSetResultKey = true; // mark as set return this; } @@ -177,6 +207,7 @@ public String getResultKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultKey(String resultKey) { this.resultKey = resultKey; + isSetResultKey = true; // mark as set } /** @@ -187,6 +218,7 @@ public void setResultKey(String resultKey) { */ public Permit validTillDate(OffsetDateTime validTillDate) { this.validTillDate = validTillDate; + isSetValidTillDate = true; // mark as set return this; } @@ -210,6 +242,27 @@ public OffsetDateTime getValidTillDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValidTillDate(OffsetDateTime validTillDate) { this.validTillDate = validTillDate; + isSetValidTillDate = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Permit 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 Permit object is equal to o. */ @@ -257,6 +310,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 (isSetPartnerId) { + addIfNull(nulls, JSON_PROPERTY_PARTNER_ID, this.partnerId); + } + if (isSetProfileReference) { + addIfNull(nulls, JSON_PROPERTY_PROFILE_REFERENCE, this.profileReference); + } + if (isSetRestriction) { + addIfNull(nulls, JSON_PROPERTY_RESTRICTION, this.restriction); + } + if (isSetResultKey) { + addIfNull(nulls, JSON_PROPERTY_RESULT_KEY, this.resultKey); + } + if (isSetValidTillDate) { + addIfNull(nulls, JSON_PROPERTY_VALID_TILL_DATE, this.validTillDate); + } + + 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 Permit given an JSON string * diff --git a/src/main/java/com/adyen/model/recurring/PermitRestriction.java b/src/main/java/com/adyen/model/recurring/PermitRestriction.java index b12dad468..19cf2ed48 100644 --- a/src/main/java/com/adyen/model/recurring/PermitRestriction.java +++ b/src/main/java/com/adyen/model/recurring/PermitRestriction.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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 PermitRestriction { public static final String JSON_PROPERTY_MAX_AMOUNT = "maxAmount"; private Amount maxAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaxAmount = false; + public static final String JSON_PROPERTY_SINGLE_TRANSACTION_LIMIT = "singleTransactionLimit"; private Amount singleTransactionLimit; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSingleTransactionLimit = false; + public static final String JSON_PROPERTY_SINGLE_USE = "singleUse"; private Boolean singleUse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSingleUse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PermitRestriction() {} /** @@ -43,6 +60,7 @@ public PermitRestriction() {} */ public PermitRestriction maxAmount(Amount maxAmount) { this.maxAmount = maxAmount; + isSetMaxAmount = true; // mark as set return this; } @@ -66,6 +84,7 @@ public Amount getMaxAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaxAmount(Amount maxAmount) { this.maxAmount = maxAmount; + isSetMaxAmount = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setMaxAmount(Amount maxAmount) { */ public PermitRestriction singleTransactionLimit(Amount singleTransactionLimit) { this.singleTransactionLimit = singleTransactionLimit; + isSetSingleTransactionLimit = true; // mark as set return this; } @@ -99,6 +119,7 @@ public Amount getSingleTransactionLimit() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSingleTransactionLimit(Amount singleTransactionLimit) { this.singleTransactionLimit = singleTransactionLimit; + isSetSingleTransactionLimit = true; // mark as set } /** @@ -111,6 +132,7 @@ public void setSingleTransactionLimit(Amount singleTransactionLimit) { */ public PermitRestriction singleUse(Boolean singleUse) { this.singleUse = singleUse; + isSetSingleUse = true; // mark as set return this; } @@ -138,6 +160,27 @@ public Boolean getSingleUse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSingleUse(Boolean singleUse) { this.singleUse = singleUse; + isSetSingleUse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PermitRestriction 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 PermitRestriction object is equal to o. */ @@ -183,6 +226,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 (isSetMaxAmount) { + addIfNull(nulls, JSON_PROPERTY_MAX_AMOUNT, this.maxAmount); + } + if (isSetSingleTransactionLimit) { + addIfNull(nulls, JSON_PROPERTY_SINGLE_TRANSACTION_LIMIT, this.singleTransactionLimit); + } + if (isSetSingleUse) { + addIfNull(nulls, JSON_PROPERTY_SINGLE_USE, this.singleUse); + } + + 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 PermitRestriction given an JSON string * diff --git a/src/main/java/com/adyen/model/recurring/PermitResult.java b/src/main/java/com/adyen/model/recurring/PermitResult.java index 69b386e20..6ac3cb6cd 100644 --- a/src/main/java/com/adyen/model/recurring/PermitResult.java +++ b/src/main/java/com/adyen/model/recurring/PermitResult.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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 PermitResult { public static final String JSON_PROPERTY_RESULT_KEY = "resultKey"; private String resultKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResultKey = false; + public static final String JSON_PROPERTY_TOKEN = "token"; private String token; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PermitResult() {} /** @@ -36,6 +50,7 @@ public PermitResult() {} */ public PermitResult resultKey(String resultKey) { this.resultKey = resultKey; + isSetResultKey = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getResultKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultKey(String resultKey) { this.resultKey = resultKey; + isSetResultKey = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setResultKey(String resultKey) { */ public PermitResult token(String token) { this.token = token; + isSetToken = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setToken(String token) { this.token = token; + isSetToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PermitResult 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 PermitResult object is equal to o. */ @@ -133,6 +171,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 (isSetResultKey) { + addIfNull(nulls, JSON_PROPERTY_RESULT_KEY, this.resultKey); + } + if (isSetToken) { + addIfNull(nulls, JSON_PROPERTY_TOKEN, this.token); + } + + 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 PermitResult given an JSON string * diff --git a/src/main/java/com/adyen/model/recurring/Recurring.java b/src/main/java/com/adyen/model/recurring/Recurring.java index a1076952e..ddfcb9f2b 100644 --- a/src/main/java/com/adyen/model/recurring/Recurring.java +++ b/src/main/java/com/adyen/model/recurring/Recurring.java @@ -11,7 +11,9 @@ package com.adyen.model.recurring; +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. */ @@ -435,6 +488,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/recurring/RecurringDetail.java b/src/main/java/com/adyen/model/recurring/RecurringDetail.java index fa094d7a8..6bd768933 100644 --- a/src/main/java/com/adyen/model/recurring/RecurringDetail.java +++ b/src/main/java/com/adyen/model/recurring/RecurringDetail.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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,54 +48,111 @@ public class RecurringDetail { 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_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_BANK = "bank"; private BankAccount bank; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBank = 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_CONTRACT_TYPES = "contractTypes"; private List contractTypes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContractTypes = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_FIRST_PSP_REFERENCE = "firstPspReference"; private String firstPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirstPspReference = 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_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_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_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = 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_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_TOKEN_DETAILS = "tokenDetails"; private TokenDetails tokenDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenDetails = false; + public static final String JSON_PROPERTY_VARIANT = "variant"; private String variant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVariant = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RecurringDetail() {} /** @@ -107,6 +166,7 @@ public RecurringDetail() {} */ public RecurringDetail additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -144,6 +204,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -156,6 +217,7 @@ public void setAdditionalData(Map additionalData) { */ public RecurringDetail alias(String alias) { this.alias = alias; + isSetAlias = true; // mark as set return this; } @@ -183,6 +245,7 @@ public String getAlias() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAlias(String alias) { this.alias = alias; + isSetAlias = true; // mark as set } /** @@ -195,6 +258,7 @@ public void setAlias(String alias) { */ public RecurringDetail aliasType(String aliasType) { this.aliasType = aliasType; + isSetAliasType = true; // mark as set return this; } @@ -222,6 +286,7 @@ public String getAliasType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAliasType(String aliasType) { this.aliasType = aliasType; + isSetAliasType = true; // mark as set } /** @@ -232,6 +297,7 @@ public void setAliasType(String aliasType) { */ public RecurringDetail bank(BankAccount bank) { this.bank = bank; + isSetBank = true; // mark as set return this; } @@ -255,6 +321,7 @@ public BankAccount getBank() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBank(BankAccount bank) { this.bank = bank; + isSetBank = true; // mark as set } /** @@ -265,6 +332,7 @@ public void setBank(BankAccount bank) { */ public RecurringDetail billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -288,6 +356,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -298,6 +367,7 @@ public void setBillingAddress(Address billingAddress) { */ public RecurringDetail card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -321,6 +391,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -331,6 +402,7 @@ public void setCard(Card card) { */ public RecurringDetail contractTypes(List contractTypes) { this.contractTypes = contractTypes; + isSetContractTypes = true; // mark as set return this; } @@ -362,6 +434,7 @@ public List getContractTypes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContractTypes(List contractTypes) { this.contractTypes = contractTypes; + isSetContractTypes = true; // mark as set } /** @@ -372,6 +445,7 @@ public void setContractTypes(List contractTypes) { */ public RecurringDetail creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -395,6 +469,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -406,6 +481,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public RecurringDetail firstPspReference(String firstPspReference) { this.firstPspReference = firstPspReference; + isSetFirstPspReference = true; // mark as set return this; } @@ -431,6 +507,7 @@ public String getFirstPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstPspReference(String firstPspReference) { this.firstPspReference = firstPspReference; + isSetFirstPspReference = true; // mark as set } /** @@ -441,6 +518,7 @@ public void setFirstPspReference(String firstPspReference) { */ public RecurringDetail name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -464,6 +542,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -478,6 +557,7 @@ public void setName(String name) { */ public RecurringDetail networkTxReference(String networkTxReference) { this.networkTxReference = networkTxReference; + isSetNetworkTxReference = true; // mark as set return this; } @@ -509,6 +589,7 @@ public String getNetworkTxReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkTxReference(String networkTxReference) { this.networkTxReference = networkTxReference; + isSetNetworkTxReference = true; // mark as set } /** @@ -523,6 +604,7 @@ public void setNetworkTxReference(String networkTxReference) { */ public RecurringDetail paymentMethodVariant(String paymentMethodVariant) { this.paymentMethodVariant = paymentMethodVariant; + isSetPaymentMethodVariant = true; // mark as set return this; } @@ -554,6 +636,7 @@ public String getPaymentMethodVariant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodVariant(String paymentMethodVariant) { this.paymentMethodVariant = paymentMethodVariant; + isSetPaymentMethodVariant = true; // mark as set } /** @@ -564,6 +647,7 @@ public void setPaymentMethodVariant(String paymentMethodVariant) { */ public RecurringDetail recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -587,6 +671,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -597,6 +682,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public RecurringDetail shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -620,6 +706,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -631,6 +718,7 @@ public void setShopperName(Name shopperName) { */ public RecurringDetail socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -656,6 +744,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -666,6 +755,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public RecurringDetail tokenDetails(TokenDetails tokenDetails) { this.tokenDetails = tokenDetails; + isSetTokenDetails = true; // mark as set return this; } @@ -689,6 +779,7 @@ public TokenDetails getTokenDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenDetails(TokenDetails tokenDetails) { this.tokenDetails = tokenDetails; + isSetTokenDetails = true; // mark as set } /** @@ -701,6 +792,7 @@ public void setTokenDetails(TokenDetails tokenDetails) { */ public RecurringDetail variant(String variant) { this.variant = variant; + isSetVariant = true; // mark as set return this; } @@ -728,6 +820,27 @@ public String getVariant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVariant(String variant) { this.variant = variant; + isSetVariant = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RecurringDetail 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 RecurringDetail object is equal to o. */ @@ -822,6 +935,78 @@ 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 (isSetAlias) { + addIfNull(nulls, JSON_PROPERTY_ALIAS, this.alias); + } + if (isSetAliasType) { + addIfNull(nulls, JSON_PROPERTY_ALIAS_TYPE, this.aliasType); + } + if (isSetBank) { + addIfNull(nulls, JSON_PROPERTY_BANK, this.bank); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetContractTypes) { + addIfNull(nulls, JSON_PROPERTY_CONTRACT_TYPES, this.contractTypes); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetFirstPspReference) { + addIfNull(nulls, JSON_PROPERTY_FIRST_PSP_REFERENCE, this.firstPspReference); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetNetworkTxReference) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TX_REFERENCE, this.networkTxReference); + } + if (isSetPaymentMethodVariant) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_VARIANT, this.paymentMethodVariant); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetShopperName) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_NAME, this.shopperName); + } + if (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + if (isSetTokenDetails) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_DETAILS, this.tokenDetails); + } + if (isSetVariant) { + addIfNull(nulls, JSON_PROPERTY_VARIANT, this.variant); + } + + 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 RecurringDetail given an JSON string * diff --git a/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java b/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java index 9bd59e10e..eac1dd119 100644 --- a/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java +++ b/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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 RecurringDetailWrapper { public static final String JSON_PROPERTY_RECURRING_DETAIL = "RecurringDetail"; private RecurringDetail recurringDetail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetail = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RecurringDetailWrapper() {} /** @@ -33,6 +44,7 @@ public RecurringDetailWrapper() {} */ public RecurringDetailWrapper recurringDetail(RecurringDetail recurringDetail) { this.recurringDetail = recurringDetail; + isSetRecurringDetail = true; // mark as set return this; } @@ -56,6 +68,27 @@ public RecurringDetail getRecurringDetail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetail(RecurringDetail recurringDetail) { this.recurringDetail = recurringDetail; + isSetRecurringDetail = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RecurringDetailWrapper 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 RecurringDetailWrapper object is equal to o. */ @@ -95,6 +128,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 (isSetRecurringDetail) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL, this.recurringDetail); + } + + 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 RecurringDetailWrapper given an JSON string * diff --git a/src/main/java/com/adyen/model/recurring/RecurringDetailsRequest.java b/src/main/java/com/adyen/model/recurring/RecurringDetailsRequest.java index cc4748c33..21aab20e2 100644 --- a/src/main/java/com/adyen/model/recurring/RecurringDetailsRequest.java +++ b/src/main/java/com/adyen/model/recurring/RecurringDetailsRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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 RecurringDetailsRequest { 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_RECURRING = "recurring"; private Recurring recurring; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurring = 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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RecurringDetailsRequest() {} /** @@ -44,6 +61,7 @@ public RecurringDetailsRequest() {} */ public RecurringDetailsRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -69,6 +87,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -79,6 +98,7 @@ public void setMerchantAccount(String merchantAccount) { */ public RecurringDetailsRequest recurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set return this; } @@ -102,6 +122,7 @@ public Recurring getRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set } /** @@ -113,6 +134,7 @@ public void setRecurring(Recurring recurring) { */ public RecurringDetailsRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -138,6 +160,27 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RecurringDetailsRequest 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 RecurringDetailsRequest object is equal to o. */ @@ -181,6 +224,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 (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetRecurring) { + addIfNull(nulls, JSON_PROPERTY_RECURRING, this.recurring); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + + 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 RecurringDetailsRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java b/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java index cb9ba821c..c0d54a96d 100644 --- a/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java +++ b/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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; @@ -31,15 +33,33 @@ public class RecurringDetailsResult { public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_DETAILS = "details"; private List details; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetails = false; + public static final String JSON_PROPERTY_LAST_KNOWN_SHOPPER_EMAIL = "lastKnownShopperEmail"; private String lastKnownShopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastKnownShopperEmail = 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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RecurringDetailsResult() {} /** @@ -50,6 +70,7 @@ public RecurringDetailsResult() {} */ public RecurringDetailsResult creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -73,6 +94,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -83,6 +105,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public RecurringDetailsResult details(List details) { this.details = details; + isSetDetails = true; // mark as set return this; } @@ -114,6 +137,7 @@ public List getDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetails(List details) { this.details = details; + isSetDetails = true; // mark as set } /** @@ -124,6 +148,7 @@ public void setDetails(List details) { */ public RecurringDetailsResult lastKnownShopperEmail(String lastKnownShopperEmail) { this.lastKnownShopperEmail = lastKnownShopperEmail; + isSetLastKnownShopperEmail = true; // mark as set return this; } @@ -147,6 +172,7 @@ public String getLastKnownShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastKnownShopperEmail(String lastKnownShopperEmail) { this.lastKnownShopperEmail = lastKnownShopperEmail; + isSetLastKnownShopperEmail = true; // mark as set } /** @@ -158,6 +184,7 @@ public void setLastKnownShopperEmail(String lastKnownShopperEmail) { */ public RecurringDetailsResult shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -183,6 +210,27 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RecurringDetailsResult 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 RecurringDetailsResult object is equal to o. */ @@ -230,6 +278,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 (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetDetails) { + addIfNull(nulls, JSON_PROPERTY_DETAILS, this.details); + } + if (isSetLastKnownShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_LAST_KNOWN_SHOPPER_EMAIL, this.lastKnownShopperEmail); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + + 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 RecurringDetailsResult given an JSON string * diff --git a/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterRequest.java b/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterRequest.java index 2104dd2d1..60c49bc85 100644 --- a/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterRequest.java +++ b/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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,22 +34,46 @@ public class ScheduleAccountUpdaterRequest { 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_CARD = "card"; private Card card; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCard = 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_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = 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_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ScheduleAccountUpdaterRequest() {} /** @@ -60,6 +86,7 @@ public ScheduleAccountUpdaterRequest() {} */ public ScheduleAccountUpdaterRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -94,6 +121,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -105,6 +133,7 @@ public void setAdditionalData(Map additionalData) { */ public ScheduleAccountUpdaterRequest card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -128,6 +157,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -139,6 +169,7 @@ public void setCard(Card card) { */ public ScheduleAccountUpdaterRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -162,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 } /** @@ -173,6 +205,7 @@ public void setMerchantAccount(String merchantAccount) { */ public ScheduleAccountUpdaterRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -196,6 +229,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -209,6 +243,7 @@ public void setReference(String reference) { public ScheduleAccountUpdaterRequest selectedRecurringDetailReference( String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set return this; } @@ -234,6 +269,7 @@ public String getSelectedRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelectedRecurringDetailReference(String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set } /** @@ -247,6 +283,7 @@ public void setSelectedRecurringDetailReference(String selectedRecurringDetailRe */ public ScheduleAccountUpdaterRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -274,6 +311,27 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ScheduleAccountUpdaterRequest 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 ScheduleAccountUpdaterRequest object is equal to o. */ @@ -333,6 +391,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSelectedRecurringDetailReference) { + addIfNull( + nulls, + JSON_PROPERTY_SELECTED_RECURRING_DETAIL_REFERENCE, + this.selectedRecurringDetailReference); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + + 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 ScheduleAccountUpdaterRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterResult.java b/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterResult.java index 18f9911ef..ab2e00a40 100644 --- a/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterResult.java +++ b/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterResult.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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 ScheduleAccountUpdaterResult { 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_RESULT = "result"; private String result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResult = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ScheduleAccountUpdaterResult() {} /** @@ -41,6 +55,7 @@ public ScheduleAccountUpdaterResult() {} */ public ScheduleAccountUpdaterResult pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -68,6 +83,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -80,6 +96,7 @@ public void setPspReference(String pspReference) { */ public ScheduleAccountUpdaterResult result(String result) { this.result = result; + isSetResult = true; // mark as set return this; } @@ -107,6 +124,27 @@ public String getResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResult(String result) { this.result = result; + isSetResult = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ScheduleAccountUpdaterResult 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 ScheduleAccountUpdaterResult object is equal to o. */ @@ -148,6 +186,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 (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetResult) { + addIfNull(nulls, JSON_PROPERTY_RESULT, this.result); + } + + 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 ScheduleAccountUpdaterResult given an JSON string * diff --git a/src/main/java/com/adyen/model/recurring/ServiceError.java b/src/main/java/com/adyen/model/recurring/ServiceError.java index 2e2c3eef5..fbd1de6a9 100644 --- a/src/main/java/com/adyen/model/recurring/ServiceError.java +++ b/src/main/java/com/adyen/model/recurring/ServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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. */ @@ -311,6 +369,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/recurring/TokenDetails.java b/src/main/java/com/adyen/model/recurring/TokenDetails.java index da56a3e0b..17310dba0 100644 --- a/src/main/java/com/adyen/model/recurring/TokenDetails.java +++ b/src/main/java/com/adyen/model/recurring/TokenDetails.java @@ -11,6 +11,8 @@ package com.adyen.model.recurring; +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,9 +30,21 @@ public class TokenDetails { public static final String JSON_PROPERTY_TOKEN_DATA = "tokenData"; private Map tokenData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenData = 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 TokenDetails() {} /** @@ -41,6 +55,7 @@ public TokenDetails() {} */ public TokenDetails tokenData(Map tokenData) { this.tokenData = tokenData; + isSetTokenData = true; // mark as set return this; } @@ -72,6 +87,7 @@ public Map getTokenData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenData(Map tokenData) { this.tokenData = tokenData; + isSetTokenData = true; // mark as set } /** @@ -82,6 +98,7 @@ public void setTokenData(Map tokenData) { */ public TokenDetails tokenDataType(String tokenDataType) { this.tokenDataType = tokenDataType; + isSetTokenDataType = true; // mark as set return this; } @@ -105,6 +122,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 TokenDetails 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 TokenDetails object is equal to o. */ @@ -146,6 +184,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 (isSetTokenData) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_DATA, this.tokenData); + } + 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 TokenDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/reportwebhooks/BalancePlatformNotificationResponse.java b/src/main/java/com/adyen/model/reportwebhooks/BalancePlatformNotificationResponse.java index ab2375333..49169671e 100644 --- a/src/main/java/com/adyen/model/reportwebhooks/BalancePlatformNotificationResponse.java +++ b/src/main/java/com/adyen/model/reportwebhooks/BalancePlatformNotificationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.reportwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class BalancePlatformNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalancePlatformNotificationResponse() {} /** @@ -36,6 +47,7 @@ public BalancePlatformNotificationResponse() {} */ public BalancePlatformNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalancePlatformNotificationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalancePlatformNotificationResponse object is equal to o. */ @@ -106,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalancePlatformNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/reportwebhooks/ReportNotificationData.java b/src/main/java/com/adyen/model/reportwebhooks/ReportNotificationData.java index c3b1033a0..9ebbc41b1 100644 --- a/src/main/java/com/adyen/model/reportwebhooks/ReportNotificationData.java +++ b/src/main/java/com/adyen/model/reportwebhooks/ReportNotificationData.java @@ -11,6 +11,8 @@ package com.adyen.model.reportwebhooks; +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,27 +35,57 @@ public class ReportNotificationData { public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; private ResourceReference accountHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT = "balanceAccount"; private ResourceReference balanceAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccount = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_DOWNLOAD_URL = "downloadUrl"; private String downloadUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDownloadUrl = false; + public static final String JSON_PROPERTY_FILE_NAME = "fileName"; private String fileName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFileName = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REPORT_TYPE = "reportType"; private String reportType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReportType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ReportNotificationData() {} /** @@ -64,6 +96,7 @@ public ReportNotificationData() {} */ public ReportNotificationData accountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -87,6 +120,7 @@ public ResourceReference getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set } /** @@ -97,6 +131,7 @@ public void setAccountHolder(ResourceReference accountHolder) { */ public ReportNotificationData balanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set return this; } @@ -120,6 +155,7 @@ public ResourceReference getBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set } /** @@ -130,6 +166,7 @@ public void setBalanceAccount(ResourceReference balanceAccount) { */ public ReportNotificationData balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -153,6 +190,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -165,6 +203,7 @@ public void setBalancePlatform(String balancePlatform) { */ public ReportNotificationData creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -192,6 +231,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -206,6 +246,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public ReportNotificationData downloadUrl(String downloadUrl) { this.downloadUrl = downloadUrl; + isSetDownloadUrl = true; // mark as set return this; } @@ -237,6 +278,7 @@ public String getDownloadUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDownloadUrl(String downloadUrl) { this.downloadUrl = downloadUrl; + isSetDownloadUrl = true; // mark as set } /** @@ -247,6 +289,7 @@ public void setDownloadUrl(String downloadUrl) { */ public ReportNotificationData fileName(String fileName) { this.fileName = fileName; + isSetFileName = true; // mark as set return this; } @@ -270,6 +313,7 @@ public String getFileName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFileName(String fileName) { this.fileName = fileName; + isSetFileName = true; // mark as set } /** @@ -280,6 +324,7 @@ public void setFileName(String fileName) { */ public ReportNotificationData id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -303,6 +348,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -322,6 +368,7 @@ public void setId(String id) { */ public ReportNotificationData reportType(String reportType) { this.reportType = reportType; + isSetReportType = true; // mark as set return this; } @@ -363,6 +410,27 @@ public String getReportType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReportType(String reportType) { this.reportType = reportType; + isSetReportType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ReportNotificationData 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 ReportNotificationData object is equal to o. */ @@ -424,6 +492,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 (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetBalanceAccount) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT, this.balanceAccount); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetDownloadUrl) { + addIfNull(nulls, JSON_PROPERTY_DOWNLOAD_URL, this.downloadUrl); + } + if (isSetFileName) { + addIfNull(nulls, JSON_PROPERTY_FILE_NAME, this.fileName); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReportType) { + addIfNull(nulls, JSON_PROPERTY_REPORT_TYPE, this.reportType); + } + + 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 ReportNotificationData given an JSON string * diff --git a/src/main/java/com/adyen/model/reportwebhooks/ReportNotificationRequest.java b/src/main/java/com/adyen/model/reportwebhooks/ReportNotificationRequest.java index 048d5fc8c..ab35403d1 100644 --- a/src/main/java/com/adyen/model/reportwebhooks/ReportNotificationRequest.java +++ b/src/main/java/com/adyen/model/reportwebhooks/ReportNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.reportwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class ReportNotificationRequest { public static final String JSON_PROPERTY_DATA = "data"; private ReportNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + /** Type of webhook. */ public enum TypeEnum { BALANCEPLATFORM_REPORT_CREATED(String.valueOf("balancePlatform.report.created")); @@ -81,6 +92,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 ReportNotificationRequest() {} /** @@ -91,6 +111,7 @@ public ReportNotificationRequest() {} */ public ReportNotificationRequest data(ReportNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -114,6 +135,7 @@ public ReportNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(ReportNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -125,6 +147,7 @@ public void setData(ReportNotificationData data) { */ public ReportNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -150,6 +173,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -160,6 +184,7 @@ public void setEnvironment(String environment) { */ public ReportNotificationRequest timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set return this; } @@ -183,6 +208,7 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set } /** @@ -193,6 +219,7 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public ReportNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -216,6 +243,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 ReportNotificationRequest 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 ReportNotificationRequest object is equal to o. */ @@ -261,6 +309,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ReportNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/reportwebhooks/Resource.java b/src/main/java/com/adyen/model/reportwebhooks/Resource.java index 68ccb752a..2cc5ebbed 100644 --- a/src/main/java/com/adyen/model/reportwebhooks/Resource.java +++ b/src/main/java/com/adyen/model/reportwebhooks/Resource.java @@ -11,6 +11,8 @@ package com.adyen.model.reportwebhooks; +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,12 +30,27 @@ public class Resource { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Resource() {} /** @@ -44,6 +61,7 @@ public Resource() {} */ public Resource balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -67,6 +85,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -79,6 +98,7 @@ public void setBalancePlatform(String balancePlatform) { */ public Resource creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -106,6 +126,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -116,6 +137,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public Resource id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -139,6 +161,27 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Resource 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 Resource object is equal to o. */ @@ -182,6 +225,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 (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + + 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 Resource given an JSON string * diff --git a/src/main/java/com/adyen/model/reportwebhooks/ResourceReference.java b/src/main/java/com/adyen/model/reportwebhooks/ResourceReference.java index 23373433d..fe5fab2a2 100644 --- a/src/main/java/com/adyen/model/reportwebhooks/ResourceReference.java +++ b/src/main/java/com/adyen/model/reportwebhooks/ResourceReference.java @@ -11,6 +11,8 @@ package com.adyen.model.reportwebhooks; +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 ResourceReference { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResourceReference() {} /** @@ -43,6 +60,7 @@ public ResourceReference() {} */ public ResourceReference description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setDescription(String description) { */ public ResourceReference id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setId(String id) { */ public ResourceReference 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 ResourceReference includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResourceReference object is equal to o. */ @@ -175,6 +218,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResourceReference given an JSON string * diff --git a/src/main/java/com/adyen/model/sessionauthentication/AccountHolderResource.java b/src/main/java/com/adyen/model/sessionauthentication/AccountHolderResource.java index 091c6407b..71dd7ef9e 100644 --- a/src/main/java/com/adyen/model/sessionauthentication/AccountHolderResource.java +++ b/src/main/java/com/adyen/model/sessionauthentication/AccountHolderResource.java @@ -11,6 +11,8 @@ package com.adyen.model.sessionauthentication; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -36,6 +38,15 @@ public class AccountHolderResource extends Resource { public static final String JSON_PROPERTY_ACCOUNT_HOLDER_ID = "accountHolderId"; private String accountHolderId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountHolderResource() {} /** @@ -50,6 +61,7 @@ public AccountHolderResource() {} */ public AccountHolderResource accountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set return this; } @@ -81,6 +93,27 @@ public String getAccountHolderId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountHolderResource 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 AccountHolderResource object is equal to o. */ @@ -129,6 +162,30 @@ private String toIndentedString(Object o) { JSON.registerDiscriminator(AccountHolderResource.class, "type", mappings); } + /** 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 (isSetAccountHolderId) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_ID, this.accountHolderId); + } + + 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 AccountHolderResource given an JSON string * diff --git a/src/main/java/com/adyen/model/sessionauthentication/AuthenticationSessionRequest.java b/src/main/java/com/adyen/model/sessionauthentication/AuthenticationSessionRequest.java index f03dfab09..95058a811 100644 --- a/src/main/java/com/adyen/model/sessionauthentication/AuthenticationSessionRequest.java +++ b/src/main/java/com/adyen/model/sessionauthentication/AuthenticationSessionRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.sessionauthentication; +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 AuthenticationSessionRequest { public static final String JSON_PROPERTY_ALLOW_ORIGIN = "allowOrigin"; private String allowOrigin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowOrigin = false; + public static final String JSON_PROPERTY_POLICY = "policy"; private Policy policy; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPolicy = false; + public static final String JSON_PROPERTY_PRODUCT = "product"; private ProductType product; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProduct = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AuthenticationSessionRequest() {} /** @@ -46,6 +63,7 @@ public AuthenticationSessionRequest() {} */ public AuthenticationSessionRequest allowOrigin(String allowOrigin) { this.allowOrigin = allowOrigin; + isSetAllowOrigin = true; // mark as set return this; } @@ -75,6 +93,7 @@ public String getAllowOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowOrigin(String allowOrigin) { this.allowOrigin = allowOrigin; + isSetAllowOrigin = true; // mark as set } /** @@ -85,6 +104,7 @@ public void setAllowOrigin(String allowOrigin) { */ public AuthenticationSessionRequest policy(Policy policy) { this.policy = policy; + isSetPolicy = true; // mark as set return this; } @@ -108,6 +128,7 @@ public Policy getPolicy() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPolicy(Policy policy) { this.policy = policy; + isSetPolicy = true; // mark as set } /** @@ -118,6 +139,7 @@ public void setPolicy(Policy policy) { */ public AuthenticationSessionRequest product(ProductType product) { this.product = product; + isSetProduct = true; // mark as set return this; } @@ -141,6 +163,27 @@ public ProductType getProduct() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProduct(ProductType product) { this.product = product; + isSetProduct = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AuthenticationSessionRequest 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 AuthenticationSessionRequest object is equal to o. */ @@ -184,6 +227,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 (isSetAllowOrigin) { + addIfNull(nulls, JSON_PROPERTY_ALLOW_ORIGIN, this.allowOrigin); + } + if (isSetPolicy) { + addIfNull(nulls, JSON_PROPERTY_POLICY, this.policy); + } + if (isSetProduct) { + addIfNull(nulls, JSON_PROPERTY_PRODUCT, this.product); + } + + 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 AuthenticationSessionRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/sessionauthentication/AuthenticationSessionResponse.java b/src/main/java/com/adyen/model/sessionauthentication/AuthenticationSessionResponse.java index e014962cc..059c07224 100644 --- a/src/main/java/com/adyen/model/sessionauthentication/AuthenticationSessionResponse.java +++ b/src/main/java/com/adyen/model/sessionauthentication/AuthenticationSessionResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.sessionauthentication; +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 AuthenticationSessionResponse { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_TOKEN = "token"; private String token; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AuthenticationSessionResponse() {} /** @@ -40,6 +54,7 @@ public AuthenticationSessionResponse() {} */ public AuthenticationSessionResponse id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -63,6 +78,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setId(String id) { */ public AuthenticationSessionResponse token(String token) { this.token = token; + isSetToken = true; // mark as set return this; } @@ -97,6 +114,27 @@ public String getToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setToken(String token) { this.token = token; + isSetToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AuthenticationSessionResponse 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 AuthenticationSessionResponse object is equal to o. */ @@ -138,6 +176,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetToken) { + addIfNull(nulls, JSON_PROPERTY_TOKEN, this.token); + } + + 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 AuthenticationSessionResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/sessionauthentication/BalanceAccountResource.java b/src/main/java/com/adyen/model/sessionauthentication/BalanceAccountResource.java index 6f38c2ea2..dea99d650 100644 --- a/src/main/java/com/adyen/model/sessionauthentication/BalanceAccountResource.java +++ b/src/main/java/com/adyen/model/sessionauthentication/BalanceAccountResource.java @@ -11,6 +11,8 @@ package com.adyen.model.sessionauthentication; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -36,6 +38,15 @@ public class BalanceAccountResource extends Resource { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceAccountResource() {} /** @@ -46,6 +57,7 @@ public BalanceAccountResource() {} */ public BalanceAccountResource balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -69,6 +81,27 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceAccountResource 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 BalanceAccountResource object is equal to o. */ @@ -117,6 +150,30 @@ private String toIndentedString(Object o) { JSON.registerDiscriminator(BalanceAccountResource.class, "type", mappings); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + + 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 BalanceAccountResource given an JSON string * diff --git a/src/main/java/com/adyen/model/sessionauthentication/DefaultErrorResponseEntity.java b/src/main/java/com/adyen/model/sessionauthentication/DefaultErrorResponseEntity.java index 322bd0309..2be59145f 100644 --- a/src/main/java/com/adyen/model/sessionauthentication/DefaultErrorResponseEntity.java +++ b/src/main/java/com/adyen/model/sessionauthentication/DefaultErrorResponseEntity.java @@ -11,6 +11,8 @@ package com.adyen.model.sessionauthentication; +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,27 +36,57 @@ public class DefaultErrorResponseEntity { public static final String JSON_PROPERTY_DETAIL = "detail"; private String detail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetail = 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_INSTANCE = "instance"; private String instance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstance = false; + public static final String JSON_PROPERTY_INVALID_FIELDS = "invalidFields"; private List invalidFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInvalidFields = false; + public static final String JSON_PROPERTY_REQUEST_ID = "requestId"; private String requestId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestId = false; + public static final String JSON_PROPERTY_STATUS = "status"; private Integer status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TITLE = "title"; private String title; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTitle = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 DefaultErrorResponseEntity() {} /** @@ -65,6 +97,7 @@ public DefaultErrorResponseEntity() {} */ public DefaultErrorResponseEntity detail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set return this; } @@ -88,6 +121,7 @@ public String getDetail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set } /** @@ -98,6 +132,7 @@ public void setDetail(String detail) { */ public DefaultErrorResponseEntity errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -121,6 +156,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -131,6 +167,7 @@ public void setErrorCode(String errorCode) { */ public DefaultErrorResponseEntity instance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set return this; } @@ -154,6 +191,7 @@ public String getInstance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set } /** @@ -164,6 +202,7 @@ public void setInstance(String instance) { */ public DefaultErrorResponseEntity invalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set return this; } @@ -195,6 +234,7 @@ public List getInvalidFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInvalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set } /** @@ -205,6 +245,7 @@ public void setInvalidFields(List invalidFields) { */ public DefaultErrorResponseEntity requestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set return this; } @@ -228,6 +269,7 @@ public String getRequestId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set } /** @@ -238,6 +280,7 @@ public void setRequestId(String requestId) { */ public DefaultErrorResponseEntity status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -261,6 +304,7 @@ public Integer getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(Integer status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -271,6 +315,7 @@ public void setStatus(Integer status) { */ public DefaultErrorResponseEntity title(String title) { this.title = title; + isSetTitle = true; // mark as set return this; } @@ -294,6 +339,7 @@ public String getTitle() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTitle(String title) { this.title = title; + isSetTitle = true; // mark as set } /** @@ -306,6 +352,7 @@ public void setTitle(String title) { */ public DefaultErrorResponseEntity type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -333,6 +380,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DefaultErrorResponseEntity 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 DefaultErrorResponseEntity object is equal to o. */ @@ -386,6 +454,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 (isSetDetail) { + addIfNull(nulls, JSON_PROPERTY_DETAIL, this.detail); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetInstance) { + addIfNull(nulls, JSON_PROPERTY_INSTANCE, this.instance); + } + if (isSetInvalidFields) { + addIfNull(nulls, JSON_PROPERTY_INVALID_FIELDS, this.invalidFields); + } + if (isSetRequestId) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_ID, this.requestId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTitle) { + addIfNull(nulls, JSON_PROPERTY_TITLE, this.title); + } + 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 DefaultErrorResponseEntity given an JSON string * diff --git a/src/main/java/com/adyen/model/sessionauthentication/InvalidField.java b/src/main/java/com/adyen/model/sessionauthentication/InvalidField.java index 363199846..dd1555196 100644 --- a/src/main/java/com/adyen/model/sessionauthentication/InvalidField.java +++ b/src/main/java/com/adyen/model/sessionauthentication/InvalidField.java @@ -11,6 +11,8 @@ package com.adyen.model.sessionauthentication; +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 InvalidField { 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_VALUE = "value"; private String value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public InvalidField() {} /** @@ -43,6 +60,7 @@ public InvalidField() {} */ public InvalidField name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setName(String name) { */ public InvalidField value(String value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(String value) { this.value = value; + isSetValue = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setValue(String value) { */ public InvalidField message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InvalidField 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 InvalidField object is equal to o. */ @@ -175,6 +218,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 (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + + 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 InvalidField given an JSON string * diff --git a/src/main/java/com/adyen/model/sessionauthentication/LegalEntityResource.java b/src/main/java/com/adyen/model/sessionauthentication/LegalEntityResource.java index 9ba2208fb..6d6a3a6a3 100644 --- a/src/main/java/com/adyen/model/sessionauthentication/LegalEntityResource.java +++ b/src/main/java/com/adyen/model/sessionauthentication/LegalEntityResource.java @@ -11,6 +11,8 @@ package com.adyen.model.sessionauthentication; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -36,6 +38,15 @@ public class LegalEntityResource extends Resource { public static final String JSON_PROPERTY_LEGAL_ENTITY_ID = "legalEntityId"; private String legalEntityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalEntityId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public LegalEntityResource() {} /** @@ -55,6 +66,7 @@ public LegalEntityResource() {} */ public LegalEntityResource legalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set return this; } @@ -96,6 +108,27 @@ public String getLegalEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LegalEntityResource 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 LegalEntityResource object is equal to o. */ @@ -143,6 +176,30 @@ private String toIndentedString(Object o) { JSON.registerDiscriminator(LegalEntityResource.class, "type", mappings); } + /** 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 (isSetLegalEntityId) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_ENTITY_ID, this.legalEntityId); + } + + 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 LegalEntityResource given an JSON string * diff --git a/src/main/java/com/adyen/model/sessionauthentication/MerchantAccountResource.java b/src/main/java/com/adyen/model/sessionauthentication/MerchantAccountResource.java index 9d9788a9d..cb6a6328e 100644 --- a/src/main/java/com/adyen/model/sessionauthentication/MerchantAccountResource.java +++ b/src/main/java/com/adyen/model/sessionauthentication/MerchantAccountResource.java @@ -11,6 +11,8 @@ package com.adyen.model.sessionauthentication; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -36,6 +38,15 @@ public class MerchantAccountResource extends Resource { public static final String JSON_PROPERTY_MERCHANT_ACCOUNT_CODE = "merchantAccountCode"; private String merchantAccountCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccountCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantAccountResource() {} /** @@ -46,6 +57,7 @@ public MerchantAccountResource() {} */ public MerchantAccountResource merchantAccountCode(String merchantAccountCode) { this.merchantAccountCode = merchantAccountCode; + isSetMerchantAccountCode = true; // mark as set return this; } @@ -69,6 +81,27 @@ public String getMerchantAccountCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccountCode(String merchantAccountCode) { this.merchantAccountCode = merchantAccountCode; + isSetMerchantAccountCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantAccountResource 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 MerchantAccountResource object is equal to o. */ @@ -119,6 +152,30 @@ private String toIndentedString(Object o) { JSON.registerDiscriminator(MerchantAccountResource.class, "type", mappings); } + /** 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 (isSetMerchantAccountCode) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT_CODE, this.merchantAccountCode); + } + + 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 MerchantAccountResource given an JSON string * diff --git a/src/main/java/com/adyen/model/sessionauthentication/PaymentInstrumentResource.java b/src/main/java/com/adyen/model/sessionauthentication/PaymentInstrumentResource.java index d6bfe35a7..8416c3a95 100644 --- a/src/main/java/com/adyen/model/sessionauthentication/PaymentInstrumentResource.java +++ b/src/main/java/com/adyen/model/sessionauthentication/PaymentInstrumentResource.java @@ -11,6 +11,8 @@ package com.adyen.model.sessionauthentication; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -36,6 +38,15 @@ public class PaymentInstrumentResource extends Resource { public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrumentResource() {} /** @@ -46,6 +57,7 @@ public PaymentInstrumentResource() {} */ public PaymentInstrumentResource paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -69,6 +81,27 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrumentResource 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 PaymentInstrumentResource object is equal to o. */ @@ -119,6 +152,30 @@ private String toIndentedString(Object o) { JSON.registerDiscriminator(PaymentInstrumentResource.class, "type", mappings); } + /** 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 (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + + 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 PaymentInstrumentResource given an JSON string * diff --git a/src/main/java/com/adyen/model/sessionauthentication/Policy.java b/src/main/java/com/adyen/model/sessionauthentication/Policy.java index 819ad6f7a..966fca763 100644 --- a/src/main/java/com/adyen/model/sessionauthentication/Policy.java +++ b/src/main/java/com/adyen/model/sessionauthentication/Policy.java @@ -11,6 +11,8 @@ package com.adyen.model.sessionauthentication; +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 Policy { public static final String JSON_PROPERTY_RESOURCES = "resources"; private Set resources; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResources = false; + public static final String JSON_PROPERTY_ROLES = "roles"; private Set roles; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRoles = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Policy() {} /** @@ -51,6 +65,7 @@ public Policy() {} */ public Policy resources(Set resources) { this.resources = resources; + isSetResources = true; // mark as set return this; } @@ -107,6 +122,7 @@ public Set getResources() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResources(Set resources) { this.resources = resources; + isSetResources = true; // mark as set } /** @@ -117,6 +133,7 @@ public void setResources(Set resources) { */ public Policy roles(Set roles) { this.roles = roles; + isSetRoles = true; // mark as set return this; } @@ -149,6 +166,27 @@ public Set getRoles() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRoles(Set roles) { this.roles = roles; + isSetRoles = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Policy 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 Policy object is equal to o. */ @@ -190,6 +228,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 (isSetResources) { + addIfNull(nulls, JSON_PROPERTY_RESOURCES, this.resources); + } + if (isSetRoles) { + addIfNull(nulls, JSON_PROPERTY_ROLES, this.roles); + } + + 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 Policy given an JSON string * diff --git a/src/main/java/com/adyen/model/sessionauthentication/Resource.java b/src/main/java/com/adyen/model/sessionauthentication/Resource.java index 37196efc7..26e3c780d 100644 --- a/src/main/java/com/adyen/model/sessionauthentication/Resource.java +++ b/src/main/java/com/adyen/model/sessionauthentication/Resource.java @@ -11,6 +11,8 @@ package com.adyen.model.sessionauthentication; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -44,6 +46,15 @@ public class Resource { public static final String JSON_PROPERTY_TYPE = "type"; private ResourceType 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 Resource() {} /** @@ -54,6 +65,7 @@ public Resource() {} */ public Resource type(ResourceType type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -77,6 +89,27 @@ public ResourceType getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(ResourceType type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Resource 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 Resource object is equal to o. */ @@ -128,6 +161,30 @@ private String toIndentedString(Object o) { JSON.registerDiscriminator(Resource.class, "type", mappings); } + /** 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 Resource given an JSON string * diff --git a/src/main/java/com/adyen/model/storedvalue/Amount.java b/src/main/java/com/adyen/model/storedvalue/Amount.java index d3c6bc931..3764fc4f7 100644 --- a/src/main/java/com/adyen/model/storedvalue/Amount.java +++ b/src/main/java/com/adyen/model/storedvalue/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.storedvalue; +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. */ @@ -145,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 (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/storedvalue/ServiceError.java b/src/main/java/com/adyen/model/storedvalue/ServiceError.java index 3b3b51dbf..4b372d26d 100644 --- a/src/main/java/com/adyen/model/storedvalue/ServiceError.java +++ b/src/main/java/com/adyen/model/storedvalue/ServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.storedvalue; +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. */ @@ -311,6 +369,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/storedvalue/StoredValueBalanceCheckRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckRequest.java index 622733c3a..4e552afbc 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.storedvalue; +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,18 +40,33 @@ public class StoredValueBalanceCheckRequest { 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_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private Map paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = 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 @@ -110,12 +127,27 @@ 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_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StoredValueBalanceCheckRequest() {} /** @@ -127,6 +159,7 @@ public StoredValueBalanceCheckRequest() {} */ public StoredValueBalanceCheckRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -150,6 +183,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -162,6 +196,7 @@ public void setAmount(Amount amount) { */ public StoredValueBalanceCheckRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -187,6 +222,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -200,6 +236,7 @@ public void setMerchantAccount(String merchantAccount) { */ public StoredValueBalanceCheckRequest paymentMethod(Map paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -235,6 +272,7 @@ public Map getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(Map paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -246,6 +284,7 @@ public void setPaymentMethod(Map paymentMethod) { */ public StoredValueBalanceCheckRequest recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -269,6 +308,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -286,6 +326,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public StoredValueBalanceCheckRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -321,6 +362,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -354,6 +396,7 @@ public void setReference(String reference) { public StoredValueBalanceCheckRequest shopperInteraction( ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -419,6 +462,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -430,6 +474,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public StoredValueBalanceCheckRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -453,6 +498,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -464,6 +510,7 @@ public void setShopperReference(String shopperReference) { */ public StoredValueBalanceCheckRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -487,6 +534,27 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredValueBalanceCheckRequest 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 StoredValueBalanceCheckRequest object is equal to o. */ @@ -553,6 +621,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetShopperInteraction) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION, this.shopperInteraction); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + + 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 StoredValueBalanceCheckRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckResponse.java index 3a4ce284b..09f07ab8c 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.storedvalue; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class StoredValueBalanceCheckResponse { public static final String JSON_PROPERTY_CURRENT_BALANCE = "currentBalance"; private Amount currentBalance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrentBalance = 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. Possible values: * **Success** – The operation has been completed * successfully. * **Refused** – The operation was refused. The reason is given in the @@ -94,9 +105,21 @@ 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; + public static final String JSON_PROPERTY_THIRD_PARTY_REFUSAL_REASON = "thirdPartyRefusalReason"; private String thirdPartyRefusalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThirdPartyRefusalReason = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StoredValueBalanceCheckResponse() {} /** @@ -108,6 +131,7 @@ public StoredValueBalanceCheckResponse() {} */ public StoredValueBalanceCheckResponse currentBalance(Amount currentBalance) { this.currentBalance = currentBalance; + isSetCurrentBalance = true; // mark as set return this; } @@ -131,6 +155,7 @@ public Amount getCurrentBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrentBalance(Amount currentBalance) { this.currentBalance = currentBalance; + isSetCurrentBalance = true; // mark as set } /** @@ -145,6 +170,7 @@ public void setCurrentBalance(Amount currentBalance) { */ public StoredValueBalanceCheckResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -174,6 +200,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -190,6 +217,7 @@ public void setPspReference(String pspReference) { */ public StoredValueBalanceCheckResponse refusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set return this; } @@ -223,6 +251,7 @@ public String getRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set } /** @@ -244,6 +273,7 @@ public void setRefusalReason(String refusalReason) { */ public StoredValueBalanceCheckResponse resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -287,6 +317,7 @@ public ResultCodeEnum getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set } /** @@ -299,6 +330,7 @@ public void setResultCode(ResultCodeEnum resultCode) { */ public StoredValueBalanceCheckResponse thirdPartyRefusalReason(String thirdPartyRefusalReason) { this.thirdPartyRefusalReason = thirdPartyRefusalReason; + isSetThirdPartyRefusalReason = true; // mark as set return this; } @@ -324,6 +356,27 @@ public String getThirdPartyRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThirdPartyRefusalReason(String thirdPartyRefusalReason) { this.thirdPartyRefusalReason = thirdPartyRefusalReason; + isSetThirdPartyRefusalReason = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredValueBalanceCheckResponse 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 StoredValueBalanceCheckResponse object is equal to o. */ @@ -376,6 +429,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 (isSetCurrentBalance) { + addIfNull(nulls, JSON_PROPERTY_CURRENT_BALANCE, this.currentBalance); + } + 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); + } + if (isSetThirdPartyRefusalReason) { + addIfNull(nulls, JSON_PROPERTY_THIRD_PARTY_REFUSAL_REASON, this.thirdPartyRefusalReason); + } + + 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 StoredValueBalanceCheckResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeRequest.java index 331ff837a..e5dfc7177 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.storedvalue; +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; @@ -39,18 +41,33 @@ public class StoredValueBalanceMergeRequest { 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_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private Map paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = 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 @@ -111,15 +128,33 @@ 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_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_SOURCE_PAYMENT_METHOD = "sourcePaymentMethod"; private Map sourcePaymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSourcePaymentMethod = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StoredValueBalanceMergeRequest() {} /** @@ -131,6 +166,7 @@ public StoredValueBalanceMergeRequest() {} */ public StoredValueBalanceMergeRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -154,6 +190,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -166,6 +203,7 @@ public void setAmount(Amount amount) { */ public StoredValueBalanceMergeRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -191,6 +229,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -204,6 +243,7 @@ public void setMerchantAccount(String merchantAccount) { */ public StoredValueBalanceMergeRequest paymentMethod(Map paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -239,6 +279,7 @@ public Map getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(Map paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -250,6 +291,7 @@ public void setPaymentMethod(Map paymentMethod) { */ public StoredValueBalanceMergeRequest recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -273,6 +315,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -290,6 +333,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public StoredValueBalanceMergeRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -325,6 +369,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -358,6 +403,7 @@ public void setReference(String reference) { public StoredValueBalanceMergeRequest shopperInteraction( ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -423,6 +469,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -434,6 +481,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public StoredValueBalanceMergeRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -457,6 +505,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -473,6 +522,7 @@ public void setShopperReference(String shopperReference) { public StoredValueBalanceMergeRequest sourcePaymentMethod( Map sourcePaymentMethod) { this.sourcePaymentMethod = sourcePaymentMethod; + isSetSourcePaymentMethod = true; // mark as set return this; } @@ -513,6 +563,7 @@ public Map getSourcePaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSourcePaymentMethod(Map sourcePaymentMethod) { this.sourcePaymentMethod = sourcePaymentMethod; + isSetSourcePaymentMethod = true; // mark as set } /** @@ -524,6 +575,7 @@ public void setSourcePaymentMethod(Map sourcePaymentMethod) { */ public StoredValueBalanceMergeRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -547,6 +599,27 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredValueBalanceMergeRequest 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 StoredValueBalanceMergeRequest object is equal to o. */ @@ -619,6 +692,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 (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetShopperInteraction) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION, this.shopperInteraction); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetSourcePaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_SOURCE_PAYMENT_METHOD, this.sourcePaymentMethod); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + + 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 StoredValueBalanceMergeRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeResponse.java index 3bb2dca33..02ff4461d 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.storedvalue; +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 StoredValueBalanceMergeResponse { 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_CURRENT_BALANCE = "currentBalance"; private Amount currentBalance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrentBalance = 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. Possible values: * **Success** – The operation has been completed * successfully. * **Refused** – The operation was refused. The reason is given in the @@ -98,9 +112,21 @@ 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; + public static final String JSON_PROPERTY_THIRD_PARTY_REFUSAL_REASON = "thirdPartyRefusalReason"; private String thirdPartyRefusalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThirdPartyRefusalReason = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StoredValueBalanceMergeResponse() {} /** @@ -115,6 +141,7 @@ public StoredValueBalanceMergeResponse() {} */ public StoredValueBalanceMergeResponse authCode(String authCode) { this.authCode = authCode; + isSetAuthCode = true; // mark as set return this; } @@ -144,6 +171,7 @@ public String getAuthCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthCode(String authCode) { this.authCode = authCode; + isSetAuthCode = true; // mark as set } /** @@ -155,6 +183,7 @@ public void setAuthCode(String authCode) { */ public StoredValueBalanceMergeResponse currentBalance(Amount currentBalance) { this.currentBalance = currentBalance; + isSetCurrentBalance = true; // mark as set return this; } @@ -178,6 +207,7 @@ public Amount getCurrentBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrentBalance(Amount currentBalance) { this.currentBalance = currentBalance; + isSetCurrentBalance = true; // mark as set } /** @@ -192,6 +222,7 @@ public void setCurrentBalance(Amount currentBalance) { */ public StoredValueBalanceMergeResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -221,6 +252,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -237,6 +269,7 @@ public void setPspReference(String pspReference) { */ public StoredValueBalanceMergeResponse refusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set return this; } @@ -270,6 +303,7 @@ public String getRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set } /** @@ -291,6 +325,7 @@ public void setRefusalReason(String refusalReason) { */ public StoredValueBalanceMergeResponse resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -334,6 +369,7 @@ public ResultCodeEnum getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set } /** @@ -346,6 +382,7 @@ public void setResultCode(ResultCodeEnum resultCode) { */ public StoredValueBalanceMergeResponse thirdPartyRefusalReason(String thirdPartyRefusalReason) { this.thirdPartyRefusalReason = thirdPartyRefusalReason; + isSetThirdPartyRefusalReason = true; // mark as set return this; } @@ -371,6 +408,27 @@ public String getThirdPartyRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThirdPartyRefusalReason(String thirdPartyRefusalReason) { this.thirdPartyRefusalReason = thirdPartyRefusalReason; + isSetThirdPartyRefusalReason = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredValueBalanceMergeResponse 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 StoredValueBalanceMergeResponse object is equal to o. */ @@ -425,6 +483,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 (isSetAuthCode) { + addIfNull(nulls, JSON_PROPERTY_AUTH_CODE, this.authCode); + } + if (isSetCurrentBalance) { + addIfNull(nulls, JSON_PROPERTY_CURRENT_BALANCE, this.currentBalance); + } + 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); + } + if (isSetThirdPartyRefusalReason) { + addIfNull(nulls, JSON_PROPERTY_THIRD_PARTY_REFUSAL_REASON, this.thirdPartyRefusalReason); + } + + 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 StoredValueBalanceMergeResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueIssueRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueIssueRequest.java index 38d80a39f..a0b497283 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueIssueRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueIssueRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.storedvalue; +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,18 +40,33 @@ public class StoredValueIssueRequest { 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_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private Map paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = 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 @@ -110,12 +127,27 @@ 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_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StoredValueIssueRequest() {} /** @@ -126,6 +158,7 @@ public StoredValueIssueRequest() {} */ public StoredValueIssueRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -149,6 +182,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -160,6 +194,7 @@ public void setAmount(Amount amount) { */ public StoredValueIssueRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -185,6 +220,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -197,6 +233,7 @@ public void setMerchantAccount(String merchantAccount) { */ public StoredValueIssueRequest paymentMethod(Map paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -232,6 +269,7 @@ public Map getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(Map paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -242,6 +280,7 @@ public void setPaymentMethod(Map paymentMethod) { */ public StoredValueIssueRequest recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -265,6 +304,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -281,6 +321,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public StoredValueIssueRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -316,6 +357,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -347,6 +389,7 @@ public void setReference(String reference) { */ public StoredValueIssueRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -412,6 +455,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -422,6 +466,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public StoredValueIssueRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -445,6 +490,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -455,6 +501,7 @@ public void setShopperReference(String shopperReference) { */ public StoredValueIssueRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -478,6 +525,27 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredValueIssueRequest 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 StoredValueIssueRequest object is equal to o. */ @@ -542,6 +610,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetShopperInteraction) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION, this.shopperInteraction); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + + 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 StoredValueIssueRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueIssueResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueIssueResponse.java index 399fa3820..65865c850 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueIssueResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueIssueResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.storedvalue; +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,18 +39,33 @@ public class StoredValueIssueResponse { 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_CURRENT_BALANCE = "currentBalance"; private Amount currentBalance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrentBalance = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private Map paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = 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. Possible values: * **Success** – The operation has been completed * successfully. * **Refused** – The operation was refused. The reason is given in the @@ -104,9 +121,21 @@ 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; + public static final String JSON_PROPERTY_THIRD_PARTY_REFUSAL_REASON = "thirdPartyRefusalReason"; private String thirdPartyRefusalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThirdPartyRefusalReason = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StoredValueIssueResponse() {} /** @@ -120,6 +149,7 @@ public StoredValueIssueResponse() {} */ public StoredValueIssueResponse authCode(String authCode) { this.authCode = authCode; + isSetAuthCode = true; // mark as set return this; } @@ -149,6 +179,7 @@ public String getAuthCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthCode(String authCode) { this.authCode = authCode; + isSetAuthCode = true; // mark as set } /** @@ -159,6 +190,7 @@ public void setAuthCode(String authCode) { */ public StoredValueIssueResponse currentBalance(Amount currentBalance) { this.currentBalance = currentBalance; + isSetCurrentBalance = true; // mark as set return this; } @@ -182,6 +214,7 @@ public Amount getCurrentBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrentBalance(Amount currentBalance) { this.currentBalance = currentBalance; + isSetCurrentBalance = true; // mark as set } /** @@ -194,6 +227,7 @@ public void setCurrentBalance(Amount currentBalance) { */ public StoredValueIssueResponse paymentMethod(Map paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -229,6 +263,7 @@ public Map getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(Map paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -242,6 +277,7 @@ public void setPaymentMethod(Map paymentMethod) { */ public StoredValueIssueResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -271,6 +307,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -286,6 +323,7 @@ public void setPspReference(String pspReference) { */ public StoredValueIssueResponse refusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set return this; } @@ -319,6 +357,7 @@ public String getRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set } /** @@ -339,6 +378,7 @@ public void setRefusalReason(String refusalReason) { */ public StoredValueIssueResponse resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -382,6 +422,7 @@ public ResultCodeEnum getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set } /** @@ -393,6 +434,7 @@ public void setResultCode(ResultCodeEnum resultCode) { */ public StoredValueIssueResponse thirdPartyRefusalReason(String thirdPartyRefusalReason) { this.thirdPartyRefusalReason = thirdPartyRefusalReason; + isSetThirdPartyRefusalReason = true; // mark as set return this; } @@ -418,6 +460,27 @@ public String getThirdPartyRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThirdPartyRefusalReason(String thirdPartyRefusalReason) { this.thirdPartyRefusalReason = thirdPartyRefusalReason; + isSetThirdPartyRefusalReason = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredValueIssueResponse 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 StoredValueIssueResponse object is equal to o. */ @@ -479,6 +542,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAuthCode) { + addIfNull(nulls, JSON_PROPERTY_AUTH_CODE, this.authCode); + } + if (isSetCurrentBalance) { + addIfNull(nulls, JSON_PROPERTY_CURRENT_BALANCE, this.currentBalance); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + 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); + } + if (isSetThirdPartyRefusalReason) { + addIfNull(nulls, JSON_PROPERTY_THIRD_PARTY_REFUSAL_REASON, this.thirdPartyRefusalReason); + } + + 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 StoredValueIssueResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueLoadRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueLoadRequest.java index e910c341f..5c2fbb006 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueLoadRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueLoadRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.storedvalue; +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; @@ -39,6 +41,9 @@ public class StoredValueLoadRequest { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + /** The type of load you are trying to do, when absent we default to 'Load' */ public enum LoadTypeEnum { MERCHANDISERETURN(String.valueOf("merchandiseReturn")), @@ -83,18 +88,33 @@ public static LoadTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_LOAD_TYPE = "loadType"; private LoadTypeEnum loadType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLoadType = 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_PAYMENT_METHOD = "paymentMethod"; private Map paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = 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 @@ -155,12 +175,27 @@ 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_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StoredValueLoadRequest() {} /** @@ -171,6 +206,7 @@ public StoredValueLoadRequest() {} */ public StoredValueLoadRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -194,6 +230,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -204,6 +241,7 @@ public void setAmount(Amount amount) { */ public StoredValueLoadRequest loadType(LoadTypeEnum loadType) { this.loadType = loadType; + isSetLoadType = true; // mark as set return this; } @@ -228,6 +266,7 @@ public LoadTypeEnum getLoadType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLoadType(LoadTypeEnum loadType) { this.loadType = loadType; + isSetLoadType = true; // mark as set } /** @@ -239,6 +278,7 @@ public void setLoadType(LoadTypeEnum loadType) { */ public StoredValueLoadRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -264,6 +304,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -276,6 +317,7 @@ public void setMerchantAccount(String merchantAccount) { */ public StoredValueLoadRequest paymentMethod(Map paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -311,6 +353,7 @@ public Map getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(Map paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -321,6 +364,7 @@ public void setPaymentMethod(Map paymentMethod) { */ public StoredValueLoadRequest recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -344,6 +388,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -360,6 +405,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public StoredValueLoadRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -395,6 +441,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -426,6 +473,7 @@ public void setReference(String reference) { */ public StoredValueLoadRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -491,6 +539,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -501,6 +550,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public StoredValueLoadRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -524,6 +574,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -534,6 +585,7 @@ public void setShopperReference(String shopperReference) { */ public StoredValueLoadRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -557,6 +609,27 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredValueLoadRequest 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 StoredValueLoadRequest object is equal to o. */ @@ -624,6 +697,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 (isSetLoadType) { + addIfNull(nulls, JSON_PROPERTY_LOAD_TYPE, this.loadType); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetShopperInteraction) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION, this.shopperInteraction); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + + 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 StoredValueLoadRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueLoadResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueLoadResponse.java index e28e92922..0af7b6ac0 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueLoadResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueLoadResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.storedvalue; +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 StoredValueLoadResponse { 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_CURRENT_BALANCE = "currentBalance"; private Amount currentBalance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrentBalance = 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. Possible values: * **Success** – The operation has been completed * successfully. * **Refused** – The operation was refused. The reason is given in the @@ -98,9 +112,21 @@ 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; + public static final String JSON_PROPERTY_THIRD_PARTY_REFUSAL_REASON = "thirdPartyRefusalReason"; private String thirdPartyRefusalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThirdPartyRefusalReason = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StoredValueLoadResponse() {} /** @@ -114,6 +140,7 @@ public StoredValueLoadResponse() {} */ public StoredValueLoadResponse authCode(String authCode) { this.authCode = authCode; + isSetAuthCode = true; // mark as set return this; } @@ -143,6 +170,7 @@ public String getAuthCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthCode(String authCode) { this.authCode = authCode; + isSetAuthCode = true; // mark as set } /** @@ -153,6 +181,7 @@ public void setAuthCode(String authCode) { */ public StoredValueLoadResponse currentBalance(Amount currentBalance) { this.currentBalance = currentBalance; + isSetCurrentBalance = true; // mark as set return this; } @@ -176,6 +205,7 @@ public Amount getCurrentBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrentBalance(Amount currentBalance) { this.currentBalance = currentBalance; + isSetCurrentBalance = true; // mark as set } /** @@ -189,6 +219,7 @@ public void setCurrentBalance(Amount currentBalance) { */ public StoredValueLoadResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -218,6 +249,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -233,6 +265,7 @@ public void setPspReference(String pspReference) { */ public StoredValueLoadResponse refusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set return this; } @@ -266,6 +299,7 @@ public String getRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set } /** @@ -286,6 +320,7 @@ public void setRefusalReason(String refusalReason) { */ public StoredValueLoadResponse resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -329,6 +364,7 @@ public ResultCodeEnum getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set } /** @@ -340,6 +376,7 @@ public void setResultCode(ResultCodeEnum resultCode) { */ public StoredValueLoadResponse thirdPartyRefusalReason(String thirdPartyRefusalReason) { this.thirdPartyRefusalReason = thirdPartyRefusalReason; + isSetThirdPartyRefusalReason = true; // mark as set return this; } @@ -365,6 +402,27 @@ public String getThirdPartyRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThirdPartyRefusalReason(String thirdPartyRefusalReason) { this.thirdPartyRefusalReason = thirdPartyRefusalReason; + isSetThirdPartyRefusalReason = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredValueLoadResponse 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 StoredValueLoadResponse object is equal to o. */ @@ -418,6 +476,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 (isSetAuthCode) { + addIfNull(nulls, JSON_PROPERTY_AUTH_CODE, this.authCode); + } + if (isSetCurrentBalance) { + addIfNull(nulls, JSON_PROPERTY_CURRENT_BALANCE, this.currentBalance); + } + 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); + } + if (isSetThirdPartyRefusalReason) { + addIfNull(nulls, JSON_PROPERTY_THIRD_PARTY_REFUSAL_REASON, this.thirdPartyRefusalReason); + } + + 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 StoredValueLoadResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeRequest.java index b7fc03187..6b31824a4 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.storedvalue; +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; @@ -39,18 +41,33 @@ public class StoredValueStatusChangeRequest { 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_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private Map paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = 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 @@ -111,9 +128,15 @@ 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_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + /** The status you want to change to */ public enum StatusEnum { ACTIVE(String.valueOf("active")), @@ -158,9 +181,21 @@ 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_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StoredValueStatusChangeRequest() {} /** @@ -172,6 +207,7 @@ public StoredValueStatusChangeRequest() {} */ public StoredValueStatusChangeRequest 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 } /** @@ -207,6 +244,7 @@ public void setAmount(Amount amount) { */ public StoredValueStatusChangeRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -232,6 +270,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -245,6 +284,7 @@ public void setMerchantAccount(String merchantAccount) { */ public StoredValueStatusChangeRequest paymentMethod(Map paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -280,6 +320,7 @@ public Map getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(Map paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -291,6 +332,7 @@ public void setPaymentMethod(Map paymentMethod) { */ public StoredValueStatusChangeRequest recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -314,6 +356,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -331,6 +374,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public StoredValueStatusChangeRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -366,6 +410,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -399,6 +444,7 @@ public void setReference(String reference) { public StoredValueStatusChangeRequest shopperInteraction( ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -464,6 +510,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -475,6 +522,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public StoredValueStatusChangeRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -498,6 +546,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -509,6 +558,7 @@ public void setShopperReference(String shopperReference) { */ public StoredValueStatusChangeRequest status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -532,6 +582,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -543,6 +594,7 @@ public void setStatus(StatusEnum status) { */ public StoredValueStatusChangeRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -566,6 +618,27 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredValueStatusChangeRequest 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 StoredValueStatusChangeRequest object is equal to o. */ @@ -635,6 +708,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 (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetShopperInteraction) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION, this.shopperInteraction); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + + 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 StoredValueStatusChangeRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeResponse.java index b319e6432..e942d5f21 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.storedvalue; +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 StoredValueStatusChangeResponse { 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_CURRENT_BALANCE = "currentBalance"; private Amount currentBalance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrentBalance = 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. Possible values: * **Success** – The operation has been completed * successfully. * **Refused** – The operation was refused. The reason is given in the @@ -98,9 +112,21 @@ 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; + public static final String JSON_PROPERTY_THIRD_PARTY_REFUSAL_REASON = "thirdPartyRefusalReason"; private String thirdPartyRefusalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThirdPartyRefusalReason = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StoredValueStatusChangeResponse() {} /** @@ -115,6 +141,7 @@ public StoredValueStatusChangeResponse() {} */ public StoredValueStatusChangeResponse authCode(String authCode) { this.authCode = authCode; + isSetAuthCode = true; // mark as set return this; } @@ -144,6 +171,7 @@ public String getAuthCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthCode(String authCode) { this.authCode = authCode; + isSetAuthCode = true; // mark as set } /** @@ -155,6 +183,7 @@ public void setAuthCode(String authCode) { */ public StoredValueStatusChangeResponse currentBalance(Amount currentBalance) { this.currentBalance = currentBalance; + isSetCurrentBalance = true; // mark as set return this; } @@ -178,6 +207,7 @@ public Amount getCurrentBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrentBalance(Amount currentBalance) { this.currentBalance = currentBalance; + isSetCurrentBalance = true; // mark as set } /** @@ -192,6 +222,7 @@ public void setCurrentBalance(Amount currentBalance) { */ public StoredValueStatusChangeResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -221,6 +252,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -237,6 +269,7 @@ public void setPspReference(String pspReference) { */ public StoredValueStatusChangeResponse refusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set return this; } @@ -270,6 +303,7 @@ public String getRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set } /** @@ -291,6 +325,7 @@ public void setRefusalReason(String refusalReason) { */ public StoredValueStatusChangeResponse resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -334,6 +369,7 @@ public ResultCodeEnum getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set } /** @@ -346,6 +382,7 @@ public void setResultCode(ResultCodeEnum resultCode) { */ public StoredValueStatusChangeResponse thirdPartyRefusalReason(String thirdPartyRefusalReason) { this.thirdPartyRefusalReason = thirdPartyRefusalReason; + isSetThirdPartyRefusalReason = true; // mark as set return this; } @@ -371,6 +408,27 @@ public String getThirdPartyRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThirdPartyRefusalReason(String thirdPartyRefusalReason) { this.thirdPartyRefusalReason = thirdPartyRefusalReason; + isSetThirdPartyRefusalReason = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredValueStatusChangeResponse 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 StoredValueStatusChangeResponse object is equal to o. */ @@ -425,6 +483,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 (isSetAuthCode) { + addIfNull(nulls, JSON_PROPERTY_AUTH_CODE, this.authCode); + } + if (isSetCurrentBalance) { + addIfNull(nulls, JSON_PROPERTY_CURRENT_BALANCE, this.currentBalance); + } + 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); + } + if (isSetThirdPartyRefusalReason) { + addIfNull(nulls, JSON_PROPERTY_THIRD_PARTY_REFUSAL_REASON, this.thirdPartyRefusalReason); + } + + 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 StoredValueStatusChangeResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueVoidRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueVoidRequest.java index fa42095bc..a10f84f70 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueVoidRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueVoidRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.storedvalue; +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 StoredValueVoidRequest { 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_ORIGINAL_REFERENCE = "originalReference"; private String originalReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalReference = 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_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = 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 StoredValueVoidRequest() {} /** @@ -56,6 +82,7 @@ public StoredValueVoidRequest() {} */ public StoredValueVoidRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -81,6 +108,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -91,6 +119,7 @@ public void setMerchantAccount(String merchantAccount) { */ public StoredValueVoidRequest originalReference(String originalReference) { this.originalReference = originalReference; + isSetOriginalReference = true; // mark as set return this; } @@ -114,6 +143,7 @@ public String getOriginalReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalReference(String originalReference) { this.originalReference = originalReference; + isSetOriginalReference = true; // mark as set } /** @@ -126,6 +156,7 @@ public void setOriginalReference(String originalReference) { */ public StoredValueVoidRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -153,6 +184,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -163,6 +195,7 @@ public void setReference(String reference) { */ public StoredValueVoidRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -186,6 +219,7 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set } /** @@ -196,6 +230,7 @@ public void setStore(String store) { */ public StoredValueVoidRequest tenderReference(String tenderReference) { this.tenderReference = tenderReference; + isSetTenderReference = true; // mark as set return this; } @@ -219,6 +254,7 @@ public String getTenderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTenderReference(String tenderReference) { this.tenderReference = tenderReference; + isSetTenderReference = true; // mark as set } /** @@ -229,6 +265,7 @@ public void setTenderReference(String tenderReference) { */ public StoredValueVoidRequest uniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set return this; } @@ -252,6 +289,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 StoredValueVoidRequest 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 StoredValueVoidRequest object is equal to o. */ @@ -302,6 +360,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 (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetOriginalReference) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_REFERENCE, this.originalReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + 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 StoredValueVoidRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueVoidResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueVoidResponse.java index 72d4252f8..b54d19116 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueVoidResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueVoidResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.storedvalue; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class StoredValueVoidResponse { public static final String JSON_PROPERTY_CURRENT_BALANCE = "currentBalance"; private Amount currentBalance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrentBalance = 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. Possible values: * **Success** – The operation has been completed * successfully. * **Refused** – The operation was refused. The reason is given in the @@ -94,9 +105,21 @@ 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; + public static final String JSON_PROPERTY_THIRD_PARTY_REFUSAL_REASON = "thirdPartyRefusalReason"; private String thirdPartyRefusalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThirdPartyRefusalReason = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StoredValueVoidResponse() {} /** @@ -107,6 +130,7 @@ public StoredValueVoidResponse() {} */ public StoredValueVoidResponse currentBalance(Amount currentBalance) { this.currentBalance = currentBalance; + isSetCurrentBalance = true; // mark as set return this; } @@ -130,6 +154,7 @@ public Amount getCurrentBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrentBalance(Amount currentBalance) { this.currentBalance = currentBalance; + isSetCurrentBalance = true; // mark as set } /** @@ -143,6 +168,7 @@ public void setCurrentBalance(Amount currentBalance) { */ public StoredValueVoidResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -172,6 +198,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -187,6 +214,7 @@ public void setPspReference(String pspReference) { */ public StoredValueVoidResponse refusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set return this; } @@ -220,6 +248,7 @@ public String getRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set } /** @@ -240,6 +269,7 @@ public void setRefusalReason(String refusalReason) { */ public StoredValueVoidResponse resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -283,6 +313,7 @@ public ResultCodeEnum getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set } /** @@ -294,6 +325,7 @@ public void setResultCode(ResultCodeEnum resultCode) { */ public StoredValueVoidResponse thirdPartyRefusalReason(String thirdPartyRefusalReason) { this.thirdPartyRefusalReason = thirdPartyRefusalReason; + isSetThirdPartyRefusalReason = true; // mark as set return this; } @@ -319,6 +351,27 @@ public String getThirdPartyRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThirdPartyRefusalReason(String thirdPartyRefusalReason) { this.thirdPartyRefusalReason = thirdPartyRefusalReason; + isSetThirdPartyRefusalReason = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredValueVoidResponse 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 StoredValueVoidResponse object is equal to o. */ @@ -370,6 +423,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 (isSetCurrentBalance) { + addIfNull(nulls, JSON_PROPERTY_CURRENT_BALANCE, this.currentBalance); + } + 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); + } + if (isSetThirdPartyRefusalReason) { + addIfNull(nulls, JSON_PROPERTY_THIRD_PARTY_REFUSAL_REASON, this.thirdPartyRefusalReason); + } + + 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 StoredValueVoidResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/tokenizationwebhooks/RecurringToken.java b/src/main/java/com/adyen/model/tokenizationwebhooks/RecurringToken.java index ac1530659..2898a569f 100644 --- a/src/main/java/com/adyen/model/tokenizationwebhooks/RecurringToken.java +++ b/src/main/java/com/adyen/model/tokenizationwebhooks/RecurringToken.java @@ -11,6 +11,8 @@ package com.adyen.model.tokenizationwebhooks; +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 RecurringToken { 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_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 RecurringToken() {} /** @@ -48,6 +68,7 @@ public RecurringToken() {} */ public RecurringToken merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -73,6 +94,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -84,6 +106,7 @@ public void setMerchantAccount(String merchantAccount) { */ public RecurringToken shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -109,6 +132,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -119,6 +143,7 @@ public void setShopperReference(String shopperReference) { */ public RecurringToken storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -142,6 +167,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -152,6 +178,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public RecurringToken type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -175,6 +202,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RecurringToken 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 RecurringToken object is equal to o. */ @@ -222,6 +270,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 (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 RecurringToken given an JSON string * diff --git a/src/main/java/com/adyen/model/tokenizationwebhooks/RecurringTokenStoreOperation.java b/src/main/java/com/adyen/model/tokenizationwebhooks/RecurringTokenStoreOperation.java index 36dc749db..9445d8745 100644 --- a/src/main/java/com/adyen/model/tokenizationwebhooks/RecurringTokenStoreOperation.java +++ b/src/main/java/com/adyen/model/tokenizationwebhooks/RecurringTokenStoreOperation.java @@ -11,6 +11,8 @@ package com.adyen.model.tokenizationwebhooks; +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 RecurringTokenStoreOperation { 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_OPERATION = "operation"; private String operation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOperation = 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_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 RecurringTokenStoreOperation() {} /** @@ -52,6 +75,7 @@ public RecurringTokenStoreOperation() {} */ public RecurringTokenStoreOperation merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -77,6 +101,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -88,6 +113,7 @@ public void setMerchantAccount(String merchantAccount) { */ public RecurringTokenStoreOperation operation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set return this; } @@ -113,6 +139,7 @@ public String getOperation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOperation(String operation) { this.operation = operation; + isSetOperation = true; // mark as set } /** @@ -124,6 +151,7 @@ public void setOperation(String operation) { */ public RecurringTokenStoreOperation shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -149,6 +177,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -159,6 +188,7 @@ public void setShopperReference(String shopperReference) { */ public RecurringTokenStoreOperation storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -182,6 +212,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -192,6 +223,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public RecurringTokenStoreOperation type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -215,6 +247,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RecurringTokenStoreOperation 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 RecurringTokenStoreOperation object is equal to o. */ @@ -265,6 +318,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 (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetOperation) { + addIfNull(nulls, JSON_PROPERTY_OPERATION, this.operation); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + 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 RecurringTokenStoreOperation given an JSON string * diff --git a/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationAlreadyExistingDetailsNotificationRequest.java b/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationAlreadyExistingDetailsNotificationRequest.java index 7b2892b57..576a334e9 100644 --- a/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationAlreadyExistingDetailsNotificationRequest.java +++ b/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationAlreadyExistingDetailsNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.tokenizationwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +37,15 @@ public class TokenizationAlreadyExistingDetailsNotificationRequest { 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_DATA = "data"; private RecurringTokenStoreOperation data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + /** The environment from which the webhook originated. Possible values: **test**, **live**. */ public enum EnvironmentEnum { TEST(String.valueOf("test")), @@ -82,9 +90,15 @@ public static EnvironmentEnum fromValue(String value) { public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private EnvironmentEnum environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_EVENT_ID = "eventId"; private String eventId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEventId = false; + /** The type of webhook. */ public enum TypeEnum { RECURRING_TOKEN_ALREADYEXISTING(String.valueOf("recurring.token.alreadyExisting")); @@ -127,9 +141,21 @@ 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; + 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 TokenizationAlreadyExistingDetailsNotificationRequest() {} /** @@ -141,6 +167,7 @@ public TokenizationAlreadyExistingDetailsNotificationRequest() {} */ public TokenizationAlreadyExistingDetailsNotificationRequest createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -164,6 +191,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -176,6 +204,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { public TokenizationAlreadyExistingDetailsNotificationRequest data( RecurringTokenStoreOperation data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -199,6 +228,7 @@ public RecurringTokenStoreOperation getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(RecurringTokenStoreOperation data) { this.data = data; + isSetData = true; // mark as set } /** @@ -212,6 +242,7 @@ public void setData(RecurringTokenStoreOperation data) { public TokenizationAlreadyExistingDetailsNotificationRequest environment( EnvironmentEnum environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -237,6 +268,7 @@ public EnvironmentEnum getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(EnvironmentEnum environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -248,6 +280,7 @@ public void setEnvironment(EnvironmentEnum environment) { */ public TokenizationAlreadyExistingDetailsNotificationRequest eventId(String eventId) { this.eventId = eventId; + isSetEventId = true; // mark as set return this; } @@ -271,6 +304,7 @@ public String getEventId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEventId(String eventId) { this.eventId = eventId; + isSetEventId = true; // mark as set } /** @@ -282,6 +316,7 @@ public void setEventId(String eventId) { */ public TokenizationAlreadyExistingDetailsNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -305,6 +340,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -316,6 +352,7 @@ public void setType(TypeEnum type) { */ public TokenizationAlreadyExistingDetailsNotificationRequest version(String version) { this.version = version; + isSetVersion = true; // mark as set return this; } @@ -339,6 +376,28 @@ 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 TokenizationAlreadyExistingDetailsNotificationRequest 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; } /** @@ -396,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 (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetEventId) { + addIfNull(nulls, JSON_PROPERTY_EVENT_ID, this.eventId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + 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 TokenizationAlreadyExistingDetailsNotificationRequest given an JSON * string diff --git a/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationCreatedDetailsNotificationRequest.java b/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationCreatedDetailsNotificationRequest.java index f104f3526..d61c7d98d 100644 --- a/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationCreatedDetailsNotificationRequest.java +++ b/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationCreatedDetailsNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.tokenizationwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +37,15 @@ public class TokenizationCreatedDetailsNotificationRequest { 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_DATA = "data"; private RecurringTokenStoreOperation data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + /** The environment from which the webhook originated. Possible values: **test**, **live**. */ public enum EnvironmentEnum { TEST(String.valueOf("test")), @@ -82,9 +90,15 @@ public static EnvironmentEnum fromValue(String value) { public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private EnvironmentEnum environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_EVENT_ID = "eventId"; private String eventId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEventId = false; + /** The type of webhook. */ public enum TypeEnum { RECURRING_TOKEN_CREATED(String.valueOf("recurring.token.created")); @@ -127,9 +141,21 @@ 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; + 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 TokenizationCreatedDetailsNotificationRequest() {} /** @@ -141,6 +167,7 @@ public TokenizationCreatedDetailsNotificationRequest() {} */ public TokenizationCreatedDetailsNotificationRequest createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -164,6 +191,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -175,6 +203,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public TokenizationCreatedDetailsNotificationRequest data(RecurringTokenStoreOperation data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -198,6 +227,7 @@ public RecurringTokenStoreOperation getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(RecurringTokenStoreOperation data) { this.data = data; + isSetData = true; // mark as set } /** @@ -210,6 +240,7 @@ public void setData(RecurringTokenStoreOperation data) { */ public TokenizationCreatedDetailsNotificationRequest environment(EnvironmentEnum environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -235,6 +266,7 @@ public EnvironmentEnum getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(EnvironmentEnum environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -246,6 +278,7 @@ public void setEnvironment(EnvironmentEnum environment) { */ public TokenizationCreatedDetailsNotificationRequest eventId(String eventId) { this.eventId = eventId; + isSetEventId = true; // mark as set return this; } @@ -269,6 +302,7 @@ public String getEventId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEventId(String eventId) { this.eventId = eventId; + isSetEventId = true; // mark as set } /** @@ -280,6 +314,7 @@ public void setEventId(String eventId) { */ public TokenizationCreatedDetailsNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -303,6 +338,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -314,6 +350,7 @@ public void setType(TypeEnum type) { */ public TokenizationCreatedDetailsNotificationRequest version(String version) { this.version = version; + isSetVersion = true; // mark as set return this; } @@ -337,6 +374,28 @@ 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 TokenizationCreatedDetailsNotificationRequest 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 TokenizationCreatedDetailsNotificationRequest object is equal to o. */ @@ -388,6 +447,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 (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetEventId) { + addIfNull(nulls, JSON_PROPERTY_EVENT_ID, this.eventId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + 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 TokenizationCreatedDetailsNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationDisabledDetailsNotificationRequest.java b/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationDisabledDetailsNotificationRequest.java index ef9974e36..be14a876a 100644 --- a/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationDisabledDetailsNotificationRequest.java +++ b/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationDisabledDetailsNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.tokenizationwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +37,15 @@ public class TokenizationDisabledDetailsNotificationRequest { 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_DATA = "data"; private RecurringToken data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + /** The environment from which the webhook originated. Possible values: **test**, **live**. */ public enum EnvironmentEnum { TEST(String.valueOf("test")), @@ -82,9 +90,15 @@ public static EnvironmentEnum fromValue(String value) { public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private EnvironmentEnum environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_EVENT_ID = "eventId"; private String eventId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEventId = false; + /** The type of webhook. */ public enum TypeEnum { RECURRING_TOKEN_DISABLED(String.valueOf("recurring.token.disabled")); @@ -127,9 +141,21 @@ 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; + 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 TokenizationDisabledDetailsNotificationRequest() {} /** @@ -141,6 +167,7 @@ public TokenizationDisabledDetailsNotificationRequest() {} */ public TokenizationDisabledDetailsNotificationRequest createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -164,6 +191,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -175,6 +203,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public TokenizationDisabledDetailsNotificationRequest data(RecurringToken data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -198,6 +227,7 @@ public RecurringToken getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(RecurringToken data) { this.data = data; + isSetData = true; // mark as set } /** @@ -210,6 +240,7 @@ public void setData(RecurringToken data) { */ public TokenizationDisabledDetailsNotificationRequest environment(EnvironmentEnum environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -235,6 +266,7 @@ public EnvironmentEnum getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(EnvironmentEnum environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -246,6 +278,7 @@ public void setEnvironment(EnvironmentEnum environment) { */ public TokenizationDisabledDetailsNotificationRequest eventId(String eventId) { this.eventId = eventId; + isSetEventId = true; // mark as set return this; } @@ -269,6 +302,7 @@ public String getEventId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEventId(String eventId) { this.eventId = eventId; + isSetEventId = true; // mark as set } /** @@ -280,6 +314,7 @@ public void setEventId(String eventId) { */ public TokenizationDisabledDetailsNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -303,6 +338,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -314,6 +350,7 @@ public void setType(TypeEnum type) { */ public TokenizationDisabledDetailsNotificationRequest version(String version) { this.version = version; + isSetVersion = true; // mark as set return this; } @@ -337,6 +374,28 @@ 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 TokenizationDisabledDetailsNotificationRequest 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 TokenizationDisabledDetailsNotificationRequest object is equal to o. */ @@ -388,6 +447,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 (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetEventId) { + addIfNull(nulls, JSON_PROPERTY_EVENT_ID, this.eventId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + 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 TokenizationDisabledDetailsNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationNotificationResponse.java b/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationNotificationResponse.java index e47741c80..48dc59d6c 100644 --- a/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationNotificationResponse.java +++ b/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationNotificationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.tokenizationwebhooks; +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 TokenizationNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TokenizationNotificationResponse() {} /** @@ -36,6 +47,7 @@ public TokenizationNotificationResponse() {} */ public TokenizationNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TokenizationNotificationResponse 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 TokenizationNotificationResponse object is equal to o. */ @@ -106,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TokenizationNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationUpdatedDetailsNotificationRequest.java b/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationUpdatedDetailsNotificationRequest.java index 09cc67bbb..c36505fe1 100644 --- a/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationUpdatedDetailsNotificationRequest.java +++ b/src/main/java/com/adyen/model/tokenizationwebhooks/TokenizationUpdatedDetailsNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.tokenizationwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +37,15 @@ public class TokenizationUpdatedDetailsNotificationRequest { 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_DATA = "data"; private RecurringTokenStoreOperation data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + /** The environment from which the webhook originated. Possible values: **test**, **live**. */ public enum EnvironmentEnum { TEST(String.valueOf("test")), @@ -82,9 +90,15 @@ public static EnvironmentEnum fromValue(String value) { public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private EnvironmentEnum environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_EVENT_ID = "eventId"; private String eventId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEventId = false; + /** The type of webhook. */ public enum TypeEnum { RECURRING_TOKEN_UPDATED(String.valueOf("recurring.token.updated")); @@ -127,9 +141,21 @@ 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; + 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 TokenizationUpdatedDetailsNotificationRequest() {} /** @@ -141,6 +167,7 @@ public TokenizationUpdatedDetailsNotificationRequest() {} */ public TokenizationUpdatedDetailsNotificationRequest createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -164,6 +191,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -175,6 +203,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public TokenizationUpdatedDetailsNotificationRequest data(RecurringTokenStoreOperation data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -198,6 +227,7 @@ public RecurringTokenStoreOperation getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(RecurringTokenStoreOperation data) { this.data = data; + isSetData = true; // mark as set } /** @@ -210,6 +240,7 @@ public void setData(RecurringTokenStoreOperation data) { */ public TokenizationUpdatedDetailsNotificationRequest environment(EnvironmentEnum environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -235,6 +266,7 @@ public EnvironmentEnum getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(EnvironmentEnum environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -246,6 +278,7 @@ public void setEnvironment(EnvironmentEnum environment) { */ public TokenizationUpdatedDetailsNotificationRequest eventId(String eventId) { this.eventId = eventId; + isSetEventId = true; // mark as set return this; } @@ -269,6 +302,7 @@ public String getEventId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEventId(String eventId) { this.eventId = eventId; + isSetEventId = true; // mark as set } /** @@ -280,6 +314,7 @@ public void setEventId(String eventId) { */ public TokenizationUpdatedDetailsNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -303,6 +338,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -314,6 +350,7 @@ public void setType(TypeEnum type) { */ public TokenizationUpdatedDetailsNotificationRequest version(String version) { this.version = version; + isSetVersion = true; // mark as set return this; } @@ -337,6 +374,28 @@ 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 TokenizationUpdatedDetailsNotificationRequest 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 TokenizationUpdatedDetailsNotificationRequest object is equal to o. */ @@ -388,6 +447,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 (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetEventId) { + addIfNull(nulls, JSON_PROPERTY_EVENT_ID, this.eventId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + 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 TokenizationUpdatedDetailsNotificationRequest 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..b28ae0d76 100644 --- a/src/main/java/com/adyen/model/transactionwebhooks/Amount.java +++ b/src/main/java/com/adyen/model/transactionwebhooks/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.transactionwebhooks; +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. */ @@ -145,6 +189,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/transactionwebhooks/BalancePlatformNotificationResponse.java b/src/main/java/com/adyen/model/transactionwebhooks/BalancePlatformNotificationResponse.java index 639e14f1e..4bd2cddca 100644 --- a/src/main/java/com/adyen/model/transactionwebhooks/BalancePlatformNotificationResponse.java +++ b/src/main/java/com/adyen/model/transactionwebhooks/BalancePlatformNotificationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.transactionwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class BalancePlatformNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalancePlatformNotificationResponse() {} /** @@ -36,6 +47,7 @@ public BalancePlatformNotificationResponse() {} */ public BalancePlatformNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalancePlatformNotificationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalancePlatformNotificationResponse object is equal to o. */ @@ -106,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalancePlatformNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/transactionwebhooks/BankCategoryData.java b/src/main/java/com/adyen/model/transactionwebhooks/BankCategoryData.java index ca0ad9e60..3018d58a5 100644 --- a/src/main/java/com/adyen/model/transactionwebhooks/BankCategoryData.java +++ b/src/main/java/com/adyen/model/transactionwebhooks/BankCategoryData.java @@ -11,7 +11,9 @@ package com.adyen.model.transactionwebhooks; +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; @@ -27,14 +29,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 { @@ -88,6 +90,9 @@ public static PriorityEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITY = "priority"; private PriorityEnum priority; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriority = false; + /** **bank** */ public enum TypeEnum { BANK(String.valueOf("bank")); @@ -130,62 +135,72 @@ 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 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 */ public BankCategoryData priority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set return this; } /** * 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,32 +212,33 @@ 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) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set } /** @@ -233,6 +249,7 @@ public void setPriority(PriorityEnum priority) { */ public BankCategoryData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -256,6 +273,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 BankCategoryData 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 BankCategoryData object is equal to o. */ @@ -297,6 +335,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 (isSetPriority) { + addIfNull(nulls, JSON_PROPERTY_PRIORITY, this.priority); + } + 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 BankCategoryData given an JSON string * diff --git a/src/main/java/com/adyen/model/transactionwebhooks/InternalCategoryData.java b/src/main/java/com/adyen/model/transactionwebhooks/InternalCategoryData.java index 73fed0ff6..2d2e301e6 100644 --- a/src/main/java/com/adyen/model/transactionwebhooks/InternalCategoryData.java +++ b/src/main/java/com/adyen/model/transactionwebhooks/InternalCategoryData.java @@ -11,7 +11,9 @@ package com.adyen.model.transactionwebhooks; +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; @@ -32,9 +34,15 @@ public class InternalCategoryData { "modificationMerchantReference"; private String modificationMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationMerchantReference = false; + public static final String JSON_PROPERTY_MODIFICATION_PSP_REFERENCE = "modificationPspReference"; private String modificationPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationPspReference = false; + /** **internal** */ public enum TypeEnum { INTERNAL(String.valueOf("internal")); @@ -77,6 +85,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 InternalCategoryData() {} /** @@ -88,6 +105,7 @@ public InternalCategoryData() {} */ public InternalCategoryData modificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set return this; } @@ -113,6 +131,7 @@ public String getModificationMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set } /** @@ -123,6 +142,7 @@ public void setModificationMerchantReference(String modificationMerchantReferenc */ public InternalCategoryData modificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set return this; } @@ -146,6 +166,7 @@ public String getModificationPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set } /** @@ -156,6 +177,7 @@ public void setModificationPspReference(String modificationPspReference) { */ public InternalCategoryData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -179,6 +201,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 InternalCategoryData 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 InternalCategoryData object is equal to o. */ @@ -228,6 +271,37 @@ 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 (isSetModificationMerchantReference) { + addIfNull( + nulls, JSON_PROPERTY_MODIFICATION_MERCHANT_REFERENCE, this.modificationMerchantReference); + } + if (isSetModificationPspReference) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_PSP_REFERENCE, this.modificationPspReference); + } + 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 InternalCategoryData given an JSON string * diff --git a/src/main/java/com/adyen/model/transactionwebhooks/IssuedCard.java b/src/main/java/com/adyen/model/transactionwebhooks/IssuedCard.java index 4be8f2aae..99f8d31a2 100644 --- a/src/main/java/com/adyen/model/transactionwebhooks/IssuedCard.java +++ b/src/main/java/com/adyen/model/transactionwebhooks/IssuedCard.java @@ -11,7 +11,9 @@ package com.adyen.model.transactionwebhooks; +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; @@ -39,6 +41,9 @@ public class IssuedCard { public static final String JSON_PROPERTY_AUTHORISATION_TYPE = "authorisationType"; private String authorisationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorisationType = false; + /** * Indicates the method used for entering the PAN to initiate a transaction. Possible values: * **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**. @@ -96,6 +101,9 @@ public static PanEntryModeEnum fromValue(String value) { public static final String JSON_PROPERTY_PAN_ENTRY_MODE = "panEntryMode"; private PanEntryModeEnum panEntryMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPanEntryMode = false; + /** * Contains information about how the payment was processed. For example, **ecommerce** for online * or **pos** for in-person payments. @@ -155,19 +163,34 @@ public static ProcessingTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_PROCESSING_TYPE = "processingType"; private ProcessingTypeEnum processingType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProcessingType = false; + public static final String JSON_PROPERTY_RELAYED_AUTHORISATION_DATA = "relayedAuthorisationData"; private RelayedAuthorisationData relayedAuthorisationData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRelayedAuthorisationData = false; + public static final String JSON_PROPERTY_SCHEME_TRACE_ID = "schemeTraceId"; private String schemeTraceId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchemeTraceId = false; + public static final String JSON_PROPERTY_SCHEME_UNIQUE_TRANSACTION_ID = "schemeUniqueTransactionId"; private String schemeUniqueTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchemeUniqueTransactionId = false; + public static final String JSON_PROPERTY_THREE_D_SECURE = "threeDSecure"; private ThreeDSecure threeDSecure; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSecure = false; + /** **issuedCard** */ public enum TypeEnum { ISSUEDCARD(String.valueOf("issuedCard")); @@ -210,9 +233,21 @@ 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; + public static final String JSON_PROPERTY_VALIDATION_FACTS = "validationFacts"; private List validationFacts; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValidationFacts = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public IssuedCard() {} /** @@ -225,6 +260,7 @@ public IssuedCard() {} */ public IssuedCard authorisationType(String authorisationType) { this.authorisationType = authorisationType; + isSetAuthorisationType = true; // mark as set return this; } @@ -252,6 +288,7 @@ public String getAuthorisationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisationType(String authorisationType) { this.authorisationType = authorisationType; + isSetAuthorisationType = true; // mark as set } /** @@ -265,6 +302,7 @@ public void setAuthorisationType(String authorisationType) { */ public IssuedCard panEntryMode(PanEntryModeEnum panEntryMode) { this.panEntryMode = panEntryMode; + isSetPanEntryMode = true; // mark as set return this; } @@ -294,6 +332,7 @@ public PanEntryModeEnum getPanEntryMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPanEntryMode(PanEntryModeEnum panEntryMode) { this.panEntryMode = panEntryMode; + isSetPanEntryMode = true; // mark as set } /** @@ -306,6 +345,7 @@ public void setPanEntryMode(PanEntryModeEnum panEntryMode) { */ public IssuedCard processingType(ProcessingTypeEnum processingType) { this.processingType = processingType; + isSetProcessingType = true; // mark as set return this; } @@ -333,6 +373,7 @@ public ProcessingTypeEnum getProcessingType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProcessingType(ProcessingTypeEnum processingType) { this.processingType = processingType; + isSetProcessingType = true; // mark as set } /** @@ -343,6 +384,7 @@ public void setProcessingType(ProcessingTypeEnum processingType) { */ public IssuedCard relayedAuthorisationData(RelayedAuthorisationData relayedAuthorisationData) { this.relayedAuthorisationData = relayedAuthorisationData; + isSetRelayedAuthorisationData = true; // mark as set return this; } @@ -366,6 +408,7 @@ public RelayedAuthorisationData getRelayedAuthorisationData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRelayedAuthorisationData(RelayedAuthorisationData relayedAuthorisationData) { this.relayedAuthorisationData = relayedAuthorisationData; + isSetRelayedAuthorisationData = true; // mark as set } /** @@ -384,6 +427,7 @@ public void setRelayedAuthorisationData(RelayedAuthorisationData relayedAuthoris */ public IssuedCard schemeTraceId(String schemeTraceId) { this.schemeTraceId = schemeTraceId; + isSetSchemeTraceId = true; // mark as set return this; } @@ -423,6 +467,7 @@ public String getSchemeTraceId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchemeTraceId(String schemeTraceId) { this.schemeTraceId = schemeTraceId; + isSetSchemeTraceId = true; // mark as set } /** @@ -435,6 +480,7 @@ public void setSchemeTraceId(String schemeTraceId) { */ public IssuedCard schemeUniqueTransactionId(String schemeUniqueTransactionId) { this.schemeUniqueTransactionId = schemeUniqueTransactionId; + isSetSchemeUniqueTransactionId = true; // mark as set return this; } @@ -462,6 +508,7 @@ public String getSchemeUniqueTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchemeUniqueTransactionId(String schemeUniqueTransactionId) { this.schemeUniqueTransactionId = schemeUniqueTransactionId; + isSetSchemeUniqueTransactionId = true; // mark as set } /** @@ -472,6 +519,7 @@ public void setSchemeUniqueTransactionId(String schemeUniqueTransactionId) { */ public IssuedCard threeDSecure(ThreeDSecure threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set return this; } @@ -495,6 +543,7 @@ public ThreeDSecure getThreeDSecure() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSecure(ThreeDSecure threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set } /** @@ -505,6 +554,7 @@ public void setThreeDSecure(ThreeDSecure threeDSecure) { */ public IssuedCard type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -528,6 +578,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -540,6 +591,7 @@ public void setType(TypeEnum type) { */ public IssuedCard validationFacts(List validationFacts) { this.validationFacts = validationFacts; + isSetValidationFacts = true; // mark as set return this; } @@ -575,6 +627,27 @@ public List getValidationFacts() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValidationFacts(List validationFacts) { this.validationFacts = validationFacts; + isSetValidationFacts = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public IssuedCard 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 IssuedCard object is equal to o. */ @@ -643,6 +716,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 (isSetAuthorisationType) { + addIfNull(nulls, JSON_PROPERTY_AUTHORISATION_TYPE, this.authorisationType); + } + if (isSetPanEntryMode) { + addIfNull(nulls, JSON_PROPERTY_PAN_ENTRY_MODE, this.panEntryMode); + } + if (isSetProcessingType) { + addIfNull(nulls, JSON_PROPERTY_PROCESSING_TYPE, this.processingType); + } + if (isSetRelayedAuthorisationData) { + addIfNull(nulls, JSON_PROPERTY_RELAYED_AUTHORISATION_DATA, this.relayedAuthorisationData); + } + if (isSetSchemeTraceId) { + addIfNull(nulls, JSON_PROPERTY_SCHEME_TRACE_ID, this.schemeTraceId); + } + if (isSetSchemeUniqueTransactionId) { + addIfNull(nulls, JSON_PROPERTY_SCHEME_UNIQUE_TRANSACTION_ID, this.schemeUniqueTransactionId); + } + if (isSetThreeDSecure) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_SECURE, this.threeDSecure); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetValidationFacts) { + addIfNull(nulls, JSON_PROPERTY_VALIDATION_FACTS, this.validationFacts); + } + + 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 IssuedCard given an JSON string * diff --git a/src/main/java/com/adyen/model/transactionwebhooks/PaymentInstrument.java b/src/main/java/com/adyen/model/transactionwebhooks/PaymentInstrument.java index ad51ffa3c..63b6eebb0 100644 --- a/src/main/java/com/adyen/model/transactionwebhooks/PaymentInstrument.java +++ b/src/main/java/com/adyen/model/transactionwebhooks/PaymentInstrument.java @@ -11,6 +11,8 @@ package com.adyen.model.transactionwebhooks; +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 PaymentInstrument { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_TOKEN_TYPE = "tokenType"; private String tokenType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrument() {} /** @@ -47,6 +67,7 @@ public PaymentInstrument() {} */ public PaymentInstrument description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -70,6 +91,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setDescription(String description) { */ public PaymentInstrument id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -103,6 +126,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setId(String id) { */ public PaymentInstrument reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setReference(String reference) { */ public PaymentInstrument tokenType(String tokenType) { this.tokenType = tokenType; + isSetTokenType = true; // mark as set return this; } @@ -169,6 +196,27 @@ public String getTokenType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenType(String tokenType) { this.tokenType = tokenType; + isSetTokenType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrument 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 PaymentInstrument object is equal to o. */ @@ -214,6 +262,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetTokenType) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_TYPE, this.tokenType); + } + + 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 PaymentInstrument given an JSON string * diff --git a/src/main/java/com/adyen/model/transactionwebhooks/PlatformPayment.java b/src/main/java/com/adyen/model/transactionwebhooks/PlatformPayment.java index 44d895627..85f47fc81 100644 --- a/src/main/java/com/adyen/model/transactionwebhooks/PlatformPayment.java +++ b/src/main/java/com/adyen/model/transactionwebhooks/PlatformPayment.java @@ -11,7 +11,9 @@ package com.adyen.model.transactionwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,33 +37,42 @@ public class PlatformPayment { "modificationMerchantReference"; private String modificationMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationMerchantReference = false; + public static final String JSON_PROPERTY_MODIFICATION_PSP_REFERENCE = "modificationPspReference"; private String modificationPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationPspReference = false; + public static final String JSON_PROPERTY_PAYMENT_MERCHANT_REFERENCE = "paymentMerchantReference"; private String paymentMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMerchantReference = false; + /** * Specifies the nature of the transfer. This parameter helps categorize transfers so you can * reconcile transactions at a later time, using the Balance Platform Accounting Report for * [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 { @@ -137,9 +148,15 @@ public static PlatformPaymentTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_PLATFORM_PAYMENT_TYPE = "platformPaymentType"; private PlatformPaymentTypeEnum platformPaymentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformPaymentType = false; + public static final String JSON_PROPERTY_PSP_PAYMENT_REFERENCE = "pspPaymentReference"; private String pspPaymentReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspPaymentReference = false; + /** **platformPayment** */ public enum TypeEnum { PLATFORMPAYMENT(String.valueOf("platformPayment")); @@ -182,6 +199,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 PlatformPayment() {} /** @@ -193,6 +219,7 @@ public PlatformPayment() {} */ public PlatformPayment modificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set return this; } @@ -218,6 +245,7 @@ public String getModificationMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set } /** @@ -228,6 +256,7 @@ public void setModificationMerchantReference(String modificationMerchantReferenc */ public PlatformPayment modificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set return this; } @@ -251,6 +280,7 @@ public String getModificationPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set } /** @@ -261,6 +291,7 @@ public void setModificationPspReference(String modificationPspReference) { */ public PlatformPayment paymentMerchantReference(String paymentMerchantReference) { this.paymentMerchantReference = paymentMerchantReference; + isSetPaymentMerchantReference = true; // mark as set return this; } @@ -284,6 +315,7 @@ public String getPaymentMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMerchantReference(String paymentMerchantReference) { this.paymentMerchantReference = paymentMerchantReference; + isSetPaymentMerchantReference = true; // mark as set } /** @@ -292,21 +324,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,26 +347,27 @@ 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) { this.platformPaymentType = platformPaymentType; + isSetPlatformPaymentType = true; // mark as set return this; } @@ -344,21 +377,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 +400,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 +429,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,27 +452,28 @@ 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) public void setPlatformPaymentType(PlatformPaymentTypeEnum platformPaymentType) { this.platformPaymentType = platformPaymentType; + isSetPlatformPaymentType = true; // mark as set } /** @@ -450,6 +484,7 @@ public void setPlatformPaymentType(PlatformPaymentTypeEnum platformPaymentType) */ public PlatformPayment pspPaymentReference(String pspPaymentReference) { this.pspPaymentReference = pspPaymentReference; + isSetPspPaymentReference = true; // mark as set return this; } @@ -473,6 +508,7 @@ public String getPspPaymentReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspPaymentReference(String pspPaymentReference) { this.pspPaymentReference = pspPaymentReference; + isSetPspPaymentReference = true; // mark as set } /** @@ -483,6 +519,7 @@ public void setPspPaymentReference(String pspPaymentReference) { */ public PlatformPayment type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -506,6 +543,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 PlatformPayment 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 PlatformPayment object is equal to o. */ @@ -572,6 +630,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 (isSetModificationMerchantReference) { + addIfNull( + nulls, JSON_PROPERTY_MODIFICATION_MERCHANT_REFERENCE, this.modificationMerchantReference); + } + if (isSetModificationPspReference) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_PSP_REFERENCE, this.modificationPspReference); + } + if (isSetPaymentMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_MERCHANT_REFERENCE, this.paymentMerchantReference); + } + if (isSetPlatformPaymentType) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_PAYMENT_TYPE, this.platformPaymentType); + } + if (isSetPspPaymentReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_PAYMENT_REFERENCE, this.pspPaymentReference); + } + 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 PlatformPayment given an JSON string * diff --git a/src/main/java/com/adyen/model/transactionwebhooks/RelayedAuthorisationData.java b/src/main/java/com/adyen/model/transactionwebhooks/RelayedAuthorisationData.java index 00a7565d7..0d7b0154e 100644 --- a/src/main/java/com/adyen/model/transactionwebhooks/RelayedAuthorisationData.java +++ b/src/main/java/com/adyen/model/transactionwebhooks/RelayedAuthorisationData.java @@ -11,6 +11,8 @@ package com.adyen.model.transactionwebhooks; +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,9 +30,21 @@ public class RelayedAuthorisationData { 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_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 RelayedAuthorisationData() {} /** @@ -43,6 +57,7 @@ public RelayedAuthorisationData() {} */ public RelayedAuthorisationData metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -78,6 +93,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -88,6 +104,7 @@ public void setMetadata(Map metadata) { */ public RelayedAuthorisationData reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -111,6 +128,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 RelayedAuthorisationData 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 RelayedAuthorisationData object is equal to o. */ @@ -152,6 +190,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 (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + 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 RelayedAuthorisationData given an JSON string * diff --git a/src/main/java/com/adyen/model/transactionwebhooks/Resource.java b/src/main/java/com/adyen/model/transactionwebhooks/Resource.java index 925b9380f..69503de19 100644 --- a/src/main/java/com/adyen/model/transactionwebhooks/Resource.java +++ b/src/main/java/com/adyen/model/transactionwebhooks/Resource.java @@ -11,6 +11,8 @@ package com.adyen.model.transactionwebhooks; +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,12 +30,27 @@ public class Resource { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Resource() {} /** @@ -44,6 +61,7 @@ public Resource() {} */ public Resource balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -67,6 +85,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -79,6 +98,7 @@ public void setBalancePlatform(String balancePlatform) { */ public Resource creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -106,6 +126,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -116,6 +137,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public Resource id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -139,6 +161,27 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Resource 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 Resource object is equal to o. */ @@ -182,6 +225,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 (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + + 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 Resource given an JSON string * diff --git a/src/main/java/com/adyen/model/transactionwebhooks/ResourceReference.java b/src/main/java/com/adyen/model/transactionwebhooks/ResourceReference.java index da124b0c4..2038ec667 100644 --- a/src/main/java/com/adyen/model/transactionwebhooks/ResourceReference.java +++ b/src/main/java/com/adyen/model/transactionwebhooks/ResourceReference.java @@ -11,6 +11,8 @@ package com.adyen.model.transactionwebhooks; +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 ResourceReference { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResourceReference() {} /** @@ -43,6 +60,7 @@ public ResourceReference() {} */ public ResourceReference description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setDescription(String description) { */ public ResourceReference id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setId(String id) { */ public ResourceReference 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 ResourceReference includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResourceReference object is equal to o. */ @@ -175,6 +218,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResourceReference given an JSON string * diff --git a/src/main/java/com/adyen/model/transactionwebhooks/ThreeDSecure.java b/src/main/java/com/adyen/model/transactionwebhooks/ThreeDSecure.java index 1754e5771..ea31c20fa 100644 --- a/src/main/java/com/adyen/model/transactionwebhooks/ThreeDSecure.java +++ b/src/main/java/com/adyen/model/transactionwebhooks/ThreeDSecure.java @@ -11,6 +11,8 @@ package com.adyen.model.transactionwebhooks; +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 ThreeDSecure { public static final String JSON_PROPERTY_ACS_TRANSACTION_ID = "acsTransactionId"; private String acsTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsTransactionId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDSecure() {} /** @@ -33,6 +44,7 @@ public ThreeDSecure() {} */ public ThreeDSecure acsTransactionId(String acsTransactionId) { this.acsTransactionId = acsTransactionId; + isSetAcsTransactionId = true; // mark as set return this; } @@ -56,6 +68,27 @@ public String getAcsTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsTransactionId(String acsTransactionId) { this.acsTransactionId = acsTransactionId; + isSetAcsTransactionId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDSecure 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 ThreeDSecure object is equal to o. */ @@ -95,6 +128,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 (isSetAcsTransactionId) { + addIfNull(nulls, JSON_PROPERTY_ACS_TRANSACTION_ID, this.acsTransactionId); + } + + 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 ThreeDSecure given an JSON string * diff --git a/src/main/java/com/adyen/model/transactionwebhooks/Transaction.java b/src/main/java/com/adyen/model/transactionwebhooks/Transaction.java index e583a0cdc..7215e0e41 100644 --- a/src/main/java/com/adyen/model/transactionwebhooks/Transaction.java +++ b/src/main/java/com/adyen/model/transactionwebhooks/Transaction.java @@ -11,7 +11,9 @@ package com.adyen.model.transactionwebhooks; +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,33 +44,63 @@ public class Transaction { public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; private ResourceReference accountHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT = "balanceAccount"; private ResourceReference balanceAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccount = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_BOOKING_DATE = "bookingDate"; private OffsetDateTime bookingDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBookingDate = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT = "paymentInstrument"; private PaymentInstrument paymentInstrument; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrument = false; + public static final String JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; private String referenceForBeneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + /** * The status of the transaction. Possible values: * **pending**: The transaction is still * pending. * **booked**: The transaction has been booked to the balance account. @@ -116,12 +148,27 @@ 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_TRANSFER = "transfer"; private TransferView transfer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransfer = false; + public static final String JSON_PROPERTY_VALUE_DATE = "valueDate"; private OffsetDateTime valueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValueDate = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Transaction() {} /** @@ -132,6 +179,7 @@ public Transaction() {} */ public Transaction accountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -155,6 +203,7 @@ public ResourceReference getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set } /** @@ -165,6 +214,7 @@ public void setAccountHolder(ResourceReference accountHolder) { */ public Transaction amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -188,6 +238,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -198,6 +249,7 @@ public void setAmount(Amount amount) { */ public Transaction balanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set return this; } @@ -221,6 +273,7 @@ public ResourceReference getBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set } /** @@ -231,6 +284,7 @@ public void setBalanceAccount(ResourceReference balanceAccount) { */ public Transaction balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -254,6 +308,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -264,6 +319,7 @@ public void setBalancePlatform(String balancePlatform) { */ public Transaction bookingDate(OffsetDateTime bookingDate) { this.bookingDate = bookingDate; + isSetBookingDate = true; // mark as set return this; } @@ -287,6 +343,7 @@ public OffsetDateTime getBookingDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBookingDate(OffsetDateTime bookingDate) { this.bookingDate = bookingDate; + isSetBookingDate = true; // mark as set } /** @@ -299,6 +356,7 @@ public void setBookingDate(OffsetDateTime bookingDate) { */ public Transaction creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -326,6 +384,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -336,6 +395,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public Transaction description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -359,6 +419,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -369,6 +430,7 @@ public void setDescription(String description) { */ public Transaction id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -392,6 +454,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -402,6 +465,7 @@ public void setId(String id) { */ public Transaction paymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set return this; } @@ -425,6 +489,7 @@ public PaymentInstrument getPaymentInstrument() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set } /** @@ -444,6 +509,7 @@ public void setPaymentInstrument(PaymentInstrument paymentInstrument) { */ public Transaction referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -485,6 +551,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -497,6 +564,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public Transaction status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -524,6 +592,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -534,6 +603,7 @@ public void setStatus(StatusEnum status) { */ public Transaction transfer(TransferView transfer) { this.transfer = transfer; + isSetTransfer = true; // mark as set return this; } @@ -557,6 +627,7 @@ public TransferView getTransfer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransfer(TransferView transfer) { this.transfer = transfer; + isSetTransfer = true; // mark as set } /** @@ -567,6 +638,7 @@ public void setTransfer(TransferView transfer) { */ public Transaction valueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; + isSetValueDate = true; // mark as set return this; } @@ -590,6 +662,27 @@ public OffsetDateTime getValueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; + isSetValueDate = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Transaction 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 Transaction object is equal to o. */ @@ -668,6 +761,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 (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBalanceAccount) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT, this.balanceAccount); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetBookingDate) { + addIfNull(nulls, JSON_PROPERTY_BOOKING_DATE, this.bookingDate); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrument) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT, this.paymentInstrument); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTransfer) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER, this.transfer); + } + if (isSetValueDate) { + addIfNull(nulls, JSON_PROPERTY_VALUE_DATE, this.valueDate); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Transaction given an JSON string * diff --git a/src/main/java/com/adyen/model/transactionwebhooks/TransactionNotificationRequestV4.java b/src/main/java/com/adyen/model/transactionwebhooks/TransactionNotificationRequestV4.java index 0caf28581..131cdc237 100644 --- a/src/main/java/com/adyen/model/transactionwebhooks/TransactionNotificationRequestV4.java +++ b/src/main/java/com/adyen/model/transactionwebhooks/TransactionNotificationRequestV4.java @@ -11,7 +11,9 @@ package com.adyen.model.transactionwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class TransactionNotificationRequestV4 { public static final String JSON_PROPERTY_DATA = "data"; private Transaction data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + /** Type of the webhook. */ public enum TypeEnum { BALANCEPLATFORM_TRANSACTION_CREATED(String.valueOf("balancePlatform.transaction.created")); @@ -81,6 +92,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 TransactionNotificationRequestV4() {} /** @@ -92,6 +112,7 @@ public TransactionNotificationRequestV4() {} */ public TransactionNotificationRequestV4 data(Transaction data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -115,6 +136,7 @@ public Transaction getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(Transaction data) { this.data = data; + isSetData = true; // mark as set } /** @@ -127,6 +149,7 @@ public void setData(Transaction data) { */ public TransactionNotificationRequestV4 environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -152,6 +175,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -163,6 +187,7 @@ public void setEnvironment(String environment) { */ public TransactionNotificationRequestV4 timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set return this; } @@ -186,6 +211,7 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set } /** @@ -197,6 +223,7 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public TransactionNotificationRequestV4 type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -220,6 +247,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 TransactionNotificationRequestV4 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 TransactionNotificationRequestV4 object is equal to o. */ @@ -266,6 +314,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransactionNotificationRequestV4 given an JSON string * diff --git a/src/main/java/com/adyen/model/transactionwebhooks/TransferNotificationValidationFact.java b/src/main/java/com/adyen/model/transactionwebhooks/TransferNotificationValidationFact.java index f12636eac..5b364f29e 100644 --- a/src/main/java/com/adyen/model/transactionwebhooks/TransferNotificationValidationFact.java +++ b/src/main/java/com/adyen/model/transactionwebhooks/TransferNotificationValidationFact.java @@ -11,6 +11,8 @@ package com.adyen.model.transactionwebhooks; +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 TransferNotificationValidationFact { public static final String JSON_PROPERTY_RESULT = "result"; private String result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResult = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 TransferNotificationValidationFact() {} /** @@ -40,6 +54,7 @@ public TransferNotificationValidationFact() {} */ public TransferNotificationValidationFact result(String result) { this.result = result; + isSetResult = true; // mark as set return this; } @@ -63,6 +78,7 @@ public String getResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResult(String result) { this.result = result; + isSetResult = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setResult(String result) { */ public TransferNotificationValidationFact type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -97,6 +114,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferNotificationValidationFact 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 TransferNotificationValidationFact object is equal to o. */ @@ -139,6 +177,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 (isSetResult) { + addIfNull(nulls, JSON_PROPERTY_RESULT, this.result); + } + 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 TransferNotificationValidationFact given an JSON string * diff --git a/src/main/java/com/adyen/model/transactionwebhooks/TransferView.java b/src/main/java/com/adyen/model/transactionwebhooks/TransferView.java index dfb76fec0..de5084f36 100644 --- a/src/main/java/com/adyen/model/transactionwebhooks/TransferView.java +++ b/src/main/java/com/adyen/model/transactionwebhooks/TransferView.java @@ -11,6 +11,8 @@ package com.adyen.model.transactionwebhooks; +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 TransferView { public static final String JSON_PROPERTY_CATEGORY_DATA = "categoryData"; private TransferViewCategoryData categoryData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategoryData = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferView() {} /** @@ -43,6 +60,7 @@ public TransferView() {} */ public TransferView categoryData(TransferViewCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set return this; } @@ -66,6 +84,7 @@ public TransferViewCategoryData getCategoryData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategoryData(TransferViewCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setCategoryData(TransferViewCategoryData categoryData) { */ public TransferView id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -115,6 +136,7 @@ public void setId(String id) { */ public TransferView reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -150,6 +172,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 TransferView 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 TransferView object is equal to o. */ @@ -193,6 +236,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 (isSetCategoryData) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY_DATA, this.categoryData); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferView given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java index 7783e05a6..1366538da 100644 --- a/src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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,9 +33,15 @@ public class AULocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BSB_CODE = "bsbCode"; private String bsbCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBsbCode = false; + /** **auLocal** */ public enum TypeEnum { AULOCAL(String.valueOf("auLocal")); @@ -76,6 +84,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 AULocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public AULocalAccountIdentification() {} */ public AULocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -121,6 +140,7 @@ public void setAccountNumber(String accountNumber) { */ public AULocalAccountIdentification bsbCode(String bsbCode) { this.bsbCode = bsbCode; + isSetBsbCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getBsbCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBsbCode(String bsbCode) { this.bsbCode = bsbCode; + isSetBsbCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setBsbCode(String bsbCode) { */ public AULocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,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 AULocalAccountIdentification 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 AULocalAccountIdentification object is equal to o. */ @@ -224,6 +267,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBsbCode) { + addIfNull(nulls, JSON_PROPERTY_BSB_CODE, this.bsbCode); + } + 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 AULocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/AdditionalBankIdentification.java b/src/main/java/com/adyen/model/transfers/AdditionalBankIdentification.java index e04fa046c..bc049c895 100644 --- a/src/main/java/com/adyen/model/transfers/AdditionalBankIdentification.java +++ b/src/main/java/com/adyen/model/transfers/AdditionalBankIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -30,6 +32,9 @@ public class AdditionalBankIdentification { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + /** * The type of additional bank identification, depending on the country. Possible values: * * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) @@ -89,6 +94,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 AdditionalBankIdentification() {} /** @@ -99,6 +113,7 @@ public AdditionalBankIdentification() {} */ public AdditionalBankIdentification code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -122,6 +137,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -150,6 +166,7 @@ public void setCode(String code) { */ public AdditionalBankIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -209,6 +226,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 AdditionalBankIdentification 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 AdditionalBankIdentification object is equal to o. */ @@ -250,6 +288,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 (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + 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 AdditionalBankIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Address.java b/src/main/java/com/adyen/model/transfers/Address.java index 91636b973..4e954423d 100644 --- a/src/main/java/com/adyen/model/transfers/Address.java +++ b/src/main/java/com/adyen/model/transfers/Address.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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_LINE1 = "line1"; private String line1; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine1 = false; + public static final String JSON_PROPERTY_LINE2 = "line2"; private String line2; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine2 = 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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Address() {} /** @@ -57,6 +83,7 @@ public Address() {} */ public Address city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -84,6 +111,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -95,6 +123,7 @@ public void setCity(String city) { */ public Address country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -120,6 +149,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 line1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set return this; } @@ -162,6 +193,7 @@ public String getLine1() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set } /** @@ -175,6 +207,7 @@ public void setLine1(String line1) { */ public Address line2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set return this; } @@ -204,6 +237,7 @@ public String getLine2() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set } /** @@ -218,6 +252,7 @@ public void setLine2(String line2) { */ public Address postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -249,6 +284,7 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set } /** @@ -261,6 +297,7 @@ public void setPostalCode(String postalCode) { */ public Address stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set return this; } @@ -288,6 +325,27 @@ public String getStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = 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. */ @@ -337,6 +395,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 (isSetLine1) { + addIfNull(nulls, JSON_PROPERTY_LINE1, this.line1); + } + if (isSetLine2) { + addIfNull(nulls, JSON_PROPERTY_LINE2, this.line2); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + if (isSetStateOrProvince) { + addIfNull(nulls, JSON_PROPERTY_STATE_OR_PROVINCE, this.stateOrProvince); + } + + 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/transfers/Airline.java b/src/main/java/com/adyen/model/transfers/Airline.java index 6c8b03983..f984a8439 100644 --- a/src/main/java/com/adyen/model/transfers/Airline.java +++ b/src/main/java/com/adyen/model/transfers/Airline.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 Airline { public static final String JSON_PROPERTY_LEGS = "legs"; private List legs; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegs = false; + public static final String JSON_PROPERTY_TICKET_NUMBER = "ticketNumber"; private String ticketNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTicketNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Airline() {} /** @@ -38,6 +52,7 @@ public Airline() {} */ public Airline legs(List legs) { this.legs = legs; + isSetLegs = true; // mark as set return this; } @@ -69,6 +84,7 @@ public List getLegs() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegs(List legs) { this.legs = legs; + isSetLegs = true; // mark as set } /** @@ -79,6 +95,7 @@ public void setLegs(List legs) { */ public Airline ticketNumber(String ticketNumber) { this.ticketNumber = ticketNumber; + isSetTicketNumber = true; // mark as set return this; } @@ -102,6 +119,27 @@ public String getTicketNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTicketNumber(String ticketNumber) { this.ticketNumber = ticketNumber; + isSetTicketNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Airline 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 Airline object is equal to o. */ @@ -143,6 +181,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 (isSetLegs) { + addIfNull(nulls, JSON_PROPERTY_LEGS, this.legs); + } + if (isSetTicketNumber) { + addIfNull(nulls, JSON_PROPERTY_TICKET_NUMBER, this.ticketNumber); + } + + 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 Airline given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Amount.java b/src/main/java/com/adyen/model/transfers/Amount.java index 530fab926..b291d2f90 100644 --- a/src/main/java/com/adyen/model/transfers/Amount.java +++ b/src/main/java/com/adyen/model/transfers/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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. */ @@ -145,6 +189,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/transfers/AmountAdjustment.java b/src/main/java/com/adyen/model/transfers/AmountAdjustment.java index 03b2df268..d02e0742a 100644 --- a/src/main/java/com/adyen/model/transfers/AmountAdjustment.java +++ b/src/main/java/com/adyen/model/transfers/AmountAdjustment.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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 AmountAdjustment { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + /** * The type of markup that is applied to an authorised payment. Possible values: **exchange**, * **forexMarkup**, **authHoldReserve**, **atmMarkup**. @@ -82,9 +87,21 @@ public static AmountAdjustmentTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_AMOUNT_ADJUSTMENT_TYPE = "amountAdjustmentType"; private AmountAdjustmentTypeEnum amountAdjustmentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountAdjustmentType = false; + public static final String JSON_PROPERTY_BASEPOINTS = "basepoints"; private Integer basepoints; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasepoints = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AmountAdjustment() {} /** @@ -95,6 +112,7 @@ public AmountAdjustment() {} */ public AmountAdjustment amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -118,6 +136,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -130,6 +149,7 @@ public void setAmount(Amount amount) { */ public AmountAdjustment amountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentType) { this.amountAdjustmentType = amountAdjustmentType; + isSetAmountAdjustmentType = true; // mark as set return this; } @@ -157,6 +177,7 @@ public AmountAdjustmentTypeEnum getAmountAdjustmentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentType) { this.amountAdjustmentType = amountAdjustmentType; + isSetAmountAdjustmentType = true; // mark as set } /** @@ -167,6 +188,7 @@ public void setAmountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentTyp */ public AmountAdjustment basepoints(Integer basepoints) { this.basepoints = basepoints; + isSetBasepoints = true; // mark as set return this; } @@ -190,6 +212,27 @@ public Integer getBasepoints() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBasepoints(Integer basepoints) { this.basepoints = basepoints; + isSetBasepoints = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AmountAdjustment 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 AmountAdjustment object is equal to o. */ @@ -235,6 +278,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetAmountAdjustmentType) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_ADJUSTMENT_TYPE, this.amountAdjustmentType); + } + if (isSetBasepoints) { + addIfNull(nulls, JSON_PROPERTY_BASEPOINTS, this.basepoints); + } + + 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 AmountAdjustment given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ApproveTransfersRequest.java b/src/main/java/com/adyen/model/transfers/ApproveTransfersRequest.java index a8c71d092..e4594e196 100644 --- a/src/main/java/com/adyen/model/transfers/ApproveTransfersRequest.java +++ b/src/main/java/com/adyen/model/transfers/ApproveTransfersRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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,6 +27,15 @@ public class ApproveTransfersRequest { public static final String JSON_PROPERTY_TRANSFER_IDS = "transferIds"; private List transferIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ApproveTransfersRequest() {} /** @@ -35,6 +46,7 @@ public ApproveTransfersRequest() {} */ public ApproveTransfersRequest transferIds(List transferIds) { this.transferIds = transferIds; + isSetTransferIds = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getTransferIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferIds(List transferIds) { this.transferIds = transferIds; + isSetTransferIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ApproveTransfersRequest 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 ApproveTransfersRequest object is equal to o. */ @@ -105,6 +138,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 (isSetTransferIds) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_IDS, this.transferIds); + } + + 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 ApproveTransfersRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/BRLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/BRLocalAccountIdentification.java index 728d4dff6..144cb0e4d 100644 --- a/src/main/java/com/adyen/model/transfers/BRLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/BRLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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 BRLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + public static final String JSON_PROPERTY_BRANCH_NUMBER = "branchNumber"; private String branchNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBranchNumber = false; + public static final String JSON_PROPERTY_ISPB = "ispb"; private String ispb; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIspb = false; + /** **brLocal** */ public enum TypeEnum { BRLOCAL(String.valueOf("brLocal")); @@ -84,6 +98,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 BRLocalAccountIdentification() {} /** @@ -94,6 +117,7 @@ public BRLocalAccountIdentification() {} */ public BRLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +141,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +152,7 @@ public void setAccountNumber(String accountNumber) { */ public BRLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -150,6 +176,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -160,6 +187,7 @@ public void setBankCode(String bankCode) { */ public BRLocalAccountIdentification branchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set return this; } @@ -183,6 +211,7 @@ public String getBranchNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBranchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set } /** @@ -193,6 +222,7 @@ public void setBranchNumber(String branchNumber) { */ public BRLocalAccountIdentification ispb(String ispb) { this.ispb = ispb; + isSetIspb = true; // mark as set return this; } @@ -216,6 +246,7 @@ public String getIspb() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIspb(String ispb) { this.ispb = ispb; + isSetIspb = true; // mark as set } /** @@ -226,6 +257,7 @@ public void setIspb(String ispb) { */ public BRLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -249,6 +281,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 BRLocalAccountIdentification 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 BRLocalAccountIdentification object is equal to o. */ @@ -296,6 +349,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetBranchNumber) { + addIfNull(nulls, JSON_PROPERTY_BRANCH_NUMBER, this.branchNumber); + } + if (isSetIspb) { + addIfNull(nulls, JSON_PROPERTY_ISPB, this.ispb); + } + 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 BRLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/BalanceMutation.java b/src/main/java/com/adyen/model/transfers/BalanceMutation.java index 2514bdce2..b91c3eb29 100644 --- a/src/main/java/com/adyen/model/transfers/BalanceMutation.java +++ b/src/main/java/com/adyen/model/transfers/BalanceMutation.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 BalanceMutation { public static final String JSON_PROPERTY_BALANCE = "balance"; private Long balance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalance = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_RECEIVED = "received"; private Long received; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReceived = false; + public static final String JSON_PROPERTY_RESERVED = "reserved"; private Long reserved; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReserved = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceMutation() {} /** @@ -49,6 +69,7 @@ public BalanceMutation() {} */ public BalanceMutation balance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set return this; } @@ -76,6 +97,7 @@ public Long getBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set } /** @@ -88,6 +110,7 @@ public void setBalance(Long balance) { */ public BalanceMutation currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -115,6 +138,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -127,6 +151,7 @@ public void setCurrency(String currency) { */ public BalanceMutation received(Long received) { this.received = received; + isSetReceived = true; // mark as set return this; } @@ -154,6 +179,7 @@ public Long getReceived() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReceived(Long received) { this.received = received; + isSetReceived = true; // mark as set } /** @@ -166,6 +192,7 @@ public void setReceived(Long received) { */ public BalanceMutation reserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set return this; } @@ -193,6 +220,27 @@ public Long getReserved() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceMutation 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 BalanceMutation object is equal to o. */ @@ -238,6 +286,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 (isSetBalance) { + addIfNull(nulls, JSON_PROPERTY_BALANCE, this.balance); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetReceived) { + addIfNull(nulls, JSON_PROPERTY_RECEIVED, this.received); + } + if (isSetReserved) { + addIfNull(nulls, JSON_PROPERTY_RESERVED, this.reserved); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceMutation given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/BankAccountV3.java b/src/main/java/com/adyen/model/transfers/BankAccountV3.java index 3d1a99a35..ea14c090c 100644 --- a/src/main/java/com/adyen/model/transfers/BankAccountV3.java +++ b/src/main/java/com/adyen/model/transfers/BankAccountV3.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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; @@ -20,15 +22,34 @@ /** BankAccountV3 */ @JsonPropertyOrder({ BankAccountV3.JSON_PROPERTY_ACCOUNT_HOLDER, - BankAccountV3.JSON_PROPERTY_ACCOUNT_IDENTIFICATION + BankAccountV3.JSON_PROPERTY_ACCOUNT_IDENTIFICATION, + BankAccountV3.JSON_PROPERTY_STORED_PAYMENT_METHOD_ID }) public class BankAccountV3 { public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; private PartyIdentification accountHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + public static final String JSON_PROPERTY_ACCOUNT_IDENTIFICATION = "accountIdentification"; private BankAccountV3AccountIdentification accountIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountIdentification = false; + + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; + private String storedPaymentMethodId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BankAccountV3() {} /** @@ -39,6 +60,7 @@ public BankAccountV3() {} */ public BankAccountV3 accountHolder(PartyIdentification accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -62,6 +84,7 @@ public PartyIdentification getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(PartyIdentification accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set } /** @@ -73,6 +96,7 @@ public void setAccountHolder(PartyIdentification accountHolder) { public BankAccountV3 accountIdentification( BankAccountV3AccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set return this; } @@ -96,6 +120,68 @@ public BankAccountV3AccountIdentification getAccountIdentification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountIdentification(BankAccountV3AccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set + } + + /** + * The unique token that identifies the stored bank account details of the counterparty for a + * payout. + * + * @param storedPaymentMethodId The unique token that identifies the stored bank account details + * of the counterparty for a payout. + * @return the current {@code BankAccountV3} instance, allowing for method chaining + */ + public BankAccountV3 storedPaymentMethodId(String storedPaymentMethodId) { + this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + return this; + } + + /** + * The unique token that identifies the stored bank account details of the counterparty for a + * payout. + * + * @return storedPaymentMethodId The unique token that identifies the stored bank account details + * of the counterparty for a payout. + */ + @JsonProperty(JSON_PROPERTY_STORED_PAYMENT_METHOD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStoredPaymentMethodId() { + return storedPaymentMethodId; + } + + /** + * The unique token that identifies the stored bank account details of the counterparty for a + * payout. + * + * @param storedPaymentMethodId The unique token that identifies the stored bank account details + * of the counterparty for a payout. + */ + @JsonProperty(JSON_PROPERTY_STORED_PAYMENT_METHOD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredPaymentMethodId(String storedPaymentMethodId) { + this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankAccountV3 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 BankAccountV3 object is equal to o. */ @@ -109,12 +195,13 @@ public boolean equals(Object o) { } BankAccountV3 bankAccountV3 = (BankAccountV3) o; return Objects.equals(this.accountHolder, bankAccountV3.accountHolder) - && Objects.equals(this.accountIdentification, bankAccountV3.accountIdentification); + && Objects.equals(this.accountIdentification, bankAccountV3.accountIdentification) + && Objects.equals(this.storedPaymentMethodId, bankAccountV3.storedPaymentMethodId); } @Override public int hashCode() { - return Objects.hash(accountHolder, accountIdentification); + return Objects.hash(accountHolder, accountIdentification, storedPaymentMethodId); } @Override @@ -125,6 +212,9 @@ public String toString() { sb.append(" accountIdentification: ") .append(toIndentedString(accountIdentification)) .append("\n"); + sb.append(" storedPaymentMethodId: ") + .append(toIndentedString(storedPaymentMethodId)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -139,6 +229,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 (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAccountIdentification) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_IDENTIFICATION, this.accountIdentification); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + + 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 BankAccountV3 given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/BankCategoryData.java b/src/main/java/com/adyen/model/transfers/BankCategoryData.java index cbd1399b2..527bd77b8 100644 --- a/src/main/java/com/adyen/model/transfers/BankCategoryData.java +++ b/src/main/java/com/adyen/model/transfers/BankCategoryData.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -27,14 +29,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 { @@ -88,6 +90,9 @@ public static PriorityEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITY = "priority"; private PriorityEnum priority; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriority = false; + /** **bank** */ public enum TypeEnum { BANK(String.valueOf("bank")); @@ -130,62 +135,72 @@ 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 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 */ public BankCategoryData priority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set return this; } /** * 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,32 +212,33 @@ 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) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set } /** @@ -233,6 +249,7 @@ public void setPriority(PriorityEnum priority) { */ public BankCategoryData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -256,6 +273,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 BankCategoryData 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 BankCategoryData object is equal to o. */ @@ -297,6 +335,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 (isSetPriority) { + addIfNull(nulls, JSON_PROPERTY_PRIORITY, this.priority); + } + 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 BankCategoryData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java index 648bb2325..068cac3d1 100644 --- a/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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 CALocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. */ @@ -79,12 +84,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_INSTITUTION_NUMBER = "institutionNumber"; private String institutionNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstitutionNumber = false; + public static final String JSON_PROPERTY_TRANSIT_NUMBER = "transitNumber"; private String transitNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransitNumber = false; + /** **caLocal** */ public enum TypeEnum { CALOCAL(String.valueOf("caLocal")); @@ -127,6 +141,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 CALocalAccountIdentification() {} /** @@ -137,6 +160,7 @@ public CALocalAccountIdentification() {} */ public CALocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -160,6 +184,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -171,6 +196,7 @@ public void setAccountNumber(String accountNumber) { */ public CALocalAccountIdentification accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -196,6 +222,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -206,6 +233,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public CALocalAccountIdentification institutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; + isSetInstitutionNumber = true; // mark as set return this; } @@ -229,6 +257,7 @@ public String getInstitutionNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstitutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; + isSetInstitutionNumber = true; // mark as set } /** @@ -239,6 +268,7 @@ public void setInstitutionNumber(String institutionNumber) { */ public CALocalAccountIdentification transitNumber(String transitNumber) { this.transitNumber = transitNumber; + isSetTransitNumber = true; // mark as set return this; } @@ -262,6 +292,7 @@ public String getTransitNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransitNumber(String transitNumber) { this.transitNumber = transitNumber; + isSetTransitNumber = true; // mark as set } /** @@ -272,6 +303,7 @@ public void setTransitNumber(String transitNumber) { */ public CALocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -295,6 +327,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 CALocalAccountIdentification 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 CALocalAccountIdentification object is equal to o. */ @@ -342,6 +395,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetInstitutionNumber) { + addIfNull(nulls, JSON_PROPERTY_INSTITUTION_NUMBER, this.institutionNumber); + } + if (isSetTransitNumber) { + addIfNull(nulls, JSON_PROPERTY_TRANSIT_NUMBER, this.transitNumber); + } + 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 CALocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/CZLocalAccountIdentification.java index b07f74868..4522b55eb 100644 --- a/src/main/java/com/adyen/model/transfers/CZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/CZLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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,9 +33,15 @@ public class CZLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + /** **czLocal** */ public enum TypeEnum { CZLOCAL(String.valueOf("czLocal")); @@ -76,6 +84,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 CZLocalAccountIdentification() {} /** @@ -94,6 +111,7 @@ public CZLocalAccountIdentification() {} */ public CZLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -133,6 +151,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -143,6 +162,7 @@ public void setAccountNumber(String accountNumber) { */ public CZLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setBankCode(String bankCode) { */ public CZLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -199,6 +221,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 CZLocalAccountIdentification 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 CZLocalAccountIdentification object is equal to o. */ @@ -242,6 +285,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + 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 CZLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CancelTransfersRequest.java b/src/main/java/com/adyen/model/transfers/CancelTransfersRequest.java index 86903a5b6..bb3e61236 100644 --- a/src/main/java/com/adyen/model/transfers/CancelTransfersRequest.java +++ b/src/main/java/com/adyen/model/transfers/CancelTransfersRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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,6 +27,15 @@ public class CancelTransfersRequest { public static final String JSON_PROPERTY_TRANSFER_IDS = "transferIds"; private List transferIds; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferIds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CancelTransfersRequest() {} /** @@ -35,6 +46,7 @@ public CancelTransfersRequest() {} */ public CancelTransfersRequest transferIds(List transferIds) { this.transferIds = transferIds; + isSetTransferIds = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getTransferIds() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferIds(List transferIds) { this.transferIds = transferIds; + isSetTransferIds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CancelTransfersRequest 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 CancelTransfersRequest object is equal to o. */ @@ -105,6 +138,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 (isSetTransferIds) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_IDS, this.transferIds); + } + + 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 CancelTransfersRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CapitalBalance.java b/src/main/java/com/adyen/model/transfers/CapitalBalance.java index c8fe68990..d0bf59d1d 100644 --- a/src/main/java/com/adyen/model/transfers/CapitalBalance.java +++ b/src/main/java/com/adyen/model/transfers/CapitalBalance.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 CapitalBalance { 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_FEE = "fee"; private Long fee; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFee = false; + public static final String JSON_PROPERTY_PRINCIPAL = "principal"; private Long principal; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrincipal = false; + public static final String JSON_PROPERTY_TOTAL = "total"; private Long total; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotal = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapitalBalance() {} /** @@ -49,6 +69,7 @@ public CapitalBalance() {} */ public CapitalBalance currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -76,6 +97,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -86,6 +108,7 @@ public void setCurrency(String currency) { */ public CapitalBalance fee(Long fee) { this.fee = fee; + isSetFee = true; // mark as set return this; } @@ -109,6 +132,7 @@ public Long getFee() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFee(Long fee) { this.fee = fee; + isSetFee = true; // mark as set } /** @@ -119,6 +143,7 @@ public void setFee(Long fee) { */ public CapitalBalance principal(Long principal) { this.principal = principal; + isSetPrincipal = true; // mark as set return this; } @@ -142,6 +167,7 @@ public Long getPrincipal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrincipal(Long principal) { this.principal = principal; + isSetPrincipal = true; // mark as set } /** @@ -152,6 +178,7 @@ public void setPrincipal(Long principal) { */ public CapitalBalance total(Long total) { this.total = total; + isSetTotal = true; // mark as set return this; } @@ -175,6 +202,27 @@ public Long getTotal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTotal(Long total) { this.total = total; + isSetTotal = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapitalBalance 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 CapitalBalance object is equal to o. */ @@ -220,6 +268,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 (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetFee) { + addIfNull(nulls, JSON_PROPERTY_FEE, this.fee); + } + if (isSetPrincipal) { + addIfNull(nulls, JSON_PROPERTY_PRINCIPAL, this.principal); + } + if (isSetTotal) { + addIfNull(nulls, JSON_PROPERTY_TOTAL, this.total); + } + + 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 CapitalBalance given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CapitalGrant.java b/src/main/java/com/adyen/model/transfers/CapitalGrant.java index 898c8a4d4..92af073c4 100644 --- a/src/main/java/com/adyen/model/transfers/CapitalGrant.java +++ b/src/main/java/com/adyen/model/transfers/CapitalGrant.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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,27 +39,51 @@ public class CapitalGrant { 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_BALANCES = "balances"; private CapitalBalance balances; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalances = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private Counterparty counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + public static final String JSON_PROPERTY_FEE = "fee"; private Fee fee; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFee = false; + public static final String JSON_PROPERTY_GRANT_ACCOUNT_ID = "grantAccountId"; private String grantAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrantAccountId = false; + public static final String JSON_PROPERTY_GRANT_OFFER_ID = "grantOfferId"; private String grantOfferId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrantOfferId = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REPAYMENT = "repayment"; private Repayment repayment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRepayment = false; + /** * The current status of the grant. Possible values: **Pending**, **Active**, **Repaid**, * **WrittenOff**, **Failed**, **Revoked**. @@ -113,6 +139,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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapitalGrant() {} /** @@ -123,6 +158,7 @@ public CapitalGrant() {} */ public CapitalGrant amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -146,6 +182,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -156,6 +193,7 @@ public void setAmount(Amount amount) { */ public CapitalGrant balances(CapitalBalance balances) { this.balances = balances; + isSetBalances = true; // mark as set return this; } @@ -179,6 +217,7 @@ public CapitalBalance getBalances() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalances(CapitalBalance balances) { this.balances = balances; + isSetBalances = true; // mark as set } /** @@ -189,6 +228,7 @@ public void setBalances(CapitalBalance balances) { */ public CapitalGrant counterparty(Counterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -212,6 +252,7 @@ public Counterparty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(Counterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -222,6 +263,7 @@ public void setCounterparty(Counterparty counterparty) { */ public CapitalGrant fee(Fee fee) { this.fee = fee; + isSetFee = true; // mark as set return this; } @@ -245,6 +287,7 @@ public Fee getFee() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFee(Fee fee) { this.fee = fee; + isSetFee = true; // mark as set } /** @@ -255,6 +298,7 @@ public void setFee(Fee fee) { */ public CapitalGrant grantAccountId(String grantAccountId) { this.grantAccountId = grantAccountId; + isSetGrantAccountId = true; // mark as set return this; } @@ -278,6 +322,7 @@ public String getGrantAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGrantAccountId(String grantAccountId) { this.grantAccountId = grantAccountId; + isSetGrantAccountId = true; // mark as set } /** @@ -290,6 +335,7 @@ public void setGrantAccountId(String grantAccountId) { */ public CapitalGrant grantOfferId(String grantOfferId) { this.grantOfferId = grantOfferId; + isSetGrantOfferId = true; // mark as set return this; } @@ -317,6 +363,7 @@ public String getGrantOfferId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGrantOfferId(String grantOfferId) { this.grantOfferId = grantOfferId; + isSetGrantOfferId = true; // mark as set } /** @@ -327,6 +374,7 @@ public void setGrantOfferId(String grantOfferId) { */ public CapitalGrant id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -350,6 +398,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -360,6 +409,7 @@ public void setId(String id) { */ public CapitalGrant repayment(Repayment repayment) { this.repayment = repayment; + isSetRepayment = true; // mark as set return this; } @@ -383,6 +433,7 @@ public Repayment getRepayment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRepayment(Repayment repayment) { this.repayment = repayment; + isSetRepayment = true; // mark as set } /** @@ -395,6 +446,7 @@ public void setRepayment(Repayment repayment) { */ public CapitalGrant status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -422,6 +474,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapitalGrant 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 CapitalGrant object is equal to o. */ @@ -478,6 +551,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 (isSetBalances) { + addIfNull(nulls, JSON_PROPERTY_BALANCES, this.balances); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetFee) { + addIfNull(nulls, JSON_PROPERTY_FEE, this.fee); + } + if (isSetGrantAccountId) { + addIfNull(nulls, JSON_PROPERTY_GRANT_ACCOUNT_ID, this.grantAccountId); + } + if (isSetGrantOfferId) { + addIfNull(nulls, JSON_PROPERTY_GRANT_OFFER_ID, this.grantOfferId); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetRepayment) { + addIfNull(nulls, JSON_PROPERTY_REPAYMENT, this.repayment); + } + 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 CapitalGrant given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CapitalGrantInfo.java b/src/main/java/com/adyen/model/transfers/CapitalGrantInfo.java index 2ba854c7f..70459e15d 100644 --- a/src/main/java/com/adyen/model/transfers/CapitalGrantInfo.java +++ b/src/main/java/com/adyen/model/transfers/CapitalGrantInfo.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 CapitalGrantInfo { public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private Counterparty counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = false; + public static final String JSON_PROPERTY_GRANT_ACCOUNT_ID = "grantAccountId"; private String grantAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrantAccountId = false; + public static final String JSON_PROPERTY_GRANT_OFFER_ID = "grantOfferId"; private String grantOfferId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrantOfferId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapitalGrantInfo() {} /** @@ -43,6 +60,7 @@ public CapitalGrantInfo() {} */ public CapitalGrantInfo counterparty(Counterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -66,6 +84,7 @@ public Counterparty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(Counterparty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setCounterparty(Counterparty counterparty) { */ public CapitalGrantInfo grantAccountId(String grantAccountId) { this.grantAccountId = grantAccountId; + isSetGrantAccountId = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getGrantAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGrantAccountId(String grantAccountId) { this.grantAccountId = grantAccountId; + isSetGrantAccountId = true; // mark as set } /** @@ -111,6 +132,7 @@ public void setGrantAccountId(String grantAccountId) { */ public CapitalGrantInfo grantOfferId(String grantOfferId) { this.grantOfferId = grantOfferId; + isSetGrantOfferId = true; // mark as set return this; } @@ -138,6 +160,27 @@ public String getGrantOfferId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGrantOfferId(String grantOfferId) { this.grantOfferId = grantOfferId; + isSetGrantOfferId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapitalGrantInfo 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 CapitalGrantInfo object is equal to o. */ @@ -181,6 +224,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 (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetGrantAccountId) { + addIfNull(nulls, JSON_PROPERTY_GRANT_ACCOUNT_ID, this.grantAccountId); + } + if (isSetGrantOfferId) { + addIfNull(nulls, JSON_PROPERTY_GRANT_OFFER_ID, this.grantOfferId); + } + + 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 CapitalGrantInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CapitalGrants.java b/src/main/java/com/adyen/model/transfers/CapitalGrants.java index d3587db82..52e51bb38 100644 --- a/src/main/java/com/adyen/model/transfers/CapitalGrants.java +++ b/src/main/java/com/adyen/model/transfers/CapitalGrants.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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,6 +27,15 @@ public class CapitalGrants { public static final String JSON_PROPERTY_GRANTS = "grants"; private List grants; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrants = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapitalGrants() {} /** @@ -35,6 +46,7 @@ public CapitalGrants() {} */ public CapitalGrants grants(List grants) { this.grants = grants; + isSetGrants = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getGrants() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGrants(List grants) { this.grants = grants; + isSetGrants = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapitalGrants 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 CapitalGrants object is equal to o. */ @@ -105,6 +138,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 (isSetGrants) { + addIfNull(nulls, JSON_PROPERTY_GRANTS, this.grants); + } + + 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 CapitalGrants given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Card.java b/src/main/java/com/adyen/model/transfers/Card.java index cc75ab40a..34c3f1854 100644 --- a/src/main/java/com/adyen/model/transfers/Card.java +++ b/src/main/java/com/adyen/model/transfers/Card.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 Card { public static final String JSON_PROPERTY_CARD_HOLDER = "cardHolder"; private PartyIdentification cardHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardHolder = false; + public static final String JSON_PROPERTY_CARD_IDENTIFICATION = "cardIdentification"; private CardIdentification cardIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardIdentification = 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() {} /** @@ -36,6 +50,7 @@ public Card() {} */ public Card cardHolder(PartyIdentification cardHolder) { this.cardHolder = cardHolder; + isSetCardHolder = true; // mark as set return this; } @@ -59,6 +74,7 @@ public PartyIdentification getCardHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardHolder(PartyIdentification cardHolder) { this.cardHolder = cardHolder; + isSetCardHolder = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCardHolder(PartyIdentification cardHolder) { */ public Card cardIdentification(CardIdentification cardIdentification) { this.cardIdentification = cardIdentification; + isSetCardIdentification = true; // mark as set return this; } @@ -92,6 +109,27 @@ public CardIdentification getCardIdentification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardIdentification(CardIdentification cardIdentification) { this.cardIdentification = cardIdentification; + isSetCardIdentification = 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. */ @@ -133,6 +171,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 (isSetCardHolder) { + addIfNull(nulls, JSON_PROPERTY_CARD_HOLDER, this.cardHolder); + } + if (isSetCardIdentification) { + addIfNull(nulls, JSON_PROPERTY_CARD_IDENTIFICATION, this.cardIdentification); + } + + 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/transfers/CardIdentification.java b/src/main/java/com/adyen/model/transfers/CardIdentification.java index 01ae824fd..97fc4d3ad 100644 --- a/src/main/java/com/adyen/model/transfers/CardIdentification.java +++ b/src/main/java/com/adyen/model/transfers/CardIdentification.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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; @@ -31,24 +33,51 @@ public class CardIdentification { 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_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; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardIdentification() {} /** @@ -61,6 +90,7 @@ public CardIdentification() {} */ public CardIdentification expiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set return this; } @@ -88,6 +118,7 @@ public String getExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set } /** @@ -98,6 +129,7 @@ public void setExpiryMonth(String expiryMonth) { */ public CardIdentification expiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set return this; } @@ -121,6 +153,7 @@ public String getExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set } /** @@ -131,6 +164,7 @@ public void setExpiryYear(String expiryYear) { */ public CardIdentification issueNumber(String issueNumber) { this.issueNumber = issueNumber; + isSetIssueNumber = true; // mark as set return this; } @@ -154,6 +188,7 @@ public String getIssueNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssueNumber(String issueNumber) { this.issueNumber = issueNumber; + isSetIssueNumber = true; // mark as set } /** @@ -166,6 +201,7 @@ public void setIssueNumber(String issueNumber) { */ public CardIdentification number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -193,6 +229,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -206,6 +243,7 @@ public void setNumber(String number) { */ public CardIdentification startMonth(String startMonth) { this.startMonth = startMonth; + isSetStartMonth = true; // mark as set return this; } @@ -235,6 +273,7 @@ public String getStartMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartMonth(String startMonth) { this.startMonth = startMonth; + isSetStartMonth = true; // mark as set } /** @@ -247,6 +286,7 @@ public void setStartMonth(String startMonth) { */ public CardIdentification startYear(String startYear) { this.startYear = startYear; + isSetStartYear = true; // mark as set return this; } @@ -274,6 +314,7 @@ public String getStartYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartYear(String startYear) { this.startYear = startYear; + isSetStartYear = true; // mark as set } /** @@ -288,6 +329,7 @@ public void setStartYear(String startYear) { */ public CardIdentification storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -319,6 +361,27 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardIdentification 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 CardIdentification object is equal to o. */ @@ -373,6 +436,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_MONTH, this.expiryMonth); + } + if (isSetExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_YEAR, this.expiryYear); + } + 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); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + + 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 CardIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ConfirmationTrackingData.java b/src/main/java/com/adyen/model/transfers/ConfirmationTrackingData.java index d21e99954..60bfeb534 100644 --- a/src/main/java/com/adyen/model/transfers/ConfirmationTrackingData.java +++ b/src/main/java/com/adyen/model/transfers/ConfirmationTrackingData.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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 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; + /** * The type of the tracking event. Possible values: - **confirmation**: the transfer passed * Adyen's internal review. @@ -120,6 +125,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 ConfirmationTrackingData() {} /** @@ -134,6 +148,7 @@ public ConfirmationTrackingData() {} */ public ConfirmationTrackingData status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -165,6 +180,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -177,6 +193,7 @@ public void setStatus(StatusEnum status) { */ public ConfirmationTrackingData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -204,6 +221,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 ConfirmationTrackingData 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 ConfirmationTrackingData object is equal to o. */ @@ -245,6 +283,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 (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + 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 ConfirmationTrackingData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Counterparty.java b/src/main/java/com/adyen/model/transfers/Counterparty.java index d7776c09c..73972f0d2 100644 --- a/src/main/java/com/adyen/model/transfers/Counterparty.java +++ b/src/main/java/com/adyen/model/transfers/Counterparty.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 Counterparty { public static final String JSON_PROPERTY_ACCOUNT_HOLDER_ID = "accountHolderId"; private String accountHolderId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderId = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Counterparty() {} /** @@ -46,6 +63,7 @@ public Counterparty() {} */ public Counterparty accountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set return this; } @@ -75,6 +93,7 @@ public String getAccountHolderId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolderId(String accountHolderId) { this.accountHolderId = accountHolderId; + isSetAccountHolderId = true; // mark as set } /** @@ -86,6 +105,7 @@ public void setAccountHolderId(String accountHolderId) { */ public Counterparty balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -111,6 +131,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -123,6 +144,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public Counterparty transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -150,6 +172,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Counterparty 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 Counterparty object is equal to o. */ @@ -195,6 +238,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 (isSetAccountHolderId) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_ID, this.accountHolderId); + } + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + 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 Counterparty given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CounterpartyInfoV3.java b/src/main/java/com/adyen/model/transfers/CounterpartyInfoV3.java index ab07377da..b80beb42e 100644 --- a/src/main/java/com/adyen/model/transfers/CounterpartyInfoV3.java +++ b/src/main/java/com/adyen/model/transfers/CounterpartyInfoV3.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 CounterpartyInfoV3 { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountV3 bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = 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_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CounterpartyInfoV3() {} /** @@ -49,6 +69,7 @@ public CounterpartyInfoV3() {} */ public CounterpartyInfoV3 balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -76,6 +97,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -86,6 +108,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public CounterpartyInfoV3 bankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -109,6 +132,7 @@ public BankAccountV3 getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -119,6 +143,7 @@ public void setBankAccount(BankAccountV3 bankAccount) { */ public CounterpartyInfoV3 card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -142,6 +167,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -154,6 +180,7 @@ public void setCard(Card card) { */ public CounterpartyInfoV3 transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -181,6 +208,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CounterpartyInfoV3 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 CounterpartyInfoV3 object is equal to o. */ @@ -228,6 +276,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 (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + 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 CounterpartyInfoV3 given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/CounterpartyV3.java b/src/main/java/com/adyen/model/transfers/CounterpartyV3.java index e9fb906e3..1dff3d7d5 100644 --- a/src/main/java/com/adyen/model/transfers/CounterpartyV3.java +++ b/src/main/java/com/adyen/model/transfers/CounterpartyV3.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 CounterpartyV3 { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountV3 bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = 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_MERCHANT = "merchant"; private MerchantData merchant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchant = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CounterpartyV3() {} /** @@ -53,6 +76,7 @@ public CounterpartyV3() {} */ public CounterpartyV3 balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -80,6 +104,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -90,6 +115,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public CounterpartyV3 bankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -113,6 +139,7 @@ public BankAccountV3 getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -123,6 +150,7 @@ public void setBankAccount(BankAccountV3 bankAccount) { */ public CounterpartyV3 card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -146,6 +174,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -156,6 +185,7 @@ public void setCard(Card card) { */ public CounterpartyV3 merchant(MerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set return this; } @@ -179,6 +209,7 @@ public MerchantData getMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchant(MerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set } /** @@ -191,6 +222,7 @@ public void setMerchant(MerchantData merchant) { */ public CounterpartyV3 transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -218,6 +250,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CounterpartyV3 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 CounterpartyV3 object is equal to o. */ @@ -267,6 +320,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 (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetMerchant) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT, this.merchant); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + 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 CounterpartyV3 given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/DKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/DKLocalAccountIdentification.java index 1531d3128..549c47489 100644 --- a/src/main/java/com/adyen/model/transfers/DKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/DKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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,9 +33,15 @@ public class DKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + /** **dkLocal** */ public enum TypeEnum { DKLOCAL(String.valueOf("dkLocal")); @@ -76,6 +84,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 DKLocalAccountIdentification() {} /** @@ -87,6 +104,7 @@ public DKLocalAccountIdentification() {} */ public DKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -112,6 +130,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -122,6 +141,7 @@ public void setAccountNumber(String accountNumber) { */ public DKLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -146,6 +166,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -156,6 +177,7 @@ public void setBankCode(String bankCode) { */ public DKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -179,6 +201,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 DKLocalAccountIdentification 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 DKLocalAccountIdentification object is equal to o. */ @@ -222,6 +265,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + 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 DKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/DirectDebitInformation.java b/src/main/java/com/adyen/model/transfers/DirectDebitInformation.java index 957c0e11a..dbeb2d8c7 100644 --- a/src/main/java/com/adyen/model/transfers/DirectDebitInformation.java +++ b/src/main/java/com/adyen/model/transfers/DirectDebitInformation.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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,15 +31,33 @@ public class DirectDebitInformation { public static final String JSON_PROPERTY_DATE_OF_SIGNATURE = "dateOfSignature"; private OffsetDateTime dateOfSignature; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfSignature = false; + public static final String JSON_PROPERTY_DUE_DATE = "dueDate"; private OffsetDateTime dueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDueDate = false; + public static final String JSON_PROPERTY_MANDATE_ID = "mandateId"; private String mandateId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMandateId = false; + public static final String JSON_PROPERTY_SEQUENCE_TYPE = "sequenceType"; private String sequenceType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSequenceType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DirectDebitInformation() {} /** @@ -50,6 +70,7 @@ public DirectDebitInformation() {} */ public DirectDebitInformation dateOfSignature(OffsetDateTime dateOfSignature) { this.dateOfSignature = dateOfSignature; + isSetDateOfSignature = true; // mark as set return this; } @@ -77,6 +98,7 @@ public OffsetDateTime getDateOfSignature() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfSignature(OffsetDateTime dateOfSignature) { this.dateOfSignature = dateOfSignature; + isSetDateOfSignature = true; // mark as set } /** @@ -87,6 +109,7 @@ public void setDateOfSignature(OffsetDateTime dateOfSignature) { */ public DirectDebitInformation dueDate(OffsetDateTime dueDate) { this.dueDate = dueDate; + isSetDueDate = true; // mark as set return this; } @@ -110,6 +133,7 @@ public OffsetDateTime getDueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDueDate(OffsetDateTime dueDate) { this.dueDate = dueDate; + isSetDueDate = true; // mark as set } /** @@ -120,6 +144,7 @@ public void setDueDate(OffsetDateTime dueDate) { */ public DirectDebitInformation mandateId(String mandateId) { this.mandateId = mandateId; + isSetMandateId = true; // mark as set return this; } @@ -143,6 +168,7 @@ public String getMandateId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMandateId(String mandateId) { this.mandateId = mandateId; + isSetMandateId = true; // mark as set } /** @@ -155,6 +181,7 @@ public void setMandateId(String mandateId) { */ public DirectDebitInformation sequenceType(String sequenceType) { this.sequenceType = sequenceType; + isSetSequenceType = true; // mark as set return this; } @@ -182,6 +209,27 @@ public String getSequenceType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSequenceType(String sequenceType) { this.sequenceType = sequenceType; + isSetSequenceType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DirectDebitInformation 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 DirectDebitInformation object is equal to o. */ @@ -227,6 +275,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 (isSetDateOfSignature) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_SIGNATURE, this.dateOfSignature); + } + if (isSetDueDate) { + addIfNull(nulls, JSON_PROPERTY_DUE_DATE, this.dueDate); + } + if (isSetMandateId) { + addIfNull(nulls, JSON_PROPERTY_MANDATE_ID, this.mandateId); + } + if (isSetSequenceType) { + addIfNull(nulls, JSON_PROPERTY_SEQUENCE_TYPE, this.sequenceType); + } + + 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 DirectDebitInformation given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/EstimationTrackingData.java b/src/main/java/com/adyen/model/transfers/EstimationTrackingData.java index f6242456e..cda7d561b 100644 --- a/src/main/java/com/adyen/model/transfers/EstimationTrackingData.java +++ b/src/main/java/com/adyen/model/transfers/EstimationTrackingData.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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 EstimationTrackingData { public static final String JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME = "estimatedArrivalTime"; private OffsetDateTime estimatedArrivalTime; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEstimatedArrivalTime = false; + /** * The type of tracking event. Possible values: - **estimation**: the estimated date and time of * when the funds will be credited has been determined. @@ -76,6 +81,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 EstimationTrackingData() {} /** @@ -86,6 +100,7 @@ public EstimationTrackingData() {} */ public EstimationTrackingData estimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set return this; } @@ -110,6 +125,7 @@ public OffsetDateTime getEstimatedArrivalTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set } /** @@ -122,6 +138,7 @@ public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { */ public EstimationTrackingData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -149,6 +166,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 EstimationTrackingData 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 EstimationTrackingData object is equal to o. */ @@ -192,6 +230,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 (isSetEstimatedArrivalTime) { + addIfNull(nulls, JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME, this.estimatedArrivalTime); + } + 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 EstimationTrackingData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ExecutionDate.java b/src/main/java/com/adyen/model/transfers/ExecutionDate.java index 7ad4cb2eb..fba85afd0 100644 --- a/src/main/java/com/adyen/model/transfers/ExecutionDate.java +++ b/src/main/java/com/adyen/model/transfers/ExecutionDate.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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; @@ -24,9 +26,21 @@ public class ExecutionDate { public static final String JSON_PROPERTY_DATE = "date"; private LocalDate date; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDate = false; + public static final String JSON_PROPERTY_TIMEZONE = "timezone"; private String timezone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimezone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ExecutionDate() {} /** @@ -43,6 +57,7 @@ public ExecutionDate() {} */ public ExecutionDate date(LocalDate date) { this.date = date; + isSetDate = true; // mark as set return this; } @@ -78,6 +93,7 @@ public LocalDate getDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDate(LocalDate date) { this.date = date; + isSetDate = true; // mark as set } /** @@ -92,6 +108,7 @@ public void setDate(LocalDate date) { */ public ExecutionDate timezone(String timezone) { this.timezone = timezone; + isSetTimezone = true; // mark as set return this; } @@ -123,6 +140,27 @@ public String getTimezone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimezone(String timezone) { this.timezone = timezone; + isSetTimezone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ExecutionDate 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 ExecutionDate object is equal to o. */ @@ -164,6 +202,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 (isSetDate) { + addIfNull(nulls, JSON_PROPERTY_DATE, this.date); + } + if (isSetTimezone) { + addIfNull(nulls, JSON_PROPERTY_TIMEZONE, this.timezone); + } + + 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 ExecutionDate given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ExternalReason.java b/src/main/java/com/adyen/model/transfers/ExternalReason.java index 24ddccc88..ce5b33864 100644 --- a/src/main/java/com/adyen/model/transfers/ExternalReason.java +++ b/src/main/java/com/adyen/model/transfers/ExternalReason.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 ExternalReason { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = 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_NAMESPACE = "namespace"; private String namespace; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNamespace = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ExternalReason() {} /** @@ -43,6 +60,7 @@ public ExternalReason() {} */ public ExternalReason code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setCode(String code) { */ public ExternalReason description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setDescription(String description) { */ public ExternalReason namespace(String namespace) { this.namespace = namespace; + isSetNamespace = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getNamespace() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNamespace(String namespace) { this.namespace = namespace; + isSetNamespace = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ExternalReason 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 ExternalReason object is equal to o. */ @@ -175,6 +218,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 (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetNamespace) { + addIfNull(nulls, JSON_PROPERTY_NAMESPACE, this.namespace); + } + + 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 ExternalReason given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Fee.java b/src/main/java/com/adyen/model/transfers/Fee.java index f02f6f94b..6dd6ecb78 100644 --- a/src/main/java/com/adyen/model/transfers/Fee.java +++ b/src/main/java/com/adyen/model/transfers/Fee.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 Fee { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Fee() {} /** @@ -33,6 +44,7 @@ public Fee() {} */ public Fee amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -56,6 +68,27 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Fee 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 Fee object is equal to o. */ @@ -95,6 +128,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + + 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 Fee given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/FindTransfersResponse.java b/src/main/java/com/adyen/model/transfers/FindTransfersResponse.java index 3f5c2509c..244d68230 100644 --- a/src/main/java/com/adyen/model/transfers/FindTransfersResponse.java +++ b/src/main/java/com/adyen/model/transfers/FindTransfersResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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,9 +30,21 @@ public class FindTransfersResponse { public static final String JSON_PROPERTY_LINKS = "_links"; private Links links; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLinks = false; + public static final String JSON_PROPERTY_DATA = "data"; private List data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public FindTransfersResponse() {} /** @@ -41,6 +55,7 @@ public FindTransfersResponse() {} */ public FindTransfersResponse links(Links links) { this.links = links; + isSetLinks = true; // mark as set return this; } @@ -64,6 +79,7 @@ public Links getLinks() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLinks(Links links) { this.links = links; + isSetLinks = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setLinks(Links links) { */ public FindTransfersResponse data(List data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -105,6 +122,27 @@ public List getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(List data) { this.data = data; + isSetData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FindTransfersResponse 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 FindTransfersResponse object is equal to o. */ @@ -146,6 +184,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 (isSetLinks) { + addIfNull(nulls, JSON_PROPERTY_LINKS, this.links); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + + 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 FindTransfersResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/FundingInstrument.java b/src/main/java/com/adyen/model/transfers/FundingInstrument.java new file mode 100644 index 000000000..3ad99878e --- /dev/null +++ b/src/main/java/com/adyen/model/transfers/FundingInstrument.java @@ -0,0 +1,385 @@ +/* + * Transfers API + * + * The version of the OpenAPI document: 4 + * + * + * 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.transfers; + +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; + +/** FundingInstrument */ +@JsonPropertyOrder({ + FundingInstrument.JSON_PROPERTY_CARD_IDENTIFICATION, + FundingInstrument.JSON_PROPERTY_NETWORK_PAYMENT_REFERENCE, + FundingInstrument.JSON_PROPERTY_REFERENCE, + FundingInstrument.JSON_PROPERTY_SOURCE_OF_FUNDS +}) +public class FundingInstrument { + public static final String JSON_PROPERTY_CARD_IDENTIFICATION = "cardIdentification"; + private CardIdentification cardIdentification; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardIdentification = false; + + public static final String JSON_PROPERTY_NETWORK_PAYMENT_REFERENCE = "networkPaymentReference"; + private String networkPaymentReference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkPaymentReference = false; + + public static final String JSON_PROPERTY_REFERENCE = "reference"; + private String reference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Indicates where the funds used for the transfer originated. Possible values are: - **DEBIT** + * for card-to-card transfers. - **DEPOSIT_ACCOUNT** for wallet-to-card transfers. + */ + public enum SourceOfFundsEnum { + DEBIT(String.valueOf("DEBIT")), + + DEPOSIT_ACCOUNT(String.valueOf("DEPOSIT_ACCOUNT")); + + private static final Logger LOG = Logger.getLogger(SourceOfFundsEnum.class.getName()); + + private String value; + + SourceOfFundsEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SourceOfFundsEnum fromValue(String value) { + for (SourceOfFundsEnum b : SourceOfFundsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "SourceOfFundsEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(SourceOfFundsEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_SOURCE_OF_FUNDS = "sourceOfFunds"; + private SourceOfFundsEnum sourceOfFunds; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSourceOfFunds = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public FundingInstrument() {} + + /** + * cardIdentification + * + * @param cardIdentification + * @return the current {@code FundingInstrument} instance, allowing for method chaining + */ + public FundingInstrument cardIdentification(CardIdentification cardIdentification) { + this.cardIdentification = cardIdentification; + isSetCardIdentification = true; // mark as set + return this; + } + + /** + * Get cardIdentification + * + * @return cardIdentification + */ + @JsonProperty(JSON_PROPERTY_CARD_IDENTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CardIdentification getCardIdentification() { + return cardIdentification; + } + + /** + * cardIdentification + * + * @param cardIdentification + */ + @JsonProperty(JSON_PROPERTY_CARD_IDENTIFICATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCardIdentification(CardIdentification cardIdentification) { + this.cardIdentification = cardIdentification; + isSetCardIdentification = true; // mark as set + } + + /** + * The unique reference assigned by the card network for the pay-in transaction. + * + * @param networkPaymentReference The unique reference assigned by the card network for the pay-in + * transaction. + * @return the current {@code FundingInstrument} instance, allowing for method chaining + */ + public FundingInstrument networkPaymentReference(String networkPaymentReference) { + this.networkPaymentReference = networkPaymentReference; + isSetNetworkPaymentReference = true; // mark as set + return this; + } + + /** + * The unique reference assigned by the card network for the pay-in transaction. + * + * @return networkPaymentReference The unique reference assigned by the card network for the + * pay-in transaction. + */ + @JsonProperty(JSON_PROPERTY_NETWORK_PAYMENT_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNetworkPaymentReference() { + return networkPaymentReference; + } + + /** + * The unique reference assigned by the card network for the pay-in transaction. + * + * @param networkPaymentReference The unique reference assigned by the card network for the pay-in + * transaction. + */ + @JsonProperty(JSON_PROPERTY_NETWORK_PAYMENT_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNetworkPaymentReference(String networkPaymentReference) { + this.networkPaymentReference = networkPaymentReference; + isSetNetworkPaymentReference = true; // mark as set + } + + /** + * Your internal reference that identifies this funding instrument. Required if + * `sourceOfFunds` is **DEPOSIT_ACCOUNT**. + * + * @param reference Your internal reference that identifies this funding instrument. Required if + * `sourceOfFunds` is **DEPOSIT_ACCOUNT**. + * @return the current {@code FundingInstrument} instance, allowing for method chaining + */ + public FundingInstrument reference(String reference) { + this.reference = reference; + isSetReference = true; // mark as set + return this; + } + + /** + * Your internal reference that identifies this funding instrument. Required if + * `sourceOfFunds` is **DEPOSIT_ACCOUNT**. + * + * @return reference Your internal reference that identifies this funding instrument. Required if + * `sourceOfFunds` is **DEPOSIT_ACCOUNT**. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReference() { + return reference; + } + + /** + * Your internal reference that identifies this funding instrument. Required if + * `sourceOfFunds` is **DEPOSIT_ACCOUNT**. + * + * @param reference Your internal reference that identifies this funding instrument. Required if + * `sourceOfFunds` is **DEPOSIT_ACCOUNT**. + */ + @JsonProperty(JSON_PROPERTY_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReference(String reference) { + this.reference = reference; + isSetReference = true; // mark as set + } + + /** + * Indicates where the funds used for the transfer originated. Possible values are: - **DEBIT** + * for card-to-card transfers. - **DEPOSIT_ACCOUNT** for wallet-to-card transfers. + * + * @param sourceOfFunds Indicates where the funds used for the transfer originated. Possible + * values are: - **DEBIT** for card-to-card transfers. - **DEPOSIT_ACCOUNT** for + * wallet-to-card transfers. + * @return the current {@code FundingInstrument} instance, allowing for method chaining + */ + public FundingInstrument sourceOfFunds(SourceOfFundsEnum sourceOfFunds) { + this.sourceOfFunds = sourceOfFunds; + isSetSourceOfFunds = true; // mark as set + return this; + } + + /** + * Indicates where the funds used for the transfer originated. Possible values are: - **DEBIT** + * for card-to-card transfers. - **DEPOSIT_ACCOUNT** for wallet-to-card transfers. + * + * @return sourceOfFunds Indicates where the funds used for the transfer originated. Possible + * values are: - **DEBIT** for card-to-card transfers. - **DEPOSIT_ACCOUNT** for + * wallet-to-card transfers. + */ + @JsonProperty(JSON_PROPERTY_SOURCE_OF_FUNDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SourceOfFundsEnum getSourceOfFunds() { + return sourceOfFunds; + } + + /** + * Indicates where the funds used for the transfer originated. Possible values are: - **DEBIT** + * for card-to-card transfers. - **DEPOSIT_ACCOUNT** for wallet-to-card transfers. + * + * @param sourceOfFunds Indicates where the funds used for the transfer originated. Possible + * values are: - **DEBIT** for card-to-card transfers. - **DEPOSIT_ACCOUNT** for + * wallet-to-card transfers. + */ + @JsonProperty(JSON_PROPERTY_SOURCE_OF_FUNDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceOfFunds(SourceOfFundsEnum sourceOfFunds) { + this.sourceOfFunds = sourceOfFunds; + isSetSourceOfFunds = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FundingInstrument 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 FundingInstrument object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FundingInstrument fundingInstrument = (FundingInstrument) o; + return Objects.equals(this.cardIdentification, fundingInstrument.cardIdentification) + && Objects.equals(this.networkPaymentReference, fundingInstrument.networkPaymentReference) + && Objects.equals(this.reference, fundingInstrument.reference) + && Objects.equals(this.sourceOfFunds, fundingInstrument.sourceOfFunds); + } + + @Override + public int hashCode() { + return Objects.hash(cardIdentification, networkPaymentReference, reference, sourceOfFunds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FundingInstrument {\n"); + sb.append(" cardIdentification: ").append(toIndentedString(cardIdentification)).append("\n"); + sb.append(" networkPaymentReference: ") + .append(toIndentedString(networkPaymentReference)) + .append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" sourceOfFunds: ").append(toIndentedString(sourceOfFunds)).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 (isSetCardIdentification) { + addIfNull(nulls, JSON_PROPERTY_CARD_IDENTIFICATION, this.cardIdentification); + } + if (isSetNetworkPaymentReference) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_PAYMENT_REFERENCE, this.networkPaymentReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSourceOfFunds) { + addIfNull(nulls, JSON_PROPERTY_SOURCE_OF_FUNDS, this.sourceOfFunds); + } + + 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 FundingInstrument given an JSON string + * + * @param jsonString JSON string + * @return An instance of FundingInstrument + * @throws JsonProcessingException if the JSON string is invalid with respect to FundingInstrument + */ + public static FundingInstrument fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, FundingInstrument.class); + } + + /** + * Convert an instance of FundingInstrument 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/transfers/HKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/HKLocalAccountIdentification.java index ab1c0d102..b60a9b398 100644 --- a/src/main/java/com/adyen/model/transfers/HKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/HKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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,9 +33,15 @@ public class HKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_CLEARING_CODE = "clearingCode"; private String clearingCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClearingCode = false; + /** **hkLocal** */ public enum TypeEnum { HKLOCAL(String.valueOf("hkLocal")); @@ -76,6 +84,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 HKLocalAccountIdentification() {} /** @@ -88,6 +105,7 @@ public HKLocalAccountIdentification() {} */ public HKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -115,6 +133,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -125,6 +144,7 @@ public void setAccountNumber(String accountNumber) { */ public HKLocalAccountIdentification clearingCode(String clearingCode) { this.clearingCode = clearingCode; + isSetClearingCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getClearingCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClearingCode(String clearingCode) { this.clearingCode = clearingCode; + isSetClearingCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setClearingCode(String clearingCode) { */ public HKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,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 HKLocalAccountIdentification 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 HKLocalAccountIdentification object is equal to o. */ @@ -224,6 +267,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetClearingCode) { + addIfNull(nulls, JSON_PROPERTY_CLEARING_CODE, this.clearingCode); + } + 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 HKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/HULocalAccountIdentification.java index 4af658eaa..48eae4a44 100644 --- a/src/main/java/com/adyen/model/transfers/HULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/HULocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -30,6 +32,9 @@ public class HULocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **huLocal** */ public enum TypeEnum { HULOCAL(String.valueOf("huLocal")); @@ -72,6 +77,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 HULocalAccountIdentification() {} /** @@ -82,6 +96,7 @@ public HULocalAccountIdentification() {} */ public HULocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -105,6 +120,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -115,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public HULocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -138,6 +155,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 HULocalAccountIdentification 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 HULocalAccountIdentification object is equal to o. */ @@ -179,6 +217,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + 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 HULocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/IbanAccountIdentification.java b/src/main/java/com/adyen/model/transfers/IbanAccountIdentification.java index c31dce55f..cd06b751e 100644 --- a/src/main/java/com/adyen/model/transfers/IbanAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/IbanAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -30,6 +32,9 @@ public class IbanAccountIdentification { public static final String JSON_PROPERTY_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + /** **iban** */ public enum TypeEnum { IBAN(String.valueOf("iban")); @@ -72,6 +77,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 IbanAccountIdentification() {} /** @@ -84,6 +98,7 @@ public IbanAccountIdentification() {} */ public IbanAccountIdentification iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -111,6 +126,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -121,6 +137,7 @@ public void setIban(String iban) { */ public IbanAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -144,6 +161,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 IbanAccountIdentification 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 IbanAccountIdentification object is equal to o. */ @@ -185,6 +223,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 (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + 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 IbanAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/InternalCategoryData.java b/src/main/java/com/adyen/model/transfers/InternalCategoryData.java index e6957c996..c2894cdf1 100644 --- a/src/main/java/com/adyen/model/transfers/InternalCategoryData.java +++ b/src/main/java/com/adyen/model/transfers/InternalCategoryData.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -32,9 +34,15 @@ public class InternalCategoryData { "modificationMerchantReference"; private String modificationMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationMerchantReference = false; + public static final String JSON_PROPERTY_MODIFICATION_PSP_REFERENCE = "modificationPspReference"; private String modificationPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationPspReference = false; + /** **internal** */ public enum TypeEnum { INTERNAL(String.valueOf("internal")); @@ -77,6 +85,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 InternalCategoryData() {} /** @@ -88,6 +105,7 @@ public InternalCategoryData() {} */ public InternalCategoryData modificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set return this; } @@ -113,6 +131,7 @@ public String getModificationMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set } /** @@ -123,6 +142,7 @@ public void setModificationMerchantReference(String modificationMerchantReferenc */ public InternalCategoryData modificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set return this; } @@ -146,6 +166,7 @@ public String getModificationPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set } /** @@ -156,6 +177,7 @@ public void setModificationPspReference(String modificationPspReference) { */ public InternalCategoryData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -179,6 +201,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 InternalCategoryData 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 InternalCategoryData object is equal to o. */ @@ -228,6 +271,37 @@ 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 (isSetModificationMerchantReference) { + addIfNull( + nulls, JSON_PROPERTY_MODIFICATION_MERCHANT_REFERENCE, this.modificationMerchantReference); + } + if (isSetModificationPspReference) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_PSP_REFERENCE, this.modificationPspReference); + } + 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 InternalCategoryData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/InternalReviewTrackingData.java b/src/main/java/com/adyen/model/transfers/InternalReviewTrackingData.java index a8b36278a..d88c3cbe0 100644 --- a/src/main/java/com/adyen/model/transfers/InternalReviewTrackingData.java +++ b/src/main/java/com/adyen/model/transfers/InternalReviewTrackingData.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -74,6 +76,9 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + /** * The status of the transfer. Possible values: - **pending**: the transfer is under internal * review by Adyen. - **failed**: the transfer failed Adyen's internal review. For details, @@ -122,6 +127,9 @@ 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; + /** * The type of tracking event. Possible values: - **internalReview**: the transfer was flagged * because it does not comply with Adyen's risk policy. @@ -167,6 +175,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 InternalReviewTrackingData() {} /** @@ -182,6 +199,7 @@ public InternalReviewTrackingData() {} */ public InternalReviewTrackingData reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -215,6 +233,7 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -229,6 +248,7 @@ public void setReason(ReasonEnum reason) { */ public InternalReviewTrackingData status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -260,6 +280,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -272,6 +293,7 @@ public void setStatus(StatusEnum status) { */ public InternalReviewTrackingData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -299,6 +321,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 InternalReviewTrackingData 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 InternalReviewTrackingData object is equal to o. */ @@ -342,6 +385,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 (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + 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 InternalReviewTrackingData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/InvalidField.java b/src/main/java/com/adyen/model/transfers/InvalidField.java index 59b4a67d9..f09cef9d8 100644 --- a/src/main/java/com/adyen/model/transfers/InvalidField.java +++ b/src/main/java/com/adyen/model/transfers/InvalidField.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 InvalidField { 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_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_VALUE = "value"; private String 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 InvalidField() {} /** @@ -43,6 +60,7 @@ public InvalidField() {} */ public InvalidField message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setMessage(String message) { */ public InvalidField 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 InvalidField value(String value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(String value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InvalidField 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 InvalidField object is equal to o. */ @@ -175,6 +218,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 (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + 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 InvalidField given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/IssuedCard.java b/src/main/java/com/adyen/model/transfers/IssuedCard.java index 4b1703e41..4da1b877c 100644 --- a/src/main/java/com/adyen/model/transfers/IssuedCard.java +++ b/src/main/java/com/adyen/model/transfers/IssuedCard.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -39,6 +41,9 @@ public class IssuedCard { public static final String JSON_PROPERTY_AUTHORISATION_TYPE = "authorisationType"; private String authorisationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorisationType = false; + /** * Indicates the method used for entering the PAN to initiate a transaction. Possible values: * **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**. @@ -96,6 +101,9 @@ public static PanEntryModeEnum fromValue(String value) { public static final String JSON_PROPERTY_PAN_ENTRY_MODE = "panEntryMode"; private PanEntryModeEnum panEntryMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPanEntryMode = false; + /** * Contains information about how the payment was processed. For example, **ecommerce** for online * or **pos** for in-person payments. @@ -155,19 +163,34 @@ public static ProcessingTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_PROCESSING_TYPE = "processingType"; private ProcessingTypeEnum processingType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProcessingType = false; + public static final String JSON_PROPERTY_RELAYED_AUTHORISATION_DATA = "relayedAuthorisationData"; private RelayedAuthorisationData relayedAuthorisationData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRelayedAuthorisationData = false; + public static final String JSON_PROPERTY_SCHEME_TRACE_ID = "schemeTraceId"; private String schemeTraceId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchemeTraceId = false; + public static final String JSON_PROPERTY_SCHEME_UNIQUE_TRANSACTION_ID = "schemeUniqueTransactionId"; private String schemeUniqueTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchemeUniqueTransactionId = false; + public static final String JSON_PROPERTY_THREE_D_SECURE = "threeDSecure"; private ThreeDSecure threeDSecure; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSecure = false; + /** **issuedCard** */ public enum TypeEnum { ISSUEDCARD(String.valueOf("issuedCard")); @@ -210,9 +233,21 @@ 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; + public static final String JSON_PROPERTY_VALIDATION_FACTS = "validationFacts"; private List validationFacts; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValidationFacts = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public IssuedCard() {} /** @@ -225,6 +260,7 @@ public IssuedCard() {} */ public IssuedCard authorisationType(String authorisationType) { this.authorisationType = authorisationType; + isSetAuthorisationType = true; // mark as set return this; } @@ -252,6 +288,7 @@ public String getAuthorisationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisationType(String authorisationType) { this.authorisationType = authorisationType; + isSetAuthorisationType = true; // mark as set } /** @@ -265,6 +302,7 @@ public void setAuthorisationType(String authorisationType) { */ public IssuedCard panEntryMode(PanEntryModeEnum panEntryMode) { this.panEntryMode = panEntryMode; + isSetPanEntryMode = true; // mark as set return this; } @@ -294,6 +332,7 @@ public PanEntryModeEnum getPanEntryMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPanEntryMode(PanEntryModeEnum panEntryMode) { this.panEntryMode = panEntryMode; + isSetPanEntryMode = true; // mark as set } /** @@ -306,6 +345,7 @@ public void setPanEntryMode(PanEntryModeEnum panEntryMode) { */ public IssuedCard processingType(ProcessingTypeEnum processingType) { this.processingType = processingType; + isSetProcessingType = true; // mark as set return this; } @@ -333,6 +373,7 @@ public ProcessingTypeEnum getProcessingType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProcessingType(ProcessingTypeEnum processingType) { this.processingType = processingType; + isSetProcessingType = true; // mark as set } /** @@ -343,6 +384,7 @@ public void setProcessingType(ProcessingTypeEnum processingType) { */ public IssuedCard relayedAuthorisationData(RelayedAuthorisationData relayedAuthorisationData) { this.relayedAuthorisationData = relayedAuthorisationData; + isSetRelayedAuthorisationData = true; // mark as set return this; } @@ -366,6 +408,7 @@ public RelayedAuthorisationData getRelayedAuthorisationData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRelayedAuthorisationData(RelayedAuthorisationData relayedAuthorisationData) { this.relayedAuthorisationData = relayedAuthorisationData; + isSetRelayedAuthorisationData = true; // mark as set } /** @@ -384,6 +427,7 @@ public void setRelayedAuthorisationData(RelayedAuthorisationData relayedAuthoris */ public IssuedCard schemeTraceId(String schemeTraceId) { this.schemeTraceId = schemeTraceId; + isSetSchemeTraceId = true; // mark as set return this; } @@ -423,6 +467,7 @@ public String getSchemeTraceId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchemeTraceId(String schemeTraceId) { this.schemeTraceId = schemeTraceId; + isSetSchemeTraceId = true; // mark as set } /** @@ -435,6 +480,7 @@ public void setSchemeTraceId(String schemeTraceId) { */ public IssuedCard schemeUniqueTransactionId(String schemeUniqueTransactionId) { this.schemeUniqueTransactionId = schemeUniqueTransactionId; + isSetSchemeUniqueTransactionId = true; // mark as set return this; } @@ -462,6 +508,7 @@ public String getSchemeUniqueTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchemeUniqueTransactionId(String schemeUniqueTransactionId) { this.schemeUniqueTransactionId = schemeUniqueTransactionId; + isSetSchemeUniqueTransactionId = true; // mark as set } /** @@ -472,6 +519,7 @@ public void setSchemeUniqueTransactionId(String schemeUniqueTransactionId) { */ public IssuedCard threeDSecure(ThreeDSecure threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set return this; } @@ -495,6 +543,7 @@ public ThreeDSecure getThreeDSecure() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSecure(ThreeDSecure threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set } /** @@ -505,6 +554,7 @@ public void setThreeDSecure(ThreeDSecure threeDSecure) { */ public IssuedCard type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -528,6 +578,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -540,6 +591,7 @@ public void setType(TypeEnum type) { */ public IssuedCard validationFacts(List validationFacts) { this.validationFacts = validationFacts; + isSetValidationFacts = true; // mark as set return this; } @@ -575,6 +627,27 @@ public List getValidationFacts() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValidationFacts(List validationFacts) { this.validationFacts = validationFacts; + isSetValidationFacts = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public IssuedCard 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 IssuedCard object is equal to o. */ @@ -643,6 +716,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 (isSetAuthorisationType) { + addIfNull(nulls, JSON_PROPERTY_AUTHORISATION_TYPE, this.authorisationType); + } + if (isSetPanEntryMode) { + addIfNull(nulls, JSON_PROPERTY_PAN_ENTRY_MODE, this.panEntryMode); + } + if (isSetProcessingType) { + addIfNull(nulls, JSON_PROPERTY_PROCESSING_TYPE, this.processingType); + } + if (isSetRelayedAuthorisationData) { + addIfNull(nulls, JSON_PROPERTY_RELAYED_AUTHORISATION_DATA, this.relayedAuthorisationData); + } + if (isSetSchemeTraceId) { + addIfNull(nulls, JSON_PROPERTY_SCHEME_TRACE_ID, this.schemeTraceId); + } + if (isSetSchemeUniqueTransactionId) { + addIfNull(nulls, JSON_PROPERTY_SCHEME_UNIQUE_TRANSACTION_ID, this.schemeUniqueTransactionId); + } + if (isSetThreeDSecure) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_SECURE, this.threeDSecure); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetValidationFacts) { + addIfNull(nulls, JSON_PROPERTY_VALIDATION_FACTS, this.validationFacts); + } + + 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 IssuedCard given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/IssuingTransactionData.java b/src/main/java/com/adyen/model/transfers/IssuingTransactionData.java index cc29e4052..69f777d05 100644 --- a/src/main/java/com/adyen/model/transfers/IssuingTransactionData.java +++ b/src/main/java/com/adyen/model/transfers/IssuingTransactionData.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -30,6 +32,9 @@ public class IssuingTransactionData { public static final String JSON_PROPERTY_CAPTURE_CYCLE_ID = "captureCycleId"; private String captureCycleId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCaptureCycleId = false; + /** * The type of events data. Possible values: - **issuingTransactionData**: issuing transaction * data @@ -75,6 +80,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 IssuingTransactionData() {} /** @@ -85,6 +99,7 @@ public IssuingTransactionData() {} */ public IssuingTransactionData captureCycleId(String captureCycleId) { this.captureCycleId = captureCycleId; + isSetCaptureCycleId = true; // mark as set return this; } @@ -108,6 +123,7 @@ public String getCaptureCycleId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureCycleId(String captureCycleId) { this.captureCycleId = captureCycleId; + isSetCaptureCycleId = true; // mark as set } /** @@ -120,6 +136,7 @@ public void setCaptureCycleId(String captureCycleId) { */ public IssuingTransactionData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -147,6 +164,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 IssuingTransactionData 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 IssuingTransactionData object is equal to o. */ @@ -188,6 +226,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 (isSetCaptureCycleId) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_CYCLE_ID, this.captureCycleId); + } + 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 IssuingTransactionData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Leg.java b/src/main/java/com/adyen/model/transfers/Leg.java index 071f3c00e..1876d05eb 100644 --- a/src/main/java/com/adyen/model/transfers/Leg.java +++ b/src/main/java/com/adyen/model/transfers/Leg.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 Leg { public static final String JSON_PROPERTY_ARRIVAL_AIRPORT_CODE = "arrivalAirportCode"; private String arrivalAirportCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetArrivalAirportCode = false; + public static final String JSON_PROPERTY_BASIC_FARE_CODE = "basicFareCode"; private String basicFareCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasicFareCode = false; + public static final String JSON_PROPERTY_CARRIER_CODE = "carrierCode"; private String carrierCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarrierCode = false; + public static final String JSON_PROPERTY_DEPARTURE_AIRPORT_CODE = "departureAirportCode"; private String departureAirportCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDepartureAirportCode = false; + public static final String JSON_PROPERTY_DEPARTURE_DATE = "departureDate"; private String departureDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDepartureDate = false; + public static final String JSON_PROPERTY_FLIGHT_NUMBER = "flightNumber"; private String flightNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFlightNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Leg() {} /** @@ -57,6 +83,7 @@ public Leg() {} */ public Leg arrivalAirportCode(String arrivalAirportCode) { this.arrivalAirportCode = arrivalAirportCode; + isSetArrivalAirportCode = true; // mark as set return this; } @@ -84,6 +111,7 @@ public String getArrivalAirportCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setArrivalAirportCode(String arrivalAirportCode) { this.arrivalAirportCode = arrivalAirportCode; + isSetArrivalAirportCode = true; // mark as set } /** @@ -94,6 +122,7 @@ public void setArrivalAirportCode(String arrivalAirportCode) { */ public Leg basicFareCode(String basicFareCode) { this.basicFareCode = basicFareCode; + isSetBasicFareCode = true; // mark as set return this; } @@ -117,6 +146,7 @@ public String getBasicFareCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBasicFareCode(String basicFareCode) { this.basicFareCode = basicFareCode; + isSetBasicFareCode = true; // mark as set } /** @@ -127,6 +157,7 @@ public void setBasicFareCode(String basicFareCode) { */ public Leg carrierCode(String carrierCode) { this.carrierCode = carrierCode; + isSetCarrierCode = true; // mark as set return this; } @@ -150,6 +181,7 @@ public String getCarrierCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarrierCode(String carrierCode) { this.carrierCode = carrierCode; + isSetCarrierCode = true; // mark as set } /** @@ -162,6 +194,7 @@ public void setCarrierCode(String carrierCode) { */ public Leg departureAirportCode(String departureAirportCode) { this.departureAirportCode = departureAirportCode; + isSetDepartureAirportCode = true; // mark as set return this; } @@ -189,6 +222,7 @@ public String getDepartureAirportCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDepartureAirportCode(String departureAirportCode) { this.departureAirportCode = departureAirportCode; + isSetDepartureAirportCode = true; // mark as set } /** @@ -199,6 +233,7 @@ public void setDepartureAirportCode(String departureAirportCode) { */ public Leg departureDate(String departureDate) { this.departureDate = departureDate; + isSetDepartureDate = true; // mark as set return this; } @@ -222,6 +257,7 @@ public String getDepartureDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDepartureDate(String departureDate) { this.departureDate = departureDate; + isSetDepartureDate = true; // mark as set } /** @@ -232,6 +268,7 @@ public void setDepartureDate(String departureDate) { */ public Leg flightNumber(String flightNumber) { this.flightNumber = flightNumber; + isSetFlightNumber = true; // mark as set return this; } @@ -255,6 +292,27 @@ public String getFlightNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFlightNumber(String flightNumber) { this.flightNumber = flightNumber; + isSetFlightNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Leg 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 Leg object is equal to o. */ @@ -312,6 +370,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 (isSetArrivalAirportCode) { + addIfNull(nulls, JSON_PROPERTY_ARRIVAL_AIRPORT_CODE, this.arrivalAirportCode); + } + if (isSetBasicFareCode) { + addIfNull(nulls, JSON_PROPERTY_BASIC_FARE_CODE, this.basicFareCode); + } + if (isSetCarrierCode) { + addIfNull(nulls, JSON_PROPERTY_CARRIER_CODE, this.carrierCode); + } + if (isSetDepartureAirportCode) { + addIfNull(nulls, JSON_PROPERTY_DEPARTURE_AIRPORT_CODE, this.departureAirportCode); + } + if (isSetDepartureDate) { + addIfNull(nulls, JSON_PROPERTY_DEPARTURE_DATE, this.departureDate); + } + if (isSetFlightNumber) { + addIfNull(nulls, JSON_PROPERTY_FLIGHT_NUMBER, this.flightNumber); + } + + 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 Leg given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Link.java b/src/main/java/com/adyen/model/transfers/Link.java index 592e82816..6b5883fdd 100644 --- a/src/main/java/com/adyen/model/transfers/Link.java +++ b/src/main/java/com/adyen/model/transfers/Link.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 Link { public static final String JSON_PROPERTY_HREF = "href"; private String href; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHref = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Link() {} /** @@ -33,6 +44,7 @@ public Link() {} */ public Link href(String href) { this.href = href; + isSetHref = true; // mark as set return this; } @@ -56,6 +68,27 @@ public String getHref() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHref(String href) { this.href = href; + isSetHref = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Link 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 Link object is equal to o. */ @@ -95,6 +128,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 (isSetHref) { + addIfNull(nulls, JSON_PROPERTY_HREF, this.href); + } + + 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 Link given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Links.java b/src/main/java/com/adyen/model/transfers/Links.java index c1bf6d0d9..cf1dd3929 100644 --- a/src/main/java/com/adyen/model/transfers/Links.java +++ b/src/main/java/com/adyen/model/transfers/Links.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 Links { public static final String JSON_PROPERTY_NEXT = "next"; private Link next; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNext = false; + public static final String JSON_PROPERTY_PREV = "prev"; private Link prev; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPrev = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Links() {} /** @@ -36,6 +50,7 @@ public Links() {} */ public Links next(Link next) { this.next = next; + isSetNext = true; // mark as set return this; } @@ -59,6 +74,7 @@ public Link getNext() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNext(Link next) { this.next = next; + isSetNext = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setNext(Link next) { */ public Links prev(Link prev) { this.prev = prev; + isSetPrev = true; // mark as set return this; } @@ -92,6 +109,27 @@ public Link getPrev() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrev(Link prev) { this.prev = prev; + isSetPrev = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Links 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 Links object is equal to o. */ @@ -132,6 +170,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 (isSetNext) { + addIfNull(nulls, JSON_PROPERTY_NEXT, this.next); + } + if (isSetPrev) { + addIfNull(nulls, JSON_PROPERTY_PREV, this.prev); + } + + 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 Links given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Lodging.java b/src/main/java/com/adyen/model/transfers/Lodging.java index 8016fcb7e..a6cc992d2 100644 --- a/src/main/java/com/adyen/model/transfers/Lodging.java +++ b/src/main/java/com/adyen/model/transfers/Lodging.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 Lodging { public static final String JSON_PROPERTY_CHECK_IN_DATE = "checkInDate"; private String checkInDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckInDate = false; + public static final String JSON_PROPERTY_NUMBER_OF_NIGHTS = "numberOfNights"; private Integer numberOfNights; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumberOfNights = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Lodging() {} /** @@ -36,6 +50,7 @@ public Lodging() {} */ public Lodging checkInDate(String checkInDate) { this.checkInDate = checkInDate; + isSetCheckInDate = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getCheckInDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckInDate(String checkInDate) { this.checkInDate = checkInDate; + isSetCheckInDate = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCheckInDate(String checkInDate) { */ public Lodging numberOfNights(Integer numberOfNights) { this.numberOfNights = numberOfNights; + isSetNumberOfNights = true; // mark as set return this; } @@ -92,6 +109,27 @@ public Integer getNumberOfNights() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumberOfNights(Integer numberOfNights) { this.numberOfNights = numberOfNights; + isSetNumberOfNights = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Lodging 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 Lodging object is equal to o. */ @@ -133,6 +171,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 (isSetCheckInDate) { + addIfNull(nulls, JSON_PROPERTY_CHECK_IN_DATE, this.checkInDate); + } + if (isSetNumberOfNights) { + addIfNull(nulls, JSON_PROPERTY_NUMBER_OF_NIGHTS, this.numberOfNights); + } + + 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 Lodging given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/MerchantData.java b/src/main/java/com/adyen/model/transfers/MerchantData.java index 7882d73b7..794c1299c 100644 --- a/src/main/java/com/adyen/model/transfers/MerchantData.java +++ b/src/main/java/com/adyen/model/transfers/MerchantData.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 MerchantData { public static final String JSON_PROPERTY_ACQUIRER_ID = "acquirerId"; private String acquirerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerId = 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_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + public static final String JSON_PROPERTY_NAME_LOCATION = "nameLocation"; private NameLocation nameLocation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNameLocation = 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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantData() {} /** @@ -51,6 +74,7 @@ public MerchantData() {} */ public MerchantData acquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set return this; } @@ -74,6 +98,7 @@ public String getAcquirerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setAcquirerId(String acquirerId) { */ public MerchantData mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setMcc(String mcc) { */ public MerchantData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -140,6 +168,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setMerchantId(String merchantId) { */ public MerchantData nameLocation(NameLocation nameLocation) { this.nameLocation = nameLocation; + isSetNameLocation = true; // mark as set return this; } @@ -173,6 +203,7 @@ public NameLocation getNameLocation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNameLocation(NameLocation nameLocation) { this.nameLocation = nameLocation; + isSetNameLocation = true; // mark as set } /** @@ -183,6 +214,7 @@ public void setNameLocation(NameLocation nameLocation) { */ public MerchantData postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -206,6 +238,27 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantData 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 MerchantData object is equal to o. */ @@ -253,6 +306,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 (isSetAcquirerId) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_ID, this.acquirerId); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + if (isSetNameLocation) { + addIfNull(nulls, JSON_PROPERTY_NAME_LOCATION, this.nameLocation); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + + 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 MerchantData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/MerchantPurchaseData.java b/src/main/java/com/adyen/model/transfers/MerchantPurchaseData.java index 0346fb7a5..c18c86ea3 100644 --- a/src/main/java/com/adyen/model/transfers/MerchantPurchaseData.java +++ b/src/main/java/com/adyen/model/transfers/MerchantPurchaseData.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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 MerchantPurchaseData { public static final String JSON_PROPERTY_AIRLINE = "airline"; private Airline airline; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirline = false; + public static final String JSON_PROPERTY_LODGING = "lodging"; private List lodging; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodging = false; + /** * The type of events data. Possible values: - **merchantPurchaseData**: merchant purchase data */ @@ -80,6 +88,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 MerchantPurchaseData() {} /** @@ -90,6 +107,7 @@ public MerchantPurchaseData() {} */ public MerchantPurchaseData airline(Airline airline) { this.airline = airline; + isSetAirline = true; // mark as set return this; } @@ -113,6 +131,7 @@ public Airline getAirline() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirline(Airline airline) { this.airline = airline; + isSetAirline = true; // mark as set } /** @@ -123,6 +142,7 @@ public void setAirline(Airline airline) { */ public MerchantPurchaseData lodging(List lodging) { this.lodging = lodging; + isSetLodging = true; // mark as set return this; } @@ -154,6 +174,7 @@ public List getLodging() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodging(List lodging) { this.lodging = lodging; + isSetLodging = true; // mark as set } /** @@ -165,6 +186,7 @@ public void setLodging(List lodging) { */ public MerchantPurchaseData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -190,6 +212,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 MerchantPurchaseData 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 MerchantPurchaseData object is equal to o. */ @@ -233,6 +276,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 (isSetAirline) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE, this.airline); + } + if (isSetLodging) { + addIfNull(nulls, JSON_PROPERTY_LODGING, this.lodging); + } + 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 MerchantPurchaseData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Modification.java b/src/main/java/com/adyen/model/transfers/Modification.java index 8a9da3129..a81f3904d 100644 --- a/src/main/java/com/adyen/model/transfers/Modification.java +++ b/src/main/java/com/adyen/model/transfers/Modification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class Modification { public static final String JSON_PROPERTY_DIRECTION = "direction"; private String direction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirection = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** The status of the transfer event. */ public enum StatusEnum { APPROVALPENDING(String.valueOf("approvalPending")), @@ -213,9 +224,21 @@ 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_TYPE = "type"; private String 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 Modification() {} /** @@ -226,6 +249,7 @@ public Modification() {} */ public Modification direction(String direction) { this.direction = direction; + isSetDirection = true; // mark as set return this; } @@ -249,6 +273,7 @@ public String getDirection() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirection(String direction) { this.direction = direction; + isSetDirection = true; // mark as set } /** @@ -259,6 +284,7 @@ public void setDirection(String direction) { */ public Modification id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -282,6 +308,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -292,6 +319,7 @@ public void setId(String id) { */ public Modification reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -315,6 +343,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -325,6 +354,7 @@ public void setReference(String reference) { */ public Modification status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -348,6 +378,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -358,6 +389,7 @@ public void setStatus(StatusEnum status) { */ public Modification type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -381,6 +413,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Modification 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 Modification object is equal to o. */ @@ -428,6 +481,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 (isSetDirection) { + addIfNull(nulls, JSON_PROPERTY_DIRECTION, this.direction); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + 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 Modification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/NOLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/NOLocalAccountIdentification.java index 747425477..446928a2e 100644 --- a/src/main/java/com/adyen/model/transfers/NOLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/NOLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -30,6 +32,9 @@ public class NOLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **noLocal** */ public enum TypeEnum { NOLOCAL(String.valueOf("noLocal")); @@ -72,6 +77,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 NOLocalAccountIdentification() {} /** @@ -82,6 +96,7 @@ public NOLocalAccountIdentification() {} */ public NOLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -105,6 +120,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -115,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public NOLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -138,6 +155,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 NOLocalAccountIdentification 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 NOLocalAccountIdentification object is equal to o. */ @@ -179,6 +217,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + 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 NOLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/NZLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/NZLocalAccountIdentification.java index 645db8365..43412c13b 100644 --- a/src/main/java/com/adyen/model/transfers/NZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/NZLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -30,6 +32,9 @@ public class NZLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **nzLocal** */ public enum TypeEnum { NZLOCAL(String.valueOf("nzLocal")); @@ -72,6 +77,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 NZLocalAccountIdentification() {} /** @@ -86,6 +100,7 @@ public NZLocalAccountIdentification() {} */ public NZLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +132,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +143,7 @@ public void setAccountNumber(String accountNumber) { */ public NZLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -150,6 +167,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 NZLocalAccountIdentification 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 NZLocalAccountIdentification object is equal to o. */ @@ -191,6 +229,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + 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 NZLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/NameLocation.java b/src/main/java/com/adyen/model/transfers/NameLocation.java index b353fe954..012f51421 100644 --- a/src/main/java/com/adyen/model/transfers/NameLocation.java +++ b/src/main/java/com/adyen/model/transfers/NameLocation.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 NameLocation { 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_COUNTRY_OF_ORIGIN = "countryOfOrigin"; private String countryOfOrigin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryOfOrigin = 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_RAW_DATA = "rawData"; private String rawData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRawData = false; + public static final String JSON_PROPERTY_STATE = "state"; private String state; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetState = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NameLocation() {} /** @@ -55,6 +81,7 @@ public NameLocation() {} */ public NameLocation 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 } /** @@ -90,6 +118,7 @@ public void setCity(String city) { */ public NameLocation country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -117,6 +146,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -131,6 +161,7 @@ public void setCountry(String country) { */ public NameLocation countryOfOrigin(String countryOfOrigin) { this.countryOfOrigin = countryOfOrigin; + isSetCountryOfOrigin = true; // mark as set return this; } @@ -162,6 +193,7 @@ public String getCountryOfOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryOfOrigin(String countryOfOrigin) { this.countryOfOrigin = countryOfOrigin; + isSetCountryOfOrigin = true; // mark as set } /** @@ -172,6 +204,7 @@ public void setCountryOfOrigin(String countryOfOrigin) { */ public NameLocation name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -195,6 +228,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -205,6 +239,7 @@ public void setName(String name) { */ public NameLocation rawData(String rawData) { this.rawData = rawData; + isSetRawData = true; // mark as set return this; } @@ -228,6 +263,7 @@ public String getRawData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRawData(String rawData) { this.rawData = rawData; + isSetRawData = true; // mark as set } /** @@ -238,6 +274,7 @@ public void setRawData(String rawData) { */ public NameLocation state(String state) { this.state = state; + isSetState = true; // mark as set return this; } @@ -261,6 +298,27 @@ public String getState() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setState(String state) { this.state = state; + isSetState = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NameLocation 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 NameLocation object is equal to o. */ @@ -310,6 +368,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 (isSetCountryOfOrigin) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_OF_ORIGIN, this.countryOfOrigin); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetRawData) { + addIfNull(nulls, JSON_PROPERTY_RAW_DATA, this.rawData); + } + if (isSetState) { + addIfNull(nulls, JSON_PROPERTY_STATE, this.state); + } + + 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 NameLocation given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/transfers/NumberAndBicAccountIdentification.java index 79037ee5e..54e7fd0f3 100644 --- a/src/main/java/com/adyen/model/transfers/NumberAndBicAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/NumberAndBicAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -32,13 +34,22 @@ public class NumberAndBicAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION = "additionalBankIdentification"; private AdditionalBankIdentification additionalBankIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalBankIdentification = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + /** **numberAndBic** */ public enum TypeEnum { NUMBERANDBIC(String.valueOf("numberAndBic")); @@ -81,6 +92,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 NumberAndBicAccountIdentification() {} /** @@ -94,6 +114,7 @@ public NumberAndBicAccountIdentification() {} */ public NumberAndBicAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -121,6 +142,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -133,6 +155,7 @@ public void setAccountNumber(String accountNumber) { public NumberAndBicAccountIdentification additionalBankIdentification( AdditionalBankIdentification additionalBankIdentification) { this.additionalBankIdentification = additionalBankIdentification; + isSetAdditionalBankIdentification = true; // mark as set return this; } @@ -157,6 +180,7 @@ public AdditionalBankIdentification getAdditionalBankIdentification() { public void setAdditionalBankIdentification( AdditionalBankIdentification additionalBankIdentification) { this.additionalBankIdentification = additionalBankIdentification; + isSetAdditionalBankIdentification = true; // mark as set } /** @@ -168,6 +192,7 @@ public void setAdditionalBankIdentification( */ public NumberAndBicAccountIdentification bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -191,6 +216,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -202,6 +228,7 @@ public void setBic(String bic) { */ public NumberAndBicAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -225,6 +252,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 NumberAndBicAccountIdentification 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 NumberAndBicAccountIdentification object is equal to o. */ @@ -275,6 +323,40 @@ 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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAdditionalBankIdentification) { + addIfNull( + nulls, JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION, this.additionalBankIdentification); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + 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 NumberAndBicAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/PLLocalAccountIdentification.java index 3158ffe10..b43fcc714 100644 --- a/src/main/java/com/adyen/model/transfers/PLLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/PLLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -30,6 +32,9 @@ public class PLLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **plLocal** */ public enum TypeEnum { PLLOCAL(String.valueOf("plLocal")); @@ -72,6 +77,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 PLLocalAccountIdentification() {} /** @@ -86,6 +100,7 @@ public PLLocalAccountIdentification() {} */ public PLLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +132,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +143,7 @@ public void setAccountNumber(String accountNumber) { */ public PLLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -150,6 +167,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 PLLocalAccountIdentification 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 PLLocalAccountIdentification object is equal to o. */ @@ -191,6 +229,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + 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 PLLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/PartyIdentification.java b/src/main/java/com/adyen/model/transfers/PartyIdentification.java index f7150a348..af94e1662 100644 --- a/src/main/java/com/adyen/model/transfers/PartyIdentification.java +++ b/src/main/java/com/adyen/model/transfers/PartyIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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,24 +40,45 @@ public class PartyIdentification { public static final String JSON_PROPERTY_ADDRESS = "address"; private Address address; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddress = 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_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + 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_FULL_NAME = "fullName"; private String fullName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFullName = 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; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * The type of entity that owns the bank account or card. Possible values: **individual**, * **organization**, or **unknown**. Required when `category` is **card**. In this case, @@ -106,9 +129,21 @@ 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; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PartyIdentification() {} /** @@ -119,6 +154,7 @@ public PartyIdentification() {} */ public PartyIdentification address(Address address) { this.address = address; + isSetAddress = true; // mark as set return this; } @@ -142,6 +178,7 @@ public Address getAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddress(Address address) { this.address = address; + isSetAddress = true; // mark as set } /** @@ -155,6 +192,7 @@ public void setAddress(Address address) { */ public PartyIdentification dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -184,6 +222,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -195,6 +234,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public PartyIdentification email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -220,6 +260,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -234,6 +275,7 @@ public void setEmail(String email) { */ public PartyIdentification firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -265,6 +307,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -279,6 +322,7 @@ public void setFirstName(String firstName) { */ public PartyIdentification fullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set return this; } @@ -310,6 +354,7 @@ public String getFullName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set } /** @@ -324,6 +369,7 @@ public void setFullName(String fullName) { */ public PartyIdentification lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -355,6 +401,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -369,6 +416,7 @@ public void setLastName(String lastName) { */ public PartyIdentification reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -400,6 +448,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -414,6 +463,7 @@ public void setReference(String reference) { */ public PartyIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -445,6 +495,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -455,6 +506,7 @@ public void setType(TypeEnum type) { */ public PartyIdentification url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -478,6 +530,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PartyIdentification 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 PartyIdentification object is equal to o. */ @@ -534,6 +607,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 (isSetAddress) { + addIfNull(nulls, JSON_PROPERTY_ADDRESS, this.address); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetFullName) { + addIfNull(nulls, JSON_PROPERTY_FULL_NAME, this.fullName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + 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 PartyIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/PaymentInstrument.java b/src/main/java/com/adyen/model/transfers/PaymentInstrument.java index 6912fc42a..8a3cabb90 100644 --- a/src/main/java/com/adyen/model/transfers/PaymentInstrument.java +++ b/src/main/java/com/adyen/model/transfers/PaymentInstrument.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 PaymentInstrument { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_TOKEN_TYPE = "tokenType"; private String tokenType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrument() {} /** @@ -47,6 +67,7 @@ public PaymentInstrument() {} */ public PaymentInstrument description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -70,6 +91,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setDescription(String description) { */ public PaymentInstrument id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -103,6 +126,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setId(String id) { */ public PaymentInstrument reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setReference(String reference) { */ public PaymentInstrument tokenType(String tokenType) { this.tokenType = tokenType; + isSetTokenType = true; // mark as set return this; } @@ -169,6 +196,27 @@ public String getTokenType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenType(String tokenType) { this.tokenType = tokenType; + isSetTokenType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrument 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 PaymentInstrument object is equal to o. */ @@ -214,6 +262,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetTokenType) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_TYPE, this.tokenType); + } + + 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 PaymentInstrument given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/PlatformPayment.java b/src/main/java/com/adyen/model/transfers/PlatformPayment.java index 9ca06af66..bbf55b5f6 100644 --- a/src/main/java/com/adyen/model/transfers/PlatformPayment.java +++ b/src/main/java/com/adyen/model/transfers/PlatformPayment.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,33 +37,42 @@ public class PlatformPayment { "modificationMerchantReference"; private String modificationMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationMerchantReference = false; + public static final String JSON_PROPERTY_MODIFICATION_PSP_REFERENCE = "modificationPspReference"; private String modificationPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationPspReference = false; + public static final String JSON_PROPERTY_PAYMENT_MERCHANT_REFERENCE = "paymentMerchantReference"; private String paymentMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMerchantReference = false; + /** * Specifies the nature of the transfer. This parameter helps categorize transfers so you can * reconcile transactions at a later time, using the Balance Platform Accounting Report for * [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 { @@ -137,9 +148,15 @@ public static PlatformPaymentTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_PLATFORM_PAYMENT_TYPE = "platformPaymentType"; private PlatformPaymentTypeEnum platformPaymentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformPaymentType = false; + public static final String JSON_PROPERTY_PSP_PAYMENT_REFERENCE = "pspPaymentReference"; private String pspPaymentReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspPaymentReference = false; + /** **platformPayment** */ public enum TypeEnum { PLATFORMPAYMENT(String.valueOf("platformPayment")); @@ -182,6 +199,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 PlatformPayment() {} /** @@ -193,6 +219,7 @@ public PlatformPayment() {} */ public PlatformPayment modificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set return this; } @@ -218,6 +245,7 @@ public String getModificationMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set } /** @@ -228,6 +256,7 @@ public void setModificationMerchantReference(String modificationMerchantReferenc */ public PlatformPayment modificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set return this; } @@ -251,6 +280,7 @@ public String getModificationPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set } /** @@ -261,6 +291,7 @@ public void setModificationPspReference(String modificationPspReference) { */ public PlatformPayment paymentMerchantReference(String paymentMerchantReference) { this.paymentMerchantReference = paymentMerchantReference; + isSetPaymentMerchantReference = true; // mark as set return this; } @@ -284,6 +315,7 @@ public String getPaymentMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMerchantReference(String paymentMerchantReference) { this.paymentMerchantReference = paymentMerchantReference; + isSetPaymentMerchantReference = true; // mark as set } /** @@ -292,21 +324,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,26 +347,27 @@ 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) { this.platformPaymentType = platformPaymentType; + isSetPlatformPaymentType = true; // mark as set return this; } @@ -344,21 +377,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 +400,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 +429,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,27 +452,28 @@ 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) public void setPlatformPaymentType(PlatformPaymentTypeEnum platformPaymentType) { this.platformPaymentType = platformPaymentType; + isSetPlatformPaymentType = true; // mark as set } /** @@ -450,6 +484,7 @@ public void setPlatformPaymentType(PlatformPaymentTypeEnum platformPaymentType) */ public PlatformPayment pspPaymentReference(String pspPaymentReference) { this.pspPaymentReference = pspPaymentReference; + isSetPspPaymentReference = true; // mark as set return this; } @@ -473,6 +508,7 @@ public String getPspPaymentReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspPaymentReference(String pspPaymentReference) { this.pspPaymentReference = pspPaymentReference; + isSetPspPaymentReference = true; // mark as set } /** @@ -483,6 +519,7 @@ public void setPspPaymentReference(String pspPaymentReference) { */ public PlatformPayment type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -506,6 +543,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 PlatformPayment 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 PlatformPayment object is equal to o. */ @@ -572,6 +630,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 (isSetModificationMerchantReference) { + addIfNull( + nulls, JSON_PROPERTY_MODIFICATION_MERCHANT_REFERENCE, this.modificationMerchantReference); + } + if (isSetModificationPspReference) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_PSP_REFERENCE, this.modificationPspReference); + } + if (isSetPaymentMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_MERCHANT_REFERENCE, this.paymentMerchantReference); + } + if (isSetPlatformPaymentType) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_PAYMENT_TYPE, this.platformPaymentType); + } + if (isSetPspPaymentReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_PAYMENT_REFERENCE, this.pspPaymentReference); + } + 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 PlatformPayment given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/RelayedAuthorisationData.java b/src/main/java/com/adyen/model/transfers/RelayedAuthorisationData.java index 518283c4c..46e25c37c 100644 --- a/src/main/java/com/adyen/model/transfers/RelayedAuthorisationData.java +++ b/src/main/java/com/adyen/model/transfers/RelayedAuthorisationData.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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,9 +30,21 @@ public class RelayedAuthorisationData { 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_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 RelayedAuthorisationData() {} /** @@ -43,6 +57,7 @@ public RelayedAuthorisationData() {} */ public RelayedAuthorisationData metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -78,6 +93,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -88,6 +104,7 @@ public void setMetadata(Map metadata) { */ public RelayedAuthorisationData reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -111,6 +128,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 RelayedAuthorisationData 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 RelayedAuthorisationData object is equal to o. */ @@ -152,6 +190,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 (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + 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 RelayedAuthorisationData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Repayment.java b/src/main/java/com/adyen/model/transfers/Repayment.java index d75ec5fbe..8f37651d1 100644 --- a/src/main/java/com/adyen/model/transfers/Repayment.java +++ b/src/main/java/com/adyen/model/transfers/Repayment.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 Repayment { public static final String JSON_PROPERTY_BASIS_POINTS = "basisPoints"; private Integer basisPoints; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasisPoints = false; + public static final String JSON_PROPERTY_TERM = "term"; private RepaymentTerm term; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTerm = false; + public static final String JSON_PROPERTY_THRESHOLD = "threshold"; private ThresholdRepayment threshold; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreshold = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Repayment() {} /** @@ -45,6 +62,7 @@ public Repayment() {} */ public Repayment basisPoints(Integer basisPoints) { this.basisPoints = basisPoints; + isSetBasisPoints = true; // mark as set return this; } @@ -72,6 +90,7 @@ public Integer getBasisPoints() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBasisPoints(Integer basisPoints) { this.basisPoints = basisPoints; + isSetBasisPoints = true; // mark as set } /** @@ -82,6 +101,7 @@ public void setBasisPoints(Integer basisPoints) { */ public Repayment term(RepaymentTerm term) { this.term = term; + isSetTerm = true; // mark as set return this; } @@ -105,6 +125,7 @@ public RepaymentTerm getTerm() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTerm(RepaymentTerm term) { this.term = term; + isSetTerm = true; // mark as set } /** @@ -115,6 +136,7 @@ public void setTerm(RepaymentTerm term) { */ public Repayment threshold(ThresholdRepayment threshold) { this.threshold = threshold; + isSetThreshold = true; // mark as set return this; } @@ -138,6 +160,27 @@ public ThresholdRepayment getThreshold() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreshold(ThresholdRepayment threshold) { this.threshold = threshold; + isSetThreshold = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Repayment 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 Repayment object is equal to o. */ @@ -181,6 +224,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 (isSetBasisPoints) { + addIfNull(nulls, JSON_PROPERTY_BASIS_POINTS, this.basisPoints); + } + if (isSetTerm) { + addIfNull(nulls, JSON_PROPERTY_TERM, this.term); + } + if (isSetThreshold) { + addIfNull(nulls, JSON_PROPERTY_THRESHOLD, this.threshold); + } + + 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 Repayment given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/RepaymentTerm.java b/src/main/java/com/adyen/model/transfers/RepaymentTerm.java index 1e06dc2ff..bf8cfe6cd 100644 --- a/src/main/java/com/adyen/model/transfers/RepaymentTerm.java +++ b/src/main/java/com/adyen/model/transfers/RepaymentTerm.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 RepaymentTerm { public static final String JSON_PROPERTY_ESTIMATED_DAYS = "estimatedDays"; private Integer estimatedDays; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEstimatedDays = false; + public static final String JSON_PROPERTY_MAXIMUM_DAYS = "maximumDays"; private Integer maximumDays; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaximumDays = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RepaymentTerm() {} /** @@ -39,6 +53,7 @@ public RepaymentTerm() {} */ public RepaymentTerm estimatedDays(Integer estimatedDays) { this.estimatedDays = estimatedDays; + isSetEstimatedDays = true; // mark as set return this; } @@ -62,6 +77,7 @@ public Integer getEstimatedDays() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEstimatedDays(Integer estimatedDays) { this.estimatedDays = estimatedDays; + isSetEstimatedDays = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setEstimatedDays(Integer estimatedDays) { */ public RepaymentTerm maximumDays(Integer maximumDays) { this.maximumDays = maximumDays; + isSetMaximumDays = true; // mark as set return this; } @@ -101,6 +118,27 @@ public Integer getMaximumDays() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaximumDays(Integer maximumDays) { this.maximumDays = maximumDays; + isSetMaximumDays = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RepaymentTerm 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 RepaymentTerm object is equal to o. */ @@ -142,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 (isSetEstimatedDays) { + addIfNull(nulls, JSON_PROPERTY_ESTIMATED_DAYS, this.estimatedDays); + } + if (isSetMaximumDays) { + addIfNull(nulls, JSON_PROPERTY_MAXIMUM_DAYS, this.maximumDays); + } + + 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 RepaymentTerm given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ResourceReference.java b/src/main/java/com/adyen/model/transfers/ResourceReference.java index e25f2a5fc..f718d247e 100644 --- a/src/main/java/com/adyen/model/transfers/ResourceReference.java +++ b/src/main/java/com/adyen/model/transfers/ResourceReference.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 ResourceReference { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResourceReference() {} /** @@ -43,6 +60,7 @@ public ResourceReference() {} */ public ResourceReference description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setDescription(String description) { */ public ResourceReference id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setId(String id) { */ public ResourceReference 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 ResourceReference includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResourceReference object is equal to o. */ @@ -175,6 +218,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResourceReference given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/RestServiceError.java b/src/main/java/com/adyen/model/transfers/RestServiceError.java index 703e3d346..eccc3663d 100644 --- a/src/main/java/com/adyen/model/transfers/RestServiceError.java +++ b/src/main/java/com/adyen/model/transfers/RestServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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,30 +37,63 @@ public class RestServiceError { public static final String JSON_PROPERTY_DETAIL = "detail"; private String detail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetail = 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_INSTANCE = "instance"; private String instance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstance = false; + public static final String JSON_PROPERTY_INVALID_FIELDS = "invalidFields"; private List invalidFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInvalidFields = false; + public static final String JSON_PROPERTY_REQUEST_ID = "requestId"; private String requestId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestId = false; + public static final String JSON_PROPERTY_RESPONSE = "response"; private Object response; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + public static final String JSON_PROPERTY_STATUS = "status"; private Integer status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TITLE = "title"; private String title; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTitle = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 RestServiceError() {} /** @@ -69,6 +104,7 @@ public RestServiceError() {} */ public RestServiceError detail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set return this; } @@ -92,6 +128,7 @@ public String getDetail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set } /** @@ -102,6 +139,7 @@ public void setDetail(String detail) { */ public RestServiceError errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -125,6 +163,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -135,6 +174,7 @@ public void setErrorCode(String errorCode) { */ public RestServiceError instance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set return this; } @@ -158,6 +198,7 @@ public String getInstance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set } /** @@ -168,6 +209,7 @@ public void setInstance(String instance) { */ public RestServiceError invalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set return this; } @@ -199,6 +241,7 @@ public List getInvalidFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInvalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set } /** @@ -210,6 +253,7 @@ public void setInvalidFields(List invalidFields) { */ public RestServiceError requestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set return this; } @@ -235,6 +279,7 @@ public String getRequestId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set } /** @@ -245,6 +290,7 @@ public void setRequestId(String requestId) { */ public RestServiceError response(Object response) { this.response = response; + isSetResponse = true; // mark as set return this; } @@ -268,6 +314,7 @@ public Object getResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResponse(Object response) { this.response = response; + isSetResponse = true; // mark as set } /** @@ -278,6 +325,7 @@ public void setResponse(Object response) { */ public RestServiceError status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -301,6 +349,7 @@ public Integer getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(Integer status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -311,6 +360,7 @@ public void setStatus(Integer status) { */ public RestServiceError title(String title) { this.title = title; + isSetTitle = true; // mark as set return this; } @@ -334,6 +384,7 @@ public String getTitle() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTitle(String title) { this.title = title; + isSetTitle = true; // mark as set } /** @@ -346,6 +397,7 @@ public void setTitle(String title) { */ public RestServiceError type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -373,6 +425,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RestServiceError 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 RestServiceError object is equal to o. */ @@ -429,6 +502,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 (isSetDetail) { + addIfNull(nulls, JSON_PROPERTY_DETAIL, this.detail); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetInstance) { + addIfNull(nulls, JSON_PROPERTY_INSTANCE, this.instance); + } + if (isSetInvalidFields) { + addIfNull(nulls, JSON_PROPERTY_INVALID_FIELDS, this.invalidFields); + } + if (isSetRequestId) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_ID, this.requestId); + } + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTitle) { + addIfNull(nulls, JSON_PROPERTY_TITLE, this.title); + } + 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 RestServiceError given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ReturnTransferRequest.java b/src/main/java/com/adyen/model/transfers/ReturnTransferRequest.java index 1164e492a..8eaf76f8a 100644 --- a/src/main/java/com/adyen/model/transfers/ReturnTransferRequest.java +++ b/src/main/java/com/adyen/model/transfers/ReturnTransferRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 ReturnTransferRequest { 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_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 ReturnTransferRequest() {} /** @@ -39,6 +53,7 @@ public ReturnTransferRequest() {} */ public ReturnTransferRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -62,6 +77,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -79,6 +95,7 @@ public void setAmount(Amount amount) { */ public ReturnTransferRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -116,6 +133,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 ReturnTransferRequest 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 ReturnTransferRequest object is equal to o. */ @@ -157,6 +195,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + 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 ReturnTransferRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ReturnTransferResponse.java b/src/main/java/com/adyen/model/transfers/ReturnTransferResponse.java index 1ef2b0bb6..85e02e85d 100644 --- a/src/main/java/com/adyen/model/transfers/ReturnTransferResponse.java +++ b/src/main/java/com/adyen/model/transfers/ReturnTransferResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -32,9 +34,15 @@ public class ReturnTransferResponse { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** The resulting status of the return. Possible values: **Authorised**, **Declined**. */ public enum StatusEnum { AUTHORISED(String.valueOf("Authorised")), @@ -79,9 +87,21 @@ 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_TRANSFER_ID = "transferId"; private String transferId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ReturnTransferResponse() {} /** @@ -92,6 +112,7 @@ public ReturnTransferResponse() {} */ public ReturnTransferResponse id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -115,6 +136,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -125,6 +147,7 @@ public void setId(String id) { */ public ReturnTransferResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -148,6 +171,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -159,6 +183,7 @@ public void setReference(String reference) { */ public ReturnTransferResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -184,6 +209,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -194,6 +220,7 @@ public void setStatus(StatusEnum status) { */ public ReturnTransferResponse transferId(String transferId) { this.transferId = transferId; + isSetTransferId = true; // mark as set return this; } @@ -217,6 +244,27 @@ public String getTransferId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferId(String transferId) { this.transferId = transferId; + isSetTransferId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ReturnTransferResponse 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 ReturnTransferResponse object is equal to o. */ @@ -262,6 +310,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTransferId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_ID, this.transferId); + } + + 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 ReturnTransferResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/RoutingDetails.java b/src/main/java/com/adyen/model/transfers/RoutingDetails.java index 52e94e611..e19196fc9 100644 --- a/src/main/java/com/adyen/model/transfers/RoutingDetails.java +++ b/src/main/java/com/adyen/model/transfers/RoutingDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -32,20 +34,26 @@ public class RoutingDetails { public static final String JSON_PROPERTY_DETAIL = "detail"; private String detail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetail = 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; + /** * 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 { @@ -99,9 +107,21 @@ public static PriorityEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITY = "priority"; private PriorityEnum priority; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriority = false; + public static final String JSON_PROPERTY_TITLE = "title"; private String title; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTitle = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RoutingDetails() {} /** @@ -112,6 +132,7 @@ public RoutingDetails() {} */ public RoutingDetails detail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set return this; } @@ -135,6 +156,7 @@ public String getDetail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set } /** @@ -145,6 +167,7 @@ public void setDetail(String detail) { */ public RoutingDetails errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -168,62 +191,64 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** * 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 RoutingDetails} instance, allowing for method chaining */ public RoutingDetails priority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set return this; } /** * 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) @@ -235,32 +260,33 @@ 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) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set } /** @@ -271,6 +297,7 @@ public void setPriority(PriorityEnum priority) { */ public RoutingDetails title(String title) { this.title = title; + isSetTitle = true; // mark as set return this; } @@ -294,6 +321,27 @@ public String getTitle() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTitle(String title) { this.title = title; + isSetTitle = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RoutingDetails 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 RoutingDetails object is equal to o. */ @@ -339,6 +387,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 (isSetDetail) { + addIfNull(nulls, JSON_PROPERTY_DETAIL, this.detail); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetPriority) { + addIfNull(nulls, JSON_PROPERTY_PRIORITY, this.priority); + } + if (isSetTitle) { + addIfNull(nulls, JSON_PROPERTY_TITLE, this.title); + } + + 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 RoutingDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/SELocalAccountIdentification.java index 23be7c97b..dad6c2845 100644 --- a/src/main/java/com/adyen/model/transfers/SELocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/SELocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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,9 +33,15 @@ public class SELocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_CLEARING_NUMBER = "clearingNumber"; private String clearingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClearingNumber = false; + /** **seLocal** */ public enum TypeEnum { SELOCAL(String.valueOf("seLocal")); @@ -76,6 +84,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 SELocalAccountIdentification() {} /** @@ -90,6 +107,7 @@ public SELocalAccountIdentification() {} */ public SELocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -121,6 +139,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -135,6 +154,7 @@ public void setAccountNumber(String accountNumber) { */ public SELocalAccountIdentification clearingNumber(String clearingNumber) { this.clearingNumber = clearingNumber; + isSetClearingNumber = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getClearingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClearingNumber(String clearingNumber) { this.clearingNumber = clearingNumber; + isSetClearingNumber = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setClearingNumber(String clearingNumber) { */ public SELocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -199,6 +221,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 SELocalAccountIdentification 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 SELocalAccountIdentification object is equal to o. */ @@ -242,6 +285,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetClearingNumber) { + addIfNull(nulls, JSON_PROPERTY_CLEARING_NUMBER, this.clearingNumber); + } + 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 SELocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/SGLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/SGLocalAccountIdentification.java index fca6b4551..d765cfab6 100644 --- a/src/main/java/com/adyen/model/transfers/SGLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/SGLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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,9 +33,15 @@ public class SGLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + /** **sgLocal** */ public enum TypeEnum { SGLOCAL(String.valueOf("sgLocal")); @@ -76,6 +84,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 SGLocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public SGLocalAccountIdentification() {} */ public SGLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -119,6 +138,7 @@ public void setAccountNumber(String accountNumber) { */ public SGLocalAccountIdentification bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -142,6 +162,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -152,6 +173,7 @@ public void setBic(String bic) { */ public SGLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -175,6 +197,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 SGLocalAccountIdentification 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 SGLocalAccountIdentification object is equal to o. */ @@ -218,6 +261,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + 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 SGLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ServiceError.java b/src/main/java/com/adyen/model/transfers/ServiceError.java index f16e39b25..3605e106c 100644 --- a/src/main/java/com/adyen/model/transfers/ServiceError.java +++ b/src/main/java/com/adyen/model/transfers/ServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 ServiceError { 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() {} /** @@ -51,6 +74,7 @@ public ServiceError() {} */ public ServiceError errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -74,6 +98,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setErrorCode(String errorCode) { */ public ServiceError errorType(String errorType) { this.errorType = errorType; + isSetErrorType = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getErrorType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorType(String errorType) { this.errorType = errorType; + isSetErrorType = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setErrorType(String errorType) { */ public ServiceError message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -140,6 +168,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setMessage(String message) { */ public ServiceError pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -173,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 } /** @@ -183,6 +214,7 @@ public void setPspReference(String pspReference) { */ public ServiceError status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -206,6 +238,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. */ @@ -253,6 +306,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 (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/transfers/ThreeDSecure.java b/src/main/java/com/adyen/model/transfers/ThreeDSecure.java index 57100877c..29d3a0ad8 100644 --- a/src/main/java/com/adyen/model/transfers/ThreeDSecure.java +++ b/src/main/java/com/adyen/model/transfers/ThreeDSecure.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 ThreeDSecure { public static final String JSON_PROPERTY_ACS_TRANSACTION_ID = "acsTransactionId"; private String acsTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsTransactionId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDSecure() {} /** @@ -33,6 +44,7 @@ public ThreeDSecure() {} */ public ThreeDSecure acsTransactionId(String acsTransactionId) { this.acsTransactionId = acsTransactionId; + isSetAcsTransactionId = true; // mark as set return this; } @@ -56,6 +68,27 @@ public String getAcsTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsTransactionId(String acsTransactionId) { this.acsTransactionId = acsTransactionId; + isSetAcsTransactionId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDSecure 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 ThreeDSecure object is equal to o. */ @@ -95,6 +128,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 (isSetAcsTransactionId) { + addIfNull(nulls, JSON_PROPERTY_ACS_TRANSACTION_ID, this.acsTransactionId); + } + + 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 ThreeDSecure given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/ThresholdRepayment.java b/src/main/java/com/adyen/model/transfers/ThresholdRepayment.java index da5c340a2..c1f7d4bfe 100644 --- a/src/main/java/com/adyen/model/transfers/ThresholdRepayment.java +++ b/src/main/java/com/adyen/model/transfers/ThresholdRepayment.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 ThresholdRepayment { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThresholdRepayment() {} /** @@ -33,6 +44,7 @@ public ThresholdRepayment() {} */ public ThresholdRepayment amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -56,6 +68,27 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThresholdRepayment 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 ThresholdRepayment object is equal to o. */ @@ -95,6 +128,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + + 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 ThresholdRepayment given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Transaction.java b/src/main/java/com/adyen/model/transfers/Transaction.java index e2d17457e..154d0bdca 100644 --- a/src/main/java/com/adyen/model/transfers/Transaction.java +++ b/src/main/java/com/adyen/model/transfers/Transaction.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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,33 +44,63 @@ public class Transaction { public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; private ResourceReference accountHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT = "balanceAccount"; private ResourceReference balanceAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccount = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_BOOKING_DATE = "bookingDate"; private OffsetDateTime bookingDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBookingDate = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT = "paymentInstrument"; private PaymentInstrument paymentInstrument; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrument = false; + public static final String JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; private String referenceForBeneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + /** * The status of the transaction. Possible values: * **pending**: The transaction is still * pending. * **booked**: The transaction has been booked to the balance account. @@ -116,12 +148,27 @@ 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_TRANSFER = "transfer"; private TransferView transfer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransfer = false; + public static final String JSON_PROPERTY_VALUE_DATE = "valueDate"; private OffsetDateTime valueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValueDate = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Transaction() {} /** @@ -132,6 +179,7 @@ public Transaction() {} */ public Transaction accountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -155,6 +203,7 @@ public ResourceReference getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set } /** @@ -165,6 +214,7 @@ public void setAccountHolder(ResourceReference accountHolder) { */ public Transaction amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -188,6 +238,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -198,6 +249,7 @@ public void setAmount(Amount amount) { */ public Transaction balanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set return this; } @@ -221,6 +273,7 @@ public ResourceReference getBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set } /** @@ -231,6 +284,7 @@ public void setBalanceAccount(ResourceReference balanceAccount) { */ public Transaction balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -254,6 +308,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -264,6 +319,7 @@ public void setBalancePlatform(String balancePlatform) { */ public Transaction bookingDate(OffsetDateTime bookingDate) { this.bookingDate = bookingDate; + isSetBookingDate = true; // mark as set return this; } @@ -287,6 +343,7 @@ public OffsetDateTime getBookingDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBookingDate(OffsetDateTime bookingDate) { this.bookingDate = bookingDate; + isSetBookingDate = true; // mark as set } /** @@ -299,6 +356,7 @@ public void setBookingDate(OffsetDateTime bookingDate) { */ public Transaction creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -326,6 +384,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -336,6 +395,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public Transaction description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -359,6 +419,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -369,6 +430,7 @@ public void setDescription(String description) { */ public Transaction id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -392,6 +454,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -402,6 +465,7 @@ public void setId(String id) { */ public Transaction paymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set return this; } @@ -425,6 +489,7 @@ public PaymentInstrument getPaymentInstrument() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set } /** @@ -444,6 +509,7 @@ public void setPaymentInstrument(PaymentInstrument paymentInstrument) { */ public Transaction referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -485,6 +551,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -497,6 +564,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public Transaction status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -524,6 +592,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -534,6 +603,7 @@ public void setStatus(StatusEnum status) { */ public Transaction transfer(TransferView transfer) { this.transfer = transfer; + isSetTransfer = true; // mark as set return this; } @@ -557,6 +627,7 @@ public TransferView getTransfer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransfer(TransferView transfer) { this.transfer = transfer; + isSetTransfer = true; // mark as set } /** @@ -567,6 +638,7 @@ public void setTransfer(TransferView transfer) { */ public Transaction valueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; + isSetValueDate = true; // mark as set return this; } @@ -590,6 +662,27 @@ public OffsetDateTime getValueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; + isSetValueDate = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Transaction 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 Transaction object is equal to o. */ @@ -668,6 +761,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 (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBalanceAccount) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT, this.balanceAccount); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetBookingDate) { + addIfNull(nulls, JSON_PROPERTY_BOOKING_DATE, this.bookingDate); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrument) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT, this.paymentInstrument); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTransfer) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER, this.transfer); + } + if (isSetValueDate) { + addIfNull(nulls, JSON_PROPERTY_VALUE_DATE, this.valueDate); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Transaction given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransactionEventViolation.java b/src/main/java/com/adyen/model/transfers/TransactionEventViolation.java index fdafd0c06..b0f0a562c 100644 --- a/src/main/java/com/adyen/model/transfers/TransactionEventViolation.java +++ b/src/main/java/com/adyen/model/transfers/TransactionEventViolation.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 TransactionEventViolation { public static final String JSON_PROPERTY_REASON = "reason"; private String reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_TRANSACTION_RULE = "transactionRule"; private TransactionRuleReference transactionRule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRule = false; + public static final String JSON_PROPERTY_TRANSACTION_RULE_SOURCE = "transactionRuleSource"; private TransactionRuleSource transactionRuleSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRuleSource = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionEventViolation() {} /** @@ -43,6 +60,7 @@ public TransactionEventViolation() {} */ public TransactionEventViolation reason(String reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(String reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setReason(String reason) { */ public TransactionEventViolation transactionRule(TransactionRuleReference transactionRule) { this.transactionRule = transactionRule; + isSetTransactionRule = true; // mark as set return this; } @@ -99,6 +119,7 @@ public TransactionRuleReference getTransactionRule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRule(TransactionRuleReference transactionRule) { this.transactionRule = transactionRule; + isSetTransactionRule = true; // mark as set } /** @@ -110,6 +131,7 @@ public void setTransactionRule(TransactionRuleReference transactionRule) { public TransactionEventViolation transactionRuleSource( TransactionRuleSource transactionRuleSource) { this.transactionRuleSource = transactionRuleSource; + isSetTransactionRuleSource = true; // mark as set return this; } @@ -133,6 +155,27 @@ public TransactionRuleSource getTransactionRuleSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRuleSource(TransactionRuleSource transactionRuleSource) { this.transactionRuleSource = transactionRuleSource; + isSetTransactionRuleSource = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionEventViolation 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 TransactionEventViolation object is equal to o. */ @@ -179,6 +222,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 (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetTransactionRule) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULE, this.transactionRule); + } + if (isSetTransactionRuleSource) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULE_SOURCE, this.transactionRuleSource); + } + + 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 TransactionEventViolation given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransactionRuleReference.java b/src/main/java/com/adyen/model/transfers/TransactionRuleReference.java index 4863931e3..f0e3f97ae 100644 --- a/src/main/java/com/adyen/model/transfers/TransactionRuleReference.java +++ b/src/main/java/com/adyen/model/transfers/TransactionRuleReference.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 TransactionRuleReference { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_OUTCOME_TYPE = "outcomeType"; private String outcomeType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutcomeType = 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_SCORE = "score"; private Integer score; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScore = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRuleReference() {} /** @@ -51,6 +74,7 @@ public TransactionRuleReference() {} */ public TransactionRuleReference description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -74,6 +98,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setDescription(String description) { */ public TransactionRuleReference id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setId(String id) { */ public TransactionRuleReference outcomeType(String outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set return this; } @@ -140,6 +168,7 @@ public String getOutcomeType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOutcomeType(String outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setOutcomeType(String outcomeType) { */ public TransactionRuleReference reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -173,6 +203,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -185,6 +216,7 @@ public void setReference(String reference) { */ public TransactionRuleReference score(Integer score) { this.score = score; + isSetScore = true; // mark as set return this; } @@ -212,6 +244,27 @@ public Integer getScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScore(Integer score) { this.score = score; + isSetScore = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRuleReference 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 TransactionRuleReference object is equal to o. */ @@ -259,6 +312,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetOutcomeType) { + addIfNull(nulls, JSON_PROPERTY_OUTCOME_TYPE, this.outcomeType); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetScore) { + addIfNull(nulls, JSON_PROPERTY_SCORE, this.score); + } + + 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 TransactionRuleReference given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransactionRuleSource.java b/src/main/java/com/adyen/model/transfers/TransactionRuleSource.java index 4b0a7e173..8850739ab 100644 --- a/src/main/java/com/adyen/model/transfers/TransactionRuleSource.java +++ b/src/main/java/com/adyen/model/transfers/TransactionRuleSource.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 TransactionRuleSource { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 TransactionRuleSource() {} /** @@ -39,6 +53,7 @@ public TransactionRuleSource() {} */ public TransactionRuleSource id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -78,6 +94,7 @@ public void setId(String id) { */ public TransactionRuleSource type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -113,6 +130,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRuleSource 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 TransactionRuleSource object is equal to o. */ @@ -154,6 +192,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + 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 TransactionRuleSource given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransactionRulesResult.java b/src/main/java/com/adyen/model/transfers/TransactionRulesResult.java index ec5f302c8..8018d4b8f 100644 --- a/src/main/java/com/adyen/model/transfers/TransactionRulesResult.java +++ b/src/main/java/com/adyen/model/transfers/TransactionRulesResult.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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,16 +32,34 @@ public class TransactionRulesResult { public static final String JSON_PROPERTY_ADVICE = "advice"; private String advice; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdvice = false; + public static final String JSON_PROPERTY_ALL_HARD_BLOCK_RULES_PASSED = "allHardBlockRulesPassed"; private Boolean allHardBlockRulesPassed; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllHardBlockRulesPassed = false; + public static final String JSON_PROPERTY_SCORE = "score"; private Integer score; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScore = false; + public static final String JSON_PROPERTY_TRIGGERED_TRANSACTION_RULES = "triggeredTransactionRules"; private List triggeredTransactionRules; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTriggeredTransactionRules = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRulesResult() {} /** @@ -50,6 +70,7 @@ public TransactionRulesResult() {} */ public TransactionRulesResult advice(String advice) { this.advice = advice; + isSetAdvice = true; // mark as set return this; } @@ -73,6 +94,7 @@ public String getAdvice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdvice(String advice) { this.advice = advice; + isSetAdvice = true; // mark as set } /** @@ -84,6 +106,7 @@ public void setAdvice(String advice) { */ public TransactionRulesResult allHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { this.allHardBlockRulesPassed = allHardBlockRulesPassed; + isSetAllHardBlockRulesPassed = true; // mark as set return this; } @@ -109,6 +132,7 @@ public Boolean getAllHardBlockRulesPassed() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { this.allHardBlockRulesPassed = allHardBlockRulesPassed; + isSetAllHardBlockRulesPassed = true; // mark as set } /** @@ -119,6 +143,7 @@ public void setAllHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { */ public TransactionRulesResult score(Integer score) { this.score = score; + isSetScore = true; // mark as set return this; } @@ -142,6 +167,7 @@ public Integer getScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScore(Integer score) { this.score = score; + isSetScore = true; // mark as set } /** @@ -154,6 +180,7 @@ public void setScore(Integer score) { public TransactionRulesResult triggeredTransactionRules( List triggeredTransactionRules) { this.triggeredTransactionRules = triggeredTransactionRules; + isSetTriggeredTransactionRules = true; // mark as set return this; } @@ -189,6 +216,27 @@ public List getTriggeredTransactionRules() { public void setTriggeredTransactionRules( List triggeredTransactionRules) { this.triggeredTransactionRules = triggeredTransactionRules; + isSetTriggeredTransactionRules = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRulesResult 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 TransactionRulesResult object is equal to o. */ @@ -240,6 +288,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 (isSetAdvice) { + addIfNull(nulls, JSON_PROPERTY_ADVICE, this.advice); + } + if (isSetAllHardBlockRulesPassed) { + addIfNull(nulls, JSON_PROPERTY_ALL_HARD_BLOCK_RULES_PASSED, this.allHardBlockRulesPassed); + } + if (isSetScore) { + addIfNull(nulls, JSON_PROPERTY_SCORE, this.score); + } + if (isSetTriggeredTransactionRules) { + addIfNull(nulls, JSON_PROPERTY_TRIGGERED_TRANSACTION_RULES, this.triggeredTransactionRules); + } + + 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 TransactionRulesResult given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java b/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java index 7f4e62408..a0c6f3ef2 100644 --- a/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java +++ b/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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,9 +30,21 @@ public class TransactionSearchResponse { public static final String JSON_PROPERTY_LINKS = "_links"; private Links links; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLinks = false; + public static final String JSON_PROPERTY_DATA = "data"; private List data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionSearchResponse() {} /** @@ -41,6 +55,7 @@ public TransactionSearchResponse() {} */ public TransactionSearchResponse links(Links links) { this.links = links; + isSetLinks = true; // mark as set return this; } @@ -64,6 +79,7 @@ public Links getLinks() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLinks(Links links) { this.links = links; + isSetLinks = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setLinks(Links links) { */ public TransactionSearchResponse data(List data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -105,6 +122,27 @@ public List getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(List data) { this.data = data; + isSetData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionSearchResponse 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 TransactionSearchResponse object is equal to o. */ @@ -146,6 +184,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 (isSetLinks) { + addIfNull(nulls, JSON_PROPERTY_LINKS, this.links); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + + 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 TransactionSearchResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/Transfer.java b/src/main/java/com/adyen/model/transfers/Transfer.java index 0ea8a540d..e36e9c67e 100644 --- a/src/main/java/com/adyen/model/transfers/Transfer.java +++ b/src/main/java/com/adyen/model/transfers/Transfer.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -49,21 +51,30 @@ public class Transfer { public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; private ResourceReference accountHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT = "balanceAccount"; private ResourceReference balanceAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccount = false; + /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. */ public enum CategoryEnum { BANK(String.valueOf("bank")), @@ -116,25 +127,46 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = false; + public static final String JSON_PROPERTY_CATEGORY_DATA = "categoryData"; private TransferCategoryData categoryData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategoryData = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private CounterpartyV3 counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = 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_CREATION_DATE = "creationDate"; @Deprecated // deprecated since Transfers API v3: Use createdAt or updatedAt private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = 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_DIRECT_DEBIT_INFORMATION = "directDebitInformation"; private DirectDebitInformation directDebitInformation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirectDebitInformation = false; + /** The direction of the transfer. Possible values: **incoming**, **outgoing**. */ public enum DirectionEnum { INCOMING(String.valueOf("incoming")), @@ -179,15 +211,27 @@ public static DirectionEnum fromValue(String value) { public static final String JSON_PROPERTY_DIRECTION = "direction"; private DirectionEnum direction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirection = false; + public static final String JSON_PROPERTY_EXECUTION_DATE = "executionDate"; private ExecutionDate executionDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExecutionDate = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT = "paymentInstrument"; private PaymentInstrument paymentInstrument; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrument = false; + /** Additional information about the status of the transfer. */ public enum ReasonEnum { ACCOUNTHIERARCHYNOTACTIVE(String.valueOf("accountHierarchyNotActive")), @@ -237,6 +281,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -279,21 +325,35 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = 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_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; private String referenceForBeneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + public static final String JSON_PROPERTY_REVIEW = "review"; private TransferReview review; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReview = false; + /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. */ public enum StatusEnum { APPROVALPENDING(String.valueOf("approvalPending")), @@ -468,6 +528,9 @@ 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; + /** * The type of transfer or transaction. For example, **refund**, **payment**, * **internalTransfer**, **bankTransfer**. @@ -587,6 +650,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 Transfer() {} /** @@ -597,6 +669,7 @@ public Transfer() {} */ public Transfer accountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -620,6 +693,7 @@ public ResourceReference getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set } /** @@ -630,6 +704,7 @@ public void setAccountHolder(ResourceReference accountHolder) { */ public Transfer amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -653,6 +728,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -663,6 +739,7 @@ public void setAmount(Amount amount) { */ public Transfer balanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set return this; } @@ -686,53 +763,55 @@ public ResourceReference getBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @param category The category of the transfer. Possible values: - **bank**: a transfer involving + * @param category The category of the transfer. Possible values: - **bank**: A transfer involving * a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. * @return the current {@code Transfer} instance, allowing for method chaining */ public Transfer category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @return category The category of the transfer. Possible values: - **bank**: a transfer + * @return category The category of the transfer. Possible values: - **bank**: A transfer * involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -741,29 +820,30 @@ public CategoryEnum getCategory() { } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @param category The category of the transfer. Possible values: - **bank**: a transfer involving + * @param category The category of the transfer. Possible values: - **bank**: A transfer involving * a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -774,6 +854,7 @@ public void setCategory(CategoryEnum category) { */ public Transfer categoryData(TransferCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set return this; } @@ -797,6 +878,7 @@ public TransferCategoryData getCategoryData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategoryData(TransferCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set } /** @@ -807,6 +889,7 @@ public void setCategoryData(TransferCategoryData categoryData) { */ public Transfer counterparty(CounterpartyV3 counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -830,6 +913,7 @@ public CounterpartyV3 getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(CounterpartyV3 counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -842,6 +926,7 @@ public void setCounterparty(CounterpartyV3 counterparty) { */ public Transfer createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -869,6 +954,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -883,6 +969,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { @Deprecated // deprecated since Transfers API v3: Use createdAt or updatedAt public Transfer creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -914,6 +1001,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -932,6 +1020,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public Transfer description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -971,6 +1060,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -981,6 +1071,7 @@ public void setDescription(String description) { */ public Transfer directDebitInformation(DirectDebitInformation directDebitInformation) { this.directDebitInformation = directDebitInformation; + isSetDirectDebitInformation = true; // mark as set return this; } @@ -1004,6 +1095,7 @@ public DirectDebitInformation getDirectDebitInformation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirectDebitInformation(DirectDebitInformation directDebitInformation) { this.directDebitInformation = directDebitInformation; + isSetDirectDebitInformation = true; // mark as set } /** @@ -1014,6 +1106,7 @@ public void setDirectDebitInformation(DirectDebitInformation directDebitInformat */ public Transfer direction(DirectionEnum direction) { this.direction = direction; + isSetDirection = true; // mark as set return this; } @@ -1037,6 +1130,7 @@ public DirectionEnum getDirection() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirection(DirectionEnum direction) { this.direction = direction; + isSetDirection = true; // mark as set } /** @@ -1047,6 +1141,7 @@ public void setDirection(DirectionEnum direction) { */ public Transfer executionDate(ExecutionDate executionDate) { this.executionDate = executionDate; + isSetExecutionDate = true; // mark as set return this; } @@ -1070,6 +1165,7 @@ public ExecutionDate getExecutionDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExecutionDate(ExecutionDate executionDate) { this.executionDate = executionDate; + isSetExecutionDate = true; // mark as set } /** @@ -1080,6 +1176,7 @@ public void setExecutionDate(ExecutionDate executionDate) { */ public Transfer id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -1103,6 +1200,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -1113,6 +1211,7 @@ public void setId(String id) { */ public Transfer paymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set return this; } @@ -1136,6 +1235,7 @@ public PaymentInstrument getPaymentInstrument() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set } /** @@ -1146,6 +1246,7 @@ public void setPaymentInstrument(PaymentInstrument paymentInstrument) { */ public Transfer reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -1169,6 +1270,7 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -1181,6 +1283,7 @@ public void setReason(ReasonEnum reason) { */ public Transfer reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -1208,6 +1311,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -1226,6 +1330,7 @@ public void setReference(String reference) { */ public Transfer referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -1265,6 +1370,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -1275,6 +1381,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public Transfer review(TransferReview review) { this.review = review; + isSetReview = true; // mark as set return this; } @@ -1298,39 +1405,51 @@ public TransferReview getReview() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReview(TransferReview review) { this.review = review; + isSetReview = true; // mark as set } /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. * * @param status The result of the transfer. For example: - **received**: an outgoing transfer - * request is created. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * request is created. - **refused**: the transfer request is rejected by Adyen for one of the + * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - + * Transaction rule requirements violated. - **authorised**: the transfer request is + * authorized and the funds are reserved. - **booked**: the funds are deducted from your + * user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. * @return the current {@code Transfer} instance, allowing for method chaining */ public Transfer status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. * * @return status The result of the transfer. For example: - **received**: an outgoing transfer - * request is created. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * request is created. - **refused**: the transfer request is rejected by Adyen for one of the + * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - + * Transaction rule requirements violated. - **authorised**: the transfer request is + * authorized and the funds are reserved. - **booked**: the funds are deducted from your + * user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1340,21 +1459,27 @@ public StatusEnum getStatus() { /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. * * @param status The result of the transfer. For example: - **received**: an outgoing transfer - * request is created. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * request is created. - **refused**: the transfer request is rejected by Adyen for one of the + * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - + * Transaction rule requirements violated. - **authorised**: the transfer request is + * authorized and the funds are reserved. - **booked**: the funds are deducted from your + * user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -1367,6 +1492,7 @@ public void setStatus(StatusEnum status) { */ public Transfer type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1394,6 +1520,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 Transfer 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 Transfer object is equal to o. */ @@ -1495,6 +1642,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 (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBalanceAccount) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT, this.balanceAccount); + } + if (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCategoryData) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY_DATA, this.categoryData); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetDirectDebitInformation) { + addIfNull(nulls, JSON_PROPERTY_DIRECT_DEBIT_INFORMATION, this.directDebitInformation); + } + if (isSetDirection) { + addIfNull(nulls, JSON_PROPERTY_DIRECTION, this.direction); + } + if (isSetExecutionDate) { + addIfNull(nulls, JSON_PROPERTY_EXECUTION_DATE, this.executionDate); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrument) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT, this.paymentInstrument); + } + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetReview) { + addIfNull(nulls, JSON_PROPERTY_REVIEW, this.review); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + 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 Transfer given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferData.java b/src/main/java/com/adyen/model/transfers/TransferData.java index 684370fbb..5d549af2e 100644 --- a/src/main/java/com/adyen/model/transfers/TransferData.java +++ b/src/main/java/com/adyen/model/transfers/TransferData.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -60,27 +62,42 @@ public class TransferData { public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; private ResourceReference accountHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT = "balanceAccount"; private ResourceReference balanceAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccount = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_BALANCES = "balances"; private List balances; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalances = false; + /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. */ public enum CategoryEnum { BANK(String.valueOf("bank")), @@ -133,25 +150,46 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = false; + public static final String JSON_PROPERTY_CATEGORY_DATA = "categoryData"; private TransferCategoryData categoryData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategoryData = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private TransferNotificationCounterParty counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = 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_CREATION_DATE = "creationDate"; @Deprecated // deprecated since Transfers API v3: Use createdAt or updatedAt private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = 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_DIRECT_DEBIT_INFORMATION = "directDebitInformation"; private DirectDebitInformation directDebitInformation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirectDebitInformation = false; + /** The direction of the transfer. Possible values: **incoming**, **outgoing**. */ public enum DirectionEnum { INCOMING(String.valueOf("incoming")), @@ -196,24 +234,45 @@ public static DirectionEnum fromValue(String value) { public static final String JSON_PROPERTY_DIRECTION = "direction"; private DirectionEnum direction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirection = false; + public static final String JSON_PROPERTY_EVENT_ID = "eventId"; private String eventId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEventId = false; + public static final String JSON_PROPERTY_EVENTS = "events"; private List events; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEvents = false; + public static final String JSON_PROPERTY_EXECUTION_DATE = "executionDate"; private ExecutionDate executionDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExecutionDate = false; + public static final String JSON_PROPERTY_EXTERNAL_REASON = "externalReason"; private ExternalReason externalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExternalReason = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT = "paymentInstrument"; private PaymentInstrument paymentInstrument; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrument = false; + /** Additional information about the status of the transfer. */ public enum ReasonEnum { ACCOUNTHIERARCHYNOTACTIVE(String.valueOf("accountHierarchyNotActive")), @@ -263,6 +322,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -305,24 +366,41 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = 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_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; private String referenceForBeneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + public static final String JSON_PROPERTY_REVIEW = "review"; private TransferReview review; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReview = false; + public static final String JSON_PROPERTY_SEQUENCE_NUMBER = "sequenceNumber"; private Integer sequenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSequenceNumber = false; + /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. */ public enum StatusEnum { APPROVALPENDING(String.valueOf("approvalPending")), @@ -497,12 +575,21 @@ 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_TRACKING = "tracking"; private TransferDataTracking tracking; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTracking = false; + public static final String JSON_PROPERTY_TRANSACTION_RULES_RESULT = "transactionRulesResult"; private TransactionRulesResult transactionRulesResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRulesResult = false; + /** * The type of transfer or transaction. For example, **refund**, **payment**, * **internalTransfer**, **bankTransfer**. @@ -622,9 +709,21 @@ 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; + public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt"; private OffsetDateTime updatedAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUpdatedAt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferData() {} /** @@ -635,6 +734,7 @@ public TransferData() {} */ public TransferData accountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -658,6 +758,7 @@ public ResourceReference getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set } /** @@ -668,6 +769,7 @@ public void setAccountHolder(ResourceReference accountHolder) { */ public TransferData amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -691,6 +793,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -701,6 +804,7 @@ public void setAmount(Amount amount) { */ public TransferData balanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set return this; } @@ -724,6 +828,7 @@ public ResourceReference getBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set } /** @@ -734,6 +839,7 @@ public void setBalanceAccount(ResourceReference balanceAccount) { */ public TransferData balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -757,6 +863,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -767,6 +874,7 @@ public void setBalancePlatform(String balancePlatform) { */ public TransferData balances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set return this; } @@ -798,53 +906,55 @@ public List getBalances() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @param category The category of the transfer. Possible values: - **bank**: a transfer involving + * @param category The category of the transfer. Possible values: - **bank**: A transfer involving * a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. * @return the current {@code TransferData} instance, allowing for method chaining */ public TransferData category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @return category The category of the transfer. Possible values: - **bank**: a transfer + * @return category The category of the transfer. Possible values: - **bank**: A transfer * involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -853,29 +963,30 @@ public CategoryEnum getCategory() { } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @param category The category of the transfer. Possible values: - **bank**: a transfer involving + * @param category The category of the transfer. Possible values: - **bank**: A transfer involving * a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -886,6 +997,7 @@ public void setCategory(CategoryEnum category) { */ public TransferData categoryData(TransferCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set return this; } @@ -909,6 +1021,7 @@ public TransferCategoryData getCategoryData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategoryData(TransferCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set } /** @@ -919,6 +1032,7 @@ public void setCategoryData(TransferCategoryData categoryData) { */ public TransferData counterparty(TransferNotificationCounterParty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -942,6 +1056,7 @@ public TransferNotificationCounterParty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(TransferNotificationCounterParty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -954,6 +1069,7 @@ public void setCounterparty(TransferNotificationCounterParty counterparty) { */ public TransferData createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -981,6 +1097,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -995,6 +1112,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { @Deprecated // deprecated since Transfers API v3: Use createdAt or updatedAt public TransferData creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -1026,6 +1144,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -1044,6 +1163,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public TransferData description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -1083,6 +1203,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -1093,6 +1214,7 @@ public void setDescription(String description) { */ public TransferData directDebitInformation(DirectDebitInformation directDebitInformation) { this.directDebitInformation = directDebitInformation; + isSetDirectDebitInformation = true; // mark as set return this; } @@ -1116,6 +1238,7 @@ public DirectDebitInformation getDirectDebitInformation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirectDebitInformation(DirectDebitInformation directDebitInformation) { this.directDebitInformation = directDebitInformation; + isSetDirectDebitInformation = true; // mark as set } /** @@ -1126,6 +1249,7 @@ public void setDirectDebitInformation(DirectDebitInformation directDebitInformat */ public TransferData direction(DirectionEnum direction) { this.direction = direction; + isSetDirection = true; // mark as set return this; } @@ -1149,6 +1273,7 @@ public DirectionEnum getDirection() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirection(DirectionEnum direction) { this.direction = direction; + isSetDirection = true; // mark as set } /** @@ -1161,6 +1286,7 @@ public void setDirection(DirectionEnum direction) { */ public TransferData eventId(String eventId) { this.eventId = eventId; + isSetEventId = true; // mark as set return this; } @@ -1188,6 +1314,7 @@ public String getEventId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEventId(String eventId) { this.eventId = eventId; + isSetEventId = true; // mark as set } /** @@ -1198,6 +1325,7 @@ public void setEventId(String eventId) { */ public TransferData events(List events) { this.events = events; + isSetEvents = true; // mark as set return this; } @@ -1229,6 +1357,7 @@ public List getEvents() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEvents(List events) { this.events = events; + isSetEvents = true; // mark as set } /** @@ -1239,6 +1368,7 @@ public void setEvents(List events) { */ public TransferData executionDate(ExecutionDate executionDate) { this.executionDate = executionDate; + isSetExecutionDate = true; // mark as set return this; } @@ -1262,6 +1392,7 @@ public ExecutionDate getExecutionDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExecutionDate(ExecutionDate executionDate) { this.executionDate = executionDate; + isSetExecutionDate = true; // mark as set } /** @@ -1272,6 +1403,7 @@ public void setExecutionDate(ExecutionDate executionDate) { */ public TransferData externalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set return this; } @@ -1295,6 +1427,7 @@ public ExternalReason getExternalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExternalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set } /** @@ -1305,6 +1438,7 @@ public void setExternalReason(ExternalReason externalReason) { */ public TransferData id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -1328,6 +1462,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -1338,6 +1473,7 @@ public void setId(String id) { */ public TransferData paymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set return this; } @@ -1361,6 +1497,7 @@ public PaymentInstrument getPaymentInstrument() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set } /** @@ -1371,6 +1508,7 @@ public void setPaymentInstrument(PaymentInstrument paymentInstrument) { */ public TransferData reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -1394,6 +1532,7 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -1406,6 +1545,7 @@ public void setReason(ReasonEnum reason) { */ public TransferData reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -1433,6 +1573,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -1451,6 +1592,7 @@ public void setReference(String reference) { */ public TransferData referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -1490,6 +1632,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -1500,6 +1643,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public TransferData review(TransferReview review) { this.review = review; + isSetReview = true; // mark as set return this; } @@ -1523,6 +1667,7 @@ public TransferReview getReview() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReview(TransferReview review) { this.review = review; + isSetReview = true; // mark as set } /** @@ -1537,6 +1682,7 @@ public void setReview(TransferReview review) { */ public TransferData sequenceNumber(Integer sequenceNumber) { this.sequenceNumber = sequenceNumber; + isSetSequenceNumber = true; // mark as set return this; } @@ -1568,39 +1714,51 @@ public Integer getSequenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSequenceNumber(Integer sequenceNumber) { this.sequenceNumber = sequenceNumber; + isSetSequenceNumber = true; // mark as set } /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. * * @param status The result of the transfer. For example: - **received**: an outgoing transfer - * request is created. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * request is created. - **refused**: the transfer request is rejected by Adyen for one of the + * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - + * Transaction rule requirements violated. - **authorised**: the transfer request is + * authorized and the funds are reserved. - **booked**: the funds are deducted from your + * user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. * @return the current {@code TransferData} instance, allowing for method chaining */ public TransferData status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. * * @return status The result of the transfer. For example: - **received**: an outgoing transfer - * request is created. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * request is created. - **refused**: the transfer request is rejected by Adyen for one of the + * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - + * Transaction rule requirements violated. - **authorised**: the transfer request is + * authorized and the funds are reserved. - **booked**: the funds are deducted from your + * user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1610,21 +1768,27 @@ public StatusEnum getStatus() { /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. * * @param status The result of the transfer. For example: - **received**: an outgoing transfer - * request is created. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * request is created. - **refused**: the transfer request is rejected by Adyen for one of the + * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - + * Transaction rule requirements violated. - **authorised**: the transfer request is + * authorized and the funds are reserved. - **booked**: the funds are deducted from your + * user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -1635,6 +1799,7 @@ public void setStatus(StatusEnum status) { */ public TransferData tracking(TransferDataTracking tracking) { this.tracking = tracking; + isSetTracking = true; // mark as set return this; } @@ -1658,6 +1823,7 @@ public TransferDataTracking getTracking() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTracking(TransferDataTracking tracking) { this.tracking = tracking; + isSetTracking = true; // mark as set } /** @@ -1668,6 +1834,7 @@ public void setTracking(TransferDataTracking tracking) { */ public TransferData transactionRulesResult(TransactionRulesResult transactionRulesResult) { this.transactionRulesResult = transactionRulesResult; + isSetTransactionRulesResult = true; // mark as set return this; } @@ -1691,6 +1858,7 @@ public TransactionRulesResult getTransactionRulesResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRulesResult(TransactionRulesResult transactionRulesResult) { this.transactionRulesResult = transactionRulesResult; + isSetTransactionRulesResult = true; // mark as set } /** @@ -1703,6 +1871,7 @@ public void setTransactionRulesResult(TransactionRulesResult transactionRulesRes */ public TransferData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1730,6 +1899,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -1742,6 +1912,7 @@ public void setType(TypeEnum type) { */ public TransferData updatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; + isSetUpdatedAt = true; // mark as set return this; } @@ -1769,6 +1940,27 @@ public OffsetDateTime getUpdatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUpdatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; + isSetUpdatedAt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferData 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 TransferData object is equal to o. */ @@ -1899,6 +2091,114 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBalanceAccount) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT, this.balanceAccount); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetBalances) { + addIfNull(nulls, JSON_PROPERTY_BALANCES, this.balances); + } + if (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCategoryData) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY_DATA, this.categoryData); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetDirectDebitInformation) { + addIfNull(nulls, JSON_PROPERTY_DIRECT_DEBIT_INFORMATION, this.directDebitInformation); + } + if (isSetDirection) { + addIfNull(nulls, JSON_PROPERTY_DIRECTION, this.direction); + } + if (isSetEventId) { + addIfNull(nulls, JSON_PROPERTY_EVENT_ID, this.eventId); + } + if (isSetEvents) { + addIfNull(nulls, JSON_PROPERTY_EVENTS, this.events); + } + if (isSetExecutionDate) { + addIfNull(nulls, JSON_PROPERTY_EXECUTION_DATE, this.executionDate); + } + if (isSetExternalReason) { + addIfNull(nulls, JSON_PROPERTY_EXTERNAL_REASON, this.externalReason); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrument) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT, this.paymentInstrument); + } + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetReview) { + addIfNull(nulls, JSON_PROPERTY_REVIEW, this.review); + } + if (isSetSequenceNumber) { + addIfNull(nulls, JSON_PROPERTY_SEQUENCE_NUMBER, this.sequenceNumber); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTracking) { + addIfNull(nulls, JSON_PROPERTY_TRACKING, this.tracking); + } + if (isSetTransactionRulesResult) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULES_RESULT, this.transactionRulesResult); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUpdatedAt) { + addIfNull(nulls, JSON_PROPERTY_UPDATED_AT, this.updatedAt); + } + + 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 TransferData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferEvent.java b/src/main/java/com/adyen/model/transfers/TransferEvent.java index cfba03bb6..3c4ec635e 100644 --- a/src/main/java/com/adyen/model/transfers/TransferEvent.java +++ b/src/main/java/com/adyen/model/transfers/TransferEvent.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -49,36 +51,69 @@ public class TransferEvent { 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_AMOUNT_ADJUSTMENTS = "amountAdjustments"; private List amountAdjustments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountAdjustments = false; + public static final String JSON_PROPERTY_ARN = "arn"; private String arn; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetArn = false; + public static final String JSON_PROPERTY_BOOKING_DATE = "bookingDate"; private OffsetDateTime bookingDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBookingDate = false; + public static final String JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME = "estimatedArrivalTime"; private OffsetDateTime estimatedArrivalTime; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEstimatedArrivalTime = false; + public static final String JSON_PROPERTY_EVENTS_DATA = "eventsData"; private List eventsData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEventsData = false; + public static final String JSON_PROPERTY_EXTERNAL_REASON = "externalReason"; private ExternalReason externalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExternalReason = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_MODIFICATION = "modification"; private Modification modification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModification = false; + public static final String JSON_PROPERTY_MUTATIONS = "mutations"; private List mutations; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMutations = false; + public static final String JSON_PROPERTY_ORIGINAL_AMOUNT = "originalAmount"; private Amount originalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalAmount = false; + /** The reason for the transfer status. */ public enum ReasonEnum { ACCOUNTHIERARCHYNOTACTIVE(String.valueOf("accountHierarchyNotActive")), @@ -128,6 +163,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -170,6 +207,9 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + /** The status of the transfer event. */ public enum StatusEnum { APPROVALPENDING(String.valueOf("approvalPending")), @@ -344,12 +384,21 @@ 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_TRACKING_DATA = "trackingData"; private TransferEventTrackingData trackingData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrackingData = false; + public static final String JSON_PROPERTY_TRANSACTION_ID = "transactionId"; private String transactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionId = false; + /** The type of the transfer event. Possible values: **accounting**, **tracking**. */ public enum TypeEnum { ACCOUNTING(String.valueOf("accounting")), @@ -394,12 +443,27 @@ 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; + public static final String JSON_PROPERTY_UPDATE_DATE = "updateDate"; private OffsetDateTime updateDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUpdateDate = false; + public static final String JSON_PROPERTY_VALUE_DATE = "valueDate"; private OffsetDateTime valueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValueDate = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferEvent() {} /** @@ -410,6 +474,7 @@ public TransferEvent() {} */ public TransferEvent amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -433,6 +498,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -445,6 +511,7 @@ public void setAmount(Amount amount) { */ public TransferEvent amountAdjustments(List amountAdjustments) { this.amountAdjustments = amountAdjustments; + isSetAmountAdjustments = true; // mark as set return this; } @@ -480,6 +547,7 @@ public List getAmountAdjustments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountAdjustments(List amountAdjustments) { this.amountAdjustments = amountAdjustments; + isSetAmountAdjustments = true; // mark as set } /** @@ -490,6 +558,7 @@ public void setAmountAdjustments(List amountAdjustments) { */ public TransferEvent arn(String arn) { this.arn = arn; + isSetArn = true; // mark as set return this; } @@ -514,6 +583,7 @@ public String getArn() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setArn(String arn) { this.arn = arn; + isSetArn = true; // mark as set } /** @@ -524,6 +594,7 @@ public void setArn(String arn) { */ public TransferEvent bookingDate(OffsetDateTime bookingDate) { this.bookingDate = bookingDate; + isSetBookingDate = true; // mark as set return this; } @@ -547,6 +618,7 @@ public OffsetDateTime getBookingDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBookingDate(OffsetDateTime bookingDate) { this.bookingDate = bookingDate; + isSetBookingDate = true; // mark as set } /** @@ -558,6 +630,7 @@ public void setBookingDate(OffsetDateTime bookingDate) { */ public TransferEvent estimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set return this; } @@ -583,6 +656,7 @@ public OffsetDateTime getEstimatedArrivalTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set } /** @@ -593,6 +667,7 @@ public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { */ public TransferEvent eventsData(List eventsData) { this.eventsData = eventsData; + isSetEventsData = true; // mark as set return this; } @@ -624,6 +699,7 @@ public List getEventsData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEventsData(List eventsData) { this.eventsData = eventsData; + isSetEventsData = true; // mark as set } /** @@ -634,6 +710,7 @@ public void setEventsData(List eventsData) { */ public TransferEvent externalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set return this; } @@ -657,6 +734,7 @@ public ExternalReason getExternalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExternalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set } /** @@ -667,6 +745,7 @@ public void setExternalReason(ExternalReason externalReason) { */ public TransferEvent id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -690,6 +769,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -700,6 +780,7 @@ public void setId(String id) { */ public TransferEvent modification(Modification modification) { this.modification = modification; + isSetModification = true; // mark as set return this; } @@ -723,6 +804,7 @@ public Modification getModification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModification(Modification modification) { this.modification = modification; + isSetModification = true; // mark as set } /** @@ -733,6 +815,7 @@ public void setModification(Modification modification) { */ public TransferEvent mutations(List mutations) { this.mutations = mutations; + isSetMutations = true; // mark as set return this; } @@ -764,6 +847,7 @@ public List getMutations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMutations(List mutations) { this.mutations = mutations; + isSetMutations = true; // mark as set } /** @@ -774,6 +858,7 @@ public void setMutations(List mutations) { */ public TransferEvent originalAmount(Amount originalAmount) { this.originalAmount = originalAmount; + isSetOriginalAmount = true; // mark as set return this; } @@ -797,6 +882,7 @@ public Amount getOriginalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalAmount(Amount originalAmount) { this.originalAmount = originalAmount; + isSetOriginalAmount = true; // mark as set } /** @@ -807,6 +893,7 @@ public void setOriginalAmount(Amount originalAmount) { */ public TransferEvent reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -830,6 +917,7 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -840,6 +928,7 @@ public void setReason(ReasonEnum reason) { */ public TransferEvent status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -863,6 +952,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -873,6 +963,7 @@ public void setStatus(StatusEnum status) { */ public TransferEvent trackingData(TransferEventTrackingData trackingData) { this.trackingData = trackingData; + isSetTrackingData = true; // mark as set return this; } @@ -896,6 +987,7 @@ public TransferEventTrackingData getTrackingData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrackingData(TransferEventTrackingData trackingData) { this.trackingData = trackingData; + isSetTrackingData = true; // mark as set } /** @@ -908,6 +1000,7 @@ public void setTrackingData(TransferEventTrackingData trackingData) { */ public TransferEvent transactionId(String transactionId) { this.transactionId = transactionId; + isSetTransactionId = true; // mark as set return this; } @@ -935,6 +1028,7 @@ public String getTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionId(String transactionId) { this.transactionId = transactionId; + isSetTransactionId = true; // mark as set } /** @@ -945,6 +1039,7 @@ public void setTransactionId(String transactionId) { */ public TransferEvent type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -968,6 +1063,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -978,6 +1074,7 @@ public void setType(TypeEnum type) { */ public TransferEvent updateDate(OffsetDateTime updateDate) { this.updateDate = updateDate; + isSetUpdateDate = true; // mark as set return this; } @@ -1001,6 +1098,7 @@ public OffsetDateTime getUpdateDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUpdateDate(OffsetDateTime updateDate) { this.updateDate = updateDate; + isSetUpdateDate = true; // mark as set } /** @@ -1013,6 +1111,7 @@ public void setUpdateDate(OffsetDateTime updateDate) { */ public TransferEvent valueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; + isSetValueDate = true; // mark as set return this; } @@ -1040,6 +1139,27 @@ public OffsetDateTime getValueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; + isSetValueDate = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferEvent 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 TransferEvent object is equal to o. */ @@ -1133,6 +1253,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetAmountAdjustments) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_ADJUSTMENTS, this.amountAdjustments); + } + if (isSetArn) { + addIfNull(nulls, JSON_PROPERTY_ARN, this.arn); + } + if (isSetBookingDate) { + addIfNull(nulls, JSON_PROPERTY_BOOKING_DATE, this.bookingDate); + } + if (isSetEstimatedArrivalTime) { + addIfNull(nulls, JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME, this.estimatedArrivalTime); + } + if (isSetEventsData) { + addIfNull(nulls, JSON_PROPERTY_EVENTS_DATA, this.eventsData); + } + if (isSetExternalReason) { + addIfNull(nulls, JSON_PROPERTY_EXTERNAL_REASON, this.externalReason); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetModification) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION, this.modification); + } + if (isSetMutations) { + addIfNull(nulls, JSON_PROPERTY_MUTATIONS, this.mutations); + } + if (isSetOriginalAmount) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_AMOUNT, this.originalAmount); + } + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTrackingData) { + addIfNull(nulls, JSON_PROPERTY_TRACKING_DATA, this.trackingData); + } + if (isSetTransactionId) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_ID, this.transactionId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUpdateDate) { + addIfNull(nulls, JSON_PROPERTY_UPDATE_DATE, this.updateDate); + } + if (isSetValueDate) { + addIfNull(nulls, JSON_PROPERTY_VALUE_DATE, this.valueDate); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferEvent given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferInfo.java b/src/main/java/com/adyen/model/transfers/TransferInfo.java index a47ba7813..5f2a3e7c0 100644 --- a/src/main/java/com/adyen/model/transfers/TransferInfo.java +++ b/src/main/java/com/adyen/model/transfers/TransferInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -44,18 +46,24 @@ public class TransferInfo { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. */ public enum CategoryEnum { BANK(String.valueOf("bank")), @@ -108,18 +116,33 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private CounterpartyInfoV3 counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = 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_EXECUTION_DATE = "executionDate"; private ExecutionDate executionDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExecutionDate = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT_ID = "paymentInstrumentId"; private String paymentInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrumentId = false; + /** Gets or Sets priorities */ public enum PrioritiesEnum { CROSSBORDER(String.valueOf("crossBorder")), @@ -172,17 +195,20 @@ public static PrioritiesEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITIES = "priorities"; private List priorities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriorities = false; + /** * 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 { @@ -236,15 +262,27 @@ public static PriorityEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITY = "priority"; private PriorityEnum priority; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriority = 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_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; private String referenceForBeneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + public static final String JSON_PROPERTY_REVIEW = "review"; private TransferRequestReview review; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReview = false; + /** * The type of transfer. Possible values: - **bankTransfer**: for push transfers to a transfer * instrument or a bank account. The `category` must be **bank**. - @@ -297,9 +335,21 @@ 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; + public static final String JSON_PROPERTY_ULTIMATE_PARTY = "ultimateParty"; private UltimatePartyIdentification ultimateParty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUltimateParty = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferInfo() {} /** @@ -310,6 +360,7 @@ public TransferInfo() {} */ public TransferInfo amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -333,6 +384,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -356,6 +408,7 @@ public void setAmount(Amount amount) { */ public TransferInfo balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -405,53 +458,55 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @param category The category of the transfer. Possible values: - **bank**: a transfer involving + * @param category The category of the transfer. Possible values: - **bank**: A transfer involving * a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. * @return the current {@code TransferInfo} instance, allowing for method chaining */ public TransferInfo category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @return category The category of the transfer. Possible values: - **bank**: a transfer + * @return category The category of the transfer. Possible values: - **bank**: A transfer * involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -460,29 +515,30 @@ public CategoryEnum getCategory() { } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @param category The category of the transfer. Possible values: - **bank**: a transfer involving + * @param category The category of the transfer. Possible values: - **bank**: A transfer involving * a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -493,6 +549,7 @@ public void setCategory(CategoryEnum category) { */ public TransferInfo counterparty(CounterpartyInfoV3 counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -516,6 +573,7 @@ public CounterpartyInfoV3 getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(CounterpartyInfoV3 counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -534,6 +592,7 @@ public void setCounterparty(CounterpartyInfoV3 counterparty) { */ public TransferInfo description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -573,6 +632,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -583,6 +643,7 @@ public void setDescription(String description) { */ public TransferInfo executionDate(ExecutionDate executionDate) { this.executionDate = executionDate; + isSetExecutionDate = true; // mark as set return this; } @@ -606,6 +667,7 @@ public ExecutionDate getExecutionDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExecutionDate(ExecutionDate executionDate) { this.executionDate = executionDate; + isSetExecutionDate = true; // mark as set } /** @@ -626,6 +688,7 @@ public void setExecutionDate(ExecutionDate executionDate) { */ public TransferInfo paymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set return this; } @@ -669,20 +732,21 @@ public String getPaymentInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrumentId(String paymentInstrumentId) { this.paymentInstrumentId = paymentInstrumentId; + isSetPaymentInstrumentId = true; // mark as set } /** * The list of priorities for the bank transfer. This sets the speed at which the transfer is sent * and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay * out using the priority you list first. If that's not possible, it moves on to the next - * option in the order of your provided priorities. 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 + * option in the order of your provided priorities. 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 United States and in [SEPA + * **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). Required for transfers with `category` **bank**. For more details, see * [fallback * priorities](https://docs.adyen.com/payouts/payout-service/payout-to-users/#fallback-priorities). @@ -691,14 +755,14 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { * the transfer is sent and the fees that you have to pay. You can provide multiple * priorities. Adyen will try to pay out using the priority you list first. If that's not * possible, it moves on to the next option in the order of your provided priorities. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to + * 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). Required for transfers with `category` **bank**. For more details, * see [fallback * priorities](https://docs.adyen.com/payouts/payout-service/payout-to-users/#fallback-priorities). @@ -706,6 +770,7 @@ public void setPaymentInstrumentId(String paymentInstrumentId) { */ public TransferInfo priorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set return this; } @@ -721,14 +786,14 @@ public TransferInfo addPrioritiesItem(PrioritiesEnum prioritiesItem) { * The list of priorities for the bank transfer. This sets the speed at which the transfer is sent * and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay * out using the priority you list first. If that's not possible, it moves on to the next - * option in the order of your provided priorities. 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 + * option in the order of your provided priorities. 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 United States and in [SEPA + * **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). Required for transfers with `category` **bank**. For more details, see * [fallback * priorities](https://docs.adyen.com/payouts/payout-service/payout-to-users/#fallback-priorities). @@ -737,14 +802,14 @@ public TransferInfo addPrioritiesItem(PrioritiesEnum prioritiesItem) { * the transfer is sent and the fees that you have to pay. You can provide multiple * priorities. Adyen will try to pay out using the priority you list first. If that's not * possible, it moves on to the next option in the order of your provided priorities. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to + * 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). Required for transfers with `category` **bank**. For more details, * see [fallback * priorities](https://docs.adyen.com/payouts/payout-service/payout-to-users/#fallback-priorities). @@ -759,14 +824,14 @@ public List getPriorities() { * The list of priorities for the bank transfer. This sets the speed at which the transfer is sent * and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay * out using the priority you list first. If that's not possible, it moves on to the next - * option in the order of your provided priorities. 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 + * option in the order of your provided priorities. 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 United States and in [SEPA + * **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). Required for transfers with `category` **bank**. For more details, see * [fallback * priorities](https://docs.adyen.com/payouts/payout-service/payout-to-users/#fallback-priorities). @@ -775,14 +840,14 @@ public List getPriorities() { * the transfer is sent and the fees that you have to pay. You can provide multiple * priorities. Adyen will try to pay out using the priority you list first. If that's not * possible, it moves on to the next option in the order of your provided priorities. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to + * 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). Required for transfers with `category` **bank**. For more details, * see [fallback * priorities](https://docs.adyen.com/payouts/payout-service/payout-to-users/#fallback-priorities). @@ -791,62 +856,64 @@ public List getPriorities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriorities(List priorities) { this.priorities = priorities; + isSetPriorities = true; // mark as set } /** * 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 TransferInfo} instance, allowing for method chaining */ public TransferInfo priority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set return this; } /** * 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) @@ -858,32 +925,33 @@ 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) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set } /** @@ -896,6 +964,7 @@ public void setPriority(PriorityEnum priority) { */ public TransferInfo reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -923,6 +992,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -942,6 +1012,7 @@ public void setReference(String reference) { */ public TransferInfo referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -983,6 +1054,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -993,6 +1065,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public TransferInfo review(TransferRequestReview review) { this.review = review; + isSetReview = true; // mark as set return this; } @@ -1016,6 +1089,7 @@ public TransferRequestReview getReview() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReview(TransferRequestReview review) { this.review = review; + isSetReview = true; // mark as set } /** @@ -1034,6 +1108,7 @@ public void setReview(TransferRequestReview review) { */ public TransferInfo type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1073,6 +1148,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -1083,6 +1159,7 @@ public void setType(TypeEnum type) { */ public TransferInfo ultimateParty(UltimatePartyIdentification ultimateParty) { this.ultimateParty = ultimateParty; + isSetUltimateParty = true; // mark as set return this; } @@ -1106,6 +1183,27 @@ public UltimatePartyIdentification getUltimateParty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUltimateParty(UltimatePartyIdentification ultimateParty) { this.ultimateParty = ultimateParty; + isSetUltimateParty = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferInfo 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 TransferInfo object is equal to o. */ @@ -1189,6 +1287,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetExecutionDate) { + addIfNull(nulls, JSON_PROPERTY_EXECUTION_DATE, this.executionDate); + } + if (isSetPaymentInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT_ID, this.paymentInstrumentId); + } + if (isSetPriorities) { + addIfNull(nulls, JSON_PROPERTY_PRIORITIES, this.priorities); + } + if (isSetPriority) { + addIfNull(nulls, JSON_PROPERTY_PRIORITY, this.priority); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetReview) { + addIfNull(nulls, JSON_PROPERTY_REVIEW, this.review); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUltimateParty) { + addIfNull(nulls, JSON_PROPERTY_ULTIMATE_PARTY, this.ultimateParty); + } + + 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 TransferInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferNotificationCounterParty.java b/src/main/java/com/adyen/model/transfers/TransferNotificationCounterParty.java index f2baaae5d..ca94ac8ce 100644 --- a/src/main/java/com/adyen/model/transfers/TransferNotificationCounterParty.java +++ b/src/main/java/com/adyen/model/transfers/TransferNotificationCounterParty.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 TransferNotificationCounterParty { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountV3 bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = 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_MERCHANT = "merchant"; private TransferNotificationMerchantData merchant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchant = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferNotificationCounterParty() {} /** @@ -54,6 +77,7 @@ public TransferNotificationCounterParty() {} */ public TransferNotificationCounterParty balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -81,6 +105,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -92,6 +117,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public TransferNotificationCounterParty bankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -115,6 +141,7 @@ public BankAccountV3 getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -126,6 +153,7 @@ public void setBankAccount(BankAccountV3 bankAccount) { */ public TransferNotificationCounterParty card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -149,6 +177,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -160,6 +189,7 @@ public void setCard(Card card) { */ public TransferNotificationCounterParty merchant(TransferNotificationMerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set return this; } @@ -183,6 +213,7 @@ public TransferNotificationMerchantData getMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchant(TransferNotificationMerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set } /** @@ -196,6 +227,7 @@ public void setMerchant(TransferNotificationMerchantData merchant) { */ public TransferNotificationCounterParty transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -223,6 +255,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferNotificationCounterParty 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 TransferNotificationCounterParty object is equal to o. */ @@ -274,6 +327,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 (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetMerchant) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT, this.merchant); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + 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 TransferNotificationCounterParty given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferNotificationMerchantData.java b/src/main/java/com/adyen/model/transfers/TransferNotificationMerchantData.java index e2df93fe4..1858c7eae 100644 --- a/src/main/java/com/adyen/model/transfers/TransferNotificationMerchantData.java +++ b/src/main/java/com/adyen/model/transfers/TransferNotificationMerchantData.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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; @@ -31,24 +33,51 @@ public class TransferNotificationMerchantData { public static final String JSON_PROPERTY_ACQUIRER_ID = "acquirerId"; private String acquirerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerId = false; + 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_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = 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_POSTAL_CODE = "postalCode"; private String postalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferNotificationMerchantData() {} /** @@ -60,6 +89,7 @@ public TransferNotificationMerchantData() {} */ public TransferNotificationMerchantData acquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set return this; } @@ -83,6 +113,7 @@ public String getAcquirerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set } /** @@ -94,6 +125,7 @@ public void setAcquirerId(String acquirerId) { */ public TransferNotificationMerchantData city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -117,6 +149,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -128,6 +161,7 @@ public void setCity(String city) { */ public TransferNotificationMerchantData country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -151,6 +185,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -162,6 +197,7 @@ public void setCountry(String country) { */ public TransferNotificationMerchantData mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -185,6 +221,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -196,6 +233,7 @@ public void setMcc(String mcc) { */ public TransferNotificationMerchantData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -219,6 +257,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -230,6 +269,7 @@ public void setMerchantId(String merchantId) { */ public TransferNotificationMerchantData name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -253,6 +293,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -264,6 +305,7 @@ public void setName(String name) { */ public TransferNotificationMerchantData postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -287,6 +329,27 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferNotificationMerchantData 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 TransferNotificationMerchantData object is equal to o. */ @@ -339,6 +402,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcquirerId) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_ID, this.acquirerId); + } + 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 (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + + 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 TransferNotificationMerchantData given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferNotificationValidationFact.java b/src/main/java/com/adyen/model/transfers/TransferNotificationValidationFact.java index 39470d60c..3e2b75497 100644 --- a/src/main/java/com/adyen/model/transfers/TransferNotificationValidationFact.java +++ b/src/main/java/com/adyen/model/transfers/TransferNotificationValidationFact.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 TransferNotificationValidationFact { public static final String JSON_PROPERTY_RESULT = "result"; private String result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResult = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 TransferNotificationValidationFact() {} /** @@ -40,6 +54,7 @@ public TransferNotificationValidationFact() {} */ public TransferNotificationValidationFact result(String result) { this.result = result; + isSetResult = true; // mark as set return this; } @@ -63,6 +78,7 @@ public String getResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResult(String result) { this.result = result; + isSetResult = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setResult(String result) { */ public TransferNotificationValidationFact type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -97,6 +114,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferNotificationValidationFact 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 TransferNotificationValidationFact object is equal to o. */ @@ -139,6 +177,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 (isSetResult) { + addIfNull(nulls, JSON_PROPERTY_RESULT, this.result); + } + 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 TransferNotificationValidationFact given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferRequestReview.java b/src/main/java/com/adyen/model/transfers/TransferRequestReview.java index dc0e34813..db44f425e 100644 --- a/src/main/java/com/adyen/model/transfers/TransferRequestReview.java +++ b/src/main/java/com/adyen/model/transfers/TransferRequestReview.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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,9 +29,21 @@ public class TransferRequestReview { "numberOfApprovalsRequired"; private Integer numberOfApprovalsRequired; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumberOfApprovalsRequired = false; + public static final String JSON_PROPERTY_SCA_ON_APPROVAL = "scaOnApproval"; private Boolean scaOnApproval; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaOnApproval = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferRequestReview() {} /** @@ -44,6 +58,7 @@ public TransferRequestReview() {} */ public TransferRequestReview numberOfApprovalsRequired(Integer numberOfApprovalsRequired) { this.numberOfApprovalsRequired = numberOfApprovalsRequired; + isSetNumberOfApprovalsRequired = true; // mark as set return this; } @@ -75,6 +90,7 @@ public Integer getNumberOfApprovalsRequired() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumberOfApprovalsRequired(Integer numberOfApprovalsRequired) { this.numberOfApprovalsRequired = numberOfApprovalsRequired; + isSetNumberOfApprovalsRequired = true; // mark as set } /** @@ -92,6 +108,7 @@ public void setNumberOfApprovalsRequired(Integer numberOfApprovalsRequired) { */ public TransferRequestReview scaOnApproval(Boolean scaOnApproval) { this.scaOnApproval = scaOnApproval; + isSetScaOnApproval = true; // mark as set return this; } @@ -129,6 +146,27 @@ public Boolean getScaOnApproval() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaOnApproval(Boolean scaOnApproval) { this.scaOnApproval = scaOnApproval; + isSetScaOnApproval = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferRequestReview 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 TransferRequestReview object is equal to o. */ @@ -173,6 +211,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 (isSetNumberOfApprovalsRequired) { + addIfNull(nulls, JSON_PROPERTY_NUMBER_OF_APPROVALS_REQUIRED, this.numberOfApprovalsRequired); + } + if (isSetScaOnApproval) { + addIfNull(nulls, JSON_PROPERTY_SCA_ON_APPROVAL, this.scaOnApproval); + } + + 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 TransferRequestReview given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferReview.java b/src/main/java/com/adyen/model/transfers/TransferReview.java index 686389247..8000590c4 100644 --- a/src/main/java/com/adyen/model/transfers/TransferReview.java +++ b/src/main/java/com/adyen/model/transfers/TransferReview.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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 TransferReview { "numberOfApprovalsRequired"; private Integer numberOfApprovalsRequired; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumberOfApprovalsRequired = false; + /** * Shows the status of the Strong Customer Authentication (SCA) process. Possible values: * **required**, **notApplicable**. @@ -80,6 +85,15 @@ public static ScaOnApprovalEnum fromValue(String value) { public static final String JSON_PROPERTY_SCA_ON_APPROVAL = "scaOnApproval"; private ScaOnApprovalEnum scaOnApproval; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaOnApproval = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferReview() {} /** @@ -94,6 +108,7 @@ public TransferReview() {} */ public TransferReview numberOfApprovalsRequired(Integer numberOfApprovalsRequired) { this.numberOfApprovalsRequired = numberOfApprovalsRequired; + isSetNumberOfApprovalsRequired = true; // mark as set return this; } @@ -125,6 +140,7 @@ public Integer getNumberOfApprovalsRequired() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumberOfApprovalsRequired(Integer numberOfApprovalsRequired) { this.numberOfApprovalsRequired = numberOfApprovalsRequired; + isSetNumberOfApprovalsRequired = true; // mark as set } /** @@ -137,6 +153,7 @@ public void setNumberOfApprovalsRequired(Integer numberOfApprovalsRequired) { */ public TransferReview scaOnApproval(ScaOnApprovalEnum scaOnApproval) { this.scaOnApproval = scaOnApproval; + isSetScaOnApproval = true; // mark as set return this; } @@ -164,6 +181,27 @@ public ScaOnApprovalEnum getScaOnApproval() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaOnApproval(ScaOnApprovalEnum scaOnApproval) { this.scaOnApproval = scaOnApproval; + isSetScaOnApproval = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferReview 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 TransferReview object is equal to o. */ @@ -207,6 +245,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 (isSetNumberOfApprovalsRequired) { + addIfNull(nulls, JSON_PROPERTY_NUMBER_OF_APPROVALS_REQUIRED, this.numberOfApprovalsRequired); + } + if (isSetScaOnApproval) { + addIfNull(nulls, JSON_PROPERTY_SCA_ON_APPROVAL, this.scaOnApproval); + } + + 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 TransferReview given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferServiceRestServiceError.java b/src/main/java/com/adyen/model/transfers/TransferServiceRestServiceError.java index 5a9123bab..85fea0eb8 100644 --- a/src/main/java/com/adyen/model/transfers/TransferServiceRestServiceError.java +++ b/src/main/java/com/adyen/model/transfers/TransferServiceRestServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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; @@ -36,33 +38,69 @@ public class TransferServiceRestServiceError { public static final String JSON_PROPERTY_DETAIL = "detail"; private String detail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetail = 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_INSTANCE = "instance"; private String instance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstance = false; + public static final String JSON_PROPERTY_INVALID_FIELDS = "invalidFields"; private List invalidFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInvalidFields = false; + public static final String JSON_PROPERTY_REQUEST_ID = "requestId"; private String requestId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestId = false; + public static final String JSON_PROPERTY_RESPONSE = "response"; private Object response; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + public static final String JSON_PROPERTY_ROUTING_DETAILS = "routingDetails"; private List routingDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRoutingDetails = false; + public static final String JSON_PROPERTY_STATUS = "status"; private Integer status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TITLE = "title"; private String title; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTitle = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 TransferServiceRestServiceError() {} /** @@ -74,6 +112,7 @@ public TransferServiceRestServiceError() {} */ public TransferServiceRestServiceError detail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set return this; } @@ -97,6 +136,7 @@ public String getDetail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set } /** @@ -108,6 +148,7 @@ public void setDetail(String detail) { */ public TransferServiceRestServiceError errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -131,6 +172,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -142,6 +184,7 @@ public void setErrorCode(String errorCode) { */ public TransferServiceRestServiceError instance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set return this; } @@ -165,6 +208,7 @@ public String getInstance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set } /** @@ -176,6 +220,7 @@ public void setInstance(String instance) { */ public TransferServiceRestServiceError invalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set return this; } @@ -207,6 +252,7 @@ public List getInvalidFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInvalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set } /** @@ -219,6 +265,7 @@ public void setInvalidFields(List invalidFields) { */ public TransferServiceRestServiceError requestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set return this; } @@ -244,6 +291,7 @@ public String getRequestId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set } /** @@ -255,6 +303,7 @@ public void setRequestId(String requestId) { */ public TransferServiceRestServiceError response(Object response) { this.response = response; + isSetResponse = true; // mark as set return this; } @@ -278,6 +327,7 @@ public Object getResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResponse(Object response) { this.response = response; + isSetResponse = true; // mark as set } /** @@ -291,6 +341,7 @@ public void setResponse(Object response) { */ public TransferServiceRestServiceError routingDetails(List routingDetails) { this.routingDetails = routingDetails; + isSetRoutingDetails = true; // mark as set return this; } @@ -326,6 +377,7 @@ public List getRoutingDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRoutingDetails(List routingDetails) { this.routingDetails = routingDetails; + isSetRoutingDetails = true; // mark as set } /** @@ -337,6 +389,7 @@ public void setRoutingDetails(List routingDetails) { */ public TransferServiceRestServiceError status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -360,6 +413,7 @@ public Integer getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(Integer status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -371,6 +425,7 @@ public void setStatus(Integer status) { */ public TransferServiceRestServiceError title(String title) { this.title = title; + isSetTitle = true; // mark as set return this; } @@ -394,6 +449,7 @@ public String getTitle() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTitle(String title) { this.title = title; + isSetTitle = true; // mark as set } /** @@ -407,6 +463,7 @@ public void setTitle(String title) { */ public TransferServiceRestServiceError type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -434,6 +491,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferServiceRestServiceError 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 TransferServiceRestServiceError object is equal to o. */ @@ -502,6 +580,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 (isSetDetail) { + addIfNull(nulls, JSON_PROPERTY_DETAIL, this.detail); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetInstance) { + addIfNull(nulls, JSON_PROPERTY_INSTANCE, this.instance); + } + if (isSetInvalidFields) { + addIfNull(nulls, JSON_PROPERTY_INVALID_FIELDS, this.invalidFields); + } + if (isSetRequestId) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_ID, this.requestId); + } + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetRoutingDetails) { + addIfNull(nulls, JSON_PROPERTY_ROUTING_DETAILS, this.routingDetails); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTitle) { + addIfNull(nulls, JSON_PROPERTY_TITLE, this.title); + } + 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 TransferServiceRestServiceError given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/TransferView.java b/src/main/java/com/adyen/model/transfers/TransferView.java index 14b147cea..455b36890 100644 --- a/src/main/java/com/adyen/model/transfers/TransferView.java +++ b/src/main/java/com/adyen/model/transfers/TransferView.java @@ -11,6 +11,8 @@ package com.adyen.model.transfers; +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 TransferView { public static final String JSON_PROPERTY_CATEGORY_DATA = "categoryData"; private TransferCategoryData categoryData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategoryData = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferView() {} /** @@ -43,6 +60,7 @@ public TransferView() {} */ public TransferView categoryData(TransferCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set return this; } @@ -66,6 +84,7 @@ public TransferCategoryData getCategoryData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategoryData(TransferCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setCategoryData(TransferCategoryData categoryData) { */ public TransferView id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -115,6 +136,7 @@ public void setId(String id) { */ public TransferView reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -150,6 +172,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 TransferView 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 TransferView object is equal to o. */ @@ -193,6 +236,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 (isSetCategoryData) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY_DATA, this.categoryData); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferView given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/UKLocalAccountIdentification.java index 6da2ae26f..60cfad17e 100644 --- a/src/main/java/com/adyen/model/transfers/UKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/UKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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,9 +33,15 @@ public class UKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_SORT_CODE = "sortCode"; private String sortCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSortCode = false; + /** **ukLocal** */ public enum TypeEnum { UKLOCAL(String.valueOf("ukLocal")); @@ -76,6 +84,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 UKLocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public UKLocalAccountIdentification() {} */ public UKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -121,6 +140,7 @@ public void setAccountNumber(String accountNumber) { */ public UKLocalAccountIdentification sortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getSortCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setSortCode(String sortCode) { */ public UKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,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 UKLocalAccountIdentification 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 UKLocalAccountIdentification object is equal to o. */ @@ -224,6 +267,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetSortCode) { + addIfNull(nulls, JSON_PROPERTY_SORT_CODE, this.sortCode); + } + 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 UKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/USLocalAccountIdentification.java index 0753bffab..b8e432d75 100644 --- a/src/main/java/com/adyen/model/transfers/USLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/USLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -32,6 +34,9 @@ public class USLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. */ @@ -78,9 +83,15 @@ 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_ROUTING_NUMBER = "routingNumber"; private String routingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRoutingNumber = false; + /** **usLocal** */ public enum TypeEnum { USLOCAL(String.valueOf("usLocal")); @@ -123,6 +134,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 USLocalAccountIdentification() {} /** @@ -133,6 +153,7 @@ public USLocalAccountIdentification() {} */ public USLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -156,6 +177,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -167,6 +189,7 @@ public void setAccountNumber(String accountNumber) { */ public USLocalAccountIdentification accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -192,6 +215,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -205,6 +229,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public USLocalAccountIdentification routingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set return this; } @@ -234,6 +259,7 @@ public String getRoutingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRoutingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set } /** @@ -244,6 +270,7 @@ public void setRoutingNumber(String routingNumber) { */ public USLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -267,6 +294,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 USLocalAccountIdentification 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 USLocalAccountIdentification object is equal to o. */ @@ -312,6 +360,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetRoutingNumber) { + addIfNull(nulls, JSON_PROPERTY_ROUTING_NUMBER, this.routingNumber); + } + 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 USLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java b/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java index 1b8cbaeee..eb9b15392 100644 --- a/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java +++ b/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transfers; +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; @@ -29,6 +31,7 @@ UltimatePartyIdentification.JSON_PROPERTY_EMAIL, UltimatePartyIdentification.JSON_PROPERTY_FIRST_NAME, UltimatePartyIdentification.JSON_PROPERTY_FULL_NAME, + UltimatePartyIdentification.JSON_PROPERTY_FUNDING_INSTRUMENT, UltimatePartyIdentification.JSON_PROPERTY_LAST_NAME, UltimatePartyIdentification.JSON_PROPERTY_REFERENCE, UltimatePartyIdentification.JSON_PROPERTY_TYPE, @@ -38,24 +41,51 @@ public class UltimatePartyIdentification { public static final String JSON_PROPERTY_ADDRESS = "address"; private Address address; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddress = 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_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + 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_FULL_NAME = "fullName"; private String fullName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFullName = false; + + public static final String JSON_PROPERTY_FUNDING_INSTRUMENT = "fundingInstrument"; + private FundingInstrument fundingInstrument; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingInstrument = 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; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * The type of entity that owns the bank account or card. Possible values: **individual**, * **organization**, or **unknown**. Required when `category` is **card**. In this case, @@ -106,9 +136,21 @@ 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; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UltimatePartyIdentification() {} /** @@ -119,6 +161,7 @@ public UltimatePartyIdentification() {} */ public UltimatePartyIdentification address(Address address) { this.address = address; + isSetAddress = true; // mark as set return this; } @@ -142,6 +185,7 @@ public Address getAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddress(Address address) { this.address = address; + isSetAddress = true; // mark as set } /** @@ -155,6 +199,7 @@ public void setAddress(Address address) { */ public UltimatePartyIdentification dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -184,6 +229,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -195,6 +241,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public UltimatePartyIdentification email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -220,6 +267,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -234,6 +282,7 @@ public void setEmail(String email) { */ public UltimatePartyIdentification firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -265,6 +314,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -279,6 +329,7 @@ public void setFirstName(String firstName) { */ public UltimatePartyIdentification fullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set return this; } @@ -310,6 +361,42 @@ public String getFullName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set + } + + /** + * fundingInstrument + * + * @param fundingInstrument + * @return the current {@code UltimatePartyIdentification} instance, allowing for method chaining + */ + public UltimatePartyIdentification fundingInstrument(FundingInstrument fundingInstrument) { + this.fundingInstrument = fundingInstrument; + isSetFundingInstrument = true; // mark as set + return this; + } + + /** + * Get fundingInstrument + * + * @return fundingInstrument + */ + @JsonProperty(JSON_PROPERTY_FUNDING_INSTRUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FundingInstrument getFundingInstrument() { + return fundingInstrument; + } + + /** + * fundingInstrument + * + * @param fundingInstrument + */ + @JsonProperty(JSON_PROPERTY_FUNDING_INSTRUMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFundingInstrument(FundingInstrument fundingInstrument) { + this.fundingInstrument = fundingInstrument; + isSetFundingInstrument = true; // mark as set } /** @@ -324,6 +411,7 @@ public void setFullName(String fullName) { */ public UltimatePartyIdentification lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -355,6 +443,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -369,6 +458,7 @@ public void setLastName(String lastName) { */ public UltimatePartyIdentification reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -400,6 +490,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -414,6 +505,7 @@ public void setReference(String reference) { */ public UltimatePartyIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -445,6 +537,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -455,6 +548,7 @@ public void setType(TypeEnum type) { */ public UltimatePartyIdentification url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -478,6 +572,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UltimatePartyIdentification 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 UltimatePartyIdentification object is equal to o. */ @@ -495,6 +610,7 @@ public boolean equals(Object o) { && Objects.equals(this.email, ultimatePartyIdentification.email) && Objects.equals(this.firstName, ultimatePartyIdentification.firstName) && Objects.equals(this.fullName, ultimatePartyIdentification.fullName) + && Objects.equals(this.fundingInstrument, ultimatePartyIdentification.fundingInstrument) && Objects.equals(this.lastName, ultimatePartyIdentification.lastName) && Objects.equals(this.reference, ultimatePartyIdentification.reference) && Objects.equals(this.type, ultimatePartyIdentification.type) @@ -504,7 +620,16 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - address, dateOfBirth, email, firstName, fullName, lastName, reference, type, url); + address, + dateOfBirth, + email, + firstName, + fullName, + fundingInstrument, + lastName, + reference, + type, + url); } @Override @@ -516,6 +641,7 @@ public String toString() { sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" fundingInstrument: ").append(toIndentedString(fundingInstrument)).append("\n"); sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); @@ -534,6 +660,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 (isSetAddress) { + addIfNull(nulls, JSON_PROPERTY_ADDRESS, this.address); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetFullName) { + addIfNull(nulls, JSON_PROPERTY_FULL_NAME, this.fullName); + } + if (isSetFundingInstrument) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_INSTRUMENT, this.fundingInstrument); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + 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 UltimatePartyIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/AULocalAccountIdentification.java index 840af2718..89cc0a70a 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/AULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/AULocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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,9 +33,15 @@ public class AULocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BSB_CODE = "bsbCode"; private String bsbCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBsbCode = false; + /** **auLocal** */ public enum TypeEnum { AULOCAL(String.valueOf("auLocal")); @@ -76,6 +84,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 AULocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public AULocalAccountIdentification() {} */ public AULocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -121,6 +140,7 @@ public void setAccountNumber(String accountNumber) { */ public AULocalAccountIdentification bsbCode(String bsbCode) { this.bsbCode = bsbCode; + isSetBsbCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getBsbCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBsbCode(String bsbCode) { this.bsbCode = bsbCode; + isSetBsbCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setBsbCode(String bsbCode) { */ public AULocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,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 AULocalAccountIdentification 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 AULocalAccountIdentification object is equal to o. */ @@ -224,6 +267,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBsbCode) { + addIfNull(nulls, JSON_PROPERTY_BSB_CODE, this.bsbCode); + } + 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 AULocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/AdditionalBankIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/AdditionalBankIdentification.java index 2cd17d0bb..4cde8b42e 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/AdditionalBankIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/AdditionalBankIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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; @@ -30,6 +32,9 @@ public class AdditionalBankIdentification { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + /** * The type of additional bank identification, depending on the country. Possible values: * * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) @@ -89,6 +94,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 AdditionalBankIdentification() {} /** @@ -99,6 +113,7 @@ public AdditionalBankIdentification() {} */ public AdditionalBankIdentification code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -122,6 +137,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -150,6 +166,7 @@ public void setCode(String code) { */ public AdditionalBankIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -209,6 +226,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 AdditionalBankIdentification 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 AdditionalBankIdentification object is equal to o. */ @@ -250,6 +288,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 (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + 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 AdditionalBankIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Address.java b/src/main/java/com/adyen/model/transferwebhooks/Address.java index d7ed7cc91..40b75cec1 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Address.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Address.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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_LINE1 = "line1"; private String line1; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine1 = false; + public static final String JSON_PROPERTY_LINE2 = "line2"; private String line2; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLine2 = 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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Address() {} /** @@ -57,6 +83,7 @@ public Address() {} */ public Address city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -84,6 +111,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -95,6 +123,7 @@ public void setCity(String city) { */ public Address country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -120,6 +149,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 line1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set return this; } @@ -162,6 +193,7 @@ public String getLine1() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine1(String line1) { this.line1 = line1; + isSetLine1 = true; // mark as set } /** @@ -175,6 +207,7 @@ public void setLine1(String line1) { */ public Address line2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set return this; } @@ -204,6 +237,7 @@ public String getLine2() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLine2(String line2) { this.line2 = line2; + isSetLine2 = true; // mark as set } /** @@ -218,6 +252,7 @@ public void setLine2(String line2) { */ public Address postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -249,6 +284,7 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set } /** @@ -261,6 +297,7 @@ public void setPostalCode(String postalCode) { */ public Address stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set return this; } @@ -288,6 +325,27 @@ public String getStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = 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. */ @@ -337,6 +395,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 (isSetLine1) { + addIfNull(nulls, JSON_PROPERTY_LINE1, this.line1); + } + if (isSetLine2) { + addIfNull(nulls, JSON_PROPERTY_LINE2, this.line2); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + if (isSetStateOrProvince) { + addIfNull(nulls, JSON_PROPERTY_STATE_OR_PROVINCE, this.stateOrProvince); + } + + 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/transferwebhooks/Airline.java b/src/main/java/com/adyen/model/transferwebhooks/Airline.java index bfe6ad80c..081cbcbcf 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Airline.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Airline.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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 Airline { public static final String JSON_PROPERTY_LEGS = "legs"; private List legs; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegs = false; + public static final String JSON_PROPERTY_TICKET_NUMBER = "ticketNumber"; private String ticketNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTicketNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Airline() {} /** @@ -38,6 +52,7 @@ public Airline() {} */ public Airline legs(List legs) { this.legs = legs; + isSetLegs = true; // mark as set return this; } @@ -69,6 +84,7 @@ public List getLegs() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegs(List legs) { this.legs = legs; + isSetLegs = true; // mark as set } /** @@ -79,6 +95,7 @@ public void setLegs(List legs) { */ public Airline ticketNumber(String ticketNumber) { this.ticketNumber = ticketNumber; + isSetTicketNumber = true; // mark as set return this; } @@ -102,6 +119,27 @@ public String getTicketNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTicketNumber(String ticketNumber) { this.ticketNumber = ticketNumber; + isSetTicketNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Airline 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 Airline object is equal to o. */ @@ -143,6 +181,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 (isSetLegs) { + addIfNull(nulls, JSON_PROPERTY_LEGS, this.legs); + } + if (isSetTicketNumber) { + addIfNull(nulls, JSON_PROPERTY_TICKET_NUMBER, this.ticketNumber); + } + + 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 Airline given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Amount.java b/src/main/java/com/adyen/model/transferwebhooks/Amount.java index 63f056c5b..8ab4878a5 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Amount.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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. */ @@ -145,6 +189,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/transferwebhooks/AmountAdjustment.java b/src/main/java/com/adyen/model/transferwebhooks/AmountAdjustment.java index 00fff8f3a..da40d7add 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/AmountAdjustment.java +++ b/src/main/java/com/adyen/model/transferwebhooks/AmountAdjustment.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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 AmountAdjustment { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + /** * The type of markup that is applied to an authorised payment. Possible values: **exchange**, * **forexMarkup**, **authHoldReserve**, **atmMarkup**. @@ -82,9 +87,21 @@ public static AmountAdjustmentTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_AMOUNT_ADJUSTMENT_TYPE = "amountAdjustmentType"; private AmountAdjustmentTypeEnum amountAdjustmentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountAdjustmentType = false; + public static final String JSON_PROPERTY_BASEPOINTS = "basepoints"; private Integer basepoints; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasepoints = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AmountAdjustment() {} /** @@ -95,6 +112,7 @@ public AmountAdjustment() {} */ public AmountAdjustment amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -118,6 +136,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -130,6 +149,7 @@ public void setAmount(Amount amount) { */ public AmountAdjustment amountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentType) { this.amountAdjustmentType = amountAdjustmentType; + isSetAmountAdjustmentType = true; // mark as set return this; } @@ -157,6 +177,7 @@ public AmountAdjustmentTypeEnum getAmountAdjustmentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentType) { this.amountAdjustmentType = amountAdjustmentType; + isSetAmountAdjustmentType = true; // mark as set } /** @@ -167,6 +188,7 @@ public void setAmountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentTyp */ public AmountAdjustment basepoints(Integer basepoints) { this.basepoints = basepoints; + isSetBasepoints = true; // mark as set return this; } @@ -190,6 +212,27 @@ public Integer getBasepoints() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBasepoints(Integer basepoints) { this.basepoints = basepoints; + isSetBasepoints = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AmountAdjustment 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 AmountAdjustment object is equal to o. */ @@ -235,6 +278,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetAmountAdjustmentType) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_ADJUSTMENT_TYPE, this.amountAdjustmentType); + } + if (isSetBasepoints) { + addIfNull(nulls, JSON_PROPERTY_BASEPOINTS, this.basepoints); + } + + 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 AmountAdjustment given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java index 12730df5f..9524de997 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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 BRLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + public static final String JSON_PROPERTY_BRANCH_NUMBER = "branchNumber"; private String branchNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBranchNumber = false; + public static final String JSON_PROPERTY_ISPB = "ispb"; private String ispb; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIspb = false; + /** **brLocal** */ public enum TypeEnum { BRLOCAL(String.valueOf("brLocal")); @@ -84,6 +98,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 BRLocalAccountIdentification() {} /** @@ -94,6 +117,7 @@ public BRLocalAccountIdentification() {} */ public BRLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +141,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +152,7 @@ public void setAccountNumber(String accountNumber) { */ public BRLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -150,6 +176,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -160,6 +187,7 @@ public void setBankCode(String bankCode) { */ public BRLocalAccountIdentification branchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set return this; } @@ -183,6 +211,7 @@ public String getBranchNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBranchNumber(String branchNumber) { this.branchNumber = branchNumber; + isSetBranchNumber = true; // mark as set } /** @@ -193,6 +222,7 @@ public void setBranchNumber(String branchNumber) { */ public BRLocalAccountIdentification ispb(String ispb) { this.ispb = ispb; + isSetIspb = true; // mark as set return this; } @@ -216,6 +246,7 @@ public String getIspb() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIspb(String ispb) { this.ispb = ispb; + isSetIspb = true; // mark as set } /** @@ -226,6 +257,7 @@ public void setIspb(String ispb) { */ public BRLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -249,6 +281,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 BRLocalAccountIdentification 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 BRLocalAccountIdentification object is equal to o. */ @@ -296,6 +349,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetBranchNumber) { + addIfNull(nulls, JSON_PROPERTY_BRANCH_NUMBER, this.branchNumber); + } + if (isSetIspb) { + addIfNull(nulls, JSON_PROPERTY_ISPB, this.ispb); + } + 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 BRLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java b/src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java index a23e484bf..d87139c76 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java +++ b/src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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 BalanceMutation { public static final String JSON_PROPERTY_BALANCE = "balance"; private Long balance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalance = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_RECEIVED = "received"; private Long received; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReceived = false; + public static final String JSON_PROPERTY_RESERVED = "reserved"; private Long reserved; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReserved = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceMutation() {} /** @@ -49,6 +69,7 @@ public BalanceMutation() {} */ public BalanceMutation balance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set return this; } @@ -76,6 +97,7 @@ public Long getBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalance(Long balance) { this.balance = balance; + isSetBalance = true; // mark as set } /** @@ -88,6 +110,7 @@ public void setBalance(Long balance) { */ public BalanceMutation currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -115,6 +138,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -127,6 +151,7 @@ public void setCurrency(String currency) { */ public BalanceMutation received(Long received) { this.received = received; + isSetReceived = true; // mark as set return this; } @@ -154,6 +179,7 @@ public Long getReceived() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReceived(Long received) { this.received = received; + isSetReceived = true; // mark as set } /** @@ -166,6 +192,7 @@ public void setReceived(Long received) { */ public BalanceMutation reserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set return this; } @@ -193,6 +220,27 @@ public Long getReserved() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReserved(Long reserved) { this.reserved = reserved; + isSetReserved = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceMutation 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 BalanceMutation object is equal to o. */ @@ -238,6 +286,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 (isSetBalance) { + addIfNull(nulls, JSON_PROPERTY_BALANCE, this.balance); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetReceived) { + addIfNull(nulls, JSON_PROPERTY_RECEIVED, this.received); + } + if (isSetReserved) { + addIfNull(nulls, JSON_PROPERTY_RESERVED, this.reserved); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceMutation given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java b/src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java index 6f13538f7..b42e64b6a 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java +++ b/src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class BalancePlatformNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalancePlatformNotificationResponse() {} /** @@ -36,6 +47,7 @@ public BalancePlatformNotificationResponse() {} */ public BalancePlatformNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalancePlatformNotificationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalancePlatformNotificationResponse object is equal to o. */ @@ -106,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalancePlatformNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java b/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java index 5d6020d39..1b8c50b46 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java +++ b/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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; @@ -20,15 +22,34 @@ /** BankAccountV3 */ @JsonPropertyOrder({ BankAccountV3.JSON_PROPERTY_ACCOUNT_HOLDER, - BankAccountV3.JSON_PROPERTY_ACCOUNT_IDENTIFICATION + BankAccountV3.JSON_PROPERTY_ACCOUNT_IDENTIFICATION, + BankAccountV3.JSON_PROPERTY_STORED_PAYMENT_METHOD_ID }) public class BankAccountV3 { public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; private PartyIdentification accountHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + public static final String JSON_PROPERTY_ACCOUNT_IDENTIFICATION = "accountIdentification"; private BankAccountV3AccountIdentification accountIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountIdentification = false; + + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; + private String storedPaymentMethodId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BankAccountV3() {} /** @@ -39,6 +60,7 @@ public BankAccountV3() {} */ public BankAccountV3 accountHolder(PartyIdentification accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -62,6 +84,7 @@ public PartyIdentification getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(PartyIdentification accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set } /** @@ -73,6 +96,7 @@ public void setAccountHolder(PartyIdentification accountHolder) { public BankAccountV3 accountIdentification( BankAccountV3AccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set return this; } @@ -96,6 +120,68 @@ public BankAccountV3AccountIdentification getAccountIdentification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountIdentification(BankAccountV3AccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; + isSetAccountIdentification = true; // mark as set + } + + /** + * The unique token that identifies the stored bank account details of the counterparty for a + * payout. + * + * @param storedPaymentMethodId The unique token that identifies the stored bank account details + * of the counterparty for a payout. + * @return the current {@code BankAccountV3} instance, allowing for method chaining + */ + public BankAccountV3 storedPaymentMethodId(String storedPaymentMethodId) { + this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + return this; + } + + /** + * The unique token that identifies the stored bank account details of the counterparty for a + * payout. + * + * @return storedPaymentMethodId The unique token that identifies the stored bank account details + * of the counterparty for a payout. + */ + @JsonProperty(JSON_PROPERTY_STORED_PAYMENT_METHOD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStoredPaymentMethodId() { + return storedPaymentMethodId; + } + + /** + * The unique token that identifies the stored bank account details of the counterparty for a + * payout. + * + * @param storedPaymentMethodId The unique token that identifies the stored bank account details + * of the counterparty for a payout. + */ + @JsonProperty(JSON_PROPERTY_STORED_PAYMENT_METHOD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredPaymentMethodId(String storedPaymentMethodId) { + this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BankAccountV3 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 BankAccountV3 object is equal to o. */ @@ -109,12 +195,13 @@ public boolean equals(Object o) { } BankAccountV3 bankAccountV3 = (BankAccountV3) o; return Objects.equals(this.accountHolder, bankAccountV3.accountHolder) - && Objects.equals(this.accountIdentification, bankAccountV3.accountIdentification); + && Objects.equals(this.accountIdentification, bankAccountV3.accountIdentification) + && Objects.equals(this.storedPaymentMethodId, bankAccountV3.storedPaymentMethodId); } @Override public int hashCode() { - return Objects.hash(accountHolder, accountIdentification); + return Objects.hash(accountHolder, accountIdentification, storedPaymentMethodId); } @Override @@ -125,6 +212,9 @@ public String toString() { sb.append(" accountIdentification: ") .append(toIndentedString(accountIdentification)) .append("\n"); + sb.append(" storedPaymentMethodId: ") + .append(toIndentedString(storedPaymentMethodId)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -139,6 +229,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 (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAccountIdentification) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_IDENTIFICATION, this.accountIdentification); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + + 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 BankAccountV3 given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java b/src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java index 12d2f75db..01eef6886 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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; @@ -27,14 +29,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 { @@ -88,6 +90,9 @@ public static PriorityEnum fromValue(String value) { public static final String JSON_PROPERTY_PRIORITY = "priority"; private PriorityEnum priority; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPriority = false; + /** **bank** */ public enum TypeEnum { BANK(String.valueOf("bank")); @@ -130,62 +135,72 @@ 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 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 */ public BankCategoryData priority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set return this; } /** * 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,32 +212,33 @@ 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) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPriority(PriorityEnum priority) { this.priority = priority; + isSetPriority = true; // mark as set } /** @@ -233,6 +249,7 @@ public void setPriority(PriorityEnum priority) { */ public BankCategoryData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -256,6 +273,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 BankCategoryData 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 BankCategoryData object is equal to o. */ @@ -297,6 +335,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 (isSetPriority) { + addIfNull(nulls, JSON_PROPERTY_PRIORITY, this.priority); + } + 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 BankCategoryData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java index e1c0ce47d..3f7201441 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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 CALocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. */ @@ -79,12 +84,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_INSTITUTION_NUMBER = "institutionNumber"; private String institutionNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstitutionNumber = false; + public static final String JSON_PROPERTY_TRANSIT_NUMBER = "transitNumber"; private String transitNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransitNumber = false; + /** **caLocal** */ public enum TypeEnum { CALOCAL(String.valueOf("caLocal")); @@ -127,6 +141,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 CALocalAccountIdentification() {} /** @@ -137,6 +160,7 @@ public CALocalAccountIdentification() {} */ public CALocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -160,6 +184,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -171,6 +196,7 @@ public void setAccountNumber(String accountNumber) { */ public CALocalAccountIdentification accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -196,6 +222,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -206,6 +233,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public CALocalAccountIdentification institutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; + isSetInstitutionNumber = true; // mark as set return this; } @@ -229,6 +257,7 @@ public String getInstitutionNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstitutionNumber(String institutionNumber) { this.institutionNumber = institutionNumber; + isSetInstitutionNumber = true; // mark as set } /** @@ -239,6 +268,7 @@ public void setInstitutionNumber(String institutionNumber) { */ public CALocalAccountIdentification transitNumber(String transitNumber) { this.transitNumber = transitNumber; + isSetTransitNumber = true; // mark as set return this; } @@ -262,6 +292,7 @@ public String getTransitNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransitNumber(String transitNumber) { this.transitNumber = transitNumber; + isSetTransitNumber = true; // mark as set } /** @@ -272,6 +303,7 @@ public void setTransitNumber(String transitNumber) { */ public CALocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -295,6 +327,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 CALocalAccountIdentification 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 CALocalAccountIdentification object is equal to o. */ @@ -342,6 +395,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetInstitutionNumber) { + addIfNull(nulls, JSON_PROPERTY_INSTITUTION_NUMBER, this.institutionNumber); + } + if (isSetTransitNumber) { + addIfNull(nulls, JSON_PROPERTY_TRANSIT_NUMBER, this.transitNumber); + } + 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 CALocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/CZLocalAccountIdentification.java index a46f58f0b..54aa9a127 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/CZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/CZLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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,9 +33,15 @@ public class CZLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + /** **czLocal** */ public enum TypeEnum { CZLOCAL(String.valueOf("czLocal")); @@ -76,6 +84,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 CZLocalAccountIdentification() {} /** @@ -94,6 +111,7 @@ public CZLocalAccountIdentification() {} */ public CZLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -133,6 +151,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -143,6 +162,7 @@ public void setAccountNumber(String accountNumber) { */ public CZLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setBankCode(String bankCode) { */ public CZLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -199,6 +221,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 CZLocalAccountIdentification 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 CZLocalAccountIdentification object is equal to o. */ @@ -242,6 +285,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + 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 CZLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Card.java b/src/main/java/com/adyen/model/transferwebhooks/Card.java index f7fe6a73b..6cc9b982d 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Card.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Card.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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 Card { public static final String JSON_PROPERTY_CARD_HOLDER = "cardHolder"; private PartyIdentification cardHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardHolder = false; + public static final String JSON_PROPERTY_CARD_IDENTIFICATION = "cardIdentification"; private CardIdentification cardIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardIdentification = 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() {} /** @@ -36,6 +50,7 @@ public Card() {} */ public Card cardHolder(PartyIdentification cardHolder) { this.cardHolder = cardHolder; + isSetCardHolder = true; // mark as set return this; } @@ -59,6 +74,7 @@ public PartyIdentification getCardHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardHolder(PartyIdentification cardHolder) { this.cardHolder = cardHolder; + isSetCardHolder = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCardHolder(PartyIdentification cardHolder) { */ public Card cardIdentification(CardIdentification cardIdentification) { this.cardIdentification = cardIdentification; + isSetCardIdentification = true; // mark as set return this; } @@ -92,6 +109,27 @@ public CardIdentification getCardIdentification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardIdentification(CardIdentification cardIdentification) { this.cardIdentification = cardIdentification; + isSetCardIdentification = 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. */ @@ -133,6 +171,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 (isSetCardHolder) { + addIfNull(nulls, JSON_PROPERTY_CARD_HOLDER, this.cardHolder); + } + if (isSetCardIdentification) { + addIfNull(nulls, JSON_PROPERTY_CARD_IDENTIFICATION, this.cardIdentification); + } + + 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/transferwebhooks/CardIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/CardIdentification.java index 5b6e43a02..c75293338 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/CardIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/CardIdentification.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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; @@ -31,24 +33,51 @@ public class CardIdentification { 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_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; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardIdentification() {} /** @@ -61,6 +90,7 @@ public CardIdentification() {} */ public CardIdentification expiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set return this; } @@ -88,6 +118,7 @@ public String getExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set } /** @@ -98,6 +129,7 @@ public void setExpiryMonth(String expiryMonth) { */ public CardIdentification expiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set return this; } @@ -121,6 +153,7 @@ public String getExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set } /** @@ -131,6 +164,7 @@ public void setExpiryYear(String expiryYear) { */ public CardIdentification issueNumber(String issueNumber) { this.issueNumber = issueNumber; + isSetIssueNumber = true; // mark as set return this; } @@ -154,6 +188,7 @@ public String getIssueNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssueNumber(String issueNumber) { this.issueNumber = issueNumber; + isSetIssueNumber = true; // mark as set } /** @@ -166,6 +201,7 @@ public void setIssueNumber(String issueNumber) { */ public CardIdentification number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -193,6 +229,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -206,6 +243,7 @@ public void setNumber(String number) { */ public CardIdentification startMonth(String startMonth) { this.startMonth = startMonth; + isSetStartMonth = true; // mark as set return this; } @@ -235,6 +273,7 @@ public String getStartMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartMonth(String startMonth) { this.startMonth = startMonth; + isSetStartMonth = true; // mark as set } /** @@ -247,6 +286,7 @@ public void setStartMonth(String startMonth) { */ public CardIdentification startYear(String startYear) { this.startYear = startYear; + isSetStartYear = true; // mark as set return this; } @@ -274,6 +314,7 @@ public String getStartYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartYear(String startYear) { this.startYear = startYear; + isSetStartYear = true; // mark as set } /** @@ -288,6 +329,7 @@ public void setStartYear(String startYear) { */ public CardIdentification storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -319,6 +361,27 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardIdentification 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 CardIdentification object is equal to o. */ @@ -373,6 +436,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_MONTH, this.expiryMonth); + } + if (isSetExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_YEAR, this.expiryYear); + } + 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); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + + 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 CardIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ConfirmationTrackingData.java b/src/main/java/com/adyen/model/transferwebhooks/ConfirmationTrackingData.java index 37c66d92c..bd352549c 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ConfirmationTrackingData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/ConfirmationTrackingData.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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 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; + /** * The type of the tracking event. Possible values: - **confirmation**: the transfer passed * Adyen's internal review. @@ -120,6 +125,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 ConfirmationTrackingData() {} /** @@ -134,6 +148,7 @@ public ConfirmationTrackingData() {} */ public ConfirmationTrackingData status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -165,6 +180,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -177,6 +193,7 @@ public void setStatus(StatusEnum status) { */ public ConfirmationTrackingData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -204,6 +221,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 ConfirmationTrackingData 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 ConfirmationTrackingData object is equal to o. */ @@ -245,6 +283,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 (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + 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 ConfirmationTrackingData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/CounterpartyV3.java b/src/main/java/com/adyen/model/transferwebhooks/CounterpartyV3.java index bb8a1a793..aeeed2dba 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/CounterpartyV3.java +++ b/src/main/java/com/adyen/model/transferwebhooks/CounterpartyV3.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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 CounterpartyV3 { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountV3 bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = 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_MERCHANT = "merchant"; private MerchantData merchant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchant = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CounterpartyV3() {} /** @@ -53,6 +76,7 @@ public CounterpartyV3() {} */ public CounterpartyV3 balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -80,6 +104,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -90,6 +115,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public CounterpartyV3 bankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -113,6 +139,7 @@ public BankAccountV3 getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -123,6 +150,7 @@ public void setBankAccount(BankAccountV3 bankAccount) { */ public CounterpartyV3 card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -146,6 +174,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -156,6 +185,7 @@ public void setCard(Card card) { */ public CounterpartyV3 merchant(MerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set return this; } @@ -179,6 +209,7 @@ public MerchantData getMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchant(MerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set } /** @@ -191,6 +222,7 @@ public void setMerchant(MerchantData merchant) { */ public CounterpartyV3 transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -218,6 +250,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CounterpartyV3 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 CounterpartyV3 object is equal to o. */ @@ -267,6 +320,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 (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetMerchant) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT, this.merchant); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + 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 CounterpartyV3 given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java index 86a651b02..f735d25d2 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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,9 +33,15 @@ public class DKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + /** **dkLocal** */ public enum TypeEnum { DKLOCAL(String.valueOf("dkLocal")); @@ -76,6 +84,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 DKLocalAccountIdentification() {} /** @@ -87,6 +104,7 @@ public DKLocalAccountIdentification() {} */ public DKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -112,6 +130,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -122,6 +141,7 @@ public void setAccountNumber(String accountNumber) { */ public DKLocalAccountIdentification bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -146,6 +166,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -156,6 +177,7 @@ public void setBankCode(String bankCode) { */ public DKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -179,6 +201,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 DKLocalAccountIdentification 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 DKLocalAccountIdentification object is equal to o. */ @@ -222,6 +265,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + 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 DKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/DirectDebitInformation.java b/src/main/java/com/adyen/model/transferwebhooks/DirectDebitInformation.java index c4944dac4..dd775cadd 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/DirectDebitInformation.java +++ b/src/main/java/com/adyen/model/transferwebhooks/DirectDebitInformation.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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,15 +31,33 @@ public class DirectDebitInformation { public static final String JSON_PROPERTY_DATE_OF_SIGNATURE = "dateOfSignature"; private OffsetDateTime dateOfSignature; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfSignature = false; + public static final String JSON_PROPERTY_DUE_DATE = "dueDate"; private OffsetDateTime dueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDueDate = false; + public static final String JSON_PROPERTY_MANDATE_ID = "mandateId"; private String mandateId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMandateId = false; + public static final String JSON_PROPERTY_SEQUENCE_TYPE = "sequenceType"; private String sequenceType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSequenceType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DirectDebitInformation() {} /** @@ -50,6 +70,7 @@ public DirectDebitInformation() {} */ public DirectDebitInformation dateOfSignature(OffsetDateTime dateOfSignature) { this.dateOfSignature = dateOfSignature; + isSetDateOfSignature = true; // mark as set return this; } @@ -77,6 +98,7 @@ public OffsetDateTime getDateOfSignature() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfSignature(OffsetDateTime dateOfSignature) { this.dateOfSignature = dateOfSignature; + isSetDateOfSignature = true; // mark as set } /** @@ -87,6 +109,7 @@ public void setDateOfSignature(OffsetDateTime dateOfSignature) { */ public DirectDebitInformation dueDate(OffsetDateTime dueDate) { this.dueDate = dueDate; + isSetDueDate = true; // mark as set return this; } @@ -110,6 +133,7 @@ public OffsetDateTime getDueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDueDate(OffsetDateTime dueDate) { this.dueDate = dueDate; + isSetDueDate = true; // mark as set } /** @@ -120,6 +144,7 @@ public void setDueDate(OffsetDateTime dueDate) { */ public DirectDebitInformation mandateId(String mandateId) { this.mandateId = mandateId; + isSetMandateId = true; // mark as set return this; } @@ -143,6 +168,7 @@ public String getMandateId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMandateId(String mandateId) { this.mandateId = mandateId; + isSetMandateId = true; // mark as set } /** @@ -155,6 +181,7 @@ public void setMandateId(String mandateId) { */ public DirectDebitInformation sequenceType(String sequenceType) { this.sequenceType = sequenceType; + isSetSequenceType = true; // mark as set return this; } @@ -182,6 +209,27 @@ public String getSequenceType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSequenceType(String sequenceType) { this.sequenceType = sequenceType; + isSetSequenceType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DirectDebitInformation 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 DirectDebitInformation object is equal to o. */ @@ -227,6 +275,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 (isSetDateOfSignature) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_SIGNATURE, this.dateOfSignature); + } + if (isSetDueDate) { + addIfNull(nulls, JSON_PROPERTY_DUE_DATE, this.dueDate); + } + if (isSetMandateId) { + addIfNull(nulls, JSON_PROPERTY_MANDATE_ID, this.mandateId); + } + if (isSetSequenceType) { + addIfNull(nulls, JSON_PROPERTY_SEQUENCE_TYPE, this.sequenceType); + } + + 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 DirectDebitInformation given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/EstimationTrackingData.java b/src/main/java/com/adyen/model/transferwebhooks/EstimationTrackingData.java index 15e7f11e8..00aec15d8 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/EstimationTrackingData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/EstimationTrackingData.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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 EstimationTrackingData { public static final String JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME = "estimatedArrivalTime"; private OffsetDateTime estimatedArrivalTime; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEstimatedArrivalTime = false; + /** * The type of tracking event. Possible values: - **estimation**: the estimated date and time of * when the funds will be credited has been determined. @@ -76,6 +81,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 EstimationTrackingData() {} /** @@ -86,6 +100,7 @@ public EstimationTrackingData() {} */ public EstimationTrackingData estimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set return this; } @@ -110,6 +125,7 @@ public OffsetDateTime getEstimatedArrivalTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set } /** @@ -122,6 +138,7 @@ public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { */ public EstimationTrackingData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -149,6 +166,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 EstimationTrackingData 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 EstimationTrackingData object is equal to o. */ @@ -192,6 +230,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 (isSetEstimatedArrivalTime) { + addIfNull(nulls, JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME, this.estimatedArrivalTime); + } + 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 EstimationTrackingData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ExecutionDate.java b/src/main/java/com/adyen/model/transferwebhooks/ExecutionDate.java index 7590e2320..92c5e7bb6 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ExecutionDate.java +++ b/src/main/java/com/adyen/model/transferwebhooks/ExecutionDate.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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; @@ -24,9 +26,21 @@ public class ExecutionDate { public static final String JSON_PROPERTY_DATE = "date"; private LocalDate date; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDate = false; + public static final String JSON_PROPERTY_TIMEZONE = "timezone"; private String timezone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimezone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ExecutionDate() {} /** @@ -43,6 +57,7 @@ public ExecutionDate() {} */ public ExecutionDate date(LocalDate date) { this.date = date; + isSetDate = true; // mark as set return this; } @@ -78,6 +93,7 @@ public LocalDate getDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDate(LocalDate date) { this.date = date; + isSetDate = true; // mark as set } /** @@ -92,6 +108,7 @@ public void setDate(LocalDate date) { */ public ExecutionDate timezone(String timezone) { this.timezone = timezone; + isSetTimezone = true; // mark as set return this; } @@ -123,6 +140,27 @@ public String getTimezone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimezone(String timezone) { this.timezone = timezone; + isSetTimezone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ExecutionDate 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 ExecutionDate object is equal to o. */ @@ -164,6 +202,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 (isSetDate) { + addIfNull(nulls, JSON_PROPERTY_DATE, this.date); + } + if (isSetTimezone) { + addIfNull(nulls, JSON_PROPERTY_TIMEZONE, this.timezone); + } + + 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 ExecutionDate given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ExternalReason.java b/src/main/java/com/adyen/model/transferwebhooks/ExternalReason.java index 23eb589fe..d0763e79b 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ExternalReason.java +++ b/src/main/java/com/adyen/model/transferwebhooks/ExternalReason.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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 ExternalReason { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = 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_NAMESPACE = "namespace"; private String namespace; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNamespace = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ExternalReason() {} /** @@ -43,6 +60,7 @@ public ExternalReason() {} */ public ExternalReason code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setCode(String code) { */ public ExternalReason description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setDescription(String description) { */ public ExternalReason namespace(String namespace) { this.namespace = namespace; + isSetNamespace = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getNamespace() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNamespace(String namespace) { this.namespace = namespace; + isSetNamespace = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ExternalReason 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 ExternalReason object is equal to o. */ @@ -175,6 +218,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 (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetNamespace) { + addIfNull(nulls, JSON_PROPERTY_NAMESPACE, this.namespace); + } + + 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 ExternalReason given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/HKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/HKLocalAccountIdentification.java index 01fcbfd81..c76a1dfc5 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/HKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/HKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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,9 +33,15 @@ public class HKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_CLEARING_CODE = "clearingCode"; private String clearingCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClearingCode = false; + /** **hkLocal** */ public enum TypeEnum { HKLOCAL(String.valueOf("hkLocal")); @@ -76,6 +84,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 HKLocalAccountIdentification() {} /** @@ -88,6 +105,7 @@ public HKLocalAccountIdentification() {} */ public HKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -115,6 +133,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -125,6 +144,7 @@ public void setAccountNumber(String accountNumber) { */ public HKLocalAccountIdentification clearingCode(String clearingCode) { this.clearingCode = clearingCode; + isSetClearingCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getClearingCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClearingCode(String clearingCode) { this.clearingCode = clearingCode; + isSetClearingCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setClearingCode(String clearingCode) { */ public HKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,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 HKLocalAccountIdentification 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 HKLocalAccountIdentification object is equal to o. */ @@ -224,6 +267,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetClearingCode) { + addIfNull(nulls, JSON_PROPERTY_CLEARING_CODE, this.clearingCode); + } + 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 HKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/HULocalAccountIdentification.java index fccfad5ec..e20f05d41 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/HULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/HULocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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; @@ -30,6 +32,9 @@ public class HULocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **huLocal** */ public enum TypeEnum { HULOCAL(String.valueOf("huLocal")); @@ -72,6 +77,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 HULocalAccountIdentification() {} /** @@ -82,6 +96,7 @@ public HULocalAccountIdentification() {} */ public HULocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -105,6 +120,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -115,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public HULocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -138,6 +155,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 HULocalAccountIdentification 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 HULocalAccountIdentification object is equal to o. */ @@ -179,6 +217,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + 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 HULocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/IbanAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/IbanAccountIdentification.java index 3d44f7cc4..60a3b8e2a 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/IbanAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/IbanAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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; @@ -30,6 +32,9 @@ public class IbanAccountIdentification { public static final String JSON_PROPERTY_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + /** **iban** */ public enum TypeEnum { IBAN(String.valueOf("iban")); @@ -72,6 +77,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 IbanAccountIdentification() {} /** @@ -84,6 +98,7 @@ public IbanAccountIdentification() {} */ public IbanAccountIdentification iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -111,6 +126,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -121,6 +137,7 @@ public void setIban(String iban) { */ public IbanAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -144,6 +161,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 IbanAccountIdentification 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 IbanAccountIdentification object is equal to o. */ @@ -185,6 +223,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 (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + 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 IbanAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/InternalCategoryData.java b/src/main/java/com/adyen/model/transferwebhooks/InternalCategoryData.java index 3139106aa..1cdbf7fff 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/InternalCategoryData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/InternalCategoryData.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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; @@ -32,9 +34,15 @@ public class InternalCategoryData { "modificationMerchantReference"; private String modificationMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationMerchantReference = false; + public static final String JSON_PROPERTY_MODIFICATION_PSP_REFERENCE = "modificationPspReference"; private String modificationPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationPspReference = false; + /** **internal** */ public enum TypeEnum { INTERNAL(String.valueOf("internal")); @@ -77,6 +85,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 InternalCategoryData() {} /** @@ -88,6 +105,7 @@ public InternalCategoryData() {} */ public InternalCategoryData modificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set return this; } @@ -113,6 +131,7 @@ public String getModificationMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set } /** @@ -123,6 +142,7 @@ public void setModificationMerchantReference(String modificationMerchantReferenc */ public InternalCategoryData modificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set return this; } @@ -146,6 +166,7 @@ public String getModificationPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set } /** @@ -156,6 +177,7 @@ public void setModificationPspReference(String modificationPspReference) { */ public InternalCategoryData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -179,6 +201,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 InternalCategoryData 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 InternalCategoryData object is equal to o. */ @@ -228,6 +271,37 @@ 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 (isSetModificationMerchantReference) { + addIfNull( + nulls, JSON_PROPERTY_MODIFICATION_MERCHANT_REFERENCE, this.modificationMerchantReference); + } + if (isSetModificationPspReference) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_PSP_REFERENCE, this.modificationPspReference); + } + 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 InternalCategoryData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/InternalReviewTrackingData.java b/src/main/java/com/adyen/model/transferwebhooks/InternalReviewTrackingData.java index a67616193..f5b519c8b 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/InternalReviewTrackingData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/InternalReviewTrackingData.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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; @@ -74,6 +76,9 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + /** * The status of the transfer. Possible values: - **pending**: the transfer is under internal * review by Adyen. - **failed**: the transfer failed Adyen's internal review. For details, @@ -122,6 +127,9 @@ 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; + /** * The type of tracking event. Possible values: - **internalReview**: the transfer was flagged * because it does not comply with Adyen's risk policy. @@ -167,6 +175,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 InternalReviewTrackingData() {} /** @@ -182,6 +199,7 @@ public InternalReviewTrackingData() {} */ public InternalReviewTrackingData reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -215,6 +233,7 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -229,6 +248,7 @@ public void setReason(ReasonEnum reason) { */ public InternalReviewTrackingData status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -260,6 +280,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -272,6 +293,7 @@ public void setStatus(StatusEnum status) { */ public InternalReviewTrackingData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -299,6 +321,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 InternalReviewTrackingData 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 InternalReviewTrackingData object is equal to o. */ @@ -342,6 +385,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 (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + 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 InternalReviewTrackingData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/IssuedCard.java b/src/main/java/com/adyen/model/transferwebhooks/IssuedCard.java index b464f625f..1cbcda685 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/IssuedCard.java +++ b/src/main/java/com/adyen/model/transferwebhooks/IssuedCard.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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; @@ -39,6 +41,9 @@ public class IssuedCard { public static final String JSON_PROPERTY_AUTHORISATION_TYPE = "authorisationType"; private String authorisationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorisationType = false; + /** * Indicates the method used for entering the PAN to initiate a transaction. Possible values: * **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**. @@ -96,6 +101,9 @@ public static PanEntryModeEnum fromValue(String value) { public static final String JSON_PROPERTY_PAN_ENTRY_MODE = "panEntryMode"; private PanEntryModeEnum panEntryMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPanEntryMode = false; + /** * Contains information about how the payment was processed. For example, **ecommerce** for online * or **pos** for in-person payments. @@ -155,19 +163,34 @@ public static ProcessingTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_PROCESSING_TYPE = "processingType"; private ProcessingTypeEnum processingType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProcessingType = false; + public static final String JSON_PROPERTY_RELAYED_AUTHORISATION_DATA = "relayedAuthorisationData"; private RelayedAuthorisationData relayedAuthorisationData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRelayedAuthorisationData = false; + public static final String JSON_PROPERTY_SCHEME_TRACE_ID = "schemeTraceId"; private String schemeTraceId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchemeTraceId = false; + public static final String JSON_PROPERTY_SCHEME_UNIQUE_TRANSACTION_ID = "schemeUniqueTransactionId"; private String schemeUniqueTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSchemeUniqueTransactionId = false; + public static final String JSON_PROPERTY_THREE_D_SECURE = "threeDSecure"; private ThreeDSecure threeDSecure; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSecure = false; + /** **issuedCard** */ public enum TypeEnum { ISSUEDCARD(String.valueOf("issuedCard")); @@ -210,9 +233,21 @@ 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; + public static final String JSON_PROPERTY_VALIDATION_FACTS = "validationFacts"; private List validationFacts; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValidationFacts = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public IssuedCard() {} /** @@ -225,6 +260,7 @@ public IssuedCard() {} */ public IssuedCard authorisationType(String authorisationType) { this.authorisationType = authorisationType; + isSetAuthorisationType = true; // mark as set return this; } @@ -252,6 +288,7 @@ public String getAuthorisationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisationType(String authorisationType) { this.authorisationType = authorisationType; + isSetAuthorisationType = true; // mark as set } /** @@ -265,6 +302,7 @@ public void setAuthorisationType(String authorisationType) { */ public IssuedCard panEntryMode(PanEntryModeEnum panEntryMode) { this.panEntryMode = panEntryMode; + isSetPanEntryMode = true; // mark as set return this; } @@ -294,6 +332,7 @@ public PanEntryModeEnum getPanEntryMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPanEntryMode(PanEntryModeEnum panEntryMode) { this.panEntryMode = panEntryMode; + isSetPanEntryMode = true; // mark as set } /** @@ -306,6 +345,7 @@ public void setPanEntryMode(PanEntryModeEnum panEntryMode) { */ public IssuedCard processingType(ProcessingTypeEnum processingType) { this.processingType = processingType; + isSetProcessingType = true; // mark as set return this; } @@ -333,6 +373,7 @@ public ProcessingTypeEnum getProcessingType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProcessingType(ProcessingTypeEnum processingType) { this.processingType = processingType; + isSetProcessingType = true; // mark as set } /** @@ -343,6 +384,7 @@ public void setProcessingType(ProcessingTypeEnum processingType) { */ public IssuedCard relayedAuthorisationData(RelayedAuthorisationData relayedAuthorisationData) { this.relayedAuthorisationData = relayedAuthorisationData; + isSetRelayedAuthorisationData = true; // mark as set return this; } @@ -366,6 +408,7 @@ public RelayedAuthorisationData getRelayedAuthorisationData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRelayedAuthorisationData(RelayedAuthorisationData relayedAuthorisationData) { this.relayedAuthorisationData = relayedAuthorisationData; + isSetRelayedAuthorisationData = true; // mark as set } /** @@ -384,6 +427,7 @@ public void setRelayedAuthorisationData(RelayedAuthorisationData relayedAuthoris */ public IssuedCard schemeTraceId(String schemeTraceId) { this.schemeTraceId = schemeTraceId; + isSetSchemeTraceId = true; // mark as set return this; } @@ -423,6 +467,7 @@ public String getSchemeTraceId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchemeTraceId(String schemeTraceId) { this.schemeTraceId = schemeTraceId; + isSetSchemeTraceId = true; // mark as set } /** @@ -435,6 +480,7 @@ public void setSchemeTraceId(String schemeTraceId) { */ public IssuedCard schemeUniqueTransactionId(String schemeUniqueTransactionId) { this.schemeUniqueTransactionId = schemeUniqueTransactionId; + isSetSchemeUniqueTransactionId = true; // mark as set return this; } @@ -462,6 +508,7 @@ public String getSchemeUniqueTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSchemeUniqueTransactionId(String schemeUniqueTransactionId) { this.schemeUniqueTransactionId = schemeUniqueTransactionId; + isSetSchemeUniqueTransactionId = true; // mark as set } /** @@ -472,6 +519,7 @@ public void setSchemeUniqueTransactionId(String schemeUniqueTransactionId) { */ public IssuedCard threeDSecure(ThreeDSecure threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set return this; } @@ -495,6 +543,7 @@ public ThreeDSecure getThreeDSecure() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSecure(ThreeDSecure threeDSecure) { this.threeDSecure = threeDSecure; + isSetThreeDSecure = true; // mark as set } /** @@ -505,6 +554,7 @@ public void setThreeDSecure(ThreeDSecure threeDSecure) { */ public IssuedCard type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -528,6 +578,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -540,6 +591,7 @@ public void setType(TypeEnum type) { */ public IssuedCard validationFacts(List validationFacts) { this.validationFacts = validationFacts; + isSetValidationFacts = true; // mark as set return this; } @@ -575,6 +627,27 @@ public List getValidationFacts() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValidationFacts(List validationFacts) { this.validationFacts = validationFacts; + isSetValidationFacts = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public IssuedCard 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 IssuedCard object is equal to o. */ @@ -643,6 +716,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 (isSetAuthorisationType) { + addIfNull(nulls, JSON_PROPERTY_AUTHORISATION_TYPE, this.authorisationType); + } + if (isSetPanEntryMode) { + addIfNull(nulls, JSON_PROPERTY_PAN_ENTRY_MODE, this.panEntryMode); + } + if (isSetProcessingType) { + addIfNull(nulls, JSON_PROPERTY_PROCESSING_TYPE, this.processingType); + } + if (isSetRelayedAuthorisationData) { + addIfNull(nulls, JSON_PROPERTY_RELAYED_AUTHORISATION_DATA, this.relayedAuthorisationData); + } + if (isSetSchemeTraceId) { + addIfNull(nulls, JSON_PROPERTY_SCHEME_TRACE_ID, this.schemeTraceId); + } + if (isSetSchemeUniqueTransactionId) { + addIfNull(nulls, JSON_PROPERTY_SCHEME_UNIQUE_TRANSACTION_ID, this.schemeUniqueTransactionId); + } + if (isSetThreeDSecure) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_SECURE, this.threeDSecure); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetValidationFacts) { + addIfNull(nulls, JSON_PROPERTY_VALIDATION_FACTS, this.validationFacts); + } + + 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 IssuedCard given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/IssuingTransactionData.java b/src/main/java/com/adyen/model/transferwebhooks/IssuingTransactionData.java index f290bcec6..9f0a221a9 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/IssuingTransactionData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/IssuingTransactionData.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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; @@ -30,6 +32,9 @@ public class IssuingTransactionData { public static final String JSON_PROPERTY_CAPTURE_CYCLE_ID = "captureCycleId"; private String captureCycleId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCaptureCycleId = false; + /** * The type of events data. Possible values: - **issuingTransactionData**: issuing transaction * data @@ -75,6 +80,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 IssuingTransactionData() {} /** @@ -85,6 +99,7 @@ public IssuingTransactionData() {} */ public IssuingTransactionData captureCycleId(String captureCycleId) { this.captureCycleId = captureCycleId; + isSetCaptureCycleId = true; // mark as set return this; } @@ -108,6 +123,7 @@ public String getCaptureCycleId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureCycleId(String captureCycleId) { this.captureCycleId = captureCycleId; + isSetCaptureCycleId = true; // mark as set } /** @@ -120,6 +136,7 @@ public void setCaptureCycleId(String captureCycleId) { */ public IssuingTransactionData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -147,6 +164,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 IssuingTransactionData 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 IssuingTransactionData object is equal to o. */ @@ -188,6 +226,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 (isSetCaptureCycleId) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_CYCLE_ID, this.captureCycleId); + } + 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 IssuingTransactionData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Leg.java b/src/main/java/com/adyen/model/transferwebhooks/Leg.java index 01040e074..c0af4def6 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Leg.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Leg.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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 Leg { public static final String JSON_PROPERTY_ARRIVAL_AIRPORT_CODE = "arrivalAirportCode"; private String arrivalAirportCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetArrivalAirportCode = false; + public static final String JSON_PROPERTY_BASIC_FARE_CODE = "basicFareCode"; private String basicFareCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasicFareCode = false; + public static final String JSON_PROPERTY_CARRIER_CODE = "carrierCode"; private String carrierCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarrierCode = false; + public static final String JSON_PROPERTY_DEPARTURE_AIRPORT_CODE = "departureAirportCode"; private String departureAirportCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDepartureAirportCode = false; + public static final String JSON_PROPERTY_DEPARTURE_DATE = "departureDate"; private String departureDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDepartureDate = false; + public static final String JSON_PROPERTY_FLIGHT_NUMBER = "flightNumber"; private String flightNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFlightNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Leg() {} /** @@ -57,6 +83,7 @@ public Leg() {} */ public Leg arrivalAirportCode(String arrivalAirportCode) { this.arrivalAirportCode = arrivalAirportCode; + isSetArrivalAirportCode = true; // mark as set return this; } @@ -84,6 +111,7 @@ public String getArrivalAirportCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setArrivalAirportCode(String arrivalAirportCode) { this.arrivalAirportCode = arrivalAirportCode; + isSetArrivalAirportCode = true; // mark as set } /** @@ -94,6 +122,7 @@ public void setArrivalAirportCode(String arrivalAirportCode) { */ public Leg basicFareCode(String basicFareCode) { this.basicFareCode = basicFareCode; + isSetBasicFareCode = true; // mark as set return this; } @@ -117,6 +146,7 @@ public String getBasicFareCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBasicFareCode(String basicFareCode) { this.basicFareCode = basicFareCode; + isSetBasicFareCode = true; // mark as set } /** @@ -127,6 +157,7 @@ public void setBasicFareCode(String basicFareCode) { */ public Leg carrierCode(String carrierCode) { this.carrierCode = carrierCode; + isSetCarrierCode = true; // mark as set return this; } @@ -150,6 +181,7 @@ public String getCarrierCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarrierCode(String carrierCode) { this.carrierCode = carrierCode; + isSetCarrierCode = true; // mark as set } /** @@ -162,6 +194,7 @@ public void setCarrierCode(String carrierCode) { */ public Leg departureAirportCode(String departureAirportCode) { this.departureAirportCode = departureAirportCode; + isSetDepartureAirportCode = true; // mark as set return this; } @@ -189,6 +222,7 @@ public String getDepartureAirportCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDepartureAirportCode(String departureAirportCode) { this.departureAirportCode = departureAirportCode; + isSetDepartureAirportCode = true; // mark as set } /** @@ -199,6 +233,7 @@ public void setDepartureAirportCode(String departureAirportCode) { */ public Leg departureDate(String departureDate) { this.departureDate = departureDate; + isSetDepartureDate = true; // mark as set return this; } @@ -222,6 +257,7 @@ public String getDepartureDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDepartureDate(String departureDate) { this.departureDate = departureDate; + isSetDepartureDate = true; // mark as set } /** @@ -232,6 +268,7 @@ public void setDepartureDate(String departureDate) { */ public Leg flightNumber(String flightNumber) { this.flightNumber = flightNumber; + isSetFlightNumber = true; // mark as set return this; } @@ -255,6 +292,27 @@ public String getFlightNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFlightNumber(String flightNumber) { this.flightNumber = flightNumber; + isSetFlightNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Leg 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 Leg object is equal to o. */ @@ -312,6 +370,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 (isSetArrivalAirportCode) { + addIfNull(nulls, JSON_PROPERTY_ARRIVAL_AIRPORT_CODE, this.arrivalAirportCode); + } + if (isSetBasicFareCode) { + addIfNull(nulls, JSON_PROPERTY_BASIC_FARE_CODE, this.basicFareCode); + } + if (isSetCarrierCode) { + addIfNull(nulls, JSON_PROPERTY_CARRIER_CODE, this.carrierCode); + } + if (isSetDepartureAirportCode) { + addIfNull(nulls, JSON_PROPERTY_DEPARTURE_AIRPORT_CODE, this.departureAirportCode); + } + if (isSetDepartureDate) { + addIfNull(nulls, JSON_PROPERTY_DEPARTURE_DATE, this.departureDate); + } + if (isSetFlightNumber) { + addIfNull(nulls, JSON_PROPERTY_FLIGHT_NUMBER, this.flightNumber); + } + + 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 Leg given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Lodging.java b/src/main/java/com/adyen/model/transferwebhooks/Lodging.java index c007d2416..e01d15872 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Lodging.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Lodging.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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 Lodging { public static final String JSON_PROPERTY_CHECK_IN_DATE = "checkInDate"; private String checkInDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckInDate = false; + public static final String JSON_PROPERTY_NUMBER_OF_NIGHTS = "numberOfNights"; private Integer numberOfNights; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumberOfNights = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Lodging() {} /** @@ -36,6 +50,7 @@ public Lodging() {} */ public Lodging checkInDate(String checkInDate) { this.checkInDate = checkInDate; + isSetCheckInDate = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getCheckInDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckInDate(String checkInDate) { this.checkInDate = checkInDate; + isSetCheckInDate = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCheckInDate(String checkInDate) { */ public Lodging numberOfNights(Integer numberOfNights) { this.numberOfNights = numberOfNights; + isSetNumberOfNights = true; // mark as set return this; } @@ -92,6 +109,27 @@ public Integer getNumberOfNights() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumberOfNights(Integer numberOfNights) { this.numberOfNights = numberOfNights; + isSetNumberOfNights = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Lodging 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 Lodging object is equal to o. */ @@ -133,6 +171,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 (isSetCheckInDate) { + addIfNull(nulls, JSON_PROPERTY_CHECK_IN_DATE, this.checkInDate); + } + if (isSetNumberOfNights) { + addIfNull(nulls, JSON_PROPERTY_NUMBER_OF_NIGHTS, this.numberOfNights); + } + + 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 Lodging given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/MerchantData.java b/src/main/java/com/adyen/model/transferwebhooks/MerchantData.java index cae5b9a6d..5ab75c3d1 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/MerchantData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/MerchantData.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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 MerchantData { public static final String JSON_PROPERTY_ACQUIRER_ID = "acquirerId"; private String acquirerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerId = 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_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + public static final String JSON_PROPERTY_NAME_LOCATION = "nameLocation"; private NameLocation nameLocation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNameLocation = 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; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantData() {} /** @@ -51,6 +74,7 @@ public MerchantData() {} */ public MerchantData acquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set return this; } @@ -74,6 +98,7 @@ public String getAcquirerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setAcquirerId(String acquirerId) { */ public MerchantData mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setMcc(String mcc) { */ public MerchantData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -140,6 +168,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setMerchantId(String merchantId) { */ public MerchantData nameLocation(NameLocation nameLocation) { this.nameLocation = nameLocation; + isSetNameLocation = true; // mark as set return this; } @@ -173,6 +203,7 @@ public NameLocation getNameLocation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNameLocation(NameLocation nameLocation) { this.nameLocation = nameLocation; + isSetNameLocation = true; // mark as set } /** @@ -183,6 +214,7 @@ public void setNameLocation(NameLocation nameLocation) { */ public MerchantData postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -206,6 +238,27 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantData 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 MerchantData object is equal to o. */ @@ -253,6 +306,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 (isSetAcquirerId) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_ID, this.acquirerId); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + if (isSetNameLocation) { + addIfNull(nulls, JSON_PROPERTY_NAME_LOCATION, this.nameLocation); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + + 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 MerchantData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/MerchantPurchaseData.java b/src/main/java/com/adyen/model/transferwebhooks/MerchantPurchaseData.java index 52c0ae910..c2f38f27e 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/MerchantPurchaseData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/MerchantPurchaseData.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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 MerchantPurchaseData { public static final String JSON_PROPERTY_AIRLINE = "airline"; private Airline airline; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirline = false; + public static final String JSON_PROPERTY_LODGING = "lodging"; private List lodging; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodging = false; + /** * The type of events data. Possible values: - **merchantPurchaseData**: merchant purchase data */ @@ -80,6 +88,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 MerchantPurchaseData() {} /** @@ -90,6 +107,7 @@ public MerchantPurchaseData() {} */ public MerchantPurchaseData airline(Airline airline) { this.airline = airline; + isSetAirline = true; // mark as set return this; } @@ -113,6 +131,7 @@ public Airline getAirline() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirline(Airline airline) { this.airline = airline; + isSetAirline = true; // mark as set } /** @@ -123,6 +142,7 @@ public void setAirline(Airline airline) { */ public MerchantPurchaseData lodging(List lodging) { this.lodging = lodging; + isSetLodging = true; // mark as set return this; } @@ -154,6 +174,7 @@ public List getLodging() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodging(List lodging) { this.lodging = lodging; + isSetLodging = true; // mark as set } /** @@ -165,6 +186,7 @@ public void setLodging(List lodging) { */ public MerchantPurchaseData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -190,6 +212,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 MerchantPurchaseData 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 MerchantPurchaseData object is equal to o. */ @@ -233,6 +276,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 (isSetAirline) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE, this.airline); + } + if (isSetLodging) { + addIfNull(nulls, JSON_PROPERTY_LODGING, this.lodging); + } + 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 MerchantPurchaseData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Modification.java b/src/main/java/com/adyen/model/transferwebhooks/Modification.java index f7a96dd05..ac83af328 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Modification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Modification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class Modification { public static final String JSON_PROPERTY_DIRECTION = "direction"; private String direction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirection = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** The status of the transfer event. */ public enum StatusEnum { APPROVALPENDING(String.valueOf("approvalPending")), @@ -213,9 +224,21 @@ 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_TYPE = "type"; private String 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 Modification() {} /** @@ -226,6 +249,7 @@ public Modification() {} */ public Modification direction(String direction) { this.direction = direction; + isSetDirection = true; // mark as set return this; } @@ -249,6 +273,7 @@ public String getDirection() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirection(String direction) { this.direction = direction; + isSetDirection = true; // mark as set } /** @@ -259,6 +284,7 @@ public void setDirection(String direction) { */ public Modification id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -282,6 +308,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -292,6 +319,7 @@ public void setId(String id) { */ public Modification reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -315,6 +343,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -325,6 +354,7 @@ public void setReference(String reference) { */ public Modification status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -348,6 +378,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -358,6 +389,7 @@ public void setStatus(StatusEnum status) { */ public Modification type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -381,6 +413,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Modification 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 Modification object is equal to o. */ @@ -428,6 +481,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 (isSetDirection) { + addIfNull(nulls, JSON_PROPERTY_DIRECTION, this.direction); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + 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 Modification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/NOLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/NOLocalAccountIdentification.java index 250b05d9b..8d2f7dc1f 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/NOLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/NOLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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; @@ -30,6 +32,9 @@ public class NOLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **noLocal** */ public enum TypeEnum { NOLOCAL(String.valueOf("noLocal")); @@ -72,6 +77,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 NOLocalAccountIdentification() {} /** @@ -82,6 +96,7 @@ public NOLocalAccountIdentification() {} */ public NOLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -105,6 +120,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -115,6 +131,7 @@ public void setAccountNumber(String accountNumber) { */ public NOLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -138,6 +155,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 NOLocalAccountIdentification 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 NOLocalAccountIdentification object is equal to o. */ @@ -179,6 +217,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + 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 NOLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/NZLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/NZLocalAccountIdentification.java index 14798f3aa..1225865b3 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/NZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/NZLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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; @@ -30,6 +32,9 @@ public class NZLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **nzLocal** */ public enum TypeEnum { NZLOCAL(String.valueOf("nzLocal")); @@ -72,6 +77,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 NZLocalAccountIdentification() {} /** @@ -86,6 +100,7 @@ public NZLocalAccountIdentification() {} */ public NZLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +132,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +143,7 @@ public void setAccountNumber(String accountNumber) { */ public NZLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -150,6 +167,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 NZLocalAccountIdentification 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 NZLocalAccountIdentification object is equal to o. */ @@ -191,6 +229,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + 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 NZLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/NameLocation.java b/src/main/java/com/adyen/model/transferwebhooks/NameLocation.java index dcd9872ea..9d85afb15 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/NameLocation.java +++ b/src/main/java/com/adyen/model/transferwebhooks/NameLocation.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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 NameLocation { 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_COUNTRY_OF_ORIGIN = "countryOfOrigin"; private String countryOfOrigin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryOfOrigin = 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_RAW_DATA = "rawData"; private String rawData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRawData = false; + public static final String JSON_PROPERTY_STATE = "state"; private String state; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetState = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public NameLocation() {} /** @@ -55,6 +81,7 @@ public NameLocation() {} */ public NameLocation 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 } /** @@ -90,6 +118,7 @@ public void setCity(String city) { */ public NameLocation country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -117,6 +146,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -131,6 +161,7 @@ public void setCountry(String country) { */ public NameLocation countryOfOrigin(String countryOfOrigin) { this.countryOfOrigin = countryOfOrigin; + isSetCountryOfOrigin = true; // mark as set return this; } @@ -162,6 +193,7 @@ public String getCountryOfOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryOfOrigin(String countryOfOrigin) { this.countryOfOrigin = countryOfOrigin; + isSetCountryOfOrigin = true; // mark as set } /** @@ -172,6 +204,7 @@ public void setCountryOfOrigin(String countryOfOrigin) { */ public NameLocation name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -195,6 +228,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -205,6 +239,7 @@ public void setName(String name) { */ public NameLocation rawData(String rawData) { this.rawData = rawData; + isSetRawData = true; // mark as set return this; } @@ -228,6 +263,7 @@ public String getRawData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRawData(String rawData) { this.rawData = rawData; + isSetRawData = true; // mark as set } /** @@ -238,6 +274,7 @@ public void setRawData(String rawData) { */ public NameLocation state(String state) { this.state = state; + isSetState = true; // mark as set return this; } @@ -261,6 +298,27 @@ public String getState() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setState(String state) { this.state = state; + isSetState = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public NameLocation 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 NameLocation object is equal to o. */ @@ -310,6 +368,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 (isSetCountryOfOrigin) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_OF_ORIGIN, this.countryOfOrigin); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetRawData) { + addIfNull(nulls, JSON_PROPERTY_RAW_DATA, this.rawData); + } + if (isSetState) { + addIfNull(nulls, JSON_PROPERTY_STATE, this.state); + } + + 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 NameLocation given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java index 49ad71cb7..19278e159 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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; @@ -32,13 +34,22 @@ public class NumberAndBicAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION = "additionalBankIdentification"; private AdditionalBankIdentification additionalBankIdentification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalBankIdentification = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + /** **numberAndBic** */ public enum TypeEnum { NUMBERANDBIC(String.valueOf("numberAndBic")); @@ -81,6 +92,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 NumberAndBicAccountIdentification() {} /** @@ -94,6 +114,7 @@ public NumberAndBicAccountIdentification() {} */ public NumberAndBicAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -121,6 +142,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -133,6 +155,7 @@ public void setAccountNumber(String accountNumber) { public NumberAndBicAccountIdentification additionalBankIdentification( AdditionalBankIdentification additionalBankIdentification) { this.additionalBankIdentification = additionalBankIdentification; + isSetAdditionalBankIdentification = true; // mark as set return this; } @@ -157,6 +180,7 @@ public AdditionalBankIdentification getAdditionalBankIdentification() { public void setAdditionalBankIdentification( AdditionalBankIdentification additionalBankIdentification) { this.additionalBankIdentification = additionalBankIdentification; + isSetAdditionalBankIdentification = true; // mark as set } /** @@ -168,6 +192,7 @@ public void setAdditionalBankIdentification( */ public NumberAndBicAccountIdentification bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -191,6 +216,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -202,6 +228,7 @@ public void setBic(String bic) { */ public NumberAndBicAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -225,6 +252,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 NumberAndBicAccountIdentification 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 NumberAndBicAccountIdentification object is equal to o. */ @@ -275,6 +323,40 @@ 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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAdditionalBankIdentification) { + addIfNull( + nulls, JSON_PROPERTY_ADDITIONAL_BANK_IDENTIFICATION, this.additionalBankIdentification); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + 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 NumberAndBicAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/PLLocalAccountIdentification.java index 5cc7835eb..a70add140 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/PLLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/PLLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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; @@ -30,6 +32,9 @@ public class PLLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** **plLocal** */ public enum TypeEnum { PLLOCAL(String.valueOf("plLocal")); @@ -72,6 +77,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 PLLocalAccountIdentification() {} /** @@ -86,6 +100,7 @@ public PLLocalAccountIdentification() {} */ public PLLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -117,6 +132,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -127,6 +143,7 @@ public void setAccountNumber(String accountNumber) { */ public PLLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -150,6 +167,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 PLLocalAccountIdentification 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 PLLocalAccountIdentification object is equal to o. */ @@ -191,6 +229,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + 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 PLLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/PartyIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/PartyIdentification.java index f4f324c6d..de9161a5e 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/PartyIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/PartyIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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,24 +40,45 @@ public class PartyIdentification { public static final String JSON_PROPERTY_ADDRESS = "address"; private Address address; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddress = 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_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + 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_FULL_NAME = "fullName"; private String fullName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFullName = 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; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * The type of entity that owns the bank account or card. Possible values: **individual**, * **organization**, or **unknown**. Required when `category` is **card**. In this case, @@ -106,9 +129,21 @@ 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; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PartyIdentification() {} /** @@ -119,6 +154,7 @@ public PartyIdentification() {} */ public PartyIdentification address(Address address) { this.address = address; + isSetAddress = true; // mark as set return this; } @@ -142,6 +178,7 @@ public Address getAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddress(Address address) { this.address = address; + isSetAddress = true; // mark as set } /** @@ -155,6 +192,7 @@ public void setAddress(Address address) { */ public PartyIdentification dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -184,6 +222,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -195,6 +234,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public PartyIdentification email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -220,6 +260,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -234,6 +275,7 @@ public void setEmail(String email) { */ public PartyIdentification firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -265,6 +307,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -279,6 +322,7 @@ public void setFirstName(String firstName) { */ public PartyIdentification fullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set return this; } @@ -310,6 +354,7 @@ public String getFullName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set } /** @@ -324,6 +369,7 @@ public void setFullName(String fullName) { */ public PartyIdentification lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -355,6 +401,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -369,6 +416,7 @@ public void setLastName(String lastName) { */ public PartyIdentification reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -400,6 +448,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -414,6 +463,7 @@ public void setReference(String reference) { */ public PartyIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -445,6 +495,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -455,6 +506,7 @@ public void setType(TypeEnum type) { */ public PartyIdentification url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -478,6 +530,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PartyIdentification 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 PartyIdentification object is equal to o. */ @@ -534,6 +607,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 (isSetAddress) { + addIfNull(nulls, JSON_PROPERTY_ADDRESS, this.address); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetFullName) { + addIfNull(nulls, JSON_PROPERTY_FULL_NAME, this.fullName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + 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 PartyIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java b/src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java index 0a21fdd52..66f8194e1 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java +++ b/src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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 PaymentInstrument { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_TOKEN_TYPE = "tokenType"; private String tokenType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentInstrument() {} /** @@ -47,6 +67,7 @@ public PaymentInstrument() {} */ public PaymentInstrument description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -70,6 +91,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setDescription(String description) { */ public PaymentInstrument id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -103,6 +126,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setId(String id) { */ public PaymentInstrument reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setReference(String reference) { */ public PaymentInstrument tokenType(String tokenType) { this.tokenType = tokenType; + isSetTokenType = true; // mark as set return this; } @@ -169,6 +196,27 @@ public String getTokenType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenType(String tokenType) { this.tokenType = tokenType; + isSetTokenType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentInstrument 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 PaymentInstrument object is equal to o. */ @@ -214,6 +262,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetTokenType) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_TYPE, this.tokenType); + } + + 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 PaymentInstrument given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java b/src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java index a68fab379..15051ed69 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java +++ b/src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,33 +37,42 @@ public class PlatformPayment { "modificationMerchantReference"; private String modificationMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationMerchantReference = false; + public static final String JSON_PROPERTY_MODIFICATION_PSP_REFERENCE = "modificationPspReference"; private String modificationPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModificationPspReference = false; + public static final String JSON_PROPERTY_PAYMENT_MERCHANT_REFERENCE = "paymentMerchantReference"; private String paymentMerchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMerchantReference = false; + /** * Specifies the nature of the transfer. This parameter helps categorize transfers so you can * reconcile transactions at a later time, using the Balance Platform Accounting Report for * [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 { @@ -137,9 +148,15 @@ public static PlatformPaymentTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_PLATFORM_PAYMENT_TYPE = "platformPaymentType"; private PlatformPaymentTypeEnum platformPaymentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformPaymentType = false; + public static final String JSON_PROPERTY_PSP_PAYMENT_REFERENCE = "pspPaymentReference"; private String pspPaymentReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspPaymentReference = false; + /** **platformPayment** */ public enum TypeEnum { PLATFORMPAYMENT(String.valueOf("platformPayment")); @@ -182,6 +199,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 PlatformPayment() {} /** @@ -193,6 +219,7 @@ public PlatformPayment() {} */ public PlatformPayment modificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set return this; } @@ -218,6 +245,7 @@ public String getModificationMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationMerchantReference(String modificationMerchantReference) { this.modificationMerchantReference = modificationMerchantReference; + isSetModificationMerchantReference = true; // mark as set } /** @@ -228,6 +256,7 @@ public void setModificationMerchantReference(String modificationMerchantReferenc */ public PlatformPayment modificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set return this; } @@ -251,6 +280,7 @@ public String getModificationPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModificationPspReference(String modificationPspReference) { this.modificationPspReference = modificationPspReference; + isSetModificationPspReference = true; // mark as set } /** @@ -261,6 +291,7 @@ public void setModificationPspReference(String modificationPspReference) { */ public PlatformPayment paymentMerchantReference(String paymentMerchantReference) { this.paymentMerchantReference = paymentMerchantReference; + isSetPaymentMerchantReference = true; // mark as set return this; } @@ -284,6 +315,7 @@ public String getPaymentMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMerchantReference(String paymentMerchantReference) { this.paymentMerchantReference = paymentMerchantReference; + isSetPaymentMerchantReference = true; // mark as set } /** @@ -292,21 +324,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,26 +347,27 @@ 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) { this.platformPaymentType = platformPaymentType; + isSetPlatformPaymentType = true; // mark as set return this; } @@ -344,21 +377,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 +400,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 +429,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,27 +452,28 @@ 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) public void setPlatformPaymentType(PlatformPaymentTypeEnum platformPaymentType) { this.platformPaymentType = platformPaymentType; + isSetPlatformPaymentType = true; // mark as set } /** @@ -450,6 +484,7 @@ public void setPlatformPaymentType(PlatformPaymentTypeEnum platformPaymentType) */ public PlatformPayment pspPaymentReference(String pspPaymentReference) { this.pspPaymentReference = pspPaymentReference; + isSetPspPaymentReference = true; // mark as set return this; } @@ -473,6 +508,7 @@ public String getPspPaymentReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspPaymentReference(String pspPaymentReference) { this.pspPaymentReference = pspPaymentReference; + isSetPspPaymentReference = true; // mark as set } /** @@ -483,6 +519,7 @@ public void setPspPaymentReference(String pspPaymentReference) { */ public PlatformPayment type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -506,6 +543,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 PlatformPayment 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 PlatformPayment object is equal to o. */ @@ -572,6 +630,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 (isSetModificationMerchantReference) { + addIfNull( + nulls, JSON_PROPERTY_MODIFICATION_MERCHANT_REFERENCE, this.modificationMerchantReference); + } + if (isSetModificationPspReference) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION_PSP_REFERENCE, this.modificationPspReference); + } + if (isSetPaymentMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_MERCHANT_REFERENCE, this.paymentMerchantReference); + } + if (isSetPlatformPaymentType) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_PAYMENT_TYPE, this.platformPaymentType); + } + if (isSetPspPaymentReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_PAYMENT_REFERENCE, this.pspPaymentReference); + } + 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 PlatformPayment given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/RelayedAuthorisationData.java b/src/main/java/com/adyen/model/transferwebhooks/RelayedAuthorisationData.java index ddc54408d..5e72f3201 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/RelayedAuthorisationData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/RelayedAuthorisationData.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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,9 +30,21 @@ public class RelayedAuthorisationData { 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_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 RelayedAuthorisationData() {} /** @@ -43,6 +57,7 @@ public RelayedAuthorisationData() {} */ public RelayedAuthorisationData metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -78,6 +93,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -88,6 +104,7 @@ public void setMetadata(Map metadata) { */ public RelayedAuthorisationData reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -111,6 +128,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 RelayedAuthorisationData 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 RelayedAuthorisationData object is equal to o. */ @@ -152,6 +190,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 (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + 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 RelayedAuthorisationData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/Resource.java b/src/main/java/com/adyen/model/transferwebhooks/Resource.java index 960a64abd..d557a4955 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Resource.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Resource.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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,12 +30,27 @@ public class Resource { public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_CREATION_DATE = "creationDate"; private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Resource() {} /** @@ -44,6 +61,7 @@ public Resource() {} */ public Resource balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -67,6 +85,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -79,6 +98,7 @@ public void setBalancePlatform(String balancePlatform) { */ public Resource creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -106,6 +126,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -116,6 +137,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public Resource id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -139,6 +161,27 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Resource 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 Resource object is equal to o. */ @@ -182,6 +225,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 (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + + 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 Resource given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ResourceReference.java b/src/main/java/com/adyen/model/transferwebhooks/ResourceReference.java index b3fe1de89..bee51fc2e 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ResourceReference.java +++ b/src/main/java/com/adyen/model/transferwebhooks/ResourceReference.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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 ResourceReference { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResourceReference() {} /** @@ -43,6 +60,7 @@ public ResourceReference() {} */ public ResourceReference description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setDescription(String description) { */ public ResourceReference id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setId(String id) { */ public ResourceReference 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 ResourceReference includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResourceReference object is equal to o. */ @@ -175,6 +218,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResourceReference given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/SELocalAccountIdentification.java index cbebe8b71..04ff1b0c1 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/SELocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/SELocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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,9 +33,15 @@ public class SELocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_CLEARING_NUMBER = "clearingNumber"; private String clearingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClearingNumber = false; + /** **seLocal** */ public enum TypeEnum { SELOCAL(String.valueOf("seLocal")); @@ -76,6 +84,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 SELocalAccountIdentification() {} /** @@ -90,6 +107,7 @@ public SELocalAccountIdentification() {} */ public SELocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -121,6 +139,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -135,6 +154,7 @@ public void setAccountNumber(String accountNumber) { */ public SELocalAccountIdentification clearingNumber(String clearingNumber) { this.clearingNumber = clearingNumber; + isSetClearingNumber = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getClearingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClearingNumber(String clearingNumber) { this.clearingNumber = clearingNumber; + isSetClearingNumber = true; // mark as set } /** @@ -176,6 +197,7 @@ public void setClearingNumber(String clearingNumber) { */ public SELocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -199,6 +221,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 SELocalAccountIdentification 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 SELocalAccountIdentification object is equal to o. */ @@ -242,6 +285,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetClearingNumber) { + addIfNull(nulls, JSON_PROPERTY_CLEARING_NUMBER, this.clearingNumber); + } + 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 SELocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/SGLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/SGLocalAccountIdentification.java index 1d088d87f..c7ca64c78 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/SGLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/SGLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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,9 +33,15 @@ public class SGLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + /** **sgLocal** */ public enum TypeEnum { SGLOCAL(String.valueOf("sgLocal")); @@ -76,6 +84,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 SGLocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public SGLocalAccountIdentification() {} */ public SGLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -119,6 +138,7 @@ public void setAccountNumber(String accountNumber) { */ public SGLocalAccountIdentification bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -142,6 +162,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -152,6 +173,7 @@ public void setBic(String bic) { */ public SGLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -175,6 +197,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 SGLocalAccountIdentification 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 SGLocalAccountIdentification object is equal to o. */ @@ -218,6 +261,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + 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 SGLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/ThreeDSecure.java b/src/main/java/com/adyen/model/transferwebhooks/ThreeDSecure.java index bda7e6d8f..5faa3a1c6 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/ThreeDSecure.java +++ b/src/main/java/com/adyen/model/transferwebhooks/ThreeDSecure.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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 ThreeDSecure { public static final String JSON_PROPERTY_ACS_TRANSACTION_ID = "acsTransactionId"; private String acsTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsTransactionId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDSecure() {} /** @@ -33,6 +44,7 @@ public ThreeDSecure() {} */ public ThreeDSecure acsTransactionId(String acsTransactionId) { this.acsTransactionId = acsTransactionId; + isSetAcsTransactionId = true; // mark as set return this; } @@ -56,6 +68,27 @@ public String getAcsTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsTransactionId(String acsTransactionId) { this.acsTransactionId = acsTransactionId; + isSetAcsTransactionId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDSecure 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 ThreeDSecure object is equal to o. */ @@ -95,6 +128,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 (isSetAcsTransactionId) { + addIfNull(nulls, JSON_PROPERTY_ACS_TRANSACTION_ID, this.acsTransactionId); + } + + 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 ThreeDSecure given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionEventViolation.java b/src/main/java/com/adyen/model/transferwebhooks/TransactionEventViolation.java index bf42d1869..74f718469 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransactionEventViolation.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransactionEventViolation.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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 TransactionEventViolation { public static final String JSON_PROPERTY_REASON = "reason"; private String reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_TRANSACTION_RULE = "transactionRule"; private TransactionRuleReference transactionRule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRule = false; + public static final String JSON_PROPERTY_TRANSACTION_RULE_SOURCE = "transactionRuleSource"; private TransactionRuleSource transactionRuleSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRuleSource = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionEventViolation() {} /** @@ -43,6 +60,7 @@ public TransactionEventViolation() {} */ public TransactionEventViolation reason(String reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(String reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setReason(String reason) { */ public TransactionEventViolation transactionRule(TransactionRuleReference transactionRule) { this.transactionRule = transactionRule; + isSetTransactionRule = true; // mark as set return this; } @@ -99,6 +119,7 @@ public TransactionRuleReference getTransactionRule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRule(TransactionRuleReference transactionRule) { this.transactionRule = transactionRule; + isSetTransactionRule = true; // mark as set } /** @@ -110,6 +131,7 @@ public void setTransactionRule(TransactionRuleReference transactionRule) { public TransactionEventViolation transactionRuleSource( TransactionRuleSource transactionRuleSource) { this.transactionRuleSource = transactionRuleSource; + isSetTransactionRuleSource = true; // mark as set return this; } @@ -133,6 +155,27 @@ public TransactionRuleSource getTransactionRuleSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRuleSource(TransactionRuleSource transactionRuleSource) { this.transactionRuleSource = transactionRuleSource; + isSetTransactionRuleSource = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionEventViolation 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 TransactionEventViolation object is equal to o. */ @@ -179,6 +222,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 (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetTransactionRule) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULE, this.transactionRule); + } + if (isSetTransactionRuleSource) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULE_SOURCE, this.transactionRuleSource); + } + + 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 TransactionEventViolation given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java b/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java index 73caf743b..9aef6e6fa 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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 TransactionRuleReference { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_OUTCOME_TYPE = "outcomeType"; private String outcomeType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOutcomeType = 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_SCORE = "score"; private Integer score; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScore = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRuleReference() {} /** @@ -51,6 +74,7 @@ public TransactionRuleReference() {} */ public TransactionRuleReference description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -74,6 +98,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setDescription(String description) { */ public TransactionRuleReference id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setId(String id) { */ public TransactionRuleReference outcomeType(String outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set return this; } @@ -140,6 +168,7 @@ public String getOutcomeType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOutcomeType(String outcomeType) { this.outcomeType = outcomeType; + isSetOutcomeType = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setOutcomeType(String outcomeType) { */ public TransactionRuleReference reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -173,6 +203,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -185,6 +216,7 @@ public void setReference(String reference) { */ public TransactionRuleReference score(Integer score) { this.score = score; + isSetScore = true; // mark as set return this; } @@ -212,6 +244,27 @@ public Integer getScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScore(Integer score) { this.score = score; + isSetScore = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRuleReference 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 TransactionRuleReference object is equal to o. */ @@ -259,6 +312,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 (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetOutcomeType) { + addIfNull(nulls, JSON_PROPERTY_OUTCOME_TYPE, this.outcomeType); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetScore) { + addIfNull(nulls, JSON_PROPERTY_SCORE, this.score); + } + + 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 TransactionRuleReference given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java b/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java index 73cab0fca..d820e4a6e 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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 TransactionRuleSource { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 TransactionRuleSource() {} /** @@ -39,6 +53,7 @@ public TransactionRuleSource() {} */ public TransactionRuleSource id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -78,6 +94,7 @@ public void setId(String id) { */ public TransactionRuleSource type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -113,6 +130,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRuleSource 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 TransactionRuleSource object is equal to o. */ @@ -154,6 +192,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 (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + 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 TransactionRuleSource given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java b/src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java index 8a6be6073..821bfc074 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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,16 +32,34 @@ public class TransactionRulesResult { public static final String JSON_PROPERTY_ADVICE = "advice"; private String advice; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdvice = false; + public static final String JSON_PROPERTY_ALL_HARD_BLOCK_RULES_PASSED = "allHardBlockRulesPassed"; private Boolean allHardBlockRulesPassed; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllHardBlockRulesPassed = false; + public static final String JSON_PROPERTY_SCORE = "score"; private Integer score; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScore = false; + public static final String JSON_PROPERTY_TRIGGERED_TRANSACTION_RULES = "triggeredTransactionRules"; private List triggeredTransactionRules; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTriggeredTransactionRules = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransactionRulesResult() {} /** @@ -50,6 +70,7 @@ public TransactionRulesResult() {} */ public TransactionRulesResult advice(String advice) { this.advice = advice; + isSetAdvice = true; // mark as set return this; } @@ -73,6 +94,7 @@ public String getAdvice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdvice(String advice) { this.advice = advice; + isSetAdvice = true; // mark as set } /** @@ -84,6 +106,7 @@ public void setAdvice(String advice) { */ public TransactionRulesResult allHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { this.allHardBlockRulesPassed = allHardBlockRulesPassed; + isSetAllHardBlockRulesPassed = true; // mark as set return this; } @@ -109,6 +132,7 @@ public Boolean getAllHardBlockRulesPassed() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { this.allHardBlockRulesPassed = allHardBlockRulesPassed; + isSetAllHardBlockRulesPassed = true; // mark as set } /** @@ -119,6 +143,7 @@ public void setAllHardBlockRulesPassed(Boolean allHardBlockRulesPassed) { */ public TransactionRulesResult score(Integer score) { this.score = score; + isSetScore = true; // mark as set return this; } @@ -142,6 +167,7 @@ public Integer getScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScore(Integer score) { this.score = score; + isSetScore = true; // mark as set } /** @@ -154,6 +180,7 @@ public void setScore(Integer score) { public TransactionRulesResult triggeredTransactionRules( List triggeredTransactionRules) { this.triggeredTransactionRules = triggeredTransactionRules; + isSetTriggeredTransactionRules = true; // mark as set return this; } @@ -189,6 +216,27 @@ public List getTriggeredTransactionRules() { public void setTriggeredTransactionRules( List triggeredTransactionRules) { this.triggeredTransactionRules = triggeredTransactionRules; + isSetTriggeredTransactionRules = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransactionRulesResult 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 TransactionRulesResult object is equal to o. */ @@ -240,6 +288,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 (isSetAdvice) { + addIfNull(nulls, JSON_PROPERTY_ADVICE, this.advice); + } + if (isSetAllHardBlockRulesPassed) { + addIfNull(nulls, JSON_PROPERTY_ALL_HARD_BLOCK_RULES_PASSED, this.allHardBlockRulesPassed); + } + if (isSetScore) { + addIfNull(nulls, JSON_PROPERTY_SCORE, this.score); + } + if (isSetTriggeredTransactionRules) { + addIfNull(nulls, JSON_PROPERTY_TRIGGERED_TRANSACTION_RULES, this.triggeredTransactionRules); + } + + 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 TransactionRulesResult given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferData.java b/src/main/java/com/adyen/model/transferwebhooks/TransferData.java index 019807d3e..83f39f66b 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferData.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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; @@ -60,27 +62,42 @@ public class TransferData { public static final String JSON_PROPERTY_ACCOUNT_HOLDER = "accountHolder"; private ResourceReference accountHolder; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolder = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_BALANCE_ACCOUNT = "balanceAccount"; private ResourceReference balanceAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccount = false; + public static final String JSON_PROPERTY_BALANCE_PLATFORM = "balancePlatform"; private String balancePlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalancePlatform = false; + public static final String JSON_PROPERTY_BALANCES = "balances"; private List balances; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalances = false; + /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. */ public enum CategoryEnum { BANK(String.valueOf("bank")), @@ -133,25 +150,46 @@ public static CategoryEnum fromValue(String value) { public static final String JSON_PROPERTY_CATEGORY = "category"; private CategoryEnum category; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategory = false; + public static final String JSON_PROPERTY_CATEGORY_DATA = "categoryData"; private TransferDataCategoryData categoryData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCategoryData = false; + public static final String JSON_PROPERTY_COUNTERPARTY = "counterparty"; private TransferNotificationCounterParty counterparty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCounterparty = 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_CREATION_DATE = "creationDate"; @Deprecated // deprecated since Transfer webhooks v3: Use createdAt or updatedAt private OffsetDateTime creationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreationDate = 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_DIRECT_DEBIT_INFORMATION = "directDebitInformation"; private DirectDebitInformation directDebitInformation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirectDebitInformation = false; + /** The direction of the transfer. Possible values: **incoming**, **outgoing**. */ public enum DirectionEnum { INCOMING(String.valueOf("incoming")), @@ -196,24 +234,45 @@ public static DirectionEnum fromValue(String value) { public static final String JSON_PROPERTY_DIRECTION = "direction"; private DirectionEnum direction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirection = false; + public static final String JSON_PROPERTY_EVENT_ID = "eventId"; private String eventId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEventId = false; + public static final String JSON_PROPERTY_EVENTS = "events"; private List events; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEvents = false; + public static final String JSON_PROPERTY_EXECUTION_DATE = "executionDate"; private ExecutionDate executionDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExecutionDate = false; + public static final String JSON_PROPERTY_EXTERNAL_REASON = "externalReason"; private ExternalReason externalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExternalReason = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENT_INSTRUMENT = "paymentInstrument"; private PaymentInstrument paymentInstrument; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentInstrument = false; + /** Additional information about the status of the transfer. */ public enum ReasonEnum { ACCOUNTHIERARCHYNOTACTIVE(String.valueOf("accountHierarchyNotActive")), @@ -263,6 +322,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -305,24 +366,41 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = 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_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; private String referenceForBeneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferenceForBeneficiary = false; + public static final String JSON_PROPERTY_REVIEW = "review"; private TransferReview review; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReview = false; + public static final String JSON_PROPERTY_SEQUENCE_NUMBER = "sequenceNumber"; private Integer sequenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSequenceNumber = false; + /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. */ public enum StatusEnum { APPROVALPENDING(String.valueOf("approvalPending")), @@ -497,12 +575,21 @@ 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_TRACKING = "tracking"; private TransferDataTracking tracking; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTracking = false; + public static final String JSON_PROPERTY_TRANSACTION_RULES_RESULT = "transactionRulesResult"; private TransactionRulesResult transactionRulesResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionRulesResult = false; + /** * The type of transfer or transaction. For example, **refund**, **payment**, * **internalTransfer**, **bankTransfer**. @@ -622,9 +709,21 @@ 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; + public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt"; private OffsetDateTime updatedAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUpdatedAt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferData() {} /** @@ -635,6 +734,7 @@ public TransferData() {} */ public TransferData accountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set return this; } @@ -658,6 +758,7 @@ public ResourceReference getAccountHolder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolder(ResourceReference accountHolder) { this.accountHolder = accountHolder; + isSetAccountHolder = true; // mark as set } /** @@ -668,6 +769,7 @@ public void setAccountHolder(ResourceReference accountHolder) { */ public TransferData amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -691,6 +793,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -701,6 +804,7 @@ public void setAmount(Amount amount) { */ public TransferData balanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set return this; } @@ -724,6 +828,7 @@ public ResourceReference getBalanceAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccount(ResourceReference balanceAccount) { this.balanceAccount = balanceAccount; + isSetBalanceAccount = true; // mark as set } /** @@ -734,6 +839,7 @@ public void setBalanceAccount(ResourceReference balanceAccount) { */ public TransferData balancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set return this; } @@ -757,6 +863,7 @@ public String getBalancePlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalancePlatform(String balancePlatform) { this.balancePlatform = balancePlatform; + isSetBalancePlatform = true; // mark as set } /** @@ -767,6 +874,7 @@ public void setBalancePlatform(String balancePlatform) { */ public TransferData balances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set return this; } @@ -798,53 +906,55 @@ public List getBalances() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalances(List balances) { this.balances = balances; + isSetBalances = true; // mark as set } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @param category The category of the transfer. Possible values: - **bank**: a transfer involving + * @param category The category of the transfer. Possible values: - **bank**: A transfer involving * a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. * @return the current {@code TransferData} instance, allowing for method chaining */ public TransferData category(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set return this; } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @return category The category of the transfer. Possible values: - **bank**: a transfer + * @return category The category of the transfer. Possible values: - **bank**: A transfer * involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -853,29 +963,30 @@ public CategoryEnum getCategory() { } /** - * The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - - * **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. - + * **topUp**: An incoming transfer initiated by your user to top up their balance account. * - * @param category The category of the transfer. Possible values: - **bank**: a transfer involving + * @param category The category of the transfer. Possible values: - **bank**: A transfer involving * a [transfer - * instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) - * or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a + * instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) + * or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A * transfer between [balance - * accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) - * within your platform. - **issuedCard**: a transfer initiated by an Adyen-issued card. - - * **platformPayment**: funds movements related to payments that are acquired for your users. - * - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) + * within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - + * **platformPayment**: Funds movements related to payments that are acquired for your users. + * - **topUp**: An incoming transfer initiated by your user to top up their balance account. */ @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategory(CategoryEnum category) { this.category = category; + isSetCategory = true; // mark as set } /** @@ -886,6 +997,7 @@ public void setCategory(CategoryEnum category) { */ public TransferData categoryData(TransferDataCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set return this; } @@ -909,6 +1021,7 @@ public TransferDataCategoryData getCategoryData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCategoryData(TransferDataCategoryData categoryData) { this.categoryData = categoryData; + isSetCategoryData = true; // mark as set } /** @@ -919,6 +1032,7 @@ public void setCategoryData(TransferDataCategoryData categoryData) { */ public TransferData counterparty(TransferNotificationCounterParty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set return this; } @@ -942,6 +1056,7 @@ public TransferNotificationCounterParty getCounterparty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCounterparty(TransferNotificationCounterParty counterparty) { this.counterparty = counterparty; + isSetCounterparty = true; // mark as set } /** @@ -954,6 +1069,7 @@ public void setCounterparty(TransferNotificationCounterParty counterparty) { */ public TransferData createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -981,6 +1097,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -995,6 +1112,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { @Deprecated // deprecated since Transfer webhooks v3: Use createdAt or updatedAt public TransferData creationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set return this; } @@ -1026,6 +1144,7 @@ public OffsetDateTime getCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreationDate(OffsetDateTime creationDate) { this.creationDate = creationDate; + isSetCreationDate = true; // mark as set } /** @@ -1044,6 +1163,7 @@ public void setCreationDate(OffsetDateTime creationDate) { */ public TransferData description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -1083,6 +1203,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -1093,6 +1214,7 @@ public void setDescription(String description) { */ public TransferData directDebitInformation(DirectDebitInformation directDebitInformation) { this.directDebitInformation = directDebitInformation; + isSetDirectDebitInformation = true; // mark as set return this; } @@ -1116,6 +1238,7 @@ public DirectDebitInformation getDirectDebitInformation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirectDebitInformation(DirectDebitInformation directDebitInformation) { this.directDebitInformation = directDebitInformation; + isSetDirectDebitInformation = true; // mark as set } /** @@ -1126,6 +1249,7 @@ public void setDirectDebitInformation(DirectDebitInformation directDebitInformat */ public TransferData direction(DirectionEnum direction) { this.direction = direction; + isSetDirection = true; // mark as set return this; } @@ -1149,6 +1273,7 @@ public DirectionEnum getDirection() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirection(DirectionEnum direction) { this.direction = direction; + isSetDirection = true; // mark as set } /** @@ -1161,6 +1286,7 @@ public void setDirection(DirectionEnum direction) { */ public TransferData eventId(String eventId) { this.eventId = eventId; + isSetEventId = true; // mark as set return this; } @@ -1188,6 +1314,7 @@ public String getEventId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEventId(String eventId) { this.eventId = eventId; + isSetEventId = true; // mark as set } /** @@ -1198,6 +1325,7 @@ public void setEventId(String eventId) { */ public TransferData events(List events) { this.events = events; + isSetEvents = true; // mark as set return this; } @@ -1229,6 +1357,7 @@ public List getEvents() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEvents(List events) { this.events = events; + isSetEvents = true; // mark as set } /** @@ -1239,6 +1368,7 @@ public void setEvents(List events) { */ public TransferData executionDate(ExecutionDate executionDate) { this.executionDate = executionDate; + isSetExecutionDate = true; // mark as set return this; } @@ -1262,6 +1392,7 @@ public ExecutionDate getExecutionDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExecutionDate(ExecutionDate executionDate) { this.executionDate = executionDate; + isSetExecutionDate = true; // mark as set } /** @@ -1272,6 +1403,7 @@ public void setExecutionDate(ExecutionDate executionDate) { */ public TransferData externalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set return this; } @@ -1295,6 +1427,7 @@ public ExternalReason getExternalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExternalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set } /** @@ -1305,6 +1438,7 @@ public void setExternalReason(ExternalReason externalReason) { */ public TransferData id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -1328,6 +1462,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -1338,6 +1473,7 @@ public void setId(String id) { */ public TransferData paymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set return this; } @@ -1361,6 +1497,7 @@ public PaymentInstrument getPaymentInstrument() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentInstrument(PaymentInstrument paymentInstrument) { this.paymentInstrument = paymentInstrument; + isSetPaymentInstrument = true; // mark as set } /** @@ -1371,6 +1508,7 @@ public void setPaymentInstrument(PaymentInstrument paymentInstrument) { */ public TransferData reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -1394,6 +1532,7 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -1406,6 +1545,7 @@ public void setReason(ReasonEnum reason) { */ public TransferData reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -1433,6 +1573,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -1451,6 +1592,7 @@ public void setReference(String reference) { */ public TransferData referenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set return this; } @@ -1490,6 +1632,7 @@ public String getReferenceForBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferenceForBeneficiary(String referenceForBeneficiary) { this.referenceForBeneficiary = referenceForBeneficiary; + isSetReferenceForBeneficiary = true; // mark as set } /** @@ -1500,6 +1643,7 @@ public void setReferenceForBeneficiary(String referenceForBeneficiary) { */ public TransferData review(TransferReview review) { this.review = review; + isSetReview = true; // mark as set return this; } @@ -1523,6 +1667,7 @@ public TransferReview getReview() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReview(TransferReview review) { this.review = review; + isSetReview = true; // mark as set } /** @@ -1537,6 +1682,7 @@ public void setReview(TransferReview review) { */ public TransferData sequenceNumber(Integer sequenceNumber) { this.sequenceNumber = sequenceNumber; + isSetSequenceNumber = true; // mark as set return this; } @@ -1568,39 +1714,51 @@ public Integer getSequenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSequenceNumber(Integer sequenceNumber) { this.sequenceNumber = sequenceNumber; + isSetSequenceNumber = true; // mark as set } /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. * * @param status The result of the transfer. For example: - **received**: an outgoing transfer - * request is created. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * request is created. - **refused**: the transfer request is rejected by Adyen for one of the + * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - + * Transaction rule requirements violated. - **authorised**: the transfer request is + * authorized and the funds are reserved. - **booked**: the funds are deducted from your + * user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. * @return the current {@code TransferData} instance, allowing for method chaining */ public TransferData status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. * * @return status The result of the transfer. For example: - **received**: an outgoing transfer - * request is created. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * request is created. - **refused**: the transfer request is rejected by Adyen for one of the + * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - + * Transaction rule requirements violated. - **authorised**: the transfer request is + * authorized and the funds are reserved. - **booked**: the funds are deducted from your + * user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1610,21 +1768,27 @@ public StatusEnum getStatus() { /** * The result of the transfer. For example: - **received**: an outgoing transfer request is - * created. - **authorised**: the transfer request is authorized and the funds are reserved. - - * **booked**: the funds are deducted from your user's balance account. - **failed**: the - * transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned - * by the counterparty's bank. + * created. - **refused**: the transfer request is rejected by Adyen for one of the following + * reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule + * requirements violated. - **authorised**: the transfer request is authorized and the funds are + * reserved. - **booked**: the funds are deducted from your user's balance account. - + * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the + * transfer is returned by the counterparty's bank. * * @param status The result of the transfer. For example: - **received**: an outgoing transfer - * request is created. - **authorised**: the transfer request is authorized and the funds are - * reserved. - **booked**: the funds are deducted from your user's balance account. - - * **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the - * transfer is returned by the counterparty's bank. + * request is created. - **refused**: the transfer request is rejected by Adyen for one of the + * following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - + * Transaction rule requirements violated. - **authorised**: the transfer request is + * authorized and the funds are reserved. - **booked**: the funds are deducted from your + * user's balance account. - **failed**: the transfer is rejected by the + * counterparty's bank. - **returned**: the transfer is returned by the counterparty's + * bank. */ @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -1635,6 +1799,7 @@ public void setStatus(StatusEnum status) { */ public TransferData tracking(TransferDataTracking tracking) { this.tracking = tracking; + isSetTracking = true; // mark as set return this; } @@ -1658,6 +1823,7 @@ public TransferDataTracking getTracking() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTracking(TransferDataTracking tracking) { this.tracking = tracking; + isSetTracking = true; // mark as set } /** @@ -1668,6 +1834,7 @@ public void setTracking(TransferDataTracking tracking) { */ public TransferData transactionRulesResult(TransactionRulesResult transactionRulesResult) { this.transactionRulesResult = transactionRulesResult; + isSetTransactionRulesResult = true; // mark as set return this; } @@ -1691,6 +1858,7 @@ public TransactionRulesResult getTransactionRulesResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionRulesResult(TransactionRulesResult transactionRulesResult) { this.transactionRulesResult = transactionRulesResult; + isSetTransactionRulesResult = true; // mark as set } /** @@ -1703,6 +1871,7 @@ public void setTransactionRulesResult(TransactionRulesResult transactionRulesRes */ public TransferData type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1730,6 +1899,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -1742,6 +1912,7 @@ public void setType(TypeEnum type) { */ public TransferData updatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; + isSetUpdatedAt = true; // mark as set return this; } @@ -1769,6 +1940,27 @@ public OffsetDateTime getUpdatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUpdatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; + isSetUpdatedAt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferData 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 TransferData object is equal to o. */ @@ -1899,6 +2091,114 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolder) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER, this.accountHolder); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBalanceAccount) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT, this.balanceAccount); + } + if (isSetBalancePlatform) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_PLATFORM, this.balancePlatform); + } + if (isSetBalances) { + addIfNull(nulls, JSON_PROPERTY_BALANCES, this.balances); + } + if (isSetCategory) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY, this.category); + } + if (isSetCategoryData) { + addIfNull(nulls, JSON_PROPERTY_CATEGORY_DATA, this.categoryData); + } + if (isSetCounterparty) { + addIfNull(nulls, JSON_PROPERTY_COUNTERPARTY, this.counterparty); + } + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetCreationDate) { + addIfNull(nulls, JSON_PROPERTY_CREATION_DATE, this.creationDate); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetDirectDebitInformation) { + addIfNull(nulls, JSON_PROPERTY_DIRECT_DEBIT_INFORMATION, this.directDebitInformation); + } + if (isSetDirection) { + addIfNull(nulls, JSON_PROPERTY_DIRECTION, this.direction); + } + if (isSetEventId) { + addIfNull(nulls, JSON_PROPERTY_EVENT_ID, this.eventId); + } + if (isSetEvents) { + addIfNull(nulls, JSON_PROPERTY_EVENTS, this.events); + } + if (isSetExecutionDate) { + addIfNull(nulls, JSON_PROPERTY_EXECUTION_DATE, this.executionDate); + } + if (isSetExternalReason) { + addIfNull(nulls, JSON_PROPERTY_EXTERNAL_REASON, this.externalReason); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPaymentInstrument) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_INSTRUMENT, this.paymentInstrument); + } + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReferenceForBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE_FOR_BENEFICIARY, this.referenceForBeneficiary); + } + if (isSetReview) { + addIfNull(nulls, JSON_PROPERTY_REVIEW, this.review); + } + if (isSetSequenceNumber) { + addIfNull(nulls, JSON_PROPERTY_SEQUENCE_NUMBER, this.sequenceNumber); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTracking) { + addIfNull(nulls, JSON_PROPERTY_TRACKING, this.tracking); + } + if (isSetTransactionRulesResult) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_RULES_RESULT, this.transactionRulesResult); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUpdatedAt) { + addIfNull(nulls, JSON_PROPERTY_UPDATED_AT, this.updatedAt); + } + + 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 TransferData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java b/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java index 8e00640c8..0cf3aab77 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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; @@ -49,36 +51,69 @@ public class TransferEvent { 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_AMOUNT_ADJUSTMENTS = "amountAdjustments"; private List amountAdjustments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountAdjustments = false; + public static final String JSON_PROPERTY_ARN = "arn"; private String arn; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetArn = false; + public static final String JSON_PROPERTY_BOOKING_DATE = "bookingDate"; private OffsetDateTime bookingDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBookingDate = false; + public static final String JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME = "estimatedArrivalTime"; private OffsetDateTime estimatedArrivalTime; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEstimatedArrivalTime = false; + public static final String JSON_PROPERTY_EVENTS_DATA = "eventsData"; private List eventsData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEventsData = false; + public static final String JSON_PROPERTY_EXTERNAL_REASON = "externalReason"; private ExternalReason externalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExternalReason = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_MODIFICATION = "modification"; private Modification modification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetModification = false; + public static final String JSON_PROPERTY_MUTATIONS = "mutations"; private List mutations; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMutations = false; + public static final String JSON_PROPERTY_ORIGINAL_AMOUNT = "originalAmount"; private Amount originalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalAmount = false; + /** The reason for the transfer status. */ public enum ReasonEnum { ACCOUNTHIERARCHYNOTACTIVE(String.valueOf("accountHierarchyNotActive")), @@ -128,6 +163,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -170,6 +207,9 @@ public static ReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_REASON = "reason"; private ReasonEnum reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + /** The status of the transfer event. */ public enum StatusEnum { APPROVALPENDING(String.valueOf("approvalPending")), @@ -344,12 +384,21 @@ 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_TRACKING_DATA = "trackingData"; private TransferEventTrackingData trackingData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrackingData = false; + public static final String JSON_PROPERTY_TRANSACTION_ID = "transactionId"; private String transactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionId = false; + /** The type of the transfer event. Possible values: **accounting**, **tracking**. */ public enum TypeEnum { ACCOUNTING(String.valueOf("accounting")), @@ -394,12 +443,27 @@ 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; + public static final String JSON_PROPERTY_UPDATE_DATE = "updateDate"; private OffsetDateTime updateDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUpdateDate = false; + public static final String JSON_PROPERTY_VALUE_DATE = "valueDate"; private OffsetDateTime valueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValueDate = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferEvent() {} /** @@ -410,6 +474,7 @@ public TransferEvent() {} */ public TransferEvent amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -433,6 +498,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -445,6 +511,7 @@ public void setAmount(Amount amount) { */ public TransferEvent amountAdjustments(List amountAdjustments) { this.amountAdjustments = amountAdjustments; + isSetAmountAdjustments = true; // mark as set return this; } @@ -480,6 +547,7 @@ public List getAmountAdjustments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountAdjustments(List amountAdjustments) { this.amountAdjustments = amountAdjustments; + isSetAmountAdjustments = true; // mark as set } /** @@ -490,6 +558,7 @@ public void setAmountAdjustments(List amountAdjustments) { */ public TransferEvent arn(String arn) { this.arn = arn; + isSetArn = true; // mark as set return this; } @@ -514,6 +583,7 @@ public String getArn() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setArn(String arn) { this.arn = arn; + isSetArn = true; // mark as set } /** @@ -524,6 +594,7 @@ public void setArn(String arn) { */ public TransferEvent bookingDate(OffsetDateTime bookingDate) { this.bookingDate = bookingDate; + isSetBookingDate = true; // mark as set return this; } @@ -547,6 +618,7 @@ public OffsetDateTime getBookingDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBookingDate(OffsetDateTime bookingDate) { this.bookingDate = bookingDate; + isSetBookingDate = true; // mark as set } /** @@ -558,6 +630,7 @@ public void setBookingDate(OffsetDateTime bookingDate) { */ public TransferEvent estimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set return this; } @@ -583,6 +656,7 @@ public OffsetDateTime getEstimatedArrivalTime() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { this.estimatedArrivalTime = estimatedArrivalTime; + isSetEstimatedArrivalTime = true; // mark as set } /** @@ -593,6 +667,7 @@ public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { */ public TransferEvent eventsData(List eventsData) { this.eventsData = eventsData; + isSetEventsData = true; // mark as set return this; } @@ -624,6 +699,7 @@ public List getEventsData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEventsData(List eventsData) { this.eventsData = eventsData; + isSetEventsData = true; // mark as set } /** @@ -634,6 +710,7 @@ public void setEventsData(List eventsData) { */ public TransferEvent externalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set return this; } @@ -657,6 +734,7 @@ public ExternalReason getExternalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExternalReason(ExternalReason externalReason) { this.externalReason = externalReason; + isSetExternalReason = true; // mark as set } /** @@ -667,6 +745,7 @@ public void setExternalReason(ExternalReason externalReason) { */ public TransferEvent id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -690,6 +769,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -700,6 +780,7 @@ public void setId(String id) { */ public TransferEvent modification(Modification modification) { this.modification = modification; + isSetModification = true; // mark as set return this; } @@ -723,6 +804,7 @@ public Modification getModification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setModification(Modification modification) { this.modification = modification; + isSetModification = true; // mark as set } /** @@ -733,6 +815,7 @@ public void setModification(Modification modification) { */ public TransferEvent mutations(List mutations) { this.mutations = mutations; + isSetMutations = true; // mark as set return this; } @@ -764,6 +847,7 @@ public List getMutations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMutations(List mutations) { this.mutations = mutations; + isSetMutations = true; // mark as set } /** @@ -774,6 +858,7 @@ public void setMutations(List mutations) { */ public TransferEvent originalAmount(Amount originalAmount) { this.originalAmount = originalAmount; + isSetOriginalAmount = true; // mark as set return this; } @@ -797,6 +882,7 @@ public Amount getOriginalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalAmount(Amount originalAmount) { this.originalAmount = originalAmount; + isSetOriginalAmount = true; // mark as set } /** @@ -807,6 +893,7 @@ public void setOriginalAmount(Amount originalAmount) { */ public TransferEvent reason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -830,6 +917,7 @@ public ReasonEnum getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(ReasonEnum reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -840,6 +928,7 @@ public void setReason(ReasonEnum reason) { */ public TransferEvent status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -863,6 +952,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -873,6 +963,7 @@ public void setStatus(StatusEnum status) { */ public TransferEvent trackingData(TransferEventTrackingData trackingData) { this.trackingData = trackingData; + isSetTrackingData = true; // mark as set return this; } @@ -896,6 +987,7 @@ public TransferEventTrackingData getTrackingData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrackingData(TransferEventTrackingData trackingData) { this.trackingData = trackingData; + isSetTrackingData = true; // mark as set } /** @@ -908,6 +1000,7 @@ public void setTrackingData(TransferEventTrackingData trackingData) { */ public TransferEvent transactionId(String transactionId) { this.transactionId = transactionId; + isSetTransactionId = true; // mark as set return this; } @@ -935,6 +1028,7 @@ public String getTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionId(String transactionId) { this.transactionId = transactionId; + isSetTransactionId = true; // mark as set } /** @@ -945,6 +1039,7 @@ public void setTransactionId(String transactionId) { */ public TransferEvent type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -968,6 +1063,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -978,6 +1074,7 @@ public void setType(TypeEnum type) { */ public TransferEvent updateDate(OffsetDateTime updateDate) { this.updateDate = updateDate; + isSetUpdateDate = true; // mark as set return this; } @@ -1001,6 +1098,7 @@ public OffsetDateTime getUpdateDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUpdateDate(OffsetDateTime updateDate) { this.updateDate = updateDate; + isSetUpdateDate = true; // mark as set } /** @@ -1013,6 +1111,7 @@ public void setUpdateDate(OffsetDateTime updateDate) { */ public TransferEvent valueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; + isSetValueDate = true; // mark as set return this; } @@ -1040,6 +1139,27 @@ public OffsetDateTime getValueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValueDate(OffsetDateTime valueDate) { this.valueDate = valueDate; + isSetValueDate = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferEvent 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 TransferEvent object is equal to o. */ @@ -1133,6 +1253,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 (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetAmountAdjustments) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_ADJUSTMENTS, this.amountAdjustments); + } + if (isSetArn) { + addIfNull(nulls, JSON_PROPERTY_ARN, this.arn); + } + if (isSetBookingDate) { + addIfNull(nulls, JSON_PROPERTY_BOOKING_DATE, this.bookingDate); + } + if (isSetEstimatedArrivalTime) { + addIfNull(nulls, JSON_PROPERTY_ESTIMATED_ARRIVAL_TIME, this.estimatedArrivalTime); + } + if (isSetEventsData) { + addIfNull(nulls, JSON_PROPERTY_EVENTS_DATA, this.eventsData); + } + if (isSetExternalReason) { + addIfNull(nulls, JSON_PROPERTY_EXTERNAL_REASON, this.externalReason); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetModification) { + addIfNull(nulls, JSON_PROPERTY_MODIFICATION, this.modification); + } + if (isSetMutations) { + addIfNull(nulls, JSON_PROPERTY_MUTATIONS, this.mutations); + } + if (isSetOriginalAmount) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_AMOUNT, this.originalAmount); + } + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTrackingData) { + addIfNull(nulls, JSON_PROPERTY_TRACKING_DATA, this.trackingData); + } + if (isSetTransactionId) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_ID, this.transactionId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUpdateDate) { + addIfNull(nulls, JSON_PROPERTY_UPDATE_DATE, this.updateDate); + } + if (isSetValueDate) { + addIfNull(nulls, JSON_PROPERTY_VALUE_DATE, this.valueDate); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferEvent given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationCounterParty.java b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationCounterParty.java index cb9c7a255..8a72a8e28 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationCounterParty.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationCounterParty.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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 TransferNotificationCounterParty { public static final String JSON_PROPERTY_BALANCE_ACCOUNT_ID = "balanceAccountId"; private String balanceAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalanceAccountId = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private BankAccountV3 bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = 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_MERCHANT = "merchant"; private TransferNotificationMerchantData merchant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchant = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferNotificationCounterParty() {} /** @@ -54,6 +77,7 @@ public TransferNotificationCounterParty() {} */ public TransferNotificationCounterParty balanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set return this; } @@ -81,6 +105,7 @@ public String getBalanceAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalanceAccountId(String balanceAccountId) { this.balanceAccountId = balanceAccountId; + isSetBalanceAccountId = true; // mark as set } /** @@ -92,6 +117,7 @@ public void setBalanceAccountId(String balanceAccountId) { */ public TransferNotificationCounterParty bankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -115,6 +141,7 @@ public BankAccountV3 getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(BankAccountV3 bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -126,6 +153,7 @@ public void setBankAccount(BankAccountV3 bankAccount) { */ public TransferNotificationCounterParty card(Card card) { this.card = card; + isSetCard = true; // mark as set return this; } @@ -149,6 +177,7 @@ public Card getCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCard(Card card) { this.card = card; + isSetCard = true; // mark as set } /** @@ -160,6 +189,7 @@ public void setCard(Card card) { */ public TransferNotificationCounterParty merchant(TransferNotificationMerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set return this; } @@ -183,6 +213,7 @@ public TransferNotificationMerchantData getMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchant(TransferNotificationMerchantData merchant) { this.merchant = merchant; + isSetMerchant = true; // mark as set } /** @@ -196,6 +227,7 @@ public void setMerchant(TransferNotificationMerchantData merchant) { */ public TransferNotificationCounterParty transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -223,6 +255,27 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferNotificationCounterParty 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 TransferNotificationCounterParty object is equal to o. */ @@ -274,6 +327,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 (isSetBalanceAccountId) { + addIfNull(nulls, JSON_PROPERTY_BALANCE_ACCOUNT_ID, this.balanceAccountId); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetCard) { + addIfNull(nulls, JSON_PROPERTY_CARD, this.card); + } + if (isSetMerchant) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT, this.merchant); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + + 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 TransferNotificationCounterParty given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationMerchantData.java b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationMerchantData.java index 1595c6a5b..44acc9612 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationMerchantData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationMerchantData.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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; @@ -31,24 +33,51 @@ public class TransferNotificationMerchantData { public static final String JSON_PROPERTY_ACQUIRER_ID = "acquirerId"; private String acquirerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerId = false; + 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_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = 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_POSTAL_CODE = "postalCode"; private String postalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferNotificationMerchantData() {} /** @@ -60,6 +89,7 @@ public TransferNotificationMerchantData() {} */ public TransferNotificationMerchantData acquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set return this; } @@ -83,6 +113,7 @@ public String getAcquirerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerId(String acquirerId) { this.acquirerId = acquirerId; + isSetAcquirerId = true; // mark as set } /** @@ -94,6 +125,7 @@ public void setAcquirerId(String acquirerId) { */ public TransferNotificationMerchantData city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -117,6 +149,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -128,6 +161,7 @@ public void setCity(String city) { */ public TransferNotificationMerchantData country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -151,6 +185,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -162,6 +197,7 @@ public void setCountry(String country) { */ public TransferNotificationMerchantData mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -185,6 +221,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -196,6 +233,7 @@ public void setMcc(String mcc) { */ public TransferNotificationMerchantData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -219,6 +257,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -230,6 +269,7 @@ public void setMerchantId(String merchantId) { */ public TransferNotificationMerchantData name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -253,6 +293,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -264,6 +305,7 @@ public void setName(String name) { */ public TransferNotificationMerchantData postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -287,6 +329,27 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferNotificationMerchantData 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 TransferNotificationMerchantData object is equal to o. */ @@ -339,6 +402,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcquirerId) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_ID, this.acquirerId); + } + 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 (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + + 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 TransferNotificationMerchantData given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java index 3807a8fb1..780f01caa 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class TransferNotificationRequest { public static final String JSON_PROPERTY_DATA = "data"; private TransferData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private OffsetDateTime timestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + /** The type of webhook. */ public enum TypeEnum { BALANCEPLATFORM_TRANSFER_CREATED(String.valueOf("balancePlatform.transfer.created")), @@ -83,6 +94,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 TransferNotificationRequest() {} /** @@ -93,6 +113,7 @@ public TransferNotificationRequest() {} */ public TransferNotificationRequest data(TransferData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -116,6 +137,7 @@ public TransferData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(TransferData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -127,6 +149,7 @@ public void setData(TransferData data) { */ public TransferNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -152,6 +175,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -162,6 +186,7 @@ public void setEnvironment(String environment) { */ public TransferNotificationRequest timestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set return this; } @@ -185,6 +210,7 @@ public OffsetDateTime getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(OffsetDateTime timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set } /** @@ -195,6 +221,7 @@ public void setTimestamp(OffsetDateTime timestamp) { */ public TransferNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -218,6 +245,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 TransferNotificationRequest 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 TransferNotificationRequest object is equal to o. */ @@ -263,6 +311,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TransferNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java index efaaecffd..4a45b436a 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java @@ -11,6 +11,8 @@ package com.adyen.model.transferwebhooks; +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 TransferNotificationValidationFact { public static final String JSON_PROPERTY_RESULT = "result"; private String result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResult = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String 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 TransferNotificationValidationFact() {} /** @@ -40,6 +54,7 @@ public TransferNotificationValidationFact() {} */ public TransferNotificationValidationFact result(String result) { this.result = result; + isSetResult = true; // mark as set return this; } @@ -63,6 +78,7 @@ public String getResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResult(String result) { this.result = result; + isSetResult = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setResult(String result) { */ public TransferNotificationValidationFact type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -97,6 +114,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferNotificationValidationFact 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 TransferNotificationValidationFact object is equal to o. */ @@ -139,6 +177,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 (isSetResult) { + addIfNull(nulls, JSON_PROPERTY_RESULT, this.result); + } + 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 TransferNotificationValidationFact given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferReview.java b/src/main/java/com/adyen/model/transferwebhooks/TransferReview.java index 6d8f4bd11..36129abb4 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferReview.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferReview.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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 TransferReview { "numberOfApprovalsRequired"; private Integer numberOfApprovalsRequired; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumberOfApprovalsRequired = false; + /** * Shows the status of the Strong Customer Authentication (SCA) process. Possible values: * **required**, **notApplicable**. @@ -80,6 +85,15 @@ public static ScaOnApprovalEnum fromValue(String value) { public static final String JSON_PROPERTY_SCA_ON_APPROVAL = "scaOnApproval"; private ScaOnApprovalEnum scaOnApproval; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaOnApproval = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TransferReview() {} /** @@ -94,6 +108,7 @@ public TransferReview() {} */ public TransferReview numberOfApprovalsRequired(Integer numberOfApprovalsRequired) { this.numberOfApprovalsRequired = numberOfApprovalsRequired; + isSetNumberOfApprovalsRequired = true; // mark as set return this; } @@ -125,6 +140,7 @@ public Integer getNumberOfApprovalsRequired() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumberOfApprovalsRequired(Integer numberOfApprovalsRequired) { this.numberOfApprovalsRequired = numberOfApprovalsRequired; + isSetNumberOfApprovalsRequired = true; // mark as set } /** @@ -137,6 +153,7 @@ public void setNumberOfApprovalsRequired(Integer numberOfApprovalsRequired) { */ public TransferReview scaOnApproval(ScaOnApprovalEnum scaOnApproval) { this.scaOnApproval = scaOnApproval; + isSetScaOnApproval = true; // mark as set return this; } @@ -164,6 +181,27 @@ public ScaOnApprovalEnum getScaOnApproval() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaOnApproval(ScaOnApprovalEnum scaOnApproval) { this.scaOnApproval = scaOnApproval; + isSetScaOnApproval = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TransferReview 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 TransferReview object is equal to o. */ @@ -207,6 +245,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 (isSetNumberOfApprovalsRequired) { + addIfNull(nulls, JSON_PROPERTY_NUMBER_OF_APPROVALS_REQUIRED, this.numberOfApprovalsRequired); + } + if (isSetScaOnApproval) { + addIfNull(nulls, JSON_PROPERTY_SCA_ON_APPROVAL, this.scaOnApproval); + } + + 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 TransferReview given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java index 726a08c59..71c5fe8d4 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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,9 +33,15 @@ public class UKLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_SORT_CODE = "sortCode"; private String sortCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSortCode = false; + /** **ukLocal** */ public enum TypeEnum { UKLOCAL(String.valueOf("ukLocal")); @@ -76,6 +84,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 UKLocalAccountIdentification() {} /** @@ -86,6 +103,7 @@ public UKLocalAccountIdentification() {} */ public UKLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -121,6 +140,7 @@ public void setAccountNumber(String accountNumber) { */ public UKLocalAccountIdentification sortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set return this; } @@ -148,6 +168,7 @@ public String getSortCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set } /** @@ -158,6 +179,7 @@ public void setSortCode(String sortCode) { */ public UKLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -181,6 +203,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 UKLocalAccountIdentification 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 UKLocalAccountIdentification object is equal to o. */ @@ -224,6 +267,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetSortCode) { + addIfNull(nulls, JSON_PROPERTY_SORT_CODE, this.sortCode); + } + 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 UKLocalAccountIdentification given an JSON string * diff --git a/src/main/java/com/adyen/model/transferwebhooks/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/USLocalAccountIdentification.java index d11a9c0a2..42b852437 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/USLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transferwebhooks/USLocalAccountIdentification.java @@ -11,7 +11,9 @@ package com.adyen.model.transferwebhooks; +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; @@ -32,6 +34,9 @@ public class USLocalAccountIdentification { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + /** * The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. */ @@ -78,9 +83,15 @@ 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_ROUTING_NUMBER = "routingNumber"; private String routingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRoutingNumber = false; + /** **usLocal** */ public enum TypeEnum { USLOCAL(String.valueOf("usLocal")); @@ -123,6 +134,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 USLocalAccountIdentification() {} /** @@ -133,6 +153,7 @@ public USLocalAccountIdentification() {} */ public USLocalAccountIdentification accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -156,6 +177,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -167,6 +189,7 @@ public void setAccountNumber(String accountNumber) { */ public USLocalAccountIdentification accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -192,6 +215,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -205,6 +229,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public USLocalAccountIdentification routingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set return this; } @@ -234,6 +259,7 @@ public String getRoutingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRoutingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set } /** @@ -244,6 +270,7 @@ public void setRoutingNumber(String routingNumber) { */ public USLocalAccountIdentification type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -267,6 +294,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 USLocalAccountIdentification 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 USLocalAccountIdentification object is equal to o. */ @@ -312,6 +360,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 (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetRoutingNumber) { + addIfNull(nulls, JSON_PROPERTY_ROUTING_NUMBER, this.routingNumber); + } + 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 USLocalAccountIdentification given an JSON string * diff --git a/src/test/java/com/adyen/serializer/ModelTest.java b/src/test/java/com/adyen/serializer/ModelTest.java index abf956150..64c703baf 100644 --- a/src/test/java/com/adyen/serializer/ModelTest.java +++ b/src/test/java/com/adyen/serializer/ModelTest.java @@ -198,7 +198,7 @@ public void testFromJsonCheckoutPaymentMethodBcmcMobile() throws Exception { assertEquals("7219687191761347", storedPaymentMethodDetails.getStoredPaymentMethodId()); } - // test null values are not serialized + // test null values are not serialized @Test public void testToJsonTerminalSettingsSurchargeNotSet() throws JsonProcessingException { TerminalSettings terminalSettings = new TerminalSettings(); @@ -208,18 +208,19 @@ public void testToJsonTerminalSettingsSurchargeNotSet() throws JsonProcessingExc assertEquals("{\"connectivity\":{\"simcardStatus\":\"ACTIVATED\"}}", json); } - // test values set as null are not serialized when includeNullValues is false - @Test - public void testToJsonTerminalSettingsSurchargeSetToNullWithoutEnablingIncludeNullValues() throws JsonProcessingException { - TerminalSettings terminalSettings = new TerminalSettings(); - terminalSettings - .connectivity(new Connectivity().simcardStatus(Connectivity.SimcardStatusEnum.ACTIVATED)) - .setSurcharge(null); - String json = terminalSettings.toJson(); - assertEquals("{\"connectivity\":{\"simcardStatus\":\"ACTIVATED\"}}", json); - } - - // test values set as null (using setters) are serialized + // test values set as null are not serialized when includeNullValues is false + @Test + public void testToJsonTerminalSettingsSurchargeSetToNullWithoutEnablingIncludeNullValues() + throws JsonProcessingException { + TerminalSettings terminalSettings = new TerminalSettings(); + terminalSettings + .connectivity(new Connectivity().simcardStatus(Connectivity.SimcardStatusEnum.ACTIVATED)) + .setSurcharge(null); + String json = terminalSettings.toJson(); + assertEquals("{\"connectivity\":{\"simcardStatus\":\"ACTIVATED\"}}", json); + } + + // test values set as null (using setters) are serialized @Test public void testToJsonTerminalSettingsSurchargeSetToNull() throws JsonProcessingException { TerminalSettings terminalSettings = new TerminalSettings(); @@ -231,7 +232,7 @@ public void testToJsonTerminalSettingsSurchargeSetToNull() throws JsonProcessing assertEquals("{\"connectivity\":{\"simcardStatus\":\"ACTIVATED\"},\"surcharge\":null}", json); } - // test values set as null (using build methods) are serialized + // test values set as null (using build methods) are serialized @Test public void testToJsonTerminalSettingsSurchargeChainToNull() throws JsonProcessingException { TerminalSettings terminalSettings = new TerminalSettings(); @@ -243,20 +244,22 @@ public void testToJsonTerminalSettingsSurchargeChainToNull() throws JsonProcessi assertEquals("{\"connectivity\":{\"simcardStatus\":\"ACTIVATED\"},\"surcharge\":null}", json); } - // test values, that are not explicitly SET as null, are not serialized (even when includeNullValues is true) - @Test - public void testToJsonFlagTrueButFieldNotSet() throws JsonProcessingException { - TerminalSettings terminalSettings = new TerminalSettings(); - // must consider null values that are explicitly set - terminalSettings.includeNullValues(true); + // test values, that are not explicitly SET as null, are not serialized (even when + // includeNullValues is true) + @Test + public void testToJsonFlagTrueButFieldNotSet() throws JsonProcessingException { + TerminalSettings terminalSettings = new TerminalSettings(); + // must consider null values that are explicitly set + terminalSettings.includeNullValues(true); - // We set connectivity, but we NEVER touch 'surcharge' - terminalSettings.setConnectivity(new Connectivity().simcardStatus(Connectivity.SimcardStatusEnum.ACTIVATED)); + // We set connectivity, but we NEVER touch 'surcharge' + terminalSettings.setConnectivity( + new Connectivity().simcardStatus(Connectivity.SimcardStatusEnum.ACTIVATED)); - String json = terminalSettings.toJson(); + String json = terminalSettings.toJson(); - // Expectation: 'surcharge' should NOT be present, even though the flag is true. - // It should only be present if we called setSurcharge(). - assertEquals("{\"connectivity\":{\"simcardStatus\":\"ACTIVATED\"}}", json); - } + // Expectation: 'surcharge' should NOT be present, even though the flag is true. + // It should only be present if we called setSurcharge(). + assertEquals("{\"connectivity\":{\"simcardStatus\":\"ACTIVATED\"}}", json); + } }