diff --git a/src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java index 7783e05a6..392afce25 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. */ @@ -194,13 +237,16 @@ public boolean equals(Object o) { } AULocalAccountIdentification auLocalAccountIdentification = (AULocalAccountIdentification) o; return Objects.equals(this.accountNumber, auLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, auLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.bsbCode, auLocalAccountIdentification.bsbCode) - && Objects.equals(this.type, auLocalAccountIdentification.type); + && Objects.equals(this.isSetBsbCode, auLocalAccountIdentification.isSetBsbCode) + && Objects.equals(this.type, auLocalAccountIdentification.type) + && Objects.equals(this.isSetType, auLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, bsbCode, type); + return Objects.hash(accountNumber, isSetAccountNumber, bsbCode, isSetBsbCode, type, isSetType); } @Override @@ -224,6 +270,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..f4b23da23 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. */ @@ -222,12 +260,14 @@ public boolean equals(Object o) { } AdditionalBankIdentification additionalBankIdentification = (AdditionalBankIdentification) o; return Objects.equals(this.code, additionalBankIdentification.code) - && Objects.equals(this.type, additionalBankIdentification.type); + && Objects.equals(this.isSetCode, additionalBankIdentification.isSetCode) + && Objects.equals(this.type, additionalBankIdentification.type) + && Objects.equals(this.isSetType, additionalBankIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(code, type); + return Objects.hash(code, isSetCode, type, isSetType); } @Override @@ -250,6 +290,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..637c885ca 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. */ @@ -301,16 +359,34 @@ public boolean equals(Object o) { } Address address = (Address) o; return Objects.equals(this.city, address.city) + && Objects.equals(this.isSetCity, address.isSetCity) && Objects.equals(this.country, address.country) + && Objects.equals(this.isSetCountry, address.isSetCountry) && Objects.equals(this.line1, address.line1) + && Objects.equals(this.isSetLine1, address.isSetLine1) && Objects.equals(this.line2, address.line2) + && Objects.equals(this.isSetLine2, address.isSetLine2) && Objects.equals(this.postalCode, address.postalCode) - && Objects.equals(this.stateOrProvince, address.stateOrProvince); + && Objects.equals(this.isSetPostalCode, address.isSetPostalCode) + && Objects.equals(this.stateOrProvince, address.stateOrProvince) + && Objects.equals(this.isSetStateOrProvince, address.isSetStateOrProvince); } @Override public int hashCode() { - return Objects.hash(city, country, line1, line2, postalCode, stateOrProvince); + return Objects.hash( + city, + isSetCity, + country, + isSetCountry, + line1, + isSetLine1, + line2, + isSetLine2, + postalCode, + isSetPostalCode, + stateOrProvince, + isSetStateOrProvince); } @Override @@ -337,6 +413,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..501771e08 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. */ @@ -115,12 +153,14 @@ public boolean equals(Object o) { } Airline airline = (Airline) o; return Objects.equals(this.legs, airline.legs) - && Objects.equals(this.ticketNumber, airline.ticketNumber); + && Objects.equals(this.isSetLegs, airline.isSetLegs) + && Objects.equals(this.ticketNumber, airline.ticketNumber) + && Objects.equals(this.isSetTicketNumber, airline.isSetTicketNumber); } @Override public int hashCode() { - return Objects.hash(legs, ticketNumber); + return Objects.hash(legs, isSetLegs, ticketNumber, isSetTicketNumber); } @Override @@ -143,6 +183,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (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..05e7fa74a 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. */ @@ -117,12 +161,14 @@ public boolean equals(Object o) { } Amount amount = (Amount) o; return Objects.equals(this.currency, amount.currency) - && Objects.equals(this.value, amount.value); + && Objects.equals(this.isSetCurrency, amount.isSetCurrency) + && Objects.equals(this.value, amount.value) + && Objects.equals(this.isSetValue, amount.isSetValue); } @Override public int hashCode() { - return Objects.hash(currency, value); + return Objects.hash(currency, isSetCurrency, value, isSetValue); } @Override @@ -145,6 +191,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Amount given an JSON string * diff --git a/src/main/java/com/adyen/model/transfers/AmountAdjustment.java b/src/main/java/com/adyen/model/transfers/AmountAdjustment.java index 03b2df268..232b0574a 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. */ @@ -203,13 +246,23 @@ public boolean equals(Object o) { } AmountAdjustment amountAdjustment = (AmountAdjustment) o; return Objects.equals(this.amount, amountAdjustment.amount) + && Objects.equals(this.isSetAmount, amountAdjustment.isSetAmount) && Objects.equals(this.amountAdjustmentType, amountAdjustment.amountAdjustmentType) - && Objects.equals(this.basepoints, amountAdjustment.basepoints); + && Objects.equals( + this.isSetAmountAdjustmentType, amountAdjustment.isSetAmountAdjustmentType) + && Objects.equals(this.basepoints, amountAdjustment.basepoints) + && Objects.equals(this.isSetBasepoints, amountAdjustment.isSetBasepoints); } @Override public int hashCode() { - return Objects.hash(amount, amountAdjustmentType, basepoints); + return Objects.hash( + amount, + isSetAmount, + amountAdjustmentType, + isSetAmountAdjustmentType, + basepoints, + isSetBasepoints); } @Override @@ -235,6 +288,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..52972b57c 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. */ @@ -78,12 +111,13 @@ public boolean equals(Object o) { return false; } ApproveTransfersRequest approveTransfersRequest = (ApproveTransfersRequest) o; - return Objects.equals(this.transferIds, approveTransfersRequest.transferIds); + return Objects.equals(this.transferIds, approveTransfersRequest.transferIds) + && Objects.equals(this.isSetTransferIds, approveTransfersRequest.isSetTransferIds); } @Override public int hashCode() { - return Objects.hash(transferIds); + return Objects.hash(transferIds, isSetTransferIds); } @Override @@ -105,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 (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..5bb71069a 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. */ @@ -262,15 +315,30 @@ public boolean equals(Object o) { } BRLocalAccountIdentification brLocalAccountIdentification = (BRLocalAccountIdentification) o; return Objects.equals(this.accountNumber, brLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, brLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.bankCode, brLocalAccountIdentification.bankCode) + && Objects.equals(this.isSetBankCode, brLocalAccountIdentification.isSetBankCode) && Objects.equals(this.branchNumber, brLocalAccountIdentification.branchNumber) + && Objects.equals(this.isSetBranchNumber, brLocalAccountIdentification.isSetBranchNumber) && Objects.equals(this.ispb, brLocalAccountIdentification.ispb) - && Objects.equals(this.type, brLocalAccountIdentification.type); + && Objects.equals(this.isSetIspb, brLocalAccountIdentification.isSetIspb) + && Objects.equals(this.type, brLocalAccountIdentification.type) + && Objects.equals(this.isSetType, brLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, bankCode, branchNumber, ispb, type); + return Objects.hash( + accountNumber, + isSetAccountNumber, + bankCode, + isSetBankCode, + branchNumber, + isSetBranchNumber, + ispb, + isSetIspb, + type, + isSetType); } @Override @@ -296,6 +364,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..55df98e74 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. */ @@ -206,14 +254,26 @@ public boolean equals(Object o) { } BalanceMutation balanceMutation = (BalanceMutation) o; return Objects.equals(this.balance, balanceMutation.balance) + && Objects.equals(this.isSetBalance, balanceMutation.isSetBalance) && Objects.equals(this.currency, balanceMutation.currency) + && Objects.equals(this.isSetCurrency, balanceMutation.isSetCurrency) && Objects.equals(this.received, balanceMutation.received) - && Objects.equals(this.reserved, balanceMutation.reserved); + && Objects.equals(this.isSetReceived, balanceMutation.isSetReceived) + && Objects.equals(this.reserved, balanceMutation.reserved) + && Objects.equals(this.isSetReserved, balanceMutation.isSetReserved); } @Override public int hashCode() { - return Objects.hash(balance, currency, received, reserved); + return Objects.hash( + balance, + isSetBalance, + currency, + isSetCurrency, + received, + isSetReceived, + reserved, + isSetReserved); } @Override @@ -238,6 +298,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..9379cdd31 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,23 @@ 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.isSetAccountHolder, bankAccountV3.isSetAccountHolder) + && Objects.equals(this.accountIdentification, bankAccountV3.accountIdentification) + && Objects.equals(this.isSetAccountIdentification, bankAccountV3.isSetAccountIdentification) + && Objects.equals(this.storedPaymentMethodId, bankAccountV3.storedPaymentMethodId) + && Objects.equals( + this.isSetStoredPaymentMethodId, bankAccountV3.isSetStoredPaymentMethodId); } @Override public int hashCode() { - return Objects.hash(accountHolder, accountIdentification); + return Objects.hash( + accountHolder, + isSetAccountHolder, + accountIdentification, + isSetAccountIdentification, + storedPaymentMethodId, + isSetStoredPaymentMethodId); } @Override @@ -125,6 +222,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 +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 (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..1bcead249 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. */ @@ -269,12 +307,14 @@ public boolean equals(Object o) { } BankCategoryData bankCategoryData = (BankCategoryData) o; return Objects.equals(this.priority, bankCategoryData.priority) - && Objects.equals(this.type, bankCategoryData.type); + && Objects.equals(this.isSetPriority, bankCategoryData.isSetPriority) + && Objects.equals(this.type, bankCategoryData.type) + && Objects.equals(this.isSetType, bankCategoryData.isSetType); } @Override public int hashCode() { - return Objects.hash(priority, type); + return Objects.hash(priority, isSetPriority, type, isSetType); } @Override @@ -297,6 +337,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..5325a8f1c 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. */ @@ -308,15 +361,31 @@ public boolean equals(Object o) { } CALocalAccountIdentification caLocalAccountIdentification = (CALocalAccountIdentification) o; return Objects.equals(this.accountNumber, caLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, caLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.accountType, caLocalAccountIdentification.accountType) + && Objects.equals(this.isSetAccountType, caLocalAccountIdentification.isSetAccountType) && Objects.equals(this.institutionNumber, caLocalAccountIdentification.institutionNumber) + && Objects.equals( + this.isSetInstitutionNumber, caLocalAccountIdentification.isSetInstitutionNumber) && Objects.equals(this.transitNumber, caLocalAccountIdentification.transitNumber) - && Objects.equals(this.type, caLocalAccountIdentification.type); + && Objects.equals(this.isSetTransitNumber, caLocalAccountIdentification.isSetTransitNumber) + && Objects.equals(this.type, caLocalAccountIdentification.type) + && Objects.equals(this.isSetType, caLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, accountType, institutionNumber, transitNumber, type); + return Objects.hash( + accountNumber, + isSetAccountNumber, + accountType, + isSetAccountType, + institutionNumber, + isSetInstitutionNumber, + transitNumber, + isSetTransitNumber, + type, + isSetType); } @Override @@ -342,6 +411,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..442215c6d 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. */ @@ -212,13 +255,17 @@ public boolean equals(Object o) { } CZLocalAccountIdentification czLocalAccountIdentification = (CZLocalAccountIdentification) o; return Objects.equals(this.accountNumber, czLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, czLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.bankCode, czLocalAccountIdentification.bankCode) - && Objects.equals(this.type, czLocalAccountIdentification.type); + && Objects.equals(this.isSetBankCode, czLocalAccountIdentification.isSetBankCode) + && Objects.equals(this.type, czLocalAccountIdentification.type) + && Objects.equals(this.isSetType, czLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, bankCode, type); + return Objects.hash( + accountNumber, isSetAccountNumber, bankCode, isSetBankCode, type, isSetType); } @Override @@ -242,6 +289,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..5e28e1f37 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. */ @@ -78,12 +111,13 @@ public boolean equals(Object o) { return false; } CancelTransfersRequest cancelTransfersRequest = (CancelTransfersRequest) o; - return Objects.equals(this.transferIds, cancelTransfersRequest.transferIds); + return Objects.equals(this.transferIds, cancelTransfersRequest.transferIds) + && Objects.equals(this.isSetTransferIds, cancelTransfersRequest.isSetTransferIds); } @Override public int hashCode() { - return Objects.hash(transferIds); + return Objects.hash(transferIds, isSetTransferIds); } @Override @@ -105,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 (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..729e42001 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. */ @@ -188,14 +236,19 @@ public boolean equals(Object o) { } CapitalBalance capitalBalance = (CapitalBalance) o; return Objects.equals(this.currency, capitalBalance.currency) + && Objects.equals(this.isSetCurrency, capitalBalance.isSetCurrency) && Objects.equals(this.fee, capitalBalance.fee) + && Objects.equals(this.isSetFee, capitalBalance.isSetFee) && Objects.equals(this.principal, capitalBalance.principal) - && Objects.equals(this.total, capitalBalance.total); + && Objects.equals(this.isSetPrincipal, capitalBalance.isSetPrincipal) + && Objects.equals(this.total, capitalBalance.total) + && Objects.equals(this.isSetTotal, capitalBalance.isSetTotal); } @Override public int hashCode() { - return Objects.hash(currency, fee, principal, total); + return Objects.hash( + currency, isSetCurrency, fee, isSetFee, principal, isSetPrincipal, total, isSetTotal); } @Override @@ -220,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 (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..cda663e06 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. */ @@ -435,20 +508,46 @@ public boolean equals(Object o) { } CapitalGrant capitalGrant = (CapitalGrant) o; return Objects.equals(this.amount, capitalGrant.amount) + && Objects.equals(this.isSetAmount, capitalGrant.isSetAmount) && Objects.equals(this.balances, capitalGrant.balances) + && Objects.equals(this.isSetBalances, capitalGrant.isSetBalances) && Objects.equals(this.counterparty, capitalGrant.counterparty) + && Objects.equals(this.isSetCounterparty, capitalGrant.isSetCounterparty) && Objects.equals(this.fee, capitalGrant.fee) + && Objects.equals(this.isSetFee, capitalGrant.isSetFee) && Objects.equals(this.grantAccountId, capitalGrant.grantAccountId) + && Objects.equals(this.isSetGrantAccountId, capitalGrant.isSetGrantAccountId) && Objects.equals(this.grantOfferId, capitalGrant.grantOfferId) + && Objects.equals(this.isSetGrantOfferId, capitalGrant.isSetGrantOfferId) && Objects.equals(this.id, capitalGrant.id) + && Objects.equals(this.isSetId, capitalGrant.isSetId) && Objects.equals(this.repayment, capitalGrant.repayment) - && Objects.equals(this.status, capitalGrant.status); + && Objects.equals(this.isSetRepayment, capitalGrant.isSetRepayment) + && Objects.equals(this.status, capitalGrant.status) + && Objects.equals(this.isSetStatus, capitalGrant.isSetStatus); } @Override public int hashCode() { return Objects.hash( - amount, balances, counterparty, fee, grantAccountId, grantOfferId, id, repayment, status); + amount, + isSetAmount, + balances, + isSetBalances, + counterparty, + isSetCounterparty, + fee, + isSetFee, + grantAccountId, + isSetGrantAccountId, + grantOfferId, + isSetGrantOfferId, + id, + isSetId, + repayment, + isSetRepayment, + status, + isSetStatus); } @Override @@ -478,6 +577,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..79981429e 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. */ @@ -151,13 +194,22 @@ public boolean equals(Object o) { } CapitalGrantInfo capitalGrantInfo = (CapitalGrantInfo) o; return Objects.equals(this.counterparty, capitalGrantInfo.counterparty) + && Objects.equals(this.isSetCounterparty, capitalGrantInfo.isSetCounterparty) && Objects.equals(this.grantAccountId, capitalGrantInfo.grantAccountId) - && Objects.equals(this.grantOfferId, capitalGrantInfo.grantOfferId); + && Objects.equals(this.isSetGrantAccountId, capitalGrantInfo.isSetGrantAccountId) + && Objects.equals(this.grantOfferId, capitalGrantInfo.grantOfferId) + && Objects.equals(this.isSetGrantOfferId, capitalGrantInfo.isSetGrantOfferId); } @Override public int hashCode() { - return Objects.hash(counterparty, grantAccountId, grantOfferId); + return Objects.hash( + counterparty, + isSetCounterparty, + grantAccountId, + isSetGrantAccountId, + grantOfferId, + isSetGrantOfferId); } @Override @@ -181,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 (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..a1b9c31d8 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. */ @@ -78,12 +111,13 @@ public boolean equals(Object o) { return false; } CapitalGrants capitalGrants = (CapitalGrants) o; - return Objects.equals(this.grants, capitalGrants.grants); + return Objects.equals(this.grants, capitalGrants.grants) + && Objects.equals(this.isSetGrants, capitalGrants.isSetGrants); } @Override public int hashCode() { - return Objects.hash(grants); + return Objects.hash(grants, isSetGrants); } @Override @@ -105,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 (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..bcbf09510 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. */ @@ -105,12 +143,14 @@ public boolean equals(Object o) { } Card card = (Card) o; return Objects.equals(this.cardHolder, card.cardHolder) - && Objects.equals(this.cardIdentification, card.cardIdentification); + && Objects.equals(this.isSetCardHolder, card.isSetCardHolder) + && Objects.equals(this.cardIdentification, card.cardIdentification) + && Objects.equals(this.isSetCardIdentification, card.isSetCardIdentification); } @Override public int hashCode() { - return Objects.hash(cardHolder, cardIdentification); + return Objects.hash(cardHolder, isSetCardHolder, cardIdentification, isSetCardIdentification); } @Override @@ -133,6 +173,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (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..c8370980f 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. */ @@ -332,18 +395,39 @@ public boolean equals(Object o) { } CardIdentification cardIdentification = (CardIdentification) o; return Objects.equals(this.expiryMonth, cardIdentification.expiryMonth) + && Objects.equals(this.isSetExpiryMonth, cardIdentification.isSetExpiryMonth) && Objects.equals(this.expiryYear, cardIdentification.expiryYear) + && Objects.equals(this.isSetExpiryYear, cardIdentification.isSetExpiryYear) && Objects.equals(this.issueNumber, cardIdentification.issueNumber) + && Objects.equals(this.isSetIssueNumber, cardIdentification.isSetIssueNumber) && Objects.equals(this.number, cardIdentification.number) + && Objects.equals(this.isSetNumber, cardIdentification.isSetNumber) && Objects.equals(this.startMonth, cardIdentification.startMonth) + && Objects.equals(this.isSetStartMonth, cardIdentification.isSetStartMonth) && Objects.equals(this.startYear, cardIdentification.startYear) - && Objects.equals(this.storedPaymentMethodId, cardIdentification.storedPaymentMethodId); + && Objects.equals(this.isSetStartYear, cardIdentification.isSetStartYear) + && Objects.equals(this.storedPaymentMethodId, cardIdentification.storedPaymentMethodId) + && Objects.equals( + this.isSetStoredPaymentMethodId, cardIdentification.isSetStoredPaymentMethodId); } @Override public int hashCode() { return Objects.hash( - expiryMonth, expiryYear, issueNumber, number, startMonth, startYear, storedPaymentMethodId); + expiryMonth, + isSetExpiryMonth, + expiryYear, + isSetExpiryYear, + issueNumber, + isSetIssueNumber, + number, + isSetNumber, + startMonth, + isSetStartMonth, + startYear, + isSetStartYear, + storedPaymentMethodId, + isSetStoredPaymentMethodId); } @Override @@ -373,6 +457,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..116e9466c 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. */ @@ -217,12 +255,14 @@ public boolean equals(Object o) { } ConfirmationTrackingData confirmationTrackingData = (ConfirmationTrackingData) o; return Objects.equals(this.status, confirmationTrackingData.status) - && Objects.equals(this.type, confirmationTrackingData.type); + && Objects.equals(this.isSetStatus, confirmationTrackingData.isSetStatus) + && Objects.equals(this.type, confirmationTrackingData.type) + && Objects.equals(this.isSetType, confirmationTrackingData.isSetType); } @Override public int hashCode() { - return Objects.hash(status, type); + return Objects.hash(status, isSetStatus, type, isSetType); } @Override @@ -245,6 +285,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..1d02f4d09 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. */ @@ -163,13 +206,22 @@ public boolean equals(Object o) { } Counterparty counterparty = (Counterparty) o; return Objects.equals(this.accountHolderId, counterparty.accountHolderId) + && Objects.equals(this.isSetAccountHolderId, counterparty.isSetAccountHolderId) && Objects.equals(this.balanceAccountId, counterparty.balanceAccountId) - && Objects.equals(this.transferInstrumentId, counterparty.transferInstrumentId); + && Objects.equals(this.isSetBalanceAccountId, counterparty.isSetBalanceAccountId) + && Objects.equals(this.transferInstrumentId, counterparty.transferInstrumentId) + && Objects.equals(this.isSetTransferInstrumentId, counterparty.isSetTransferInstrumentId); } @Override public int hashCode() { - return Objects.hash(accountHolderId, balanceAccountId, transferInstrumentId); + return Objects.hash( + accountHolderId, + isSetAccountHolderId, + balanceAccountId, + isSetBalanceAccountId, + transferInstrumentId, + isSetTransferInstrumentId); } @Override @@ -195,6 +247,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..e0d74dbc2 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. */ @@ -194,14 +242,27 @@ public boolean equals(Object o) { } CounterpartyInfoV3 counterpartyInfoV3 = (CounterpartyInfoV3) o; return Objects.equals(this.balanceAccountId, counterpartyInfoV3.balanceAccountId) + && Objects.equals(this.isSetBalanceAccountId, counterpartyInfoV3.isSetBalanceAccountId) && Objects.equals(this.bankAccount, counterpartyInfoV3.bankAccount) + && Objects.equals(this.isSetBankAccount, counterpartyInfoV3.isSetBankAccount) && Objects.equals(this.card, counterpartyInfoV3.card) - && Objects.equals(this.transferInstrumentId, counterpartyInfoV3.transferInstrumentId); + && Objects.equals(this.isSetCard, counterpartyInfoV3.isSetCard) + && Objects.equals(this.transferInstrumentId, counterpartyInfoV3.transferInstrumentId) + && Objects.equals( + this.isSetTransferInstrumentId, counterpartyInfoV3.isSetTransferInstrumentId); } @Override public int hashCode() { - return Objects.hash(balanceAccountId, bankAccount, card, transferInstrumentId); + return Objects.hash( + balanceAccountId, + isSetBalanceAccountId, + bankAccount, + isSetBankAccount, + card, + isSetCard, + transferInstrumentId, + isSetTransferInstrumentId); } @Override @@ -228,6 +289,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..57bd81164 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. */ @@ -231,15 +284,30 @@ public boolean equals(Object o) { } CounterpartyV3 counterpartyV3 = (CounterpartyV3) o; return Objects.equals(this.balanceAccountId, counterpartyV3.balanceAccountId) + && Objects.equals(this.isSetBalanceAccountId, counterpartyV3.isSetBalanceAccountId) && Objects.equals(this.bankAccount, counterpartyV3.bankAccount) + && Objects.equals(this.isSetBankAccount, counterpartyV3.isSetBankAccount) && Objects.equals(this.card, counterpartyV3.card) + && Objects.equals(this.isSetCard, counterpartyV3.isSetCard) && Objects.equals(this.merchant, counterpartyV3.merchant) - && Objects.equals(this.transferInstrumentId, counterpartyV3.transferInstrumentId); + && Objects.equals(this.isSetMerchant, counterpartyV3.isSetMerchant) + && Objects.equals(this.transferInstrumentId, counterpartyV3.transferInstrumentId) + && Objects.equals(this.isSetTransferInstrumentId, counterpartyV3.isSetTransferInstrumentId); } @Override public int hashCode() { - return Objects.hash(balanceAccountId, bankAccount, card, merchant, transferInstrumentId); + return Objects.hash( + balanceAccountId, + isSetBalanceAccountId, + bankAccount, + isSetBankAccount, + card, + isSetCard, + merchant, + isSetMerchant, + transferInstrumentId, + isSetTransferInstrumentId); } @Override @@ -267,6 +335,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..38f7b9bd7 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. */ @@ -192,13 +235,17 @@ public boolean equals(Object o) { } DKLocalAccountIdentification dkLocalAccountIdentification = (DKLocalAccountIdentification) o; return Objects.equals(this.accountNumber, dkLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, dkLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.bankCode, dkLocalAccountIdentification.bankCode) - && Objects.equals(this.type, dkLocalAccountIdentification.type); + && Objects.equals(this.isSetBankCode, dkLocalAccountIdentification.isSetBankCode) + && Objects.equals(this.type, dkLocalAccountIdentification.type) + && Objects.equals(this.isSetType, dkLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, bankCode, type); + return Objects.hash( + accountNumber, isSetAccountNumber, bankCode, isSetBankCode, type, isSetType); } @Override @@ -222,6 +269,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..20dd43393 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. */ @@ -195,14 +243,26 @@ public boolean equals(Object o) { } DirectDebitInformation directDebitInformation = (DirectDebitInformation) o; return Objects.equals(this.dateOfSignature, directDebitInformation.dateOfSignature) + && Objects.equals(this.isSetDateOfSignature, directDebitInformation.isSetDateOfSignature) && Objects.equals(this.dueDate, directDebitInformation.dueDate) + && Objects.equals(this.isSetDueDate, directDebitInformation.isSetDueDate) && Objects.equals(this.mandateId, directDebitInformation.mandateId) - && Objects.equals(this.sequenceType, directDebitInformation.sequenceType); + && Objects.equals(this.isSetMandateId, directDebitInformation.isSetMandateId) + && Objects.equals(this.sequenceType, directDebitInformation.sequenceType) + && Objects.equals(this.isSetSequenceType, directDebitInformation.isSetSequenceType); } @Override public int hashCode() { - return Objects.hash(dateOfSignature, dueDate, mandateId, sequenceType); + return Objects.hash( + dateOfSignature, + isSetDateOfSignature, + dueDate, + isSetDueDate, + mandateId, + isSetMandateId, + sequenceType, + isSetSequenceType); } @Override @@ -227,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 (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..5981821ac 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. */ @@ -162,12 +200,15 @@ public boolean equals(Object o) { } EstimationTrackingData estimationTrackingData = (EstimationTrackingData) o; return Objects.equals(this.estimatedArrivalTime, estimationTrackingData.estimatedArrivalTime) - && Objects.equals(this.type, estimationTrackingData.type); + && Objects.equals( + this.isSetEstimatedArrivalTime, estimationTrackingData.isSetEstimatedArrivalTime) + && Objects.equals(this.type, estimationTrackingData.type) + && Objects.equals(this.isSetType, estimationTrackingData.isSetType); } @Override public int hashCode() { - return Objects.hash(estimatedArrivalTime, type); + return Objects.hash(estimatedArrivalTime, isSetEstimatedArrivalTime, type, isSetType); } @Override @@ -192,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 (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..e20b135b9 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. */ @@ -136,12 +174,14 @@ public boolean equals(Object o) { } ExecutionDate executionDate = (ExecutionDate) o; return Objects.equals(this.date, executionDate.date) - && Objects.equals(this.timezone, executionDate.timezone); + && Objects.equals(this.isSetDate, executionDate.isSetDate) + && Objects.equals(this.timezone, executionDate.timezone) + && Objects.equals(this.isSetTimezone, executionDate.isSetTimezone); } @Override public int hashCode() { - return Objects.hash(date, timezone); + return Objects.hash(date, isSetDate, timezone, isSetTimezone); } @Override @@ -164,6 +204,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..52d443dc3 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. */ @@ -145,13 +188,16 @@ public boolean equals(Object o) { } ExternalReason externalReason = (ExternalReason) o; return Objects.equals(this.code, externalReason.code) + && Objects.equals(this.isSetCode, externalReason.isSetCode) && Objects.equals(this.description, externalReason.description) - && Objects.equals(this.namespace, externalReason.namespace); + && Objects.equals(this.isSetDescription, externalReason.isSetDescription) + && Objects.equals(this.namespace, externalReason.namespace) + && Objects.equals(this.isSetNamespace, externalReason.isSetNamespace); } @Override public int hashCode() { - return Objects.hash(code, description, namespace); + return Objects.hash(code, isSetCode, description, isSetDescription, namespace, isSetNamespace); } @Override @@ -175,6 +221,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (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..12aa1f9e3 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. */ @@ -68,12 +101,13 @@ public boolean equals(Object o) { return false; } Fee fee = (Fee) o; - return Objects.equals(this.amount, fee.amount); + return Objects.equals(this.amount, fee.amount) + && Objects.equals(this.isSetAmount, fee.isSetAmount); } @Override public int hashCode() { - return Objects.hash(amount); + return Objects.hash(amount, isSetAmount); } @Override @@ -95,6 +129,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (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..04cbde9e6 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. */ @@ -118,12 +156,14 @@ public boolean equals(Object o) { } FindTransfersResponse findTransfersResponse = (FindTransfersResponse) o; return Objects.equals(this.links, findTransfersResponse.links) - && Objects.equals(this.data, findTransfersResponse.data); + && Objects.equals(this.isSetLinks, findTransfersResponse.isSetLinks) + && Objects.equals(this.data, findTransfersResponse.data) + && Objects.equals(this.isSetData, findTransfersResponse.isSetData); } @Override public int hashCode() { - return Objects.hash(links, data); + return Objects.hash(links, isSetLinks, data, isSetData); } @Override @@ -146,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 (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..b68018e81 --- /dev/null +++ b/src/main/java/com/adyen/model/transfers/FundingInstrument.java @@ -0,0 +1,398 @@ +/* + * 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.isSetCardIdentification, fundingInstrument.isSetCardIdentification) + && Objects.equals(this.networkPaymentReference, fundingInstrument.networkPaymentReference) + && Objects.equals( + this.isSetNetworkPaymentReference, fundingInstrument.isSetNetworkPaymentReference) + && Objects.equals(this.reference, fundingInstrument.reference) + && Objects.equals(this.isSetReference, fundingInstrument.isSetReference) + && Objects.equals(this.sourceOfFunds, fundingInstrument.sourceOfFunds) + && Objects.equals(this.isSetSourceOfFunds, fundingInstrument.isSetSourceOfFunds); + } + + @Override + public int hashCode() { + return Objects.hash( + cardIdentification, + isSetCardIdentification, + networkPaymentReference, + isSetNetworkPaymentReference, + reference, + isSetReference, + sourceOfFunds, + isSetSourceOfFunds); + } + + @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..cb959913d 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. */ @@ -194,13 +237,17 @@ public boolean equals(Object o) { } HKLocalAccountIdentification hkLocalAccountIdentification = (HKLocalAccountIdentification) o; return Objects.equals(this.accountNumber, hkLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, hkLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.clearingCode, hkLocalAccountIdentification.clearingCode) - && Objects.equals(this.type, hkLocalAccountIdentification.type); + && Objects.equals(this.isSetClearingCode, hkLocalAccountIdentification.isSetClearingCode) + && Objects.equals(this.type, hkLocalAccountIdentification.type) + && Objects.equals(this.isSetType, hkLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, clearingCode, type); + return Objects.hash( + accountNumber, isSetAccountNumber, clearingCode, isSetClearingCode, type, isSetType); } @Override @@ -224,6 +271,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..84dcf415d 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. */ @@ -151,12 +189,14 @@ public boolean equals(Object o) { } HULocalAccountIdentification huLocalAccountIdentification = (HULocalAccountIdentification) o; return Objects.equals(this.accountNumber, huLocalAccountIdentification.accountNumber) - && Objects.equals(this.type, huLocalAccountIdentification.type); + && Objects.equals(this.isSetAccountNumber, huLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.type, huLocalAccountIdentification.type) + && Objects.equals(this.isSetType, huLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, type); + return Objects.hash(accountNumber, isSetAccountNumber, type, isSetType); } @Override @@ -179,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 (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..c7c690cca 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. */ @@ -157,12 +195,14 @@ public boolean equals(Object o) { } IbanAccountIdentification ibanAccountIdentification = (IbanAccountIdentification) o; return Objects.equals(this.iban, ibanAccountIdentification.iban) - && Objects.equals(this.type, ibanAccountIdentification.type); + && Objects.equals(this.isSetIban, ibanAccountIdentification.isSetIban) + && Objects.equals(this.type, ibanAccountIdentification.type) + && Objects.equals(this.isSetType, ibanAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(iban, type); + return Objects.hash(iban, isSetIban, type, isSetType); } @Override @@ -185,6 +225,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..81e81edfe 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. */ @@ -193,14 +236,26 @@ public boolean equals(Object o) { InternalCategoryData internalCategoryData = (InternalCategoryData) o; return Objects.equals( this.modificationMerchantReference, internalCategoryData.modificationMerchantReference) + && Objects.equals( + this.isSetModificationMerchantReference, + internalCategoryData.isSetModificationMerchantReference) && Objects.equals( this.modificationPspReference, internalCategoryData.modificationPspReference) - && Objects.equals(this.type, internalCategoryData.type); + && Objects.equals( + this.isSetModificationPspReference, internalCategoryData.isSetModificationPspReference) + && Objects.equals(this.type, internalCategoryData.type) + && Objects.equals(this.isSetType, internalCategoryData.isSetType); } @Override public int hashCode() { - return Objects.hash(modificationMerchantReference, modificationPspReference, type); + return Objects.hash( + modificationMerchantReference, + isSetModificationMerchantReference, + modificationPspReference, + isSetModificationPspReference, + type, + isSetType); } @Override @@ -228,6 +283,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..87eb45f38 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. */ @@ -312,13 +355,16 @@ public boolean equals(Object o) { } InternalReviewTrackingData internalReviewTrackingData = (InternalReviewTrackingData) o; return Objects.equals(this.reason, internalReviewTrackingData.reason) + && Objects.equals(this.isSetReason, internalReviewTrackingData.isSetReason) && Objects.equals(this.status, internalReviewTrackingData.status) - && Objects.equals(this.type, internalReviewTrackingData.type); + && Objects.equals(this.isSetStatus, internalReviewTrackingData.isSetStatus) + && Objects.equals(this.type, internalReviewTrackingData.type) + && Objects.equals(this.isSetType, internalReviewTrackingData.isSetType); } @Override public int hashCode() { - return Objects.hash(reason, status, type); + return Objects.hash(reason, isSetReason, status, isSetStatus, type, isSetType); } @Override @@ -342,6 +388,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..f2ab81bb7 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. */ @@ -145,13 +188,16 @@ public boolean equals(Object o) { } InvalidField invalidField = (InvalidField) o; return Objects.equals(this.message, invalidField.message) + && Objects.equals(this.isSetMessage, invalidField.isSetMessage) && Objects.equals(this.name, invalidField.name) - && Objects.equals(this.value, invalidField.value); + && Objects.equals(this.isSetName, invalidField.isSetName) + && Objects.equals(this.value, invalidField.value) + && Objects.equals(this.isSetValue, invalidField.isSetValue); } @Override public int hashCode() { - return Objects.hash(message, name, value); + return Objects.hash(message, isSetMessage, name, isSetName, value, isSetValue); } @Override @@ -175,6 +221,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (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..8ddbfb68e 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. */ @@ -588,28 +661,48 @@ public boolean equals(Object o) { } IssuedCard issuedCard = (IssuedCard) o; return Objects.equals(this.authorisationType, issuedCard.authorisationType) + && Objects.equals(this.isSetAuthorisationType, issuedCard.isSetAuthorisationType) && Objects.equals(this.panEntryMode, issuedCard.panEntryMode) + && Objects.equals(this.isSetPanEntryMode, issuedCard.isSetPanEntryMode) && Objects.equals(this.processingType, issuedCard.processingType) + && Objects.equals(this.isSetProcessingType, issuedCard.isSetProcessingType) && Objects.equals(this.relayedAuthorisationData, issuedCard.relayedAuthorisationData) + && Objects.equals( + this.isSetRelayedAuthorisationData, issuedCard.isSetRelayedAuthorisationData) && Objects.equals(this.schemeTraceId, issuedCard.schemeTraceId) + && Objects.equals(this.isSetSchemeTraceId, issuedCard.isSetSchemeTraceId) && Objects.equals(this.schemeUniqueTransactionId, issuedCard.schemeUniqueTransactionId) + && Objects.equals( + this.isSetSchemeUniqueTransactionId, issuedCard.isSetSchemeUniqueTransactionId) && Objects.equals(this.threeDSecure, issuedCard.threeDSecure) + && Objects.equals(this.isSetThreeDSecure, issuedCard.isSetThreeDSecure) && Objects.equals(this.type, issuedCard.type) - && Objects.equals(this.validationFacts, issuedCard.validationFacts); + && Objects.equals(this.isSetType, issuedCard.isSetType) + && Objects.equals(this.validationFacts, issuedCard.validationFacts) + && Objects.equals(this.isSetValidationFacts, issuedCard.isSetValidationFacts); } @Override public int hashCode() { return Objects.hash( authorisationType, + isSetAuthorisationType, panEntryMode, + isSetPanEntryMode, processingType, + isSetProcessingType, relayedAuthorisationData, + isSetRelayedAuthorisationData, schemeTraceId, + isSetSchemeTraceId, schemeUniqueTransactionId, + isSetSchemeUniqueTransactionId, threeDSecure, + isSetThreeDSecure, type, - validationFacts); + isSetType, + validationFacts, + isSetValidationFacts); } @Override @@ -643,6 +736,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..04c4d3358 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. */ @@ -160,12 +198,14 @@ public boolean equals(Object o) { } IssuingTransactionData issuingTransactionData = (IssuingTransactionData) o; return Objects.equals(this.captureCycleId, issuingTransactionData.captureCycleId) - && Objects.equals(this.type, issuingTransactionData.type); + && Objects.equals(this.isSetCaptureCycleId, issuingTransactionData.isSetCaptureCycleId) + && Objects.equals(this.type, issuingTransactionData.type) + && Objects.equals(this.isSetType, issuingTransactionData.isSetType); } @Override public int hashCode() { - return Objects.hash(captureCycleId, type); + return Objects.hash(captureCycleId, isSetCaptureCycleId, type, isSetType); } @Override @@ -188,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 (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..585a75c90 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. */ @@ -268,22 +326,34 @@ public boolean equals(Object o) { } Leg leg = (Leg) o; return Objects.equals(this.arrivalAirportCode, leg.arrivalAirportCode) + && Objects.equals(this.isSetArrivalAirportCode, leg.isSetArrivalAirportCode) && Objects.equals(this.basicFareCode, leg.basicFareCode) + && Objects.equals(this.isSetBasicFareCode, leg.isSetBasicFareCode) && Objects.equals(this.carrierCode, leg.carrierCode) + && Objects.equals(this.isSetCarrierCode, leg.isSetCarrierCode) && Objects.equals(this.departureAirportCode, leg.departureAirportCode) + && Objects.equals(this.isSetDepartureAirportCode, leg.isSetDepartureAirportCode) && Objects.equals(this.departureDate, leg.departureDate) - && Objects.equals(this.flightNumber, leg.flightNumber); + && Objects.equals(this.isSetDepartureDate, leg.isSetDepartureDate) + && Objects.equals(this.flightNumber, leg.flightNumber) + && Objects.equals(this.isSetFlightNumber, leg.isSetFlightNumber); } @Override public int hashCode() { return Objects.hash( arrivalAirportCode, + isSetArrivalAirportCode, basicFareCode, + isSetBasicFareCode, carrierCode, + isSetCarrierCode, departureAirportCode, + isSetDepartureAirportCode, departureDate, - flightNumber); + isSetDepartureDate, + flightNumber, + isSetFlightNumber); } @Override @@ -312,6 +382,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..34db842ac 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. */ @@ -68,12 +101,12 @@ public boolean equals(Object o) { return false; } Link link = (Link) o; - return Objects.equals(this.href, link.href); + return Objects.equals(this.href, link.href) && Objects.equals(this.isSetHref, link.isSetHref); } @Override public int hashCode() { - return Objects.hash(href); + return Objects.hash(href, isSetHref); } @Override @@ -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..56d87e22c 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. */ @@ -104,12 +142,15 @@ public boolean equals(Object o) { return false; } Links links = (Links) o; - return Objects.equals(this.next, links.next) && Objects.equals(this.prev, links.prev); + return Objects.equals(this.next, links.next) + && Objects.equals(this.isSetNext, links.isSetNext) + && Objects.equals(this.prev, links.prev) + && Objects.equals(this.isSetPrev, links.isSetPrev); } @Override public int hashCode() { - return Objects.hash(next, prev); + return Objects.hash(next, isSetNext, prev, isSetPrev); } @Override @@ -132,6 +173,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (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..97767c25d 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. */ @@ -105,12 +143,14 @@ public boolean equals(Object o) { } Lodging lodging = (Lodging) o; return Objects.equals(this.checkInDate, lodging.checkInDate) - && Objects.equals(this.numberOfNights, lodging.numberOfNights); + && Objects.equals(this.isSetCheckInDate, lodging.isSetCheckInDate) + && Objects.equals(this.numberOfNights, lodging.numberOfNights) + && Objects.equals(this.isSetNumberOfNights, lodging.isSetNumberOfNights); } @Override public int hashCode() { - return Objects.hash(checkInDate, numberOfNights); + return Objects.hash(checkInDate, isSetCheckInDate, numberOfNights, isSetNumberOfNights); } @Override @@ -133,6 +173,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (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..5fad8f6c0 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. */ @@ -219,15 +272,30 @@ public boolean equals(Object o) { } MerchantData merchantData = (MerchantData) o; return Objects.equals(this.acquirerId, merchantData.acquirerId) + && Objects.equals(this.isSetAcquirerId, merchantData.isSetAcquirerId) && Objects.equals(this.mcc, merchantData.mcc) + && Objects.equals(this.isSetMcc, merchantData.isSetMcc) && Objects.equals(this.merchantId, merchantData.merchantId) + && Objects.equals(this.isSetMerchantId, merchantData.isSetMerchantId) && Objects.equals(this.nameLocation, merchantData.nameLocation) - && Objects.equals(this.postalCode, merchantData.postalCode); + && Objects.equals(this.isSetNameLocation, merchantData.isSetNameLocation) + && Objects.equals(this.postalCode, merchantData.postalCode) + && Objects.equals(this.isSetPostalCode, merchantData.isSetPostalCode); } @Override public int hashCode() { - return Objects.hash(acquirerId, mcc, merchantId, nameLocation, postalCode); + return Objects.hash( + acquirerId, + isSetAcquirerId, + mcc, + isSetMcc, + merchantId, + isSetMerchantId, + nameLocation, + isSetNameLocation, + postalCode, + isSetPostalCode); } @Override @@ -253,6 +321,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..c7afd2d53 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. */ @@ -203,13 +246,16 @@ public boolean equals(Object o) { } MerchantPurchaseData merchantPurchaseData = (MerchantPurchaseData) o; return Objects.equals(this.airline, merchantPurchaseData.airline) + && Objects.equals(this.isSetAirline, merchantPurchaseData.isSetAirline) && Objects.equals(this.lodging, merchantPurchaseData.lodging) - && Objects.equals(this.type, merchantPurchaseData.type); + && Objects.equals(this.isSetLodging, merchantPurchaseData.isSetLodging) + && Objects.equals(this.type, merchantPurchaseData.type) + && Objects.equals(this.isSetType, merchantPurchaseData.isSetType); } @Override public int hashCode() { - return Objects.hash(airline, lodging, type); + return Objects.hash(airline, isSetAirline, lodging, isSetLodging, type, isSetType); } @Override @@ -233,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 (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..9774b2afc 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. */ @@ -394,15 +447,30 @@ public boolean equals(Object o) { } Modification modification = (Modification) o; return Objects.equals(this.direction, modification.direction) + && Objects.equals(this.isSetDirection, modification.isSetDirection) && Objects.equals(this.id, modification.id) + && Objects.equals(this.isSetId, modification.isSetId) && Objects.equals(this.reference, modification.reference) + && Objects.equals(this.isSetReference, modification.isSetReference) && Objects.equals(this.status, modification.status) - && Objects.equals(this.type, modification.type); + && Objects.equals(this.isSetStatus, modification.isSetStatus) + && Objects.equals(this.type, modification.type) + && Objects.equals(this.isSetType, modification.isSetType); } @Override public int hashCode() { - return Objects.hash(direction, id, reference, status, type); + return Objects.hash( + direction, + isSetDirection, + id, + isSetId, + reference, + isSetReference, + status, + isSetStatus, + type, + isSetType); } @Override @@ -428,6 +496,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..d21f0ab66 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. */ @@ -151,12 +189,14 @@ public boolean equals(Object o) { } NOLocalAccountIdentification noLocalAccountIdentification = (NOLocalAccountIdentification) o; return Objects.equals(this.accountNumber, noLocalAccountIdentification.accountNumber) - && Objects.equals(this.type, noLocalAccountIdentification.type); + && Objects.equals(this.isSetAccountNumber, noLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.type, noLocalAccountIdentification.type) + && Objects.equals(this.isSetType, noLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, type); + return Objects.hash(accountNumber, isSetAccountNumber, type, isSetType); } @Override @@ -179,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 (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..9d6a292fa 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. */ @@ -163,12 +201,14 @@ public boolean equals(Object o) { } NZLocalAccountIdentification nzLocalAccountIdentification = (NZLocalAccountIdentification) o; return Objects.equals(this.accountNumber, nzLocalAccountIdentification.accountNumber) - && Objects.equals(this.type, nzLocalAccountIdentification.type); + && Objects.equals(this.isSetAccountNumber, nzLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.type, nzLocalAccountIdentification.type) + && Objects.equals(this.isSetType, nzLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, type); + return Objects.hash(accountNumber, isSetAccountNumber, type, isSetType); } @Override @@ -191,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 (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..60307e0d7 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. */ @@ -274,16 +332,34 @@ public boolean equals(Object o) { } NameLocation nameLocation = (NameLocation) o; return Objects.equals(this.city, nameLocation.city) + && Objects.equals(this.isSetCity, nameLocation.isSetCity) && Objects.equals(this.country, nameLocation.country) + && Objects.equals(this.isSetCountry, nameLocation.isSetCountry) && Objects.equals(this.countryOfOrigin, nameLocation.countryOfOrigin) + && Objects.equals(this.isSetCountryOfOrigin, nameLocation.isSetCountryOfOrigin) && Objects.equals(this.name, nameLocation.name) + && Objects.equals(this.isSetName, nameLocation.isSetName) && Objects.equals(this.rawData, nameLocation.rawData) - && Objects.equals(this.state, nameLocation.state); + && Objects.equals(this.isSetRawData, nameLocation.isSetRawData) + && Objects.equals(this.state, nameLocation.state) + && Objects.equals(this.isSetState, nameLocation.isSetState); } @Override public int hashCode() { - return Objects.hash(city, country, countryOfOrigin, name, rawData, state); + return Objects.hash( + city, + isSetCity, + country, + isSetCountry, + countryOfOrigin, + isSetCountryOfOrigin, + name, + isSetName, + rawData, + isSetRawData, + state, + isSetState); } @Override @@ -310,6 +386,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..8ad3d6c54 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. */ @@ -239,16 +287,31 @@ public boolean equals(Object o) { NumberAndBicAccountIdentification numberAndBicAccountIdentification = (NumberAndBicAccountIdentification) o; return Objects.equals(this.accountNumber, numberAndBicAccountIdentification.accountNumber) + && Objects.equals( + this.isSetAccountNumber, numberAndBicAccountIdentification.isSetAccountNumber) && Objects.equals( this.additionalBankIdentification, numberAndBicAccountIdentification.additionalBankIdentification) + && Objects.equals( + this.isSetAdditionalBankIdentification, + numberAndBicAccountIdentification.isSetAdditionalBankIdentification) && Objects.equals(this.bic, numberAndBicAccountIdentification.bic) - && Objects.equals(this.type, numberAndBicAccountIdentification.type); + && Objects.equals(this.isSetBic, numberAndBicAccountIdentification.isSetBic) + && Objects.equals(this.type, numberAndBicAccountIdentification.type) + && Objects.equals(this.isSetType, numberAndBicAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, additionalBankIdentification, bic, type); + return Objects.hash( + accountNumber, + isSetAccountNumber, + additionalBankIdentification, + isSetAdditionalBankIdentification, + bic, + isSetBic, + type, + isSetType); } @Override @@ -275,6 +338,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..63f08af04 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. */ @@ -163,12 +201,14 @@ public boolean equals(Object o) { } PLLocalAccountIdentification plLocalAccountIdentification = (PLLocalAccountIdentification) o; return Objects.equals(this.accountNumber, plLocalAccountIdentification.accountNumber) - && Objects.equals(this.type, plLocalAccountIdentification.type); + && Objects.equals(this.isSetAccountNumber, plLocalAccountIdentification.isSetAccountNumber) + && Objects.equals(this.type, plLocalAccountIdentification.type) + && Objects.equals(this.isSetType, plLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, type); + return Objects.hash(accountNumber, isSetAccountNumber, type, isSetType); } @Override @@ -191,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 (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..025a14a8a 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. */ @@ -491,20 +564,46 @@ public boolean equals(Object o) { } PartyIdentification partyIdentification = (PartyIdentification) o; return Objects.equals(this.address, partyIdentification.address) + && Objects.equals(this.isSetAddress, partyIdentification.isSetAddress) && Objects.equals(this.dateOfBirth, partyIdentification.dateOfBirth) + && Objects.equals(this.isSetDateOfBirth, partyIdentification.isSetDateOfBirth) && Objects.equals(this.email, partyIdentification.email) + && Objects.equals(this.isSetEmail, partyIdentification.isSetEmail) && Objects.equals(this.firstName, partyIdentification.firstName) + && Objects.equals(this.isSetFirstName, partyIdentification.isSetFirstName) && Objects.equals(this.fullName, partyIdentification.fullName) + && Objects.equals(this.isSetFullName, partyIdentification.isSetFullName) && Objects.equals(this.lastName, partyIdentification.lastName) + && Objects.equals(this.isSetLastName, partyIdentification.isSetLastName) && Objects.equals(this.reference, partyIdentification.reference) + && Objects.equals(this.isSetReference, partyIdentification.isSetReference) && Objects.equals(this.type, partyIdentification.type) - && Objects.equals(this.url, partyIdentification.url); + && Objects.equals(this.isSetType, partyIdentification.isSetType) + && Objects.equals(this.url, partyIdentification.url) + && Objects.equals(this.isSetUrl, partyIdentification.isSetUrl); } @Override public int hashCode() { return Objects.hash( - address, dateOfBirth, email, firstName, fullName, lastName, reference, type, url); + address, + isSetAddress, + dateOfBirth, + isSetDateOfBirth, + email, + isSetEmail, + firstName, + isSetFirstName, + fullName, + isSetFullName, + lastName, + isSetLastName, + reference, + isSetReference, + type, + isSetType, + url, + isSetUrl); } @Override @@ -534,6 +633,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..ff8adbba5 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. */ @@ -182,14 +230,26 @@ public boolean equals(Object o) { } PaymentInstrument paymentInstrument = (PaymentInstrument) o; return Objects.equals(this.description, paymentInstrument.description) + && Objects.equals(this.isSetDescription, paymentInstrument.isSetDescription) && Objects.equals(this.id, paymentInstrument.id) + && Objects.equals(this.isSetId, paymentInstrument.isSetId) && Objects.equals(this.reference, paymentInstrument.reference) - && Objects.equals(this.tokenType, paymentInstrument.tokenType); + && Objects.equals(this.isSetReference, paymentInstrument.isSetReference) + && Objects.equals(this.tokenType, paymentInstrument.tokenType) + && Objects.equals(this.isSetTokenType, paymentInstrument.isSetTokenType); } @Override public int hashCode() { - return Objects.hash(description, id, reference, tokenType); + return Objects.hash( + description, + isSetDescription, + id, + isSetId, + reference, + isSetReference, + tokenType, + isSetTokenType); } @Override @@ -214,6 +274,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..896cf96cb 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. */ @@ -520,22 +578,38 @@ public boolean equals(Object o) { PlatformPayment platformPayment = (PlatformPayment) o; return Objects.equals( this.modificationMerchantReference, platformPayment.modificationMerchantReference) + && Objects.equals( + this.isSetModificationMerchantReference, + platformPayment.isSetModificationMerchantReference) && Objects.equals(this.modificationPspReference, platformPayment.modificationPspReference) + && Objects.equals( + this.isSetModificationPspReference, platformPayment.isSetModificationPspReference) && Objects.equals(this.paymentMerchantReference, platformPayment.paymentMerchantReference) + && Objects.equals( + this.isSetPaymentMerchantReference, platformPayment.isSetPaymentMerchantReference) && Objects.equals(this.platformPaymentType, platformPayment.platformPaymentType) + && Objects.equals(this.isSetPlatformPaymentType, platformPayment.isSetPlatformPaymentType) && Objects.equals(this.pspPaymentReference, platformPayment.pspPaymentReference) - && Objects.equals(this.type, platformPayment.type); + && Objects.equals(this.isSetPspPaymentReference, platformPayment.isSetPspPaymentReference) + && Objects.equals(this.type, platformPayment.type) + && Objects.equals(this.isSetType, platformPayment.isSetType); } @Override public int hashCode() { return Objects.hash( modificationMerchantReference, + isSetModificationMerchantReference, modificationPspReference, + isSetModificationPspReference, paymentMerchantReference, + isSetPaymentMerchantReference, platformPaymentType, + isSetPlatformPaymentType, pspPaymentReference, - type); + isSetPspPaymentReference, + type, + isSetType); } @Override @@ -572,6 +646,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..94c72a1e0 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. */ @@ -124,12 +162,14 @@ public boolean equals(Object o) { } RelayedAuthorisationData relayedAuthorisationData = (RelayedAuthorisationData) o; return Objects.equals(this.metadata, relayedAuthorisationData.metadata) - && Objects.equals(this.reference, relayedAuthorisationData.reference); + && Objects.equals(this.isSetMetadata, relayedAuthorisationData.isSetMetadata) + && Objects.equals(this.reference, relayedAuthorisationData.reference) + && Objects.equals(this.isSetReference, relayedAuthorisationData.isSetReference); } @Override public int hashCode() { - return Objects.hash(metadata, reference); + return Objects.hash(metadata, isSetMetadata, reference, isSetReference); } @Override @@ -152,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 (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..5659905bd 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. */ @@ -151,13 +194,16 @@ public boolean equals(Object o) { } Repayment repayment = (Repayment) o; return Objects.equals(this.basisPoints, repayment.basisPoints) + && Objects.equals(this.isSetBasisPoints, repayment.isSetBasisPoints) && Objects.equals(this.term, repayment.term) - && Objects.equals(this.threshold, repayment.threshold); + && Objects.equals(this.isSetTerm, repayment.isSetTerm) + && Objects.equals(this.threshold, repayment.threshold) + && Objects.equals(this.isSetThreshold, repayment.isSetThreshold); } @Override public int hashCode() { - return Objects.hash(basisPoints, term, threshold); + return Objects.hash(basisPoints, isSetBasisPoints, term, isSetTerm, threshold, isSetThreshold); } @Override @@ -181,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 (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..d6bb08354 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. */ @@ -114,12 +152,14 @@ public boolean equals(Object o) { } RepaymentTerm repaymentTerm = (RepaymentTerm) o; return Objects.equals(this.estimatedDays, repaymentTerm.estimatedDays) - && Objects.equals(this.maximumDays, repaymentTerm.maximumDays); + && Objects.equals(this.isSetEstimatedDays, repaymentTerm.isSetEstimatedDays) + && Objects.equals(this.maximumDays, repaymentTerm.maximumDays) + && Objects.equals(this.isSetMaximumDays, repaymentTerm.isSetMaximumDays); } @Override public int hashCode() { - return Objects.hash(estimatedDays, maximumDays); + return Objects.hash(estimatedDays, isSetEstimatedDays, maximumDays, isSetMaximumDays); } @Override @@ -142,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 (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..e2e451ba4 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. */ @@ -145,13 +188,16 @@ public boolean equals(Object o) { } ResourceReference resourceReference = (ResourceReference) o; return Objects.equals(this.description, resourceReference.description) + && Objects.equals(this.isSetDescription, resourceReference.isSetDescription) && Objects.equals(this.id, resourceReference.id) - && Objects.equals(this.reference, resourceReference.reference); + && Objects.equals(this.isSetId, resourceReference.isSetId) + && Objects.equals(this.reference, resourceReference.reference) + && Objects.equals(this.isSetReference, resourceReference.isSetReference); } @Override public int hashCode() { - return Objects.hash(description, id, reference); + return Objects.hash(description, isSetDescription, id, isSetId, reference, isSetReference); } @Override @@ -175,6 +221,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (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..c6ff3772b 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. */ @@ -386,20 +459,46 @@ public boolean equals(Object o) { } RestServiceError restServiceError = (RestServiceError) o; return Objects.equals(this.detail, restServiceError.detail) + && Objects.equals(this.isSetDetail, restServiceError.isSetDetail) && Objects.equals(this.errorCode, restServiceError.errorCode) + && Objects.equals(this.isSetErrorCode, restServiceError.isSetErrorCode) && Objects.equals(this.instance, restServiceError.instance) + && Objects.equals(this.isSetInstance, restServiceError.isSetInstance) && Objects.equals(this.invalidFields, restServiceError.invalidFields) + && Objects.equals(this.isSetInvalidFields, restServiceError.isSetInvalidFields) && Objects.equals(this.requestId, restServiceError.requestId) + && Objects.equals(this.isSetRequestId, restServiceError.isSetRequestId) && Objects.equals(this.response, restServiceError.response) + && Objects.equals(this.isSetResponse, restServiceError.isSetResponse) && Objects.equals(this.status, restServiceError.status) + && Objects.equals(this.isSetStatus, restServiceError.isSetStatus) && Objects.equals(this.title, restServiceError.title) - && Objects.equals(this.type, restServiceError.type); + && Objects.equals(this.isSetTitle, restServiceError.isSetTitle) + && Objects.equals(this.type, restServiceError.type) + && Objects.equals(this.isSetType, restServiceError.isSetType); } @Override public int hashCode() { return Objects.hash( - detail, errorCode, instance, invalidFields, requestId, response, status, title, type); + detail, + isSetDetail, + errorCode, + isSetErrorCode, + instance, + isSetInstance, + invalidFields, + isSetInvalidFields, + requestId, + isSetRequestId, + response, + isSetResponse, + status, + isSetStatus, + title, + isSetTitle, + type, + isSetType); } @Override @@ -429,6 +528,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..9ce5e82b0 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. */ @@ -129,12 +167,14 @@ public boolean equals(Object o) { } ReturnTransferRequest returnTransferRequest = (ReturnTransferRequest) o; return Objects.equals(this.amount, returnTransferRequest.amount) - && Objects.equals(this.reference, returnTransferRequest.reference); + && Objects.equals(this.isSetAmount, returnTransferRequest.isSetAmount) + && Objects.equals(this.reference, returnTransferRequest.reference) + && Objects.equals(this.isSetReference, returnTransferRequest.isSetReference); } @Override public int hashCode() { - return Objects.hash(amount, reference); + return Objects.hash(amount, isSetAmount, reference, isSetReference); } @Override @@ -157,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 (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..f86f1fdbc 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. */ @@ -230,14 +278,19 @@ public boolean equals(Object o) { } ReturnTransferResponse returnTransferResponse = (ReturnTransferResponse) o; return Objects.equals(this.id, returnTransferResponse.id) + && Objects.equals(this.isSetId, returnTransferResponse.isSetId) && Objects.equals(this.reference, returnTransferResponse.reference) + && Objects.equals(this.isSetReference, returnTransferResponse.isSetReference) && Objects.equals(this.status, returnTransferResponse.status) - && Objects.equals(this.transferId, returnTransferResponse.transferId); + && Objects.equals(this.isSetStatus, returnTransferResponse.isSetStatus) + && Objects.equals(this.transferId, returnTransferResponse.transferId) + && Objects.equals(this.isSetTransferId, returnTransferResponse.isSetTransferId); } @Override public int hashCode() { - return Objects.hash(id, reference, status, transferId); + return Objects.hash( + id, isSetId, reference, isSetReference, status, isSetStatus, transferId, isSetTransferId); } @Override @@ -262,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 (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..190d3162d 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. */ @@ -307,14 +355,19 @@ public boolean equals(Object o) { } RoutingDetails routingDetails = (RoutingDetails) o; return Objects.equals(this.detail, routingDetails.detail) + && Objects.equals(this.isSetDetail, routingDetails.isSetDetail) && Objects.equals(this.errorCode, routingDetails.errorCode) + && Objects.equals(this.isSetErrorCode, routingDetails.isSetErrorCode) && Objects.equals(this.priority, routingDetails.priority) - && Objects.equals(this.title, routingDetails.title); + && Objects.equals(this.isSetPriority, routingDetails.isSetPriority) + && Objects.equals(this.title, routingDetails.title) + && Objects.equals(this.isSetTitle, routingDetails.isSetTitle); } @Override public int hashCode() { - return Objects.hash(detail, errorCode, priority, title); + return Objects.hash( + detail, isSetDetail, errorCode, isSetErrorCode, priority, isSetPriority, title, isSetTitle); } @Override @@ -339,6 +392,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..dac78227c 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. */ @@ -212,13 +255,18 @@ public boolean equals(Object o) { } SELocalAccountIdentification seLocalAccountIdentification = (SELocalAccountIdentification) o; return Objects.equals(this.accountNumber, seLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, seLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.clearingNumber, seLocalAccountIdentification.clearingNumber) - && Objects.equals(this.type, seLocalAccountIdentification.type); + && Objects.equals( + this.isSetClearingNumber, seLocalAccountIdentification.isSetClearingNumber) + && Objects.equals(this.type, seLocalAccountIdentification.type) + && Objects.equals(this.isSetType, seLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, clearingNumber, type); + return Objects.hash( + accountNumber, isSetAccountNumber, clearingNumber, isSetClearingNumber, type, isSetType); } @Override @@ -242,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 (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..350b8ba69 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. */ @@ -188,13 +231,16 @@ public boolean equals(Object o) { } SGLocalAccountIdentification sgLocalAccountIdentification = (SGLocalAccountIdentification) o; return Objects.equals(this.accountNumber, sgLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, sgLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.bic, sgLocalAccountIdentification.bic) - && Objects.equals(this.type, sgLocalAccountIdentification.type); + && Objects.equals(this.isSetBic, sgLocalAccountIdentification.isSetBic) + && Objects.equals(this.type, sgLocalAccountIdentification.type) + && Objects.equals(this.isSetType, sgLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, bic, type); + return Objects.hash(accountNumber, isSetAccountNumber, bic, isSetBic, type, isSetType); } @Override @@ -218,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 (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..2c88c1a89 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. */ @@ -219,15 +272,30 @@ public boolean equals(Object o) { } ServiceError serviceError = (ServiceError) o; return Objects.equals(this.errorCode, serviceError.errorCode) + && Objects.equals(this.isSetErrorCode, serviceError.isSetErrorCode) && Objects.equals(this.errorType, serviceError.errorType) + && Objects.equals(this.isSetErrorType, serviceError.isSetErrorType) && Objects.equals(this.message, serviceError.message) + && Objects.equals(this.isSetMessage, serviceError.isSetMessage) && Objects.equals(this.pspReference, serviceError.pspReference) - && Objects.equals(this.status, serviceError.status); + && Objects.equals(this.isSetPspReference, serviceError.isSetPspReference) + && Objects.equals(this.status, serviceError.status) + && Objects.equals(this.isSetStatus, serviceError.isSetStatus); } @Override public int hashCode() { - return Objects.hash(errorCode, errorType, message, pspReference, status); + return Objects.hash( + errorCode, + isSetErrorCode, + errorType, + isSetErrorType, + message, + isSetMessage, + pspReference, + isSetPspReference, + status, + isSetStatus); } @Override @@ -253,6 +321,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..08495476f 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. */ @@ -68,12 +101,13 @@ public boolean equals(Object o) { return false; } ThreeDSecure threeDSecure = (ThreeDSecure) o; - return Objects.equals(this.acsTransactionId, threeDSecure.acsTransactionId); + return Objects.equals(this.acsTransactionId, threeDSecure.acsTransactionId) + && Objects.equals(this.isSetAcsTransactionId, threeDSecure.isSetAcsTransactionId); } @Override public int hashCode() { - return Objects.hash(acsTransactionId); + return Objects.hash(acsTransactionId, isSetAcsTransactionId); } @Override @@ -95,6 +129,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (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..e0807837b 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. */ @@ -68,12 +101,13 @@ public boolean equals(Object o) { return false; } ThresholdRepayment thresholdRepayment = (ThresholdRepayment) o; - return Objects.equals(this.amount, thresholdRepayment.amount); + return Objects.equals(this.amount, thresholdRepayment.amount) + && Objects.equals(this.isSetAmount, thresholdRepayment.isSetAmount); } @Override public int hashCode() { - return Objects.hash(amount); + return Objects.hash(amount, isSetAmount); } @Override @@ -95,6 +129,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (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..989ac5391 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. */ @@ -603,36 +696,63 @@ public boolean equals(Object o) { } Transaction transaction = (Transaction) o; return Objects.equals(this.accountHolder, transaction.accountHolder) + && Objects.equals(this.isSetAccountHolder, transaction.isSetAccountHolder) && Objects.equals(this.amount, transaction.amount) + && Objects.equals(this.isSetAmount, transaction.isSetAmount) && Objects.equals(this.balanceAccount, transaction.balanceAccount) + && Objects.equals(this.isSetBalanceAccount, transaction.isSetBalanceAccount) && Objects.equals(this.balancePlatform, transaction.balancePlatform) + && Objects.equals(this.isSetBalancePlatform, transaction.isSetBalancePlatform) && Objects.equals(this.bookingDate, transaction.bookingDate) + && Objects.equals(this.isSetBookingDate, transaction.isSetBookingDate) && Objects.equals(this.creationDate, transaction.creationDate) + && Objects.equals(this.isSetCreationDate, transaction.isSetCreationDate) && Objects.equals(this.description, transaction.description) + && Objects.equals(this.isSetDescription, transaction.isSetDescription) && Objects.equals(this.id, transaction.id) + && Objects.equals(this.isSetId, transaction.isSetId) && Objects.equals(this.paymentInstrument, transaction.paymentInstrument) + && Objects.equals(this.isSetPaymentInstrument, transaction.isSetPaymentInstrument) && Objects.equals(this.referenceForBeneficiary, transaction.referenceForBeneficiary) + && Objects.equals( + this.isSetReferenceForBeneficiary, transaction.isSetReferenceForBeneficiary) && Objects.equals(this.status, transaction.status) + && Objects.equals(this.isSetStatus, transaction.isSetStatus) && Objects.equals(this.transfer, transaction.transfer) - && Objects.equals(this.valueDate, transaction.valueDate); + && Objects.equals(this.isSetTransfer, transaction.isSetTransfer) + && Objects.equals(this.valueDate, transaction.valueDate) + && Objects.equals(this.isSetValueDate, transaction.isSetValueDate); } @Override public int hashCode() { return Objects.hash( accountHolder, + isSetAccountHolder, amount, + isSetAmount, balanceAccount, + isSetBalanceAccount, balancePlatform, + isSetBalancePlatform, bookingDate, + isSetBookingDate, creationDate, + isSetCreationDate, description, + isSetDescription, id, + isSetId, paymentInstrument, + isSetPaymentInstrument, referenceForBeneficiary, + isSetReferenceForBeneficiary, status, + isSetStatus, transfer, - valueDate); + isSetTransfer, + valueDate, + isSetValueDate); } @Override @@ -668,6 +788,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..b97ae7297 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. */ @@ -146,14 +189,24 @@ public boolean equals(Object o) { } TransactionEventViolation transactionEventViolation = (TransactionEventViolation) o; return Objects.equals(this.reason, transactionEventViolation.reason) + && Objects.equals(this.isSetReason, transactionEventViolation.isSetReason) && Objects.equals(this.transactionRule, transactionEventViolation.transactionRule) + && Objects.equals(this.isSetTransactionRule, transactionEventViolation.isSetTransactionRule) && Objects.equals( - this.transactionRuleSource, transactionEventViolation.transactionRuleSource); + this.transactionRuleSource, transactionEventViolation.transactionRuleSource) + && Objects.equals( + this.isSetTransactionRuleSource, transactionEventViolation.isSetTransactionRuleSource); } @Override public int hashCode() { - return Objects.hash(reason, transactionRule, transactionRuleSource); + return Objects.hash( + reason, + isSetReason, + transactionRule, + isSetTransactionRule, + transactionRuleSource, + isSetTransactionRuleSource); } @Override @@ -179,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 (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..bb51d05ed 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. */ @@ -225,15 +278,30 @@ public boolean equals(Object o) { } TransactionRuleReference transactionRuleReference = (TransactionRuleReference) o; return Objects.equals(this.description, transactionRuleReference.description) + && Objects.equals(this.isSetDescription, transactionRuleReference.isSetDescription) && Objects.equals(this.id, transactionRuleReference.id) + && Objects.equals(this.isSetId, transactionRuleReference.isSetId) && Objects.equals(this.outcomeType, transactionRuleReference.outcomeType) + && Objects.equals(this.isSetOutcomeType, transactionRuleReference.isSetOutcomeType) && Objects.equals(this.reference, transactionRuleReference.reference) - && Objects.equals(this.score, transactionRuleReference.score); + && Objects.equals(this.isSetReference, transactionRuleReference.isSetReference) + && Objects.equals(this.score, transactionRuleReference.score) + && Objects.equals(this.isSetScore, transactionRuleReference.isSetScore); } @Override public int hashCode() { - return Objects.hash(description, id, outcomeType, reference, score); + return Objects.hash( + description, + isSetDescription, + id, + isSetId, + outcomeType, + isSetOutcomeType, + reference, + isSetReference, + score, + isSetScore); } @Override @@ -259,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 (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..135ab9c7d 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. */ @@ -126,12 +164,14 @@ public boolean equals(Object o) { } TransactionRuleSource transactionRuleSource = (TransactionRuleSource) o; return Objects.equals(this.id, transactionRuleSource.id) - && Objects.equals(this.type, transactionRuleSource.type); + && Objects.equals(this.isSetId, transactionRuleSource.isSetId) + && Objects.equals(this.type, transactionRuleSource.type) + && Objects.equals(this.isSetType, transactionRuleSource.isSetType); } @Override public int hashCode() { - return Objects.hash(id, type); + return Objects.hash(id, isSetId, type, isSetType); } @Override @@ -154,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 (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..436f03884 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. */ @@ -202,16 +250,31 @@ public boolean equals(Object o) { } TransactionRulesResult transactionRulesResult = (TransactionRulesResult) o; return Objects.equals(this.advice, transactionRulesResult.advice) + && Objects.equals(this.isSetAdvice, transactionRulesResult.isSetAdvice) && Objects.equals( this.allHardBlockRulesPassed, transactionRulesResult.allHardBlockRulesPassed) + && Objects.equals( + this.isSetAllHardBlockRulesPassed, transactionRulesResult.isSetAllHardBlockRulesPassed) && Objects.equals(this.score, transactionRulesResult.score) + && Objects.equals(this.isSetScore, transactionRulesResult.isSetScore) && Objects.equals( - this.triggeredTransactionRules, transactionRulesResult.triggeredTransactionRules); + this.triggeredTransactionRules, transactionRulesResult.triggeredTransactionRules) + && Objects.equals( + this.isSetTriggeredTransactionRules, + transactionRulesResult.isSetTriggeredTransactionRules); } @Override public int hashCode() { - return Objects.hash(advice, allHardBlockRulesPassed, score, triggeredTransactionRules); + return Objects.hash( + advice, + isSetAdvice, + allHardBlockRulesPassed, + isSetAllHardBlockRulesPassed, + score, + isSetScore, + triggeredTransactionRules, + isSetTriggeredTransactionRules); } @Override @@ -240,6 +303,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..d8b2ecae8 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. */ @@ -118,12 +156,14 @@ public boolean equals(Object o) { } TransactionSearchResponse transactionSearchResponse = (TransactionSearchResponse) o; return Objects.equals(this.links, transactionSearchResponse.links) - && Objects.equals(this.data, transactionSearchResponse.data); + && Objects.equals(this.isSetLinks, transactionSearchResponse.isSetLinks) + && Objects.equals(this.data, transactionSearchResponse.data) + && Objects.equals(this.isSetData, transactionSearchResponse.isSetData); } @Override public int hashCode() { - return Objects.hash(links, data); + return Objects.hash(links, isSetLinks, data, isSetData); } @Override @@ -146,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 (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..e483cdd5e 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. */ @@ -1407,50 +1554,90 @@ public boolean equals(Object o) { } Transfer transfer = (Transfer) o; return Objects.equals(this.accountHolder, transfer.accountHolder) + && Objects.equals(this.isSetAccountHolder, transfer.isSetAccountHolder) && Objects.equals(this.amount, transfer.amount) + && Objects.equals(this.isSetAmount, transfer.isSetAmount) && Objects.equals(this.balanceAccount, transfer.balanceAccount) + && Objects.equals(this.isSetBalanceAccount, transfer.isSetBalanceAccount) && Objects.equals(this.category, transfer.category) + && Objects.equals(this.isSetCategory, transfer.isSetCategory) && Objects.equals(this.categoryData, transfer.categoryData) + && Objects.equals(this.isSetCategoryData, transfer.isSetCategoryData) && Objects.equals(this.counterparty, transfer.counterparty) + && Objects.equals(this.isSetCounterparty, transfer.isSetCounterparty) && Objects.equals(this.createdAt, transfer.createdAt) + && Objects.equals(this.isSetCreatedAt, transfer.isSetCreatedAt) && Objects.equals(this.creationDate, transfer.creationDate) + && Objects.equals(this.isSetCreationDate, transfer.isSetCreationDate) && Objects.equals(this.description, transfer.description) + && Objects.equals(this.isSetDescription, transfer.isSetDescription) && Objects.equals(this.directDebitInformation, transfer.directDebitInformation) + && Objects.equals(this.isSetDirectDebitInformation, transfer.isSetDirectDebitInformation) && Objects.equals(this.direction, transfer.direction) + && Objects.equals(this.isSetDirection, transfer.isSetDirection) && Objects.equals(this.executionDate, transfer.executionDate) + && Objects.equals(this.isSetExecutionDate, transfer.isSetExecutionDate) && Objects.equals(this.id, transfer.id) + && Objects.equals(this.isSetId, transfer.isSetId) && Objects.equals(this.paymentInstrument, transfer.paymentInstrument) + && Objects.equals(this.isSetPaymentInstrument, transfer.isSetPaymentInstrument) && Objects.equals(this.reason, transfer.reason) + && Objects.equals(this.isSetReason, transfer.isSetReason) && Objects.equals(this.reference, transfer.reference) + && Objects.equals(this.isSetReference, transfer.isSetReference) && Objects.equals(this.referenceForBeneficiary, transfer.referenceForBeneficiary) + && Objects.equals(this.isSetReferenceForBeneficiary, transfer.isSetReferenceForBeneficiary) && Objects.equals(this.review, transfer.review) + && Objects.equals(this.isSetReview, transfer.isSetReview) && Objects.equals(this.status, transfer.status) - && Objects.equals(this.type, transfer.type); + && Objects.equals(this.isSetStatus, transfer.isSetStatus) + && Objects.equals(this.type, transfer.type) + && Objects.equals(this.isSetType, transfer.isSetType); } @Override public int hashCode() { return Objects.hash( accountHolder, + isSetAccountHolder, amount, + isSetAmount, balanceAccount, + isSetBalanceAccount, category, + isSetCategory, categoryData, + isSetCategoryData, counterparty, + isSetCounterparty, createdAt, + isSetCreatedAt, creationDate, + isSetCreationDate, description, + isSetDescription, directDebitInformation, + isSetDirectDebitInformation, direction, + isSetDirection, executionDate, + isSetExecutionDate, id, + isSetId, paymentInstrument, + isSetPaymentInstrument, reason, + isSetReason, reference, + isSetReference, referenceForBeneficiary, + isSetReferenceForBeneficiary, review, + isSetReview, status, - type); + isSetStatus, + type, + isSetType); } @Override @@ -1495,6 +1682,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..060a6eaad 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. */ @@ -1782,68 +1974,129 @@ public boolean equals(Object o) { } TransferData transferData = (TransferData) o; return Objects.equals(this.accountHolder, transferData.accountHolder) + && Objects.equals(this.isSetAccountHolder, transferData.isSetAccountHolder) && Objects.equals(this.amount, transferData.amount) + && Objects.equals(this.isSetAmount, transferData.isSetAmount) && Objects.equals(this.balanceAccount, transferData.balanceAccount) + && Objects.equals(this.isSetBalanceAccount, transferData.isSetBalanceAccount) && Objects.equals(this.balancePlatform, transferData.balancePlatform) + && Objects.equals(this.isSetBalancePlatform, transferData.isSetBalancePlatform) && Objects.equals(this.balances, transferData.balances) + && Objects.equals(this.isSetBalances, transferData.isSetBalances) && Objects.equals(this.category, transferData.category) + && Objects.equals(this.isSetCategory, transferData.isSetCategory) && Objects.equals(this.categoryData, transferData.categoryData) + && Objects.equals(this.isSetCategoryData, transferData.isSetCategoryData) && Objects.equals(this.counterparty, transferData.counterparty) + && Objects.equals(this.isSetCounterparty, transferData.isSetCounterparty) && Objects.equals(this.createdAt, transferData.createdAt) + && Objects.equals(this.isSetCreatedAt, transferData.isSetCreatedAt) && Objects.equals(this.creationDate, transferData.creationDate) + && Objects.equals(this.isSetCreationDate, transferData.isSetCreationDate) && Objects.equals(this.description, transferData.description) + && Objects.equals(this.isSetDescription, transferData.isSetDescription) && Objects.equals(this.directDebitInformation, transferData.directDebitInformation) + && Objects.equals( + this.isSetDirectDebitInformation, transferData.isSetDirectDebitInformation) && Objects.equals(this.direction, transferData.direction) + && Objects.equals(this.isSetDirection, transferData.isSetDirection) && Objects.equals(this.eventId, transferData.eventId) + && Objects.equals(this.isSetEventId, transferData.isSetEventId) && Objects.equals(this.events, transferData.events) + && Objects.equals(this.isSetEvents, transferData.isSetEvents) && Objects.equals(this.executionDate, transferData.executionDate) + && Objects.equals(this.isSetExecutionDate, transferData.isSetExecutionDate) && Objects.equals(this.externalReason, transferData.externalReason) + && Objects.equals(this.isSetExternalReason, transferData.isSetExternalReason) && Objects.equals(this.id, transferData.id) + && Objects.equals(this.isSetId, transferData.isSetId) && Objects.equals(this.paymentInstrument, transferData.paymentInstrument) + && Objects.equals(this.isSetPaymentInstrument, transferData.isSetPaymentInstrument) && Objects.equals(this.reason, transferData.reason) + && Objects.equals(this.isSetReason, transferData.isSetReason) && Objects.equals(this.reference, transferData.reference) + && Objects.equals(this.isSetReference, transferData.isSetReference) && Objects.equals(this.referenceForBeneficiary, transferData.referenceForBeneficiary) + && Objects.equals( + this.isSetReferenceForBeneficiary, transferData.isSetReferenceForBeneficiary) && Objects.equals(this.review, transferData.review) + && Objects.equals(this.isSetReview, transferData.isSetReview) && Objects.equals(this.sequenceNumber, transferData.sequenceNumber) + && Objects.equals(this.isSetSequenceNumber, transferData.isSetSequenceNumber) && Objects.equals(this.status, transferData.status) + && Objects.equals(this.isSetStatus, transferData.isSetStatus) && Objects.equals(this.tracking, transferData.tracking) + && Objects.equals(this.isSetTracking, transferData.isSetTracking) && Objects.equals(this.transactionRulesResult, transferData.transactionRulesResult) + && Objects.equals( + this.isSetTransactionRulesResult, transferData.isSetTransactionRulesResult) && Objects.equals(this.type, transferData.type) - && Objects.equals(this.updatedAt, transferData.updatedAt); + && Objects.equals(this.isSetType, transferData.isSetType) + && Objects.equals(this.updatedAt, transferData.updatedAt) + && Objects.equals(this.isSetUpdatedAt, transferData.isSetUpdatedAt); } @Override public int hashCode() { return Objects.hash( accountHolder, + isSetAccountHolder, amount, + isSetAmount, balanceAccount, + isSetBalanceAccount, balancePlatform, + isSetBalancePlatform, balances, + isSetBalances, category, + isSetCategory, categoryData, + isSetCategoryData, counterparty, + isSetCounterparty, createdAt, + isSetCreatedAt, creationDate, + isSetCreationDate, description, + isSetDescription, directDebitInformation, + isSetDirectDebitInformation, direction, + isSetDirection, eventId, + isSetEventId, events, + isSetEvents, executionDate, + isSetExecutionDate, externalReason, + isSetExternalReason, id, + isSetId, paymentInstrument, + isSetPaymentInstrument, reason, + isSetReason, reference, + isSetReference, referenceForBeneficiary, + isSetReferenceForBeneficiary, review, + isSetReview, sequenceNumber, + isSetSequenceNumber, status, + isSetStatus, tracking, + isSetTracking, transactionRulesResult, + isSetTransactionRulesResult, type, - updatedAt); + isSetType, + updatedAt, + isSetUpdatedAt); } @Override @@ -1899,6 +2152,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..20a73764c 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. */ @@ -1053,46 +1173,82 @@ public boolean equals(Object o) { } TransferEvent transferEvent = (TransferEvent) o; return Objects.equals(this.amount, transferEvent.amount) + && Objects.equals(this.isSetAmount, transferEvent.isSetAmount) && Objects.equals(this.amountAdjustments, transferEvent.amountAdjustments) + && Objects.equals(this.isSetAmountAdjustments, transferEvent.isSetAmountAdjustments) && Objects.equals(this.arn, transferEvent.arn) + && Objects.equals(this.isSetArn, transferEvent.isSetArn) && Objects.equals(this.bookingDate, transferEvent.bookingDate) + && Objects.equals(this.isSetBookingDate, transferEvent.isSetBookingDate) && Objects.equals(this.estimatedArrivalTime, transferEvent.estimatedArrivalTime) + && Objects.equals(this.isSetEstimatedArrivalTime, transferEvent.isSetEstimatedArrivalTime) && Objects.equals(this.eventsData, transferEvent.eventsData) + && Objects.equals(this.isSetEventsData, transferEvent.isSetEventsData) && Objects.equals(this.externalReason, transferEvent.externalReason) + && Objects.equals(this.isSetExternalReason, transferEvent.isSetExternalReason) && Objects.equals(this.id, transferEvent.id) + && Objects.equals(this.isSetId, transferEvent.isSetId) && Objects.equals(this.modification, transferEvent.modification) + && Objects.equals(this.isSetModification, transferEvent.isSetModification) && Objects.equals(this.mutations, transferEvent.mutations) + && Objects.equals(this.isSetMutations, transferEvent.isSetMutations) && Objects.equals(this.originalAmount, transferEvent.originalAmount) + && Objects.equals(this.isSetOriginalAmount, transferEvent.isSetOriginalAmount) && Objects.equals(this.reason, transferEvent.reason) + && Objects.equals(this.isSetReason, transferEvent.isSetReason) && Objects.equals(this.status, transferEvent.status) + && Objects.equals(this.isSetStatus, transferEvent.isSetStatus) && Objects.equals(this.trackingData, transferEvent.trackingData) + && Objects.equals(this.isSetTrackingData, transferEvent.isSetTrackingData) && Objects.equals(this.transactionId, transferEvent.transactionId) + && Objects.equals(this.isSetTransactionId, transferEvent.isSetTransactionId) && Objects.equals(this.type, transferEvent.type) + && Objects.equals(this.isSetType, transferEvent.isSetType) && Objects.equals(this.updateDate, transferEvent.updateDate) - && Objects.equals(this.valueDate, transferEvent.valueDate); + && Objects.equals(this.isSetUpdateDate, transferEvent.isSetUpdateDate) + && Objects.equals(this.valueDate, transferEvent.valueDate) + && Objects.equals(this.isSetValueDate, transferEvent.isSetValueDate); } @Override public int hashCode() { return Objects.hash( amount, + isSetAmount, amountAdjustments, + isSetAmountAdjustments, arn, + isSetArn, bookingDate, + isSetBookingDate, estimatedArrivalTime, + isSetEstimatedArrivalTime, eventsData, + isSetEventsData, externalReason, + isSetExternalReason, id, + isSetId, modification, + isSetModification, mutations, + isSetMutations, originalAmount, + isSetOriginalAmount, reason, + isSetReason, status, + isSetStatus, trackingData, + isSetTrackingData, transactionId, + isSetTransactionId, type, + isSetType, updateDate, - valueDate); + isSetUpdateDate, + valueDate, + isSetValueDate); } @Override @@ -1133,6 +1289,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..81513f1dc 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. */ @@ -1119,38 +1217,67 @@ public boolean equals(Object o) { } TransferInfo transferInfo = (TransferInfo) o; return Objects.equals(this.amount, transferInfo.amount) + && Objects.equals(this.isSetAmount, transferInfo.isSetAmount) && Objects.equals(this.balanceAccountId, transferInfo.balanceAccountId) + && Objects.equals(this.isSetBalanceAccountId, transferInfo.isSetBalanceAccountId) && Objects.equals(this.category, transferInfo.category) + && Objects.equals(this.isSetCategory, transferInfo.isSetCategory) && Objects.equals(this.counterparty, transferInfo.counterparty) + && Objects.equals(this.isSetCounterparty, transferInfo.isSetCounterparty) && Objects.equals(this.description, transferInfo.description) + && Objects.equals(this.isSetDescription, transferInfo.isSetDescription) && Objects.equals(this.executionDate, transferInfo.executionDate) + && Objects.equals(this.isSetExecutionDate, transferInfo.isSetExecutionDate) && Objects.equals(this.paymentInstrumentId, transferInfo.paymentInstrumentId) + && Objects.equals(this.isSetPaymentInstrumentId, transferInfo.isSetPaymentInstrumentId) && Objects.equals(this.priorities, transferInfo.priorities) + && Objects.equals(this.isSetPriorities, transferInfo.isSetPriorities) && Objects.equals(this.priority, transferInfo.priority) + && Objects.equals(this.isSetPriority, transferInfo.isSetPriority) && Objects.equals(this.reference, transferInfo.reference) + && Objects.equals(this.isSetReference, transferInfo.isSetReference) && Objects.equals(this.referenceForBeneficiary, transferInfo.referenceForBeneficiary) + && Objects.equals( + this.isSetReferenceForBeneficiary, transferInfo.isSetReferenceForBeneficiary) && Objects.equals(this.review, transferInfo.review) + && Objects.equals(this.isSetReview, transferInfo.isSetReview) && Objects.equals(this.type, transferInfo.type) - && Objects.equals(this.ultimateParty, transferInfo.ultimateParty); + && Objects.equals(this.isSetType, transferInfo.isSetType) + && Objects.equals(this.ultimateParty, transferInfo.ultimateParty) + && Objects.equals(this.isSetUltimateParty, transferInfo.isSetUltimateParty); } @Override public int hashCode() { return Objects.hash( amount, + isSetAmount, balanceAccountId, + isSetBalanceAccountId, category, + isSetCategory, counterparty, + isSetCounterparty, description, + isSetDescription, executionDate, + isSetExecutionDate, paymentInstrumentId, + isSetPaymentInstrumentId, priorities, + isSetPriorities, priority, + isSetPriority, reference, + isSetReference, referenceForBeneficiary, + isSetReferenceForBeneficiary, review, + isSetReview, type, - ultimateParty); + isSetType, + ultimateParty, + isSetUltimateParty); } @Override @@ -1189,6 +1316,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..f30bc2af3 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. */ @@ -237,16 +290,34 @@ public boolean equals(Object o) { TransferNotificationCounterParty transferNotificationCounterParty = (TransferNotificationCounterParty) o; return Objects.equals(this.balanceAccountId, transferNotificationCounterParty.balanceAccountId) + && Objects.equals( + this.isSetBalanceAccountId, transferNotificationCounterParty.isSetBalanceAccountId) && Objects.equals(this.bankAccount, transferNotificationCounterParty.bankAccount) + && Objects.equals(this.isSetBankAccount, transferNotificationCounterParty.isSetBankAccount) && Objects.equals(this.card, transferNotificationCounterParty.card) + && Objects.equals(this.isSetCard, transferNotificationCounterParty.isSetCard) && Objects.equals(this.merchant, transferNotificationCounterParty.merchant) + && Objects.equals(this.isSetMerchant, transferNotificationCounterParty.isSetMerchant) + && Objects.equals( + this.transferInstrumentId, transferNotificationCounterParty.transferInstrumentId) && Objects.equals( - this.transferInstrumentId, transferNotificationCounterParty.transferInstrumentId); + this.isSetTransferInstrumentId, + transferNotificationCounterParty.isSetTransferInstrumentId); } @Override public int hashCode() { - return Objects.hash(balanceAccountId, bankAccount, card, merchant, transferInstrumentId); + return Objects.hash( + balanceAccountId, + isSetBalanceAccountId, + bankAccount, + isSetBankAccount, + card, + isSetCard, + merchant, + isSetMerchant, + transferInstrumentId, + isSetTransferInstrumentId); } @Override @@ -274,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 (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..1ee863bea 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. */ @@ -301,17 +364,38 @@ public boolean equals(Object o) { TransferNotificationMerchantData transferNotificationMerchantData = (TransferNotificationMerchantData) o; return Objects.equals(this.acquirerId, transferNotificationMerchantData.acquirerId) + && Objects.equals(this.isSetAcquirerId, transferNotificationMerchantData.isSetAcquirerId) && Objects.equals(this.city, transferNotificationMerchantData.city) + && Objects.equals(this.isSetCity, transferNotificationMerchantData.isSetCity) && Objects.equals(this.country, transferNotificationMerchantData.country) + && Objects.equals(this.isSetCountry, transferNotificationMerchantData.isSetCountry) && Objects.equals(this.mcc, transferNotificationMerchantData.mcc) + && Objects.equals(this.isSetMcc, transferNotificationMerchantData.isSetMcc) && Objects.equals(this.merchantId, transferNotificationMerchantData.merchantId) + && Objects.equals(this.isSetMerchantId, transferNotificationMerchantData.isSetMerchantId) && Objects.equals(this.name, transferNotificationMerchantData.name) - && Objects.equals(this.postalCode, transferNotificationMerchantData.postalCode); + && Objects.equals(this.isSetName, transferNotificationMerchantData.isSetName) + && Objects.equals(this.postalCode, transferNotificationMerchantData.postalCode) + && Objects.equals(this.isSetPostalCode, transferNotificationMerchantData.isSetPostalCode); } @Override public int hashCode() { - return Objects.hash(acquirerId, city, country, mcc, merchantId, name, postalCode); + return Objects.hash( + acquirerId, + isSetAcquirerId, + city, + isSetCity, + country, + isSetCountry, + mcc, + isSetMcc, + merchantId, + isSetMerchantId, + name, + isSetName, + postalCode, + isSetPostalCode); } @Override @@ -339,6 +423,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..3e0af60d3 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. */ @@ -111,12 +149,14 @@ public boolean equals(Object o) { TransferNotificationValidationFact transferNotificationValidationFact = (TransferNotificationValidationFact) o; return Objects.equals(this.result, transferNotificationValidationFact.result) - && Objects.equals(this.type, transferNotificationValidationFact.type); + && Objects.equals(this.isSetResult, transferNotificationValidationFact.isSetResult) + && Objects.equals(this.type, transferNotificationValidationFact.type) + && Objects.equals(this.isSetType, transferNotificationValidationFact.isSetType); } @Override public int hashCode() { - return Objects.hash(result, type); + return Objects.hash(result, isSetResult, type, isSetType); } @Override @@ -139,6 +179,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (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..3a6d88127 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. */ @@ -143,12 +181,20 @@ public boolean equals(Object o) { TransferRequestReview transferRequestReview = (TransferRequestReview) o; return Objects.equals( this.numberOfApprovalsRequired, transferRequestReview.numberOfApprovalsRequired) - && Objects.equals(this.scaOnApproval, transferRequestReview.scaOnApproval); + && Objects.equals( + this.isSetNumberOfApprovalsRequired, + transferRequestReview.isSetNumberOfApprovalsRequired) + && Objects.equals(this.scaOnApproval, transferRequestReview.scaOnApproval) + && Objects.equals(this.isSetScaOnApproval, transferRequestReview.isSetScaOnApproval); } @Override public int hashCode() { - return Objects.hash(numberOfApprovalsRequired, scaOnApproval); + return Objects.hash( + numberOfApprovalsRequired, + isSetNumberOfApprovalsRequired, + scaOnApproval, + isSetScaOnApproval); } @Override @@ -173,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 (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..1934c9795 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. */ @@ -177,12 +215,19 @@ public boolean equals(Object o) { } TransferReview transferReview = (TransferReview) o; return Objects.equals(this.numberOfApprovalsRequired, transferReview.numberOfApprovalsRequired) - && Objects.equals(this.scaOnApproval, transferReview.scaOnApproval); + && Objects.equals( + this.isSetNumberOfApprovalsRequired, transferReview.isSetNumberOfApprovalsRequired) + && Objects.equals(this.scaOnApproval, transferReview.scaOnApproval) + && Objects.equals(this.isSetScaOnApproval, transferReview.isSetScaOnApproval); } @Override public int hashCode() { - return Objects.hash(numberOfApprovalsRequired, scaOnApproval); + return Objects.hash( + numberOfApprovalsRequired, + isSetNumberOfApprovalsRequired, + scaOnApproval, + isSetScaOnApproval); } @Override @@ -207,6 +252,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..8d2be0be8 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. */ @@ -448,30 +526,52 @@ public boolean equals(Object o) { TransferServiceRestServiceError transferServiceRestServiceError = (TransferServiceRestServiceError) o; return Objects.equals(this.detail, transferServiceRestServiceError.detail) + && Objects.equals(this.isSetDetail, transferServiceRestServiceError.isSetDetail) && Objects.equals(this.errorCode, transferServiceRestServiceError.errorCode) + && Objects.equals(this.isSetErrorCode, transferServiceRestServiceError.isSetErrorCode) && Objects.equals(this.instance, transferServiceRestServiceError.instance) + && Objects.equals(this.isSetInstance, transferServiceRestServiceError.isSetInstance) && Objects.equals(this.invalidFields, transferServiceRestServiceError.invalidFields) + && Objects.equals( + this.isSetInvalidFields, transferServiceRestServiceError.isSetInvalidFields) && Objects.equals(this.requestId, transferServiceRestServiceError.requestId) + && Objects.equals(this.isSetRequestId, transferServiceRestServiceError.isSetRequestId) && Objects.equals(this.response, transferServiceRestServiceError.response) + && Objects.equals(this.isSetResponse, transferServiceRestServiceError.isSetResponse) && Objects.equals(this.routingDetails, transferServiceRestServiceError.routingDetails) + && Objects.equals( + this.isSetRoutingDetails, transferServiceRestServiceError.isSetRoutingDetails) && Objects.equals(this.status, transferServiceRestServiceError.status) + && Objects.equals(this.isSetStatus, transferServiceRestServiceError.isSetStatus) && Objects.equals(this.title, transferServiceRestServiceError.title) - && Objects.equals(this.type, transferServiceRestServiceError.type); + && Objects.equals(this.isSetTitle, transferServiceRestServiceError.isSetTitle) + && Objects.equals(this.type, transferServiceRestServiceError.type) + && Objects.equals(this.isSetType, transferServiceRestServiceError.isSetType); } @Override public int hashCode() { return Objects.hash( detail, + isSetDetail, errorCode, + isSetErrorCode, instance, + isSetInstance, invalidFields, + isSetInvalidFields, requestId, + isSetRequestId, response, + isSetResponse, routingDetails, + isSetRoutingDetails, status, + isSetStatus, title, - type); + isSetTitle, + type, + isSetType); } @Override @@ -502,6 +602,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..41458ce7a 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. */ @@ -163,13 +206,16 @@ public boolean equals(Object o) { } TransferView transferView = (TransferView) o; return Objects.equals(this.categoryData, transferView.categoryData) + && Objects.equals(this.isSetCategoryData, transferView.isSetCategoryData) && Objects.equals(this.id, transferView.id) - && Objects.equals(this.reference, transferView.reference); + && Objects.equals(this.isSetId, transferView.isSetId) + && Objects.equals(this.reference, transferView.reference) + && Objects.equals(this.isSetReference, transferView.isSetReference); } @Override public int hashCode() { - return Objects.hash(categoryData, id, reference); + return Objects.hash(categoryData, isSetCategoryData, id, isSetId, reference, isSetReference); } @Override @@ -193,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 (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..1db60eb9e 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. */ @@ -194,13 +237,17 @@ public boolean equals(Object o) { } UKLocalAccountIdentification ukLocalAccountIdentification = (UKLocalAccountIdentification) o; return Objects.equals(this.accountNumber, ukLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, ukLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.sortCode, ukLocalAccountIdentification.sortCode) - && Objects.equals(this.type, ukLocalAccountIdentification.type); + && Objects.equals(this.isSetSortCode, ukLocalAccountIdentification.isSetSortCode) + && Objects.equals(this.type, ukLocalAccountIdentification.type) + && Objects.equals(this.isSetType, ukLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, sortCode, type); + return Objects.hash( + accountNumber, isSetAccountNumber, sortCode, isSetSortCode, type, isSetType); } @Override @@ -224,6 +271,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..6e4f99962 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. */ @@ -280,14 +328,26 @@ public boolean equals(Object o) { } USLocalAccountIdentification usLocalAccountIdentification = (USLocalAccountIdentification) o; return Objects.equals(this.accountNumber, usLocalAccountIdentification.accountNumber) + && Objects.equals(this.isSetAccountNumber, usLocalAccountIdentification.isSetAccountNumber) && Objects.equals(this.accountType, usLocalAccountIdentification.accountType) + && Objects.equals(this.isSetAccountType, usLocalAccountIdentification.isSetAccountType) && Objects.equals(this.routingNumber, usLocalAccountIdentification.routingNumber) - && Objects.equals(this.type, usLocalAccountIdentification.type); + && Objects.equals(this.isSetRoutingNumber, usLocalAccountIdentification.isSetRoutingNumber) + && Objects.equals(this.type, usLocalAccountIdentification.type) + && Objects.equals(this.isSetType, usLocalAccountIdentification.isSetType); } @Override public int hashCode() { - return Objects.hash(accountNumber, accountType, routingNumber, type); + return Objects.hash( + accountNumber, + isSetAccountNumber, + accountType, + isSetAccountType, + routingNumber, + isSetRoutingNumber, + type, + isSetType); } @Override @@ -312,6 +372,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..73c108bb5 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. */ @@ -491,20 +606,51 @@ public boolean equals(Object o) { } UltimatePartyIdentification ultimatePartyIdentification = (UltimatePartyIdentification) o; return Objects.equals(this.address, ultimatePartyIdentification.address) + && Objects.equals(this.isSetAddress, ultimatePartyIdentification.isSetAddress) && Objects.equals(this.dateOfBirth, ultimatePartyIdentification.dateOfBirth) + && Objects.equals(this.isSetDateOfBirth, ultimatePartyIdentification.isSetDateOfBirth) && Objects.equals(this.email, ultimatePartyIdentification.email) + && Objects.equals(this.isSetEmail, ultimatePartyIdentification.isSetEmail) && Objects.equals(this.firstName, ultimatePartyIdentification.firstName) + && Objects.equals(this.isSetFirstName, ultimatePartyIdentification.isSetFirstName) && Objects.equals(this.fullName, ultimatePartyIdentification.fullName) + && Objects.equals(this.isSetFullName, ultimatePartyIdentification.isSetFullName) + && Objects.equals(this.fundingInstrument, ultimatePartyIdentification.fundingInstrument) + && Objects.equals( + this.isSetFundingInstrument, ultimatePartyIdentification.isSetFundingInstrument) && Objects.equals(this.lastName, ultimatePartyIdentification.lastName) + && Objects.equals(this.isSetLastName, ultimatePartyIdentification.isSetLastName) && Objects.equals(this.reference, ultimatePartyIdentification.reference) + && Objects.equals(this.isSetReference, ultimatePartyIdentification.isSetReference) && Objects.equals(this.type, ultimatePartyIdentification.type) - && Objects.equals(this.url, ultimatePartyIdentification.url); + && Objects.equals(this.isSetType, ultimatePartyIdentification.isSetType) + && Objects.equals(this.url, ultimatePartyIdentification.url) + && Objects.equals(this.isSetUrl, ultimatePartyIdentification.isSetUrl); } @Override public int hashCode() { return Objects.hash( - address, dateOfBirth, email, firstName, fullName, lastName, reference, type, url); + address, + isSetAddress, + dateOfBirth, + isSetDateOfBirth, + email, + isSetEmail, + firstName, + isSetFirstName, + fullName, + isSetFullName, + fundingInstrument, + isSetFundingInstrument, + lastName, + isSetLastName, + reference, + isSetReference, + type, + isSetType, + url, + isSetUrl); } @Override @@ -516,6 +662,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 +681,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/Amount.java b/src/main/java/com/adyen/model/transferwebhooks/Amount.java index 63f056c5b..0cd70f18a 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/Amount.java +++ b/src/main/java/com/adyen/model/transferwebhooks/Amount.java @@ -30,10 +30,12 @@ public Amount() {} /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * * @param currency The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * @return the current {@code Amount} instance, allowing for method chaining */ public Amount currency(String currency) { @@ -43,10 +45,12 @@ public Amount currency(String currency) { /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * * @return currency The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -56,10 +60,12 @@ public String getCurrency() { /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * * @param currency The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -68,10 +74,10 @@ public void setCurrency(String currency) { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @param value The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * @return the current {@code Amount} instance, allowing for method chaining */ @@ -81,10 +87,10 @@ public Amount value(Long value) { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @return value The amount of the transaction, in [minor + * @return value The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). */ @JsonProperty(JSON_PROPERTY_VALUE) @@ -94,10 +100,10 @@ public Long getValue() { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @param value The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). */ @JsonProperty(JSON_PROPERTY_VALUE) diff --git a/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java b/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java index 5d6020d39..53e309721 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java +++ b/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java @@ -20,7 +20,8 @@ /** 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"; @@ -29,6 +30,9 @@ public class BankAccountV3 { public static final String JSON_PROPERTY_ACCOUNT_IDENTIFICATION = "accountIdentification"; private BankAccountV3AccountIdentification accountIdentification; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; + private String storedPaymentMethodId; + public BankAccountV3() {} /** @@ -98,6 +102,45 @@ public void setAccountIdentification(BankAccountV3AccountIdentification accountI this.accountIdentification = accountIdentification; } + /** + * 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; + 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; + } + /** Return true if this BankAccountV3 object is equal to o. */ @Override public boolean equals(Object o) { @@ -109,12 +152,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 +169,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(); } diff --git a/src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java b/src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java index 12d2f75db..8365dfedd 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/BankCategoryData.java @@ -27,14 +27,14 @@ public class BankCategoryData { /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ public enum PriorityEnum { @@ -135,26 +135,26 @@ public BankCategoryData() {} /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @param priority The priority for the bank transfer. This sets the speed at which the transfer * is sent and the fees that you have to pay. Required for transfers with `category` - * **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * @return the current {@code BankCategoryData} instance, allowing for method chaining */ @@ -166,26 +166,26 @@ public BankCategoryData priority(PriorityEnum priority) { /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @return priority The priority for the bank transfer. This sets the speed at which the transfer * is sent and the fees that you have to pay. Required for transfers with `category` - * **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ @JsonProperty(JSON_PROPERTY_PRIORITY) @@ -197,26 +197,26 @@ public PriorityEnum getPriority() { /** * The priority for the bank transfer. This sets the speed at which the transfer is sent and the * fees that you have to pay. Required for transfers with `category` **bank**. Possible - * values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer + * values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer * funds, but the fees are higher. Recommended for high-priority, low-value transactions. * - * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for - * high-priority, high-value transactions. * **instant**: for instant funds transfers within the + * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for + * high-priority, high-value transactions. * **instant**: For instant funds transfers within the * United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). * * @param priority The priority for the bank transfer. This sets the speed at which the transfer * is sent and the fees that you have to pay. Required for transfers with `category` - * **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a + * **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A * faster way to transfer funds, but the fees are higher. Recommended for high-priority, - * low-value transactions. * **wire**: the fastest way to transfer funds, but this has the - * highest fees. Recommended for high-priority, high-value transactions. * **instant**: for + * low-value transactions. * **wire**: The fastest way to transfer funds, but this has the + * highest fees. Recommended for high-priority, high-value transactions. * **instant**: For * instant funds transfers within the United States and in [SEPA * locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * - * **crossBorder**: for high-value transfers to a recipient in a different country. * - * **internal**: for transfers to an Adyen-issued business bank account (by bank account + * **crossBorder**: For high-value transfers to a recipient in a different country. * + * **internal**: For transfers to an Adyen-issued business bank account (by bank account * number/IBAN). */ @JsonProperty(JSON_PROPERTY_PRIORITY) diff --git a/src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java b/src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java index a68fab379..ca0228215 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java +++ b/src/main/java/com/adyen/model/transferwebhooks/PlatformPayment.java @@ -47,21 +47,21 @@ public class PlatformPayment { * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of interchange - * and scheme fee) incurred on a transaction. * **AdyenCommission**: the transaction fee due to + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of interchange + * and scheme fee) incurred on a transaction. * **AdyenCommission**: The transaction fee due to * Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen under - * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the amount booked - * to your user after the deduction of the relevant fees. * **Commission**: your platform's or - * marketplace's commission on a transaction. * **DCCPlatformCommission**: the Dynamic - * Currency Conversion (DCC) fee on a transaction. * **Interchange**: the interchange fee (fee - * paid to the issuer) incurred on a transaction. * **PaymentFee**: the aggregated amount of all - * transaction fees. * **Remainder**: the leftover amount after currency conversion. * - * **SchemeFee**: the scheme fee incurred on a transaction. * **Surcharge**: the surcharge paid by - * the customer on a transaction. * **Tip**: the tip paid by the customer. * **TopUp**: an - * incoming transfer to top up your user's balance account. * **VAT**: the value-added tax + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen under + * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The amount booked + * to your user after the deduction of the relevant fees. * **Commission**: Your platform's or + * marketplace's commission on a transaction. * **DCCPlatformCommission**: The Dynamic + * Currency Conversion (DCC) fee on a transaction. * **Interchange**: The interchange fee (fee + * paid to the issuer) incurred on a transaction. * **PaymentFee**: The aggregated amount of all + * transaction fees. * **Remainder**: The leftover amount after currency conversion. * + * **SchemeFee**: The scheme fee incurred on a transaction. * **Surcharge**: The surcharge paid by + * the customer on a transaction. * **Tip**: The tip paid by the customer. * **TopUp**: An + * incoming transfer to top up your user's balance account. * **VAT**: The value-added tax * charged on the payment. */ public enum PlatformPaymentTypeEnum { @@ -292,21 +292,21 @@ public void setPaymentMerchantReference(String paymentMerchantReference) { * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of interchange - * and scheme fee) incurred on a transaction. * **AdyenCommission**: the transaction fee due to + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of interchange + * and scheme fee) incurred on a transaction. * **AdyenCommission**: The transaction fee due to * Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen under - * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the amount booked - * to your user after the deduction of the relevant fees. * **Commission**: your platform's or - * marketplace's commission on a transaction. * **DCCPlatformCommission**: the Dynamic - * Currency Conversion (DCC) fee on a transaction. * **Interchange**: the interchange fee (fee - * paid to the issuer) incurred on a transaction. * **PaymentFee**: the aggregated amount of all - * transaction fees. * **Remainder**: the leftover amount after currency conversion. * - * **SchemeFee**: the scheme fee incurred on a transaction. * **Surcharge**: the surcharge paid by - * the customer on a transaction. * **Tip**: the tip paid by the customer. * **TopUp**: an - * incoming transfer to top up your user's balance account. * **VAT**: the value-added tax + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen under + * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The amount booked + * to your user after the deduction of the relevant fees. * **Commission**: Your platform's or + * marketplace's commission on a transaction. * **DCCPlatformCommission**: The Dynamic + * Currency Conversion (DCC) fee on a transaction. * **Interchange**: The interchange fee (fee + * paid to the issuer) incurred on a transaction. * **PaymentFee**: The aggregated amount of all + * transaction fees. * **Remainder**: The leftover amount after currency conversion. * + * **SchemeFee**: The scheme fee incurred on a transaction. * **Surcharge**: The surcharge paid by + * the customer on a transaction. * **Tip**: The tip paid by the customer. * **TopUp**: An + * incoming transfer to top up your user's balance account. * **VAT**: The value-added tax * charged on the payment. * * @param platformPaymentType Specifies the nature of the transfer. This parameter helps @@ -315,22 +315,22 @@ public void setPaymentMerchantReference(String paymentMerchantReference) { * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of - * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: the + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of + * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: The * transaction fee due to Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen - * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the - * amount booked to your user after the deduction of the relevant fees. * **Commission**: your + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen + * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The + * amount booked to your user after the deduction of the relevant fees. * **Commission**: Your * platform's or marketplace's commission on a transaction. * - * **DCCPlatformCommission**: the Dynamic Currency Conversion (DCC) fee on a transaction. * - * **Interchange**: the interchange fee (fee paid to the issuer) incurred on a transaction. * - * **PaymentFee**: the aggregated amount of all transaction fees. * **Remainder**: the - * leftover amount after currency conversion. * **SchemeFee**: the scheme fee incurred on a - * transaction. * **Surcharge**: the surcharge paid by the customer on a transaction. * - * **Tip**: the tip paid by the customer. * **TopUp**: an incoming transfer to top up your - * user's balance account. * **VAT**: the value-added tax charged on the payment. + * **DCCPlatformCommission**: The Dynamic Currency Conversion (DCC) fee on a transaction. * + * **Interchange**: The interchange fee (fee paid to the issuer) incurred on a transaction. * + * **PaymentFee**: The aggregated amount of all transaction fees. * **Remainder**: The + * leftover amount after currency conversion. * **SchemeFee**: The scheme fee incurred on a + * transaction. * **Surcharge**: The surcharge paid by the customer on a transaction. * + * **Tip**: The tip paid by the customer. * **TopUp**: An incoming transfer to top up your + * user's balance account. * **VAT**: The value-added tax charged on the payment. * @return the current {@code PlatformPayment} instance, allowing for method chaining */ public PlatformPayment platformPaymentType(PlatformPaymentTypeEnum platformPaymentType) { @@ -344,21 +344,21 @@ public PlatformPayment platformPaymentType(PlatformPaymentTypeEnum platformPayme * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of interchange - * and scheme fee) incurred on a transaction. * **AdyenCommission**: the transaction fee due to + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of interchange + * and scheme fee) incurred on a transaction. * **AdyenCommission**: The transaction fee due to * Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen under - * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the amount booked - * to your user after the deduction of the relevant fees. * **Commission**: your platform's or - * marketplace's commission on a transaction. * **DCCPlatformCommission**: the Dynamic - * Currency Conversion (DCC) fee on a transaction. * **Interchange**: the interchange fee (fee - * paid to the issuer) incurred on a transaction. * **PaymentFee**: the aggregated amount of all - * transaction fees. * **Remainder**: the leftover amount after currency conversion. * - * **SchemeFee**: the scheme fee incurred on a transaction. * **Surcharge**: the surcharge paid by - * the customer on a transaction. * **Tip**: the tip paid by the customer. * **TopUp**: an - * incoming transfer to top up your user's balance account. * **VAT**: the value-added tax + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen under + * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The amount booked + * to your user after the deduction of the relevant fees. * **Commission**: Your platform's or + * marketplace's commission on a transaction. * **DCCPlatformCommission**: The Dynamic + * Currency Conversion (DCC) fee on a transaction. * **Interchange**: The interchange fee (fee + * paid to the issuer) incurred on a transaction. * **PaymentFee**: The aggregated amount of all + * transaction fees. * **Remainder**: The leftover amount after currency conversion. * + * **SchemeFee**: The scheme fee incurred on a transaction. * **Surcharge**: The surcharge paid by + * the customer on a transaction. * **Tip**: The tip paid by the customer. * **TopUp**: An + * incoming transfer to top up your user's balance account. * **VAT**: The value-added tax * charged on the payment. * * @return platformPaymentType Specifies the nature of the transfer. This parameter helps @@ -367,22 +367,22 @@ public PlatformPayment platformPaymentType(PlatformPaymentTypeEnum platformPayme * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of - * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: the + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of + * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: The * transaction fee due to Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen - * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the - * amount booked to your user after the deduction of the relevant fees. * **Commission**: your + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen + * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The + * amount booked to your user after the deduction of the relevant fees. * **Commission**: Your * platform's or marketplace's commission on a transaction. * - * **DCCPlatformCommission**: the Dynamic Currency Conversion (DCC) fee on a transaction. * - * **Interchange**: the interchange fee (fee paid to the issuer) incurred on a transaction. * - * **PaymentFee**: the aggregated amount of all transaction fees. * **Remainder**: the - * leftover amount after currency conversion. * **SchemeFee**: the scheme fee incurred on a - * transaction. * **Surcharge**: the surcharge paid by the customer on a transaction. * - * **Tip**: the tip paid by the customer. * **TopUp**: an incoming transfer to top up your - * user's balance account. * **VAT**: the value-added tax charged on the payment. + * **DCCPlatformCommission**: The Dynamic Currency Conversion (DCC) fee on a transaction. * + * **Interchange**: The interchange fee (fee paid to the issuer) incurred on a transaction. * + * **PaymentFee**: The aggregated amount of all transaction fees. * **Remainder**: The + * leftover amount after currency conversion. * **SchemeFee**: The scheme fee incurred on a + * transaction. * **Surcharge**: The surcharge paid by the customer on a transaction. * + * **Tip**: The tip paid by the customer. * **TopUp**: An incoming transfer to top up your + * user's balance account. * **VAT**: The value-added tax charged on the payment. */ @JsonProperty(JSON_PROPERTY_PLATFORM_PAYMENT_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -396,21 +396,21 @@ public PlatformPaymentTypeEnum getPlatformPaymentType() { * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of interchange - * and scheme fee) incurred on a transaction. * **AdyenCommission**: the transaction fee due to + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of interchange + * and scheme fee) incurred on a transaction. * **AdyenCommission**: The transaction fee due to * Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen under - * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the amount booked - * to your user after the deduction of the relevant fees. * **Commission**: your platform's or - * marketplace's commission on a transaction. * **DCCPlatformCommission**: the Dynamic - * Currency Conversion (DCC) fee on a transaction. * **Interchange**: the interchange fee (fee - * paid to the issuer) incurred on a transaction. * **PaymentFee**: the aggregated amount of all - * transaction fees. * **Remainder**: the leftover amount after currency conversion. * - * **SchemeFee**: the scheme fee incurred on a transaction. * **Surcharge**: the surcharge paid by - * the customer on a transaction. * **Tip**: the tip paid by the customer. * **TopUp**: an - * incoming transfer to top up your user's balance account. * **VAT**: the value-added tax + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen under + * [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The amount booked + * to your user after the deduction of the relevant fees. * **Commission**: Your platform's or + * marketplace's commission on a transaction. * **DCCPlatformCommission**: The Dynamic + * Currency Conversion (DCC) fee on a transaction. * **Interchange**: The interchange fee (fee + * paid to the issuer) incurred on a transaction. * **PaymentFee**: The aggregated amount of all + * transaction fees. * **Remainder**: The leftover amount after currency conversion. * + * **SchemeFee**: The scheme fee incurred on a transaction. * **Surcharge**: The surcharge paid by + * the customer on a transaction. * **Tip**: The tip paid by the customer. * **TopUp**: An + * incoming transfer to top up your user's balance account. * **VAT**: The value-added tax * charged on the payment. * * @param platformPaymentType Specifies the nature of the transfer. This parameter helps @@ -419,22 +419,22 @@ public PlatformPaymentTypeEnum getPlatformPaymentType() { * [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) * or * [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). - * Possible values: * **AcquiringFees**: the acquiring fee (the aggregated amount of - * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: the + * Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of + * interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: The * transaction fee due to Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). - * * **AdyenFees**: all transaction fees due to Adyen. This is the aggregated amount of - * Adyen's commission and markup. * **AdyenMarkup**: the transaction fee due to Adyen - * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: the - * amount booked to your user after the deduction of the relevant fees. * **Commission**: your + * * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of + * Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen + * under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The + * amount booked to your user after the deduction of the relevant fees. * **Commission**: Your * platform's or marketplace's commission on a transaction. * - * **DCCPlatformCommission**: the Dynamic Currency Conversion (DCC) fee on a transaction. * - * **Interchange**: the interchange fee (fee paid to the issuer) incurred on a transaction. * - * **PaymentFee**: the aggregated amount of all transaction fees. * **Remainder**: the - * leftover amount after currency conversion. * **SchemeFee**: the scheme fee incurred on a - * transaction. * **Surcharge**: the surcharge paid by the customer on a transaction. * - * **Tip**: the tip paid by the customer. * **TopUp**: an incoming transfer to top up your - * user's balance account. * **VAT**: the value-added tax charged on the payment. + * **DCCPlatformCommission**: The Dynamic Currency Conversion (DCC) fee on a transaction. * + * **Interchange**: The interchange fee (fee paid to the issuer) incurred on a transaction. * + * **PaymentFee**: The aggregated amount of all transaction fees. * **Remainder**: The + * leftover amount after currency conversion. * **SchemeFee**: The scheme fee incurred on a + * transaction. * **Surcharge**: The surcharge paid by the customer on a transaction. * + * **Tip**: The tip paid by the customer. * **TopUp**: An incoming transfer to top up your + * user's balance account. * **VAT**: The value-added tax charged on the payment. */ @JsonProperty(JSON_PROPERTY_PLATFORM_PAYMENT_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferData.java b/src/main/java/com/adyen/model/transferwebhooks/TransferData.java index 019807d3e..180fe69ce 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferData.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferData.java @@ -73,14 +73,14 @@ public class TransferData { private List balances; /** - * 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")), @@ -263,6 +263,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown")); @@ -319,10 +321,12 @@ public static ReasonEnum fromValue(String value) { /** * 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")), @@ -801,24 +805,24 @@ public void setBalances(List balances) { } /** - * 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) { @@ -827,24 +831,24 @@ public TransferData category(CategoryEnum 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 + * 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,24 +857,24 @@ 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) @@ -1572,16 +1576,21 @@ public void setSequenceNumber(Integer sequenceNumber) { /** * 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) { @@ -1591,16 +1600,21 @@ public TransferData status(StatusEnum 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. + * 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,16 +1624,21 @@ 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) diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java b/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java index 8e00640c8..f14b86ca7 100644 --- a/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java @@ -128,6 +128,8 @@ public enum ReasonEnum { SCAFAILED(String.valueOf("scaFailed")), + SCHEMEADVICE(String.valueOf("schemeAdvice")), + TRANSFERINSTRUMENTDOESNOTEXIST(String.valueOf("transferInstrumentDoesNotExist")), UNKNOWN(String.valueOf("unknown"));